Salome HOME
sources v1.2
[modules/smesh.git] / src / SMESHDS / SMESHDS_Document.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_Document.hxx
25 //  Module : SMESH
26
27 #ifndef _SMESHDS_Document_HeaderFile
28 #define _SMESHDS_Document_HeaderFile
29
30 #ifndef _Standard_HeaderFile
31 #include <Standard.hxx>
32 #endif
33 #ifndef _Handle_SMESHDS_Document_HeaderFile
34 #include "Handle_SMESHDS_Document.hxx"
35 #endif
36
37 #ifndef _Standard_Integer_HeaderFile
38 #include <Standard_Integer.hxx>
39 #endif
40 #ifndef _SMESHDS_DataMapOfIntegerMesh_HeaderFile
41 #include "SMESHDS_DataMapOfIntegerMesh.hxx"
42 #endif
43 #ifndef _SMESHDS_DataMapOfIntegerPtrHypothesis_HeaderFile
44 #include "SMESHDS_DataMapOfIntegerPtrHypothesis.hxx"
45 #endif
46 #ifndef _SMESHDS_DataMapIteratorOfDataMapOfIntegerMesh_HeaderFile
47 #include "SMESHDS_DataMapIteratorOfDataMapOfIntegerMesh.hxx"
48 #endif
49 #ifndef _SMESHDS_DataMapIteratorOfDataMapOfIntegerPtrHypothesis_HeaderFile
50 #include "SMESHDS_DataMapIteratorOfDataMapOfIntegerPtrHypothesis.hxx"
51 #endif
52 #ifndef _MMgt_TShared_HeaderFile
53 #include <MMgt_TShared.hxx>
54 #endif
55 #ifndef _Handle_SMESHDS_Mesh_HeaderFile
56 #include "Handle_SMESHDS_Mesh.hxx"
57 #endif
58 #ifndef _SMESHDS_PtrHypothesis_HeaderFile
59 #include "SMESHDS_PtrHypothesis.hxx"
60 #endif
61 #ifndef _Standard_Boolean_HeaderFile
62 #include <Standard_Boolean.hxx>
63 #endif
64 class SMESHDS_Mesh;
65
66
67 class SMESHDS_Document : public MMgt_TShared {
68
69 public:
70
71     inline void* operator new(size_t,void* anAddress) 
72       {
73         return anAddress;
74       }
75     inline void* operator new(size_t size) 
76       { 
77         return Standard::Allocate(size); 
78       }
79     inline void  operator delete(void *anAddress) 
80       { 
81         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
82       }
83 //    inline void  operator delete(void *anAddress, size_t size) 
84 //      { 
85 //        if (anAddress) Standard::Free((Standard_Address&)anAddress,size); 
86 //      }
87  // Methods PUBLIC
88  // 
89 Standard_EXPORT SMESHDS_Document(const Standard_Integer UserID);
90 Standard_EXPORT   Standard_Integer NewMesh() ;
91 Standard_EXPORT   void RemoveMesh(const Standard_Integer MeshID) ;
92 Standard_EXPORT   Handle_SMESHDS_Mesh GetMesh(const Standard_Integer MeshID) ;
93 Standard_EXPORT   void AddHypothesis(const SMESHDS_PtrHypothesis& H) ;
94 Standard_EXPORT   void RemoveHypothesis(const Standard_Integer HypID) ;
95 Standard_EXPORT   SMESHDS_PtrHypothesis GetHypothesis(const Standard_Integer HypID) ;
96 Standard_EXPORT   Standard_Integer NbMeshes() ;
97 Standard_EXPORT   Standard_Integer NbHypothesis() ;
98 Standard_EXPORT   void InitMeshesIterator() ;
99 Standard_EXPORT   void NextMesh() ;
100 Standard_EXPORT   Standard_Boolean MoreMesh() ;
101 Standard_EXPORT   Handle_SMESHDS_Mesh CurrentMesh() ;
102 Standard_EXPORT   void InitHypothesisIterator() ;
103 Standard_EXPORT   void NextHypothesis() ;
104 Standard_EXPORT   Standard_Boolean MoreHypothesis() ;
105 Standard_EXPORT   SMESHDS_PtrHypothesis CurrentHypothesis() ;
106 Standard_EXPORT ~SMESHDS_Document();
107
108
109
110
111  // Type management
112  //
113  Standard_EXPORT friend Handle_Standard_Type& SMESHDS_Document_Type_();
114  Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
115  Standard_EXPORT Standard_Boolean              IsKind(const Handle(Standard_Type)&) const;
116
117 protected:
118
119  // Methods PROTECTED
120  // 
121
122
123  // Fields PROTECTED
124  //
125
126
127 private: 
128
129  // Methods PRIVATE
130  // 
131
132
133  // Fields PRIVATE
134  //
135 Standard_Integer myUserID;
136 SMESHDS_DataMapOfIntegerMesh myMeshes;
137 SMESHDS_DataMapOfIntegerPtrHypothesis myHypothesis;
138 SMESHDS_DataMapIteratorOfDataMapOfIntegerMesh myMeshesIt;
139 SMESHDS_DataMapIteratorOfDataMapOfIntegerPtrHypothesis myHypothesisIt;
140
141
142 };
143
144
145
146
147
148 // other inline functions and methods (like "C++: function call" methods)
149 //
150
151
152 #endif