From c090ab83d53666bf6102ff6e490dd5bc2f9885c6 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Thu, 26 Nov 2015 11:26:47 +0000 Subject: [PATCH] try not to include GmshDefines.h in headers --- Geo/GRegion.cpp | 27 +++++++++++++++++++++++++++ Geo/GRegion.h | 32 +++----------------------------- Geo/MElement.h | 3 ++- Post/PView.h | 2 -- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Geo/GRegion.cpp b/Geo/GRegion.cpp index 778a04dfcd..b5b36ef6bc 100644 --- a/Geo/GRegion.cpp +++ b/Geo/GRegion.cpp @@ -16,6 +16,7 @@ #include "GmshMessage.h" #include "VertexArray.h" #include "boundaryLayersData.h" +#include "GmshDefines.h" GRegion::GRegion(GModel *model, int tag) : GEntity (model, tag), compound(0) @@ -432,3 +433,29 @@ std::list<GVertex*> GRegion::vertices() const res.insert(res.begin(), v.begin(), v.end()); return res; } + +void GRegion::addElement(int type, MElement *e) +{ + switch (type){ + case TYPE_TET: + addTetrahedron((MTetrahedron*) e); + break; + case TYPE_HEX: + addHexahedron((MHexahedron*) e); + break; + case TYPE_PRI: + addPrism((MPrism*) e); + break; + case TYPE_PYR: + addPyramid((MPyramid*) e); + break; + case TYPE_TRIH: + addTrihedron((MTrihedron*) e); + break; + case TYPE_POLYH: + addPolyhedron((MPolyhedron*) e); + break; + default: + Msg::Error("Trying to add unsupported element in region"); + } +} diff --git a/Geo/GRegion.h b/Geo/GRegion.h index 2812a8a8f7..eb2b7d8c63 100644 --- a/Geo/GRegion.h +++ b/Geo/GRegion.h @@ -12,7 +12,6 @@ #include <stdio.h> #include "GEntity.h" #include "boundaryLayersData.h" -#include "GmshDefines.h" class MElement; class MTetrahedron; @@ -68,7 +67,6 @@ class GRegion : public GEntity { // vertices that bound the region virtual std::list<GVertex*> vertices() const; - // get the bounding box virtual SBoundingBox3d bounds() const; @@ -137,39 +135,15 @@ class GRegion : public GEntity { std::vector<MPolyhedron*> polyhedra; void addTetrahedron(MTetrahedron *t){ tetrahedra.push_back(t); } - void addHexahedron(MHexahedron *h){ hexahedra.push_back(h); } void addPrism(MPrism *p){ prisms.push_back(p); } void addPyramid(MPyramid *p){ pyramids.push_back(p); } void addPolyhedron(MPolyhedron *p){ polyhedra.push_back(p); } void addTrihedron(MTrihedron *t){ trihedra.push_back(t); } - void addElement(int type, MElement *e){ - switch (type){ - case TYPE_TET: - addTetrahedron((MTetrahedron*) e); - break; - case TYPE_HEX: - addHexahedron((MHexahedron*) e); - break; - case TYPE_PRI: - addPrism((MPrism*) e); - break; - case TYPE_PYR: - addPyramid((MPyramid*) e); - break; - case TYPE_TRIH: - addTrihedron((MTrihedron*) e); - break; - case TYPE_POLYH: - addPolyhedron((MPolyhedron*) e); - break; - default: - Msg::Fatal("Trying to add unsupported element"); - } - } - + void addElement(int type, MElement *e); + // get the boundary layer columns - BoundaryLayerColumns *getColumns () {return &_columns;} + BoundaryLayerColumns *getColumns () { return &_columns; } }; #endif diff --git a/Geo/MElement.h b/Geo/MElement.h index 514ff9f192..702c6a76cd 100644 --- a/Geo/MElement.h +++ b/Geo/MElement.h @@ -9,7 +9,7 @@ #include <stdio.h> #include <algorithm> #include <string> -#include "GmshDefines.h" + #include "GmshMessage.h" #include "MVertex.h" #include "MEdge.h" @@ -19,6 +19,7 @@ #include "JacobianBasis.h" #include "MetricBasis.h" #include "GaussIntegration.h" + class GModel; // A mesh element. diff --git a/Post/PView.h b/Post/PView.h index d5c080b75f..0d1db0ef21 100644 --- a/Post/PView.h +++ b/Post/PView.h @@ -10,8 +10,6 @@ #include <map> #include <string> #include "SPoint3.h" -//#include "drawContext.h" - class PViewData; class PViewOptions; -- GitLab