1 // SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
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 : SMESH_Mesh_i.hxx
25 // Author : Paul RASCLE, EDF
29 #ifndef _SMESH_MESH_I_HXX_
30 #define _SMESH_MESH_I_HXX_
32 #include <SALOMEconfig.h>
33 #include CORBA_SERVER_HEADER(SMESH_Mesh)
34 #include CORBA_SERVER_HEADER(SMESH_Group)
35 #include CORBA_SERVER_HEADER(SMESH_Hypothesis)
36 #include CORBA_CLIENT_HEADER(GEOM_Gen)
37 #include CORBA_CLIENT_HEADER(MED)
39 #include "SMESH_Hypothesis.hxx"
40 #include "SMESH_Mesh.hxx"
41 #include "SMESH_subMesh_i.hxx"
42 #include "SMESH_subMesh.hxx"
44 #include "SALOME_GenericObj_i.hh"
47 class SMESH_GroupBase_i;
52 public virtual POA_SMESH::SMESH_Mesh,
53 public virtual SALOME::GenericObj_i
56 SMESH_Mesh_i(const SMESH_Mesh_i&);
58 SMESH_Mesh_i( PortableServer::POA_ptr thePOA,
60 CORBA::Long studyId );
62 virtual ~SMESH_Mesh_i();
65 void SetShape( GEOM::GEOM_Object_ptr theShapeObject )
66 throw (SALOME::SALOME_Exception);
68 GEOM::GEOM_Object_ptr GetShapeToMesh()
69 throw (SALOME::SALOME_Exception);
71 SMESH::Hypothesis_Status AddHypothesis(GEOM::GEOM_Object_ptr aSubShapeObject,
72 SMESH::SMESH_Hypothesis_ptr anHyp)
73 throw (SALOME::SALOME_Exception);
75 SMESH::Hypothesis_Status RemoveHypothesis(GEOM::GEOM_Object_ptr aSubShapeObject,
76 SMESH::SMESH_Hypothesis_ptr anHyp)
77 throw (SALOME::SALOME_Exception);
79 SMESH::ListOfHypothesis* GetHypothesisList(GEOM::GEOM_Object_ptr aSubShapeObject)
80 throw (SALOME::SALOME_Exception);
82 SMESH::SMESH_subMesh_ptr GetSubMesh(GEOM::GEOM_Object_ptr aSubShapeObject, const char* theName)
83 throw (SALOME::SALOME_Exception);
85 void RemoveSubMesh( SMESH::SMESH_subMesh_ptr theSubMesh )
86 throw (SALOME::SALOME_Exception);
88 SMESH::SMESH_Group_ptr CreateGroup( SMESH::ElementType theElemType, const char* theName )
89 throw (SALOME::SALOME_Exception);
91 SMESH::SMESH_GroupOnGeom_ptr CreateGroupFromGEOM(SMESH::ElementType theElemType,
93 GEOM::GEOM_Object_ptr theGeomObj )
94 throw (SALOME::SALOME_Exception);
96 void RemoveGroup( SMESH::SMESH_GroupBase_ptr theGroup )
97 throw (SALOME::SALOME_Exception);
99 void RemoveGroupWithContents( SMESH::SMESH_GroupBase_ptr theGroup )
100 throw (SALOME::SALOME_Exception);
102 SMESH::SMESH_Group_ptr UnionGroups( SMESH::SMESH_GroupBase_ptr theGroup1,
103 SMESH::SMESH_GroupBase_ptr theGroup2,
104 const char* theName )
105 throw (SALOME::SALOME_Exception);
107 SMESH::SMESH_Group_ptr IntersectGroups( SMESH::SMESH_GroupBase_ptr theGroup1,
108 SMESH::SMESH_GroupBase_ptr theGroup2,
109 const char* theName )
110 throw (SALOME::SALOME_Exception);
112 SMESH::SMESH_Group_ptr CutGroups( SMESH::SMESH_GroupBase_ptr theGroup1,
113 SMESH::SMESH_GroupBase_ptr theGroup2,
114 const char* theName )
115 throw (SALOME::SALOME_Exception);
117 // SMESH::string_array* GetLog(CORBA::Boolean clearAfterGet)
118 // throw (SALOME::SALOME_Exception);
120 SMESH::log_array* GetLog(CORBA::Boolean clearAfterGet)
121 throw (SALOME::SALOME_Exception);
123 SMESH::SMESH_MeshEditor_ptr GetMeshEditor();
126 throw (SALOME::SALOME_Exception);
129 throw (SALOME::SALOME_Exception);
131 CORBA::Long GetStudyId()
132 throw (SALOME::SALOME_Exception);
136 void SetImpl(::SMESH_Mesh* impl);
137 ::SMESH_Mesh& GetImpl(); // :: force no namespace here
139 SMESH_Gen_i* GetGen() { return _gen_i; }
141 int ImportUNVFile( const char* theFileName )
142 throw (SALOME::SALOME_Exception);
144 int ImportSTLFile( const char* theFileName )
145 throw (SALOME::SALOME_Exception);
148 * consult DriverMED_R_SMESHDS_Mesh::ReadStatus for returned value
150 SMESH::DriverMED_ReadStatus ImportMEDFile( const char* theFileName, const char* theMeshName )
151 throw (SALOME::SALOME_Exception);
153 void ExportToMED( const char* file, CORBA::Boolean auto_groups, SMESH::MED_VERSION theVersion )
154 throw (SALOME::SALOME_Exception);
155 void ExportMED( const char* file, CORBA::Boolean auto_groups )
156 throw (SALOME::SALOME_Exception);
158 void ExportDAT( const char* file )
159 throw (SALOME::SALOME_Exception);
160 void ExportUNV( const char* file )
161 throw (SALOME::SALOME_Exception);
162 void ExportSTL( const char* file, const bool isascii )
163 throw (SALOME::SALOME_Exception);
165 SALOME_MED::MESH_ptr GetMEDMesh()
166 throw (SALOME::SALOME_Exception);
168 CORBA::Long NbNodes()
169 throw (SALOME::SALOME_Exception);
171 CORBA::Long NbElements()
172 throw (SALOME::SALOME_Exception);
174 CORBA::Long NbEdges()
175 throw (SALOME::SALOME_Exception);
177 CORBA::Long NbFaces()
178 throw (SALOME::SALOME_Exception);
180 CORBA::Long NbTriangles()
181 throw (SALOME::SALOME_Exception);
183 CORBA::Long NbQuadrangles()
184 throw (SALOME::SALOME_Exception);
186 CORBA::Long NbPolygons()
187 throw (SALOME::SALOME_Exception);
189 CORBA::Long NbVolumes()
190 throw (SALOME::SALOME_Exception);
192 CORBA::Long NbTetras()
193 throw (SALOME::SALOME_Exception);
195 CORBA::Long NbHexas()
196 throw (SALOME::SALOME_Exception);
198 CORBA::Long NbPyramids()
199 throw (SALOME::SALOME_Exception);
201 CORBA::Long NbPrisms()
202 throw (SALOME::SALOME_Exception);
204 CORBA::Long NbPolyhedrons()
205 throw (SALOME::SALOME_Exception);
207 CORBA::Long NbSubMesh()
208 throw (SALOME::SALOME_Exception);
210 SMESH::long_array* GetElementsId()
211 throw (SALOME::SALOME_Exception);
213 SMESH::long_array* GetElementsByType( SMESH::ElementType theElemType )
214 throw (SALOME::SALOME_Exception);
216 SMESH::long_array* GetNodesId()
217 throw (SALOME::SALOME_Exception);
221 // Internal methods not available through CORBA
222 // They are called by corresponding interface methods
223 SMESH_Hypothesis::Hypothesis_Status addHypothesis(GEOM::GEOM_Object_ptr aSubShapeObject,
224 SMESH::SMESH_Hypothesis_ptr anHyp);
226 SMESH_Hypothesis::Hypothesis_Status removeHypothesis(GEOM::GEOM_Object_ptr aSubShapeObject,
227 SMESH::SMESH_Hypothesis_ptr anHyp);
229 int importMEDFile( const char* theFileName, const char* theMeshName );
231 SMESH::SMESH_subMesh_ptr createSubMesh( GEOM::GEOM_Object_ptr theSubShapeObject );
233 void removeSubMesh(SMESH::SMESH_subMesh_ptr theSubMesh,
234 GEOM::GEOM_Object_ptr theSubShapeObject );
236 SMESH::SMESH_GroupBase_ptr createGroup(SMESH::ElementType theElemType,
238 const TopoDS_Shape& theShape = TopoDS_Shape());
240 void removeGroup( const int theId );
242 SMESH::SMESH_subMesh_ptr getSubMesh(int shapeID);
243 // return an existing subMesh object for the shapeID. shapeID == submeshID.
245 const map<int, SMESH::SMESH_GroupBase_ptr>& getGroups() { return _mapGroups; }
246 // return an existing group object.
248 virtual SMESH::long_array* GetIDs();
250 map<int, SMESH_subMesh_i*> _mapSubMesh_i; //NRI
251 map<int, ::SMESH_subMesh*> _mapSubMesh; //NRI
254 static int myIdGenerator;
255 ::SMESH_Mesh* _impl; // :: force no namespace here
257 int _id; // id given by creator (unique within the creator instance)
259 map<int, SMESH::SMESH_subMesh_ptr> _mapSubMeshIor;
260 map<int, SMESH::SMESH_GroupBase_ptr> _mapGroups;
261 map<int, SMESH::SMESH_Hypothesis_ptr> _mapHypo;