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