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(GEOM_Shape)
38 #include CORBA_CLIENT_HEADER(MED)
43 #include "SMESH_Hypothesis.hxx"
44 #include "SMESH_Mesh.hxx"
45 #include "SMESH_subMesh_i.hxx"
46 #include "SMESH_subMesh.hxx"
47 #include "SMESH_topo.hxx"
51 #include "SALOME_GenericObj_i.hh"
54 public virtual POA_SMESH::SMESH_Mesh,
55 public virtual SALOME::GenericObj_i
59 SMESH_Mesh_i( PortableServer::POA_ptr thePOA,
61 CORBA::Long studyId );
63 virtual ~SMESH_Mesh_i();
66 void SetShape( GEOM::GEOM_Shape_ptr theShape )
67 throw (SALOME::SALOME_Exception);
69 SMESH::Hypothesis_Status AddHypothesis(GEOM::GEOM_Shape_ptr aSubShape,
70 SMESH::SMESH_Hypothesis_ptr anHyp)
71 throw (SALOME::SALOME_Exception);
73 SMESH::Hypothesis_Status RemoveHypothesis(GEOM::GEOM_Shape_ptr aSubShape,
74 SMESH::SMESH_Hypothesis_ptr anHyp)
75 throw (SALOME::SALOME_Exception);
77 SMESH::ListOfHypothesis* GetHypothesisList(GEOM::GEOM_Shape_ptr aSubShape)
78 throw (SALOME::SALOME_Exception);
80 SMESH::SMESH_subMesh_ptr GetSubMesh(GEOM::GEOM_Shape_ptr aSubShape, const char* theName)
81 throw (SALOME::SALOME_Exception);
83 void RemoveSubMesh( SMESH::SMESH_subMesh_ptr theSubMesh )
84 throw (SALOME::SALOME_Exception);
86 SMESH::SMESH_Group_ptr CreateGroup( SMESH::ElementType theElemType, const char* theName )
87 throw (SALOME::SALOME_Exception);
89 void RemoveGroup( SMESH::SMESH_Group_ptr theGroup )
90 throw (SALOME::SALOME_Exception);
92 // SMESH::string_array* GetLog(CORBA::Boolean clearAfterGet)
93 // throw (SALOME::SALOME_Exception);
95 SMESH::log_array* GetLog(CORBA::Boolean clearAfterGet)
96 throw (SALOME::SALOME_Exception);
98 SMESH::SMESH_MeshEditor_ptr GetMeshEditor();
101 throw (SALOME::SALOME_Exception);
104 throw (SALOME::SALOME_Exception);
106 CORBA::Long GetStudyId()
107 throw (SALOME::SALOME_Exception);
111 void SetImpl(::SMESH_Mesh* impl);
112 ::SMESH_Mesh& GetImpl(); // :: force no namespace here
114 SMESH_Gen_i* GetGen() { return _gen_i; }
117 * consult DriverMED_R_SMESHDS_Mesh::ReadStatus for returned value
119 SMESH::DriverMED_ReadStatus ImportMEDFile( const char* theFileName, const char* theMeshName )
120 throw (SALOME::SALOME_Exception);
122 void ExportMED( const char* file, CORBA::Boolean auto_groups )
123 throw (SALOME::SALOME_Exception);
124 void ExportDAT( const char* file )
125 throw (SALOME::SALOME_Exception);
126 void ExportUNV( const char* file )
127 throw (SALOME::SALOME_Exception);
129 SALOME_MED::MESH_ptr GetMEDMesh()
130 throw (SALOME::SALOME_Exception);
132 CORBA::Long NbNodes()
133 throw (SALOME::SALOME_Exception);
135 CORBA::Long NbEdges()
136 throw (SALOME::SALOME_Exception);
138 CORBA::Long NbFaces()
139 throw (SALOME::SALOME_Exception);
141 CORBA::Long NbTriangles()
142 throw (SALOME::SALOME_Exception);
144 CORBA::Long NbQuadrangles()
145 throw (SALOME::SALOME_Exception);
147 CORBA::Long NbVolumes()
148 throw (SALOME::SALOME_Exception);
150 CORBA::Long NbTetras()
151 throw (SALOME::SALOME_Exception);
153 CORBA::Long NbHexas()
154 throw (SALOME::SALOME_Exception);
156 CORBA::Long NbPyramids()
157 throw (SALOME::SALOME_Exception);
159 CORBA::Long NbPrisms()
160 throw (SALOME::SALOME_Exception);
162 CORBA::Long NbSubMesh()
163 throw (SALOME::SALOME_Exception);
167 // Internal methods not available through CORBA
168 // They are called by corresponding interface methods
169 SMESH_Hypothesis::Hypothesis_Status addHypothesis(GEOM::GEOM_Shape_ptr aSubShape,
170 SMESH::SMESH_Hypothesis_ptr anHyp);
172 SMESH_Hypothesis::Hypothesis_Status removeHypothesis(GEOM::GEOM_Shape_ptr aSubShape,
173 SMESH::SMESH_Hypothesis_ptr anHyp);
175 bool setShape( GEOM::GEOM_Shape_ptr theShape );
177 int importMEDFile( const char* theFileName, const char* theMeshName );
179 SMESH::SMESH_subMesh_ptr createSubMesh( GEOM::GEOM_Shape_ptr theSubShape );
181 void removeSubMesh( SMESH::SMESH_subMesh_ptr theSubMesh, GEOM::GEOM_Shape_ptr theSubShape );
183 SMESH::SMESH_Group_ptr createGroup( SMESH::ElementType theElemType, const char* theName );
185 void removeGroup( const int theId );
187 map<int, SMESH_subMesh_i*> _mapSubMesh_i; //NRI
188 map<int, ::SMESH_subMesh*> _mapSubMesh; //NRI
191 static int myIdGenerator;
192 ::SMESH_Mesh* _impl; // :: force no namespace here
194 int _id; // id given by creator (unique within the creator instance)
196 map<int, SMESH::SMESH_subMesh_ptr> _mapSubMeshIor;
197 map<int, SMESH::SMESH_Group_ptr> _mapGroups;
198 map<int, SMESH::SMESH_Hypothesis_ptr> _mapHypo;