Salome HOME
Creating and importing 2 meshes from the same engine was not working. Mesh ID managem...
[modules/smesh.git] / src / SMESH_I / SMESH_Mesh_i.hxx
1 //  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
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   : SMESH_Mesh_i.hxx
25 //  Author : Paul RASCLE, EDF
26 //  Module : SMESH
27 //  $Header$
28
29 #ifndef _SMESH_MESH_I_HXX_
30 #define _SMESH_MESH_I_HXX_
31
32 #include <SALOMEconfig.h>
33 #include CORBA_SERVER_HEADER(SMESH_Mesh)
34 #include CORBA_SERVER_HEADER(SMESH_Hypothesis)
35 #include CORBA_CLIENT_HEADER(GEOM_Gen)
36 #include CORBA_CLIENT_HEADER(GEOM_Shape)
37 #include CORBA_CLIENT_HEADER(MED)
38
39 class SMESH_Gen_i;
40
41 #include "SMESH_Mesh.hxx"
42 #include "SMESH_Gen_i.hxx"
43 #include "SMESH_subMesh_i.hxx"
44 #include "SMESH_subMesh.hxx"
45 #include "SMESH_topo.hxx"
46
47 #include <map>
48
49 class SMESH_Mesh_i:
50   public POA_SMESH::SMESH_Mesh
51 {
52 public:
53   SMESH_Mesh_i(SMESH_Gen_i* myGen_i,
54                GEOM::GEOM_Gen_ptr geomEngine,
55                CORBA::Long studyId,
56                ::SMESH_Mesh * impl);
57
58   virtual ~SMESH_Mesh_i();
59
60   // --- CORBA
61
62   CORBA::Boolean AddHypothesis(GEOM::GEOM_Shape_ptr aSubShape,
63                                SMESH::SMESH_Hypothesis_ptr anHyp)
64     throw (SALOME::SALOME_Exception);
65
66   CORBA::Boolean  RemoveHypothesis(GEOM::GEOM_Shape_ptr aSubShape,
67                                    SMESH::SMESH_Hypothesis_ptr anHyp)
68     throw (SALOME::SALOME_Exception);
69
70   SMESH::ListOfHypothesis* GetHypothesisList(GEOM::GEOM_Shape_ptr aSubShape)
71     throw (SALOME::SALOME_Exception);
72
73   SMESH::SMESH_subMesh_ptr GetElementsOnShape(GEOM::GEOM_Shape_ptr aSubShape)
74     throw (SALOME::SALOME_Exception);
75
76 //    SMESH::string_array* GetLog(CORBA::Boolean clearAfterGet)
77 //      throw (SALOME::SALOME_Exception);
78
79   SMESH::log_array* GetLog(CORBA::Boolean clearAfterGet)
80     throw (SALOME::SALOME_Exception);
81
82   SMESH::SMESH_MeshEditor_ptr GetMeshEditor();
83
84   void ClearLog()
85     throw (SALOME::SALOME_Exception);
86
87   CORBA::Long GetId()
88     throw (SALOME::SALOME_Exception);
89
90   CORBA::Long GetStudyId()
91     throw (SALOME::SALOME_Exception);
92
93   void Export(const char* fileName, const char* fileType)
94         throw (SALOME::SALOME_Exception);
95
96   // --- C++ interface
97
98   void SetImpl(::SMESH_Mesh* impl);
99
100   ::SMESH_Mesh& GetImpl();         // :: force no namespace here
101   GEOM::GEOM_Gen_ptr GetGeomEngine();
102   void SetIor(SMESH::SMESH_Mesh_ptr myIor);
103   SMESH::SMESH_Mesh_ptr GetIor();
104
105   SALOME_MED::MESH_ptr GetMEDMesh()
106     throw (SALOME::SALOME_Exception);
107   
108   CORBA::Long NbNodes()
109     throw (SALOME::SALOME_Exception);
110   
111   CORBA::Long NbEdges()
112     throw (SALOME::SALOME_Exception);
113   
114   CORBA::Long NbFaces()
115     throw (SALOME::SALOME_Exception);
116
117   CORBA::Long NbTriangles()
118     throw (SALOME::SALOME_Exception);
119
120   CORBA::Long NbQuadrangles()
121     throw (SALOME::SALOME_Exception);
122   
123   CORBA::Long NbVolumes()
124     throw (SALOME::SALOME_Exception);
125
126   CORBA::Long NbTetras()
127     throw (SALOME::SALOME_Exception);
128
129   CORBA::Long NbHexas()
130     throw (SALOME::SALOME_Exception);
131   
132   CORBA::Long NbSubMesh()
133     throw (SALOME::SALOME_Exception);
134   
135
136   map<int, SMESH_subMesh_i*> _mapSubMesh_i; //NRI
137   map<int, ::SMESH_subMesh*> _mapSubMesh;   //NRI
138
139 private:
140   SMESH::log_array_var createUpdateAllCommand(SMESH::log_array_var log, int * index);
141   ::SMESH_Mesh* _impl;  // :: force no namespace here
142   SMESH_Gen_i* _gen_i;
143   //   CORBA::ORB_ptr _orb;
144 //   SMESH_topo* _topo;   // all local TopoDS_Shape of subShapes
145   GEOM::GEOM_Gen_var _geom;
146   CORBA::Long _studyId;
147   map<int, SMESH::SMESH_subMesh_ptr> _mapSubMeshIor;
148   SMESH::SMESH_Mesh_var _myIor;
149 };
150
151 #endif
152