X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHDS%2FSMESHDS_Mesh.hxx;h=86b9071c114cac6251169a2ef3d00da43c5b0c06;hb=a2f0f70d5912ea83c868916f06eaefb58a32ec2e;hp=7d26b22664c44455178b6ee84e7b2bdc450cc685;hpb=c3bf92bd87b770fd81631a3853f7f5bb1ac6a4e8;p=modules%2Fsmesh.git diff --git a/src/SMESHDS/SMESHDS_Mesh.hxx b/src/SMESHDS/SMESHDS_Mesh.hxx index 7d26b2266..86b9071c1 100644 --- a/src/SMESHDS/SMESHDS_Mesh.hxx +++ b/src/SMESHDS/SMESHDS_Mesh.hxx @@ -42,17 +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 -#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); @@ -148,9 +158,40 @@ public: const SMDS_MeshNode * n7, const SMDS_MeshNode * n8); + virtual SMDS_MeshFace* AddPolygonalFaceWithID (std::vector nodes_ids, + const int ID); + + virtual SMDS_MeshFace* AddPolygonalFaceWithID (std::vector nodes, + const int ID); + + virtual SMDS_MeshFace* AddPolygonalFace (std::vector nodes); + + virtual SMDS_MeshVolume* AddPolyhedralVolumeWithID + (std::vector nodes_ids, + std::vector quantities, + const int ID); + + virtual SMDS_MeshVolume* AddPolyhedralVolumeWithID + (std::vector nodes, + std::vector quantities, + const int ID); + + virtual SMDS_MeshVolume* AddPolyhedralVolume + (std::vector nodes, + std::vector quantities); + 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); + bool ChangePolygonNodes(const SMDS_MeshElement * elem, + std::vector nodes); + bool ChangePolyhedronNodes(const SMDS_MeshElement * elem, + std::vector nodes, + std::vector quantities); + 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); @@ -163,26 +204,34 @@ public: const TopoDS_Shape & S); TopoDS_Shape ShapeToMesh() const; bool HasMeshElements(const TopoDS_Shape & S); - SMESHDS_SubMesh * MeshElements(const TopoDS_Shape & S); + SMESHDS_SubMesh * MeshElements(const TopoDS_Shape & S) const; 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); + int ShapeToIndex(const TopoDS_Shape & aShape) const; 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: @@ -193,13 +242,20 @@ private: }; typedef std::list THypList; typedef gstd::hash_map ShapeToHypothesis; - ShapeToHypothesis myShapeToHypothesis; + ShapeToHypothesis myShapeToHypothesis; + + int myMeshID; + TopoDS_Shape myShape; + + typedef std::map TShapeIndexToSubMesh; + TShapeIndexToSubMesh myShapeIndexToSubMesh; - int myMeshID; - TopoDS_Shape myShape; TopTools_IndexedMapOfShape myIndexToShape; - std::map myShapeIndexToSubMesh; - SMESHDS_Script* myScript; + + typedef std::set TGroups; + TGroups myGroups; + + SMESHDS_Script* myScript; };