1 // SMESH SMESHDS : management of mesh data and SMESH document
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SMESHDS_Mesh.hxx
27 #ifndef _SMESHDS_Mesh_HeaderFile
28 #define _SMESHDS_Mesh_HeaderFile
30 #ifndef _Standard_HeaderFile
31 #include <Standard.hxx>
33 #ifndef _Handle_SMESHDS_Mesh_HeaderFile
34 #include "Handle_SMESHDS_Mesh.hxx"
37 #ifndef _Standard_Integer_HeaderFile
38 #include <Standard_Integer.hxx>
40 #ifndef _TopoDS_Shape_HeaderFile
41 #include <TopoDS_Shape.hxx>
43 #ifndef _TopoDS_Shell_HeaderFile
44 #include <TopoDS_Shell.hxx>
46 #ifndef _TopTools_IndexedMapOfShape_HeaderFile
47 #include <TopTools_IndexedMapOfShape.hxx>
49 #ifndef _SMESHDS_DataMapOfIntegerSubMesh_HeaderFile
50 #include "SMESHDS_DataMapOfIntegerSubMesh.hxx"
52 #ifndef _SMESHDS_DataMapOfShapeListOfPtrHypothesis_HeaderFile
53 #include "SMESHDS_DataMapOfShapeListOfPtrHypothesis.hxx"
55 #ifndef _Handle_SMESHDS_Script_HeaderFile
56 #include "Handle_SMESHDS_Script.hxx"
58 #ifndef _SMDS_Mesh_HeaderFile
59 #include "SMDS_Mesh.hxx"
61 #ifndef _Standard_Boolean_HeaderFile
62 #include <Standard_Boolean.hxx>
64 #ifndef _SMESHDS_PtrHypothesis_HeaderFile
65 #include "SMESHDS_PtrHypothesis.hxx"
67 #ifndef _Standard_Real_HeaderFile
68 #include <Standard_Real.hxx>
70 #ifndef _Handle_SMDS_MeshNode_HeaderFile
71 #include "Handle_SMDS_MeshNode.hxx"
73 #ifndef _Handle_SMDS_MeshElement_HeaderFile
74 #include "Handle_SMDS_MeshElement.hxx"
76 #ifndef _Handle_SMESHDS_SubMesh_HeaderFile
77 #include "Handle_SMESHDS_SubMesh.hxx"
86 class SMDS_MeshElement;
87 class SMESHDS_SubMesh;
88 class SMESHDS_ListOfPtrHypothesis;
91 class SMESHDS_Mesh : public SMDS_Mesh {
95 inline void* operator new(size_t,void* anAddress)
99 inline void* operator new(size_t size)
101 return Standard::Allocate(size);
103 inline void operator delete(void *anAddress)
105 if (anAddress) Standard::Free((Standard_Address&)anAddress);
107 // inline void operator delete(void *anAddress, size_t size)
109 // if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
113 Standard_EXPORT SMESHDS_Mesh(const Standard_Integer MeshID);
114 Standard_EXPORT void ShapeToMesh(const TopoDS_Shape& S) ;
115 Standard_EXPORT Standard_Boolean AddHypothesis(const TopoDS_Shape& SS,const SMESHDS_PtrHypothesis& H) ;
116 Standard_EXPORT Standard_Boolean RemoveHypothesis(const TopoDS_Shape& S,const SMESHDS_PtrHypothesis& H) ;
117 Standard_EXPORT virtual Standard_Integer AddNode(const Standard_Real x,const Standard_Real y,const Standard_Real z) ;
118 Standard_EXPORT virtual void RemoveNode(const Standard_Integer ID) ;
119 Standard_EXPORT void MoveNode(const Standard_Integer ID,const Standard_Real x,const Standard_Real y,const Standard_Real z) ;
120 Standard_EXPORT virtual Standard_Integer AddEdge(const Standard_Integer idnode1,const Standard_Integer idnode2) ;
121 Standard_EXPORT virtual Standard_Integer AddFace(const Standard_Integer idnode1,const Standard_Integer idnode2,const Standard_Integer idnode3) ;
122 Standard_EXPORT virtual Standard_Integer AddFace(const Standard_Integer idnode1,const Standard_Integer idnode2,const Standard_Integer idnode3,const Standard_Integer idnode4) ;
123 Standard_EXPORT virtual Standard_Integer AddVolume(const Standard_Integer idnode1,const Standard_Integer idnode2,const Standard_Integer idnode3,const Standard_Integer idnode4) ;
124 Standard_EXPORT virtual Standard_Integer AddVolume(const Standard_Integer idnode1,const Standard_Integer idnode2,const Standard_Integer idnode3,const Standard_Integer idnode4,const Standard_Integer idnode5) ;
125 Standard_EXPORT virtual Standard_Integer AddVolume(const Standard_Integer idnode1,const Standard_Integer idnode2,const Standard_Integer idnode3,const Standard_Integer idnode4,const Standard_Integer idnode5,const Standard_Integer idnode6) ;
126 Standard_EXPORT virtual Standard_Integer AddVolume(const Standard_Integer idnode1,const Standard_Integer idnode2,const Standard_Integer idnode3,const Standard_Integer idnode4,const Standard_Integer idnode5,const Standard_Integer idnode6,const Standard_Integer idnode7,const Standard_Integer idnode8) ;
127 Standard_EXPORT virtual void RemoveElement(const Standard_Integer IDelem) ;
128 Standard_EXPORT void SetNodeInVolume(const Handle(SMDS_MeshNode)& aNode,const TopoDS_Shell& S) ;
129 Standard_EXPORT void SetNodeOnFace(const Handle(SMDS_MeshNode)& aNode,const TopoDS_Face& S) ;
130 Standard_EXPORT void SetNodeOnEdge(const Handle(SMDS_MeshNode)& aNode,const TopoDS_Edge& S) ;
131 Standard_EXPORT void SetNodeOnVertex(const Handle(SMDS_MeshNode)& aNode,const TopoDS_Vertex& S) ;
132 Standard_EXPORT void UnSetNodeOnShape(const Handle(SMDS_MeshNode)& aNode) ;
133 Standard_EXPORT void SetMeshElementOnShape(const Handle(SMDS_MeshElement)& anElt,const TopoDS_Shape& S) ;
134 Standard_EXPORT void UnSetMeshElementOnShape(const Handle(SMDS_MeshElement)& anElt,const TopoDS_Shape& S) ;
135 Standard_EXPORT TopoDS_Shape ShapeToMesh() ;
136 Standard_EXPORT Standard_Boolean HasMeshElements(const TopoDS_Shape& S) ;
137 Standard_EXPORT Handle_SMESHDS_SubMesh MeshElements(const TopoDS_Shape& S) ;
138 Standard_EXPORT Standard_Boolean HasHypothesis(const TopoDS_Shape& S) ;
139 Standard_EXPORT const SMESHDS_ListOfPtrHypothesis& GetHypothesis(const TopoDS_Shape& S) ;
140 Standard_EXPORT const Handle_SMESHDS_Script& GetScript() ;
141 Standard_EXPORT void ClearScript() ;
142 Standard_EXPORT Standard_Integer ShapeToIndex(const TopoDS_Shape& aShape) ;
143 Standard_EXPORT TopoDS_Shape IndexToShape(const Standard_Integer ShapeIndex) ;
144 Standard_EXPORT void NewSubMesh(const Standard_Integer Index) ;
145 Standard_EXPORT void SetNodeInVolume(const Handle(SMDS_MeshNode)& aNode,const Standard_Integer Index) ;
146 Standard_EXPORT void SetNodeOnFace(const Handle(SMDS_MeshNode)& aNode,const Standard_Integer Index) ;
147 Standard_EXPORT void SetNodeOnEdge(const Handle(SMDS_MeshNode)& aNode,const Standard_Integer Index) ;
148 Standard_EXPORT void SetNodeOnVertex(const Handle(SMDS_MeshNode)& aNode,const Standard_Integer Index) ;
149 Standard_EXPORT void SetMeshElementOnShape(const Handle(SMDS_MeshElement)& anElt,const Standard_Integer Index) ;
150 Standard_EXPORT ~SMESHDS_Mesh();
157 Standard_EXPORT friend Handle_Standard_Type& SMESHDS_Mesh_Type_();
158 Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
159 Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
179 Standard_Integer myMeshID;
180 TopoDS_Shape myShape;
181 TopTools_IndexedMapOfShape myIndexToShape;
182 SMESHDS_DataMapOfIntegerSubMesh myShapeIndexToSubMesh;
183 SMESHDS_DataMapOfShapeListOfPtrHypothesis myShapeToHypothesis;
184 Handle_SMESHDS_Script myScript;
193 // other inline functions and methods (like "C++: function call" methods)