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