X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FSMESHDS%2FSMESHDS_Mesh.hxx;h=459d30848aa5c34c7d27f0c93419ba460ad45b6e;hb=refs%2Ftags%2FV2_2_0a1;hp=62b03798d7c7693b501dfbaf41760b46a8ae2d24;hpb=51569f091c2d18be76ea9bd3e68ca0247cc731c3;p=modules%2Fsmesh.git diff --git a/src/SMESHDS/SMESHDS_Mesh.hxx b/src/SMESHDS/SMESHDS_Mesh.hxx index 62b03798d..459d30848 100644 --- a/src/SMESHDS/SMESHDS_Mesh.hxx +++ b/src/SMESHDS/SMESHDS_Mesh.hxx @@ -42,19 +42,27 @@ #include #include #include +#include //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 +161,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); @@ -167,24 +179,32 @@ public: bool HasMeshElements(const TopoDS_Shape & S); SMESHDS_SubMesh * MeshElements(const TopoDS_Shape & S); SMESHDS_SubMesh * MeshElements(const int Index); - list SubMeshIndices(); + std::list SubMeshIndices(); const std::map& SubMeshes() { return myShapeIndexToSubMesh; } bool HasHypothesis(const TopoDS_Shape & S); - const list& GetHypothesis(const TopoDS_Shape & S) const; + const std::list& GetHypothesis(const TopoDS_Shape & S) const; SMESHDS_Script * GetScript(); void ClearScript(); 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 std::set& GetGroups() const { return myGroups; } + + bool IsGroupOfSubShapes (const TopoDS_Shape& aSubShape) const; + ~SMESHDS_Mesh(); private: @@ -195,13 +215,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; + std::map myShapeIndexToSubMesh; + std::set myGroups; + SMESHDS_Script* myScript; };