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"
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 SMESH::Hypothesis_Status AddHypothesis(GEOM::GEOM_Object_ptr aSubShapeObject,
69 SMESH::SMESH_Hypothesis_ptr anHyp)
70 throw (SALOME::SALOME_Exception);
72 SMESH::Hypothesis_Status RemoveHypothesis(GEOM::GEOM_Object_ptr aSubShapeObject,
73 SMESH::SMESH_Hypothesis_ptr anHyp)
74 throw (SALOME::SALOME_Exception);
76 SMESH::ListOfHypothesis* GetHypothesisList(GEOM::GEOM_Object_ptr aSubShapeObject)
77 throw (SALOME::SALOME_Exception);
79 SMESH::SMESH_subMesh_ptr GetSubMesh(GEOM::GEOM_Object_ptr aSubShapeObject, const char* theName)
80 throw (SALOME::SALOME_Exception);
82 void RemoveSubMesh( SMESH::SMESH_subMesh_ptr theSubMesh )
83 throw (SALOME::SALOME_Exception);
85 SMESH::SMESH_Group_ptr CreateGroup( SMESH::ElementType theElemType, const char* theName )
86 throw (SALOME::SALOME_Exception);
88 SMESH::SMESH_Group_ptr CreateGroupFromGEOM( SMESH::ElementType theElemType, const char* theName,
89 GEOM::GEOM_Object_ptr theGEOMGroup )
90 throw (SALOME::SALOME_Exception);
92 void RemoveGroup( SMESH::SMESH_Group_ptr theGroup )
93 throw (SALOME::SALOME_Exception);
95 void RemoveGroupWithContents( SMESH::SMESH_Group_ptr theGroup )
96 throw (SALOME::SALOME_Exception);
98 SMESH::SMESH_Group_ptr UnionGroups( SMESH::SMESH_Group_ptr theGroup1,
99 SMESH::SMESH_Group_ptr theGroup2,
100 const char* theName )
101 throw (SALOME::SALOME_Exception);
103 SMESH::SMESH_Group_ptr IntersectGroups( SMESH::SMESH_Group_ptr theGroup1,
104 SMESH::SMESH_Group_ptr theGroup2,
105 const char* theName )
106 throw (SALOME::SALOME_Exception);
108 SMESH::SMESH_Group_ptr CutGroups( SMESH::SMESH_Group_ptr theGroup1,
109 SMESH::SMESH_Group_ptr theGroup2,
110 const char* theName )
111 throw (SALOME::SALOME_Exception);
113 // SMESH::string_array* GetLog(CORBA::Boolean clearAfterGet)
114 // throw (SALOME::SALOME_Exception);
116 SMESH::log_array* GetLog(CORBA::Boolean clearAfterGet)
117 throw (SALOME::SALOME_Exception);
119 SMESH::SMESH_MeshEditor_ptr GetMeshEditor();
122 throw (SALOME::SALOME_Exception);
125 throw (SALOME::SALOME_Exception);
127 CORBA::Long GetStudyId()
128 throw (SALOME::SALOME_Exception);
132 void SetImpl(::SMESH_Mesh* impl);
133 ::SMESH_Mesh& GetImpl(); // :: force no namespace here
135 SMESH_Gen_i* GetGen() { return _gen_i; }
137 int ImportUNVFile( const char* theFileName )
138 throw (SALOME::SALOME_Exception);
140 int ImportSTLFile( const char* theFileName )
141 throw (SALOME::SALOME_Exception);
144 * consult DriverMED_R_SMESHDS_Mesh::ReadStatus for returned value
146 SMESH::DriverMED_ReadStatus ImportMEDFile( const char* theFileName, const char* theMeshName )
147 throw (SALOME::SALOME_Exception);
149 void ExportMED( const char* file, CORBA::Boolean auto_groups )
150 throw (SALOME::SALOME_Exception);
151 void ExportDAT( const char* file )
152 throw (SALOME::SALOME_Exception);
153 void ExportUNV( const char* file )
154 throw (SALOME::SALOME_Exception);
155 void ExportSTL( const char* file, const bool isascii )
156 throw (SALOME::SALOME_Exception);
158 SALOME_MED::MESH_ptr GetMEDMesh()
159 throw (SALOME::SALOME_Exception);
161 CORBA::Long NbNodes()
162 throw (SALOME::SALOME_Exception);
164 CORBA::Long NbEdges()
165 throw (SALOME::SALOME_Exception);
167 CORBA::Long NbFaces()
168 throw (SALOME::SALOME_Exception);
170 CORBA::Long NbTriangles()
171 throw (SALOME::SALOME_Exception);
173 CORBA::Long NbQuadrangles()
174 throw (SALOME::SALOME_Exception);
176 CORBA::Long NbVolumes()
177 throw (SALOME::SALOME_Exception);
179 CORBA::Long NbTetras()
180 throw (SALOME::SALOME_Exception);
182 CORBA::Long NbHexas()
183 throw (SALOME::SALOME_Exception);
185 CORBA::Long NbPyramids()
186 throw (SALOME::SALOME_Exception);
188 CORBA::Long NbPrisms()
189 throw (SALOME::SALOME_Exception);
191 CORBA::Long NbSubMesh()
192 throw (SALOME::SALOME_Exception);
196 // Internal methods not available through CORBA
197 // They are called by corresponding interface methods
198 SMESH_Hypothesis::Hypothesis_Status addHypothesis(GEOM::GEOM_Object_ptr aSubShapeObject,
199 SMESH::SMESH_Hypothesis_ptr anHyp);
201 SMESH_Hypothesis::Hypothesis_Status removeHypothesis(GEOM::GEOM_Object_ptr aSubShapeObject,
202 SMESH::SMESH_Hypothesis_ptr anHyp);
204 bool setShape( GEOM::GEOM_Object_ptr theShapeObject );
206 int importMEDFile( const char* theFileName, const char* theMeshName );
208 SMESH::SMESH_subMesh_ptr createSubMesh( GEOM::GEOM_Object_ptr theSubShapeObject );
210 void removeSubMesh( SMESH::SMESH_subMesh_ptr theSubMesh, GEOM::GEOM_Object_ptr theSubShapeObject );
212 SMESH::SMESH_Group_ptr createGroup( SMESH::ElementType theElemType, const char* theName );
214 void removeGroup( const int theId );
216 map<int, SMESH_subMesh_i*> _mapSubMesh_i; //NRI
217 map<int, ::SMESH_subMesh*> _mapSubMesh; //NRI
220 static int myIdGenerator;
221 ::SMESH_Mesh* _impl; // :: force no namespace here
223 int _id; // id given by creator (unique within the creator instance)
225 map<int, SMESH::SMESH_subMesh_ptr> _mapSubMeshIor;
226 map<int, SMESH::SMESH_Group_ptr> _mapGroups;
227 map<int, SMESH::SMESH_Hypothesis_ptr> _mapHypo;