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