Skip to content
Snippets Groups Projects
Commit c090ab83 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

try not to include GmshDefines.h in headers

parent d2299f8b
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "GmshMessage.h" #include "GmshMessage.h"
#include "VertexArray.h" #include "VertexArray.h"
#include "boundaryLayersData.h" #include "boundaryLayersData.h"
#include "GmshDefines.h"
GRegion::GRegion(GModel *model, int tag) GRegion::GRegion(GModel *model, int tag)
: GEntity (model, tag), compound(0) : GEntity (model, tag), compound(0)
...@@ -432,3 +433,29 @@ std::list<GVertex*> GRegion::vertices() const ...@@ -432,3 +433,29 @@ std::list<GVertex*> GRegion::vertices() const
res.insert(res.begin(), v.begin(), v.end()); res.insert(res.begin(), v.begin(), v.end());
return res; 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");
}
}
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include <stdio.h> #include <stdio.h>
#include "GEntity.h" #include "GEntity.h"
#include "boundaryLayersData.h" #include "boundaryLayersData.h"
#include "GmshDefines.h"
class MElement; class MElement;
class MTetrahedron; class MTetrahedron;
...@@ -68,7 +67,6 @@ class GRegion : public GEntity { ...@@ -68,7 +67,6 @@ class GRegion : public GEntity {
// vertices that bound the region // vertices that bound the region
virtual std::list<GVertex*> vertices() const; virtual std::list<GVertex*> vertices() const;
// get the bounding box // get the bounding box
virtual SBoundingBox3d bounds() const; virtual SBoundingBox3d bounds() const;
...@@ -137,39 +135,15 @@ class GRegion : public GEntity { ...@@ -137,39 +135,15 @@ class GRegion : public GEntity {
std::vector<MPolyhedron*> polyhedra; std::vector<MPolyhedron*> polyhedra;
void addTetrahedron(MTetrahedron *t){ tetrahedra.push_back(t); } void addTetrahedron(MTetrahedron *t){ tetrahedra.push_back(t); }
void addHexahedron(MHexahedron *h){ hexahedra.push_back(h); } void addHexahedron(MHexahedron *h){ hexahedra.push_back(h); }
void addPrism(MPrism *p){ prisms.push_back(p); } void addPrism(MPrism *p){ prisms.push_back(p); }
void addPyramid(MPyramid *p){ pyramids.push_back(p); } void addPyramid(MPyramid *p){ pyramids.push_back(p); }
void addPolyhedron(MPolyhedron *p){ polyhedra.push_back(p); } void addPolyhedron(MPolyhedron *p){ polyhedra.push_back(p); }
void addTrihedron(MTrihedron *t){ trihedra.push_back(t); } void addTrihedron(MTrihedron *t){ trihedra.push_back(t); }
void addElement(int type, MElement *e){ 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");
}
}
// get the boundary layer columns // get the boundary layer columns
BoundaryLayerColumns *getColumns () {return &_columns;} BoundaryLayerColumns *getColumns () { return &_columns; }
}; };
#endif #endif
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <stdio.h> #include <stdio.h>
#include <algorithm> #include <algorithm>
#include <string> #include <string>
#include "GmshDefines.h"
#include "GmshMessage.h" #include "GmshMessage.h"
#include "MVertex.h" #include "MVertex.h"
#include "MEdge.h" #include "MEdge.h"
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "JacobianBasis.h" #include "JacobianBasis.h"
#include "MetricBasis.h" #include "MetricBasis.h"
#include "GaussIntegration.h" #include "GaussIntegration.h"
class GModel; class GModel;
// A mesh element. // A mesh element.
......
...@@ -10,8 +10,6 @@ ...@@ -10,8 +10,6 @@
#include <map> #include <map>
#include <string> #include <string>
#include "SPoint3.h" #include "SPoint3.h"
//#include "drawContext.h"
class PViewData; class PViewData;
class PViewOptions; class PViewOptions;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment