diff --git a/Geo/GModelIO_GEO.cpp b/Geo/GModelIO_GEO.cpp index e65dfd389aaa69f0389d41a048466de30bb9df95..7729882d4428ea20a00df78e69c1a186360537c0 100644 --- a/Geo/GModelIO_GEO.cpp +++ b/Geo/GModelIO_GEO.cpp @@ -55,10 +55,17 @@ void GEO_Internals::_freeAll() List_Action(PhysicalGroups, Free_PhysicalGroup); List_Delete(PhysicalGroups); } -void GEO_Internals::resetPhysicalGroups() +int GEO_Internals::getMaxTag(int dim) const { - List_Action(PhysicalGroups, Free_PhysicalGroup); - List_Reset(PhysicalGroups); + switch(dim){ + case 0: return MaxPointNum; + case 1: return MaxLineNum; + case -1: return MaxLineLoopNum; + case 2: return MaxSurfaceNum; + case -2: return MaxSurfaceLoopNum; + case 3: return MaxVolumeNum; + default: return 0; + } } void GEO_Internals::addVertex(int num, double x, double y, double z, double lc) @@ -379,6 +386,12 @@ void GEO_Internals::addCompoundVolume(int num, std::vector<int> regionTags) Tree_Add(Volumes, &v); } +void GEO_Internals::resetPhysicalGroups() +{ + List_Action(PhysicalGroups, Free_PhysicalGroup); + List_Reset(PhysicalGroups); +} + void GEO_Internals::setCompoundMesh(int dim, std::vector<int> tags) { meshCompounds.insert(std::make_pair(dim, tags)); diff --git a/Geo/GModelIO_GEO.h b/Geo/GModelIO_GEO.h index ddf781b0d375b19436eaf41e81aba97c17c56fd9..9eba2faeeb0e2840888f973c7efdb5f03e7542c4 100644 --- a/Geo/GModelIO_GEO.h +++ b/Geo/GModelIO_GEO.h @@ -12,58 +12,13 @@ class GEO_Internals{ private: void _allocateAll(); void _freeAll(); - public: - // FIXME: all this must (will) become private ; and all the direct calls in - // Gmsh.y should (will) go through an integer-based API similar to the one in - // OCC_Internals - Tree_T *Points; - Tree_T *Curves; - Tree_T *Surfaces; - Tree_T *Volumes; - Tree_T *SurfaceLoops; - Tree_T *EdgeLoops; - Tree_T *LevelSets; - List_T *PhysicalGroups; - int MaxPointNum, MaxLineNum, MaxLineLoopNum, MaxSurfaceNum; - int MaxSurfaceLoopNum, MaxVolumeNum, MaxPhysicalNum; - std::multimap<int, std::vector<int> > meshCompounds; - - struct MasterEdge { - int tag; // signed - std::vector<double> affineTransform; - }; - std::map<int, MasterEdge> periodicEdges; - - struct MasterFace { - int tag; - // map from slave to master edges - std::map<int, int> edgeCounterparts; - std::vector<double> affineTransform; - }; - std::map<int, MasterFace> periodicFaces; - - gmshSurface *newGeometrySphere(int num, int centerTag, int pointTag); - gmshSurface *newGeometryPolarSphere(int num, int centerTag, int pointTag); - public: GEO_Internals(){ _allocateAll(); } ~GEO_Internals(){ _freeAll(); } void destroy(){ _freeAll(); _allocateAll(); } - void resetPhysicalGroups(); // get maximum tag number for each dimension - int getMaxTag(int dim) const - { - switch(dim){ - case 0: return MaxPointNum; - case 1: return MaxLineNum; - case -1: return MaxLineLoopNum; - case 2: return MaxSurfaceNum; - case -2: return MaxSurfaceLoopNum; - case 3: return MaxVolumeNum; - default: return 0; - } - } + int getMaxTag(int dim) const; // add shapes void addVertex(int num, double x, double y, double z, double lc); @@ -88,13 +43,40 @@ class GEO_Internals{ void addVolume(int num, std::vector<int> shellTags); void addCompoundVolume(int num, std::vector<int> regionTags); - // add physical groups + // manipulate physical groups (this will eventually move directly to GModel) + void resetPhysicalGroups(); // set meshing constraints void setCompoundMesh(int dim, std::vector<int> tags); // synchronize internal CAD data with the given GModel void synchronize(GModel *model); + + // create coordinate systems + gmshSurface *newGeometrySphere(int num, int centerTag, int pointTag); + gmshSurface *newGeometryPolarSphere(int num, int centerTag, int pointTag); + + public: + // FIXME: all of this will become private once the refactoring of the old code + // is complete + Tree_T *Points, *Curves, *EdgeLoops, *Surfaces, *SurfaceLoops, *Volumes; + Tree_T *LevelSets; + List_T *PhysicalGroups; + int MaxPointNum, MaxLineNum, MaxLineLoopNum, MaxSurfaceNum; + int MaxSurfaceLoopNum, MaxVolumeNum, MaxPhysicalNum; + std::multimap<int, std::vector<int> > meshCompounds; + struct MasterEdge { + int tag; // signed + std::vector<double> affineTransform; + }; + std::map<int, MasterEdge> periodicEdges; + struct MasterFace { + int tag; + // map from slave to master edges + std::map<int, int> edgeCounterparts; + std::vector<double> affineTransform; + }; + std::map<int, MasterFace> periodicFaces; }; #endif