Salome HOME
yfr : Merge with v1.2
[modules/smesh.git] / src / SMESHDS / SMESHDS_SubMesh.hxx
1 //  SMESH SMESHDS : management of mesh data and SMESH document
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
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. 
10 // 
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. 
15 // 
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 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : SMESHDS_SubMesh.hxx
25 //  Module : SMESH
26
27 #ifndef _SMESHDS_SubMesh_HeaderFile
28 #define _SMESHDS_SubMesh_HeaderFile
29
30 #ifndef _Standard_HeaderFile
31 #include <Standard.hxx>
32 #endif
33 #ifndef _Handle_SMESHDS_SubMesh_HeaderFile
34 #include "Handle_SMESHDS_SubMesh.hxx"
35 #endif
36
37 #ifndef _Handle_SMDS_Mesh_HeaderFile
38 #include "Handle_SMDS_Mesh.hxx"
39 #endif
40 #ifndef _SMDS_MapOfMeshElement_HeaderFile
41 #include "SMDS_MapOfMeshElement.hxx"
42 #endif
43 #ifndef _Standard_Boolean_HeaderFile
44 #include <Standard_Boolean.hxx>
45 #endif
46 #ifndef _TColStd_ListOfInteger_HeaderFile
47 #include <TColStd_ListOfInteger.hxx>
48 #endif
49 #ifndef _MMgt_TShared_HeaderFile
50 #include <MMgt_TShared.hxx>
51 #endif
52 #ifndef _Handle_SMDS_MeshElement_HeaderFile
53 #include "Handle_SMDS_MeshElement.hxx"
54 #endif
55 #ifndef _Handle_SMDS_MeshNode_HeaderFile
56 #include "Handle_SMDS_MeshNode.hxx"
57 #endif
58 #ifndef _Standard_Integer_HeaderFile
59 #include <Standard_Integer.hxx>
60 #endif
61 class SMDS_Mesh;
62 class SMDS_MeshElement;
63 class SMDS_MeshNode;
64 class SMDS_MapOfMeshElement;
65 class TColStd_ListOfInteger;
66
67
68 class SMESHDS_SubMesh : public MMgt_TShared {
69
70 public:
71
72     inline void* operator new(size_t,void* anAddress) 
73       {
74         return anAddress;
75       }
76     inline void* operator new(size_t size) 
77       { 
78         return Standard::Allocate(size); 
79       }
80     inline void  operator delete(void *anAddress) 
81       { 
82         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
83       }
84 //    inline void  operator delete(void *anAddress, size_t size) 
85 //      { 
86 //        if (anAddress) Standard::Free((Standard_Address&)anAddress,size); 
87 //      }
88  // Methods PUBLIC
89  // 
90 Standard_EXPORT SMESHDS_SubMesh(const Handle(SMDS_Mesh)& M);
91 Standard_EXPORT   void AddElement(const Handle(SMDS_MeshElement)& ME) ;
92 Standard_EXPORT   void RemoveElement(const Handle(SMDS_MeshElement)& ME) ;
93 Standard_EXPORT   void AddNode(const Handle(SMDS_MeshNode)& ME) ;
94 Standard_EXPORT   void RemoveNode(const Handle(SMDS_MeshNode)& ME) ;
95 Standard_EXPORT   Standard_Integer NbElements() ;
96 Standard_EXPORT  const SMDS_MapOfMeshElement& GetElements() ;
97 Standard_EXPORT  const TColStd_ListOfInteger& GetIDElements() ;
98 Standard_EXPORT   Standard_Integer NbNodes() ;
99 Standard_EXPORT  const SMDS_MapOfMeshElement& GetNodes() ;
100 Standard_EXPORT  const TColStd_ListOfInteger& GetIDNodes() ;
101 Standard_EXPORT ~SMESHDS_SubMesh();
102
103
104
105
106  // Type management
107  //
108  Standard_EXPORT friend Handle_Standard_Type& SMESHDS_SubMesh_Type_();
109  Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
110  Standard_EXPORT Standard_Boolean              IsKind(const Handle(Standard_Type)&) const;
111
112 protected:
113
114  // Methods PROTECTED
115  // 
116
117
118  // Fields PROTECTED
119  //
120
121
122 private: 
123
124  // Methods PRIVATE
125  // 
126
127
128  // Fields PRIVATE
129  //
130 Handle_SMDS_Mesh myMesh;
131 SMDS_MapOfMeshElement myElements;
132 SMDS_MapOfMeshElement myNodes;
133 Standard_Boolean myListOfEltIDIsUpdate;
134 TColStd_ListOfInteger myListOfEltID;
135 Standard_Boolean myListOfNodeIDIsUpdate;
136 TColStd_ListOfInteger myListOfNodeID;
137
138
139 };
140
141
142
143
144
145 // other inline functions and methods (like "C++: function call" methods)
146 //
147
148
149 #endif