X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHDS%2FSMESHDS_Mesh.hxx;h=dece6ab48ed5d9be805c48278690ca59acbddc22;hb=refs%2Ftags%2FV2_1_0b1;hp=62b03798d7c7693b501dfbaf41760b46a8ae2d24;hpb=51569f091c2d18be76ea9bd3e68ca0247cc731c3;p=modules%2Fsmesh.git diff --git a/src/SMESHDS/SMESHDS_Mesh.hxx b/src/SMESHDS/SMESHDS_Mesh.hxx index 62b03798d..dece6ab48 100644 --- a/src/SMESHDS/SMESHDS_Mesh.hxx +++ b/src/SMESHDS/SMESHDS_Mesh.hxx @@ -45,16 +45,23 @@ //Not portable see http://gcc.gnu.org/onlinedocs/libstdc++/faq/index.html#5_4 to know more. #ifdef __GNUC__ -#if __GNUC__ < 3 - #include - // _CS_gbo_100504 Do not forget to define the namespace alias gstd - namespace gstd { using ::hash_map; } // inherits globals -#else - #include - namespace gstd = __gnu_cxx; -#endif + #if __GNUC__ < 3 + #include + namespace gstd { using ::hash_map; }; // inherit globals + #else + #include + #if __GNUC_MINOR__ == 0 + namespace gstd = std; // GCC 3.0 + #else + namespace gstd = ::__gnu_cxx; // GCC 3.1 and later + #endif + #endif +#else // ... there are other compilers, right? + namespace gstd = std; #endif +class SMESHDS_GroupBase; + class SMESHDS_Mesh:public SMDS_Mesh{ public: SMESHDS_Mesh(int MeshID); @@ -153,6 +160,10 @@ public: void MoveNode(const SMDS_MeshNode *, double x, double y, double z); virtual void RemoveNode(const SMDS_MeshNode *); void RemoveElement(const SMDS_MeshElement *); + bool ChangeElementNodes(const SMDS_MeshElement * elem, + const SMDS_MeshNode * nodes[], + const int nbnodes); + void Renumber (const bool isNodes, const int startID=1, const int deltaID=1); void SetNodeInVolume(SMDS_MeshNode * aNode, const TopoDS_Shell & S); void SetNodeOnFace(SMDS_MeshNode * aNode, const TopoDS_Face & S); @@ -178,13 +189,21 @@ public: int ShapeToIndex(const TopoDS_Shape & aShape); TopoDS_Shape IndexToShape(int ShapeIndex); - void NewSubMesh(int Index); + SMESHDS_SubMesh * NewSubMesh(int Index); + int AddCompoundSubmesh(const TopoDS_Shape& S, TopAbs_ShapeEnum type = TopAbs_SHAPE); void SetNodeInVolume(const SMDS_MeshNode * aNode, int Index); void SetNodeOnFace(SMDS_MeshNode * aNode, int Index); void SetNodeOnEdge(SMDS_MeshNode * aNode, int Index); void SetNodeOnVertex(SMDS_MeshNode * aNode, int Index); void SetMeshElementOnShape(const SMDS_MeshElement * anElt, int Index); + void AddGroup (SMESHDS_GroupBase* theGroup) { myGroups.insert(theGroup); } + void RemoveGroup (SMESHDS_GroupBase* theGroup) { myGroups.erase(theGroup); } + int GetNbGroups() const { return myGroups.size(); } + const set& GetGroups() const { return myGroups; } + + bool IsGroupOfSubShapes (const TopoDS_Shape& aSubShape) const; + ~SMESHDS_Mesh(); private: @@ -195,13 +214,14 @@ private: }; typedef std::list THypList; typedef gstd::hash_map ShapeToHypothesis; - ShapeToHypothesis myShapeToHypothesis; + ShapeToHypothesis myShapeToHypothesis; - int myMeshID; - TopoDS_Shape myShape; + int myMeshID; + TopoDS_Shape myShape; TopTools_IndexedMapOfShape myIndexToShape; - std::map myShapeIndexToSubMesh; - SMESHDS_Script* myScript; + map myShapeIndexToSubMesh; + set myGroups; + SMESHDS_Script* myScript; };