Skip to content
Snippets Groups Projects
Commit 2efed964 authored by Laurent Van Migroet's avatar Laurent Van Migroet
Browse files

Added deleteMesh to GModel

parent 2d266b63
No related branches found
No related tags found
No related merge requests found
...@@ -250,6 +250,19 @@ void GModel::destroyMeshCaches() ...@@ -250,6 +250,19 @@ void GModel::destroyMeshCaches()
_octree = 0; _octree = 0;
} }
void GModel::deleteMesh()
{
for(riter it=firstRegion();it!=lastRegion();++it)
(*it)->deleteMesh();
for(fiter it=firstFace();it!=lastFace();++it)
(*it)->deleteMesh();
for(eiter it=firstEdge();it!=lastEdge();++it)
(*it)->deleteMesh();
for(viter it=firstVertex();it!=lastVertex();++it)
(*it)->deleteMesh();
destroyMeshCaches();
}
bool GModel::empty() const bool GModel::empty() const
{ {
return vertices.empty() && edges.empty() && faces.empty() && regions.empty(); return vertices.empty() && edges.empty() && faces.empty() && regions.empty();
......
...@@ -151,6 +151,8 @@ class GModel ...@@ -151,6 +151,8 @@ class GModel
// delete all the mesh-related caches (this must be called when the // delete all the mesh-related caches (this must be called when the
// mesh is changed) // mesh is changed)
void destroyMeshCaches(); void destroyMeshCaches();
//delete the mesh stored in entities and call destroMeshCaches
void deleteMesh();
// access internal CAD representations // access internal CAD representations
GEO_Internals *getGEOInternals(){ return _geo_internals; } GEO_Internals *getGEOInternals(){ return _geo_internals; }
...@@ -388,10 +390,10 @@ class GModel ...@@ -388,10 +390,10 @@ class GModel
GEntity *revolve(GEntity *e, std::vector<double> p1, std::vector<double> p2, GEntity *revolve(GEntity *e, std::vector<double> p1, std::vector<double> p2,
double angle); double angle);
GEntity *extrude(GEntity *e, std::vector<double> p1, std::vector<double> p2); GEntity *extrude(GEntity *e, std::vector<double> p1, std::vector<double> p2);
GEntity *addPipe(GEntity *e, std::vector<GEdge *> edges); GEntity *addPipe(GEntity *e, std::vector<GEdge *> edges);
void addRuledFaces(std::vector<std::vector<GEdge *> > edges); void addRuledFaces (std::vector<std::vector<GEdge *> > edges);
GFace *addFace(std::vector<GEdge *> edges, std::vector< std::vector<double > > points); GFace* addFace (std::vector<GEdge *> edges, std::vector< std::vector<double > > points);
GFace *addPlanarFace(std::vector<std::vector<GEdge *> > edges); GFace* addPlanarFace (std::vector<std::vector<GEdge *> > edges);
// create solid geometry primitives using the factory // create solid geometry primitives using the factory
GEntity *addSphere(double cx, double cy, double cz, double radius); GEntity *addSphere(double cx, double cy, double cz, double radius);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment