Salome HOME
Merging with branch OCC_development_for_3_2_0b1
[modules/smesh.git] / src / SMESH_I / SMESH_MEDMesh_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_MEDMesh_i.hxx
25 //  Module : SMESH
26
27 #ifndef _MED_SMESH_MESH_I_HXX_
28 #define _MED_SMESH_MESH_I_HXX_
29
30 #include "SMESH.hxx"
31
32 #include <SALOMEconfig.h>
33 #include CORBA_SERVER_HEADER(MED)
34 #include <string>
35 #include <vector>
36 #include <map>
37
38 #include "SMESHDS_Mesh.hxx"
39
40 #include "SMDS_MeshElement.hxx"
41 #include "SMDS_MeshNode.hxx"
42 #include "SALOME_GenericObj_i.hh"
43
44 #define MED_NBR_GEOMETRIE_MAILLE 15
45 #define MED_NBR_TYPE 5
46
47 class SMESH_Mesh_i;
48
49 class SMESH_I_EXPORT SMESH_MEDMesh_i:
50         public virtual POA_SALOME_MED::MESH, public virtual SALOME::GenericObj_i
51 {
52   public: private: protected:
53         // C++ object containing values
54         ::SMESH_Mesh_i * _mesh_i;
55         SMESHDS_Mesh *_meshDS;
56
57         string _meshId;
58         bool _compte;
59         bool _creeFamily;
60         int _indexElts;
61         int _indexEnts;
62         int _famIdent;
63
64         map < SALOME_MED::medGeometryElement, int >_mapIndToSeqElts;
65         SALOME_MED::long_array_var _seq_elemId[MED_NBR_GEOMETRIE_MAILLE];
66
67         map < SALOME_MED::medEntityMesh, int >_mapNbTypes;
68         map < SALOME_MED::medEntityMesh, int >_mapIndToVectTypes;
69         vector < SALOME_MED::medGeometryElement >
70                 _TypesId[MED_NBR_GEOMETRIE_MAILLE];
71
72         vector < SALOME_MED::FAMILY_ptr > _families;
73   public:
74
75         // Constructors and associated internal methods
76         SMESH_MEDMesh_i();
77         SMESH_MEDMesh_i(SMESH_Mesh_i * m);
78         ~SMESH_MEDMesh_i();
79
80         // IDL Methods
81         void setProtocol(SALOME::TypeOfCommunication typ) {}
82         void release() {}
83         SALOME::SenderDouble_ptr getSenderForCoordinates(long int) {return SALOME::SenderDouble::_nil();}
84         SALOME::SenderInt_ptr getSenderForConnectivity(long int, long int, long int, long int) {return SALOME::SenderInt::_nil();}
85         SALOME::SenderInt_ptr getSenderForPolygonsConnectivity(SALOME_MED::medConnectivity, SALOME_MED::medEntityMesh) {return SALOME::SenderInt::_nil();}
86         SALOME::SenderInt_ptr getSenderForPolygonsConnectivityIndex(SALOME_MED::medConnectivity, SALOME_MED::medEntityMesh) {return SALOME::SenderInt::_nil();}
87         SALOME::SenderInt_ptr getSenderForPolyhedronConnectivity(SALOME_MED::medConnectivity) {return SALOME::SenderInt::_nil();}
88         SALOME::SenderInt_ptr getSenderForPolyhedronIndex(SALOME_MED::medConnectivity) {return SALOME::SenderInt::_nil();}
89         SALOME::SenderInt_ptr getSenderForPolyhedronFacesIndex() {return SALOME::SenderInt::_nil();}
90         
91         char *getName() throw(SALOME::SALOME_Exception);
92         CORBA::Long getSpaceDimension() throw(SALOME::SALOME_Exception);
93
94         CORBA::Long getMeshDimension() throw(SALOME::SALOME_Exception);
95
96         CORBA::Boolean  getIsAGrid() throw (SALOME::SALOME_Exception);
97
98         CORBA::Boolean
99         existConnectivity(SALOME_MED::medConnectivity connectivityType,
100                           SALOME_MED::medEntityMesh entity)
101           throw (SALOME::SALOME_Exception);
102
103         char *getCoordinatesSystem() throw(SALOME::SALOME_Exception);
104
105         CORBA::Double getCoordinate(CORBA::Long Number, CORBA::Long Axis)
106           throw (SALOME::SALOME_Exception);
107
108         SALOME_MED::double_array * getCoordinates(SALOME_MED::medModeSwitch typeSwitch)
109                 throw(SALOME::SALOME_Exception);
110
111         SALOME_MED::string_array * getCoordinatesNames()
112                 throw(SALOME::SALOME_Exception);
113
114         SALOME_MED::string_array * getCoordinatesUnits()
115           throw(SALOME::SALOME_Exception);
116
117         CORBA::Long getNumberOfNodes() throw(SALOME::SALOME_Exception);
118
119         CORBA::Long getNumberOfTypes(SALOME_MED::medEntityMesh entity)
120                 throw(SALOME::SALOME_Exception);
121
122         SALOME_MED::medGeometryElement_array *
123                 getTypes(SALOME_MED::medEntityMesh entity) throw(SALOME::
124                 SALOME_Exception);
125
126         SALOME_MED::medGeometryElement
127         getElementType(SALOME_MED::medEntityMesh entity,
128                        CORBA::Long number)
129           throw   (SALOME::SALOME_Exception);
130
131         CORBA::Long getNumberOfElements(SALOME_MED::medEntityMesh entity,
132                 SALOME_MED::medGeometryElement geomElement)
133                 throw(SALOME::SALOME_Exception);
134
135         SALOME_MED::long_array *
136         getConnectivity(SALOME_MED::medModeSwitch typeSwitch,
137                         SALOME_MED::medConnectivity mode,
138                         SALOME_MED::medEntityMesh entity,
139                         SALOME_MED::medGeometryElement geomElement)
140           throw(SALOME::SALOME_Exception);
141
142         SALOME_MED::long_array *
143         getConnectivityIndex(SALOME_MED::medConnectivity mode,
144                              SALOME_MED::medEntityMesh entity)
145           throw(SALOME::SALOME_Exception);
146
147         SALOME_MED::long_array*
148         getGlobalNumberingIndex(SALOME_MED::medEntityMesh entity)
149           throw (SALOME::SALOME_Exception);
150
151         CORBA::Long getElementNumber(SALOME_MED::medConnectivity mode,
152                 SALOME_MED::medEntityMesh entity,
153                 SALOME_MED::medGeometryElement type,
154                 const SALOME_MED::long_array & connectivity)
155                 throw(SALOME::SALOME_Exception);
156
157         SALOME_MED::long_array *
158                 getReverseConnectivity(SALOME_MED::medConnectivity mode)
159           throw(SALOME::SALOME_Exception);
160
161         SALOME_MED::long_array *
162                 getReverseConnectivityIndex(SALOME_MED::
163                 medConnectivity mode) throw(SALOME::SALOME_Exception);
164
165         // Family and Group
166         CORBA::Long getNumberOfFamilies(SALOME_MED::medEntityMesh entity)
167                 throw(SALOME::SALOME_Exception);
168
169         CORBA::Long getNumberOfGroups(SALOME_MED::medEntityMesh entity)
170                 throw(SALOME::SALOME_Exception);
171
172         SALOME_MED::Family_array *
173         getFamilies(SALOME_MED::medEntityMesh entity)
174           throw(SALOME::SALOME_Exception);
175
176         SALOME_MED::FAMILY_ptr getFamily(SALOME_MED::medEntityMesh entity,
177                 CORBA::Long i) throw(SALOME::SALOME_Exception);
178
179         SALOME_MED::Group_array * getGroups(SALOME_MED::medEntityMesh entity)
180                 throw(SALOME::SALOME_Exception);
181
182         SALOME_MED::GROUP_ptr getGroup(SALOME_MED::medEntityMesh entity,
183                 CORBA::Long i) throw(SALOME::SALOME_Exception);
184
185         SALOME_MED::SUPPORT_ptr
186         getBoundaryElements(SALOME_MED::medEntityMesh entity)
187           throw (SALOME::SALOME_Exception);
188
189         SALOME_MED::SUPPORT_ptr getSkin(SALOME_MED::SUPPORT_ptr mySupport3D)
190           throw (SALOME::SALOME_Exception);
191
192         SALOME_MED::FIELD_ptr getVolume(SALOME_MED::SUPPORT_ptr mySupport)
193                 throw(SALOME::SALOME_Exception);
194
195         SALOME_MED::FIELD_ptr getArea(SALOME_MED::SUPPORT_ptr mySupport)
196                 throw(SALOME::SALOME_Exception);
197
198         SALOME_MED::FIELD_ptr getLength(SALOME_MED::SUPPORT_ptr mySupport)
199                 throw(SALOME::SALOME_Exception);
200
201         SALOME_MED::FIELD_ptr getNormal(SALOME_MED::SUPPORT_ptr mySupport)
202                 throw(SALOME::SALOME_Exception);
203
204         SALOME_MED::FIELD_ptr getBarycenter(SALOME_MED::SUPPORT_ptr mySupport)
205                 throw(SALOME::SALOME_Exception);
206
207         SALOME_MED::FIELD_ptr getNeighbourhood(SALOME_MED::SUPPORT_ptr mySupport)
208                 throw(SALOME::SALOME_Exception);
209
210         // Others
211         void addInStudy(SALOMEDS::Study_ptr myStudy,
212                 SALOME_MED::MESH_ptr myIor) throw(SALOME::SALOME_Exception);
213         CORBA::Long addDriver(SALOME_MED::medDriverTypes driverType,
214                 const char *fileName, const char *meshName)
215                 throw(SALOME::SALOME_Exception);
216         void rmDriver(CORBA::Long i) throw(SALOME::SALOME_Exception);
217         void read(CORBA::Long i) throw(SALOME::SALOME_Exception);
218         void write(CORBA::Long i, const char *driverMeshName)
219                 throw(SALOME::SALOME_Exception);
220
221         //                    Cuisine interne
222         CORBA::Long getCorbaIndex() throw(SALOME::SALOME_Exception);
223
224         SALOME_MED::MESH::meshInfos * getMeshGlobal()
225           throw (SALOME::SALOME_Exception);
226
227         bool areEquals(SALOME_MED::MESH_ptr other) { return false;};
228
229         SALOME_MED::MESH::coordinateInfos * getCoordGlobal()
230           throw (SALOME::SALOME_Exception);
231
232         SALOME_MED::MESH::connectivityInfos *
233         getConnectGlobal(SALOME_MED::medEntityMesh entity)
234           throw (SALOME::SALOME_Exception);
235
236         //
237         void calculeNbElts() throw(SALOME::SALOME_Exception);
238         void createFamilies() throw(SALOME::SALOME_Exception);
239 };
240
241 #endif /* _MED_MESH_I_HXX_ */