Salome HOME
Merge from BR_V5_DEV 16Feb09
[modules/med.git] / src / MEDMEM_I / MEDMEM_Mesh_i.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  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 // File      : MEDMEM_Mesh_i.hxx
24 // Project   : SALOME
25 // Author    : EDF 
26 // $Header: /export/home/PAL/MED_SRC/src/MEDMEM_I/MEDMEM_Mesh_i.hxx
27 //=============================================================================
28 //
29 #ifndef _MED_MESH_I_HXX_
30 #define _MED_MESH_I_HXX_
31
32 #include <MEDMEM_I.hxx>
33
34 #include <map>
35 #include <string>
36
37 #include <SALOMEconfig.h>
38 #include "SALOMEMultiComm.hxx"
39 #include "SALOME_GenericObj_i.hh"
40 #include CORBA_SERVER_HEADER(MED)
41 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
42 #include CORBA_SERVER_HEADER(SALOME_Comm)
43
44 namespace MEDMEM {
45 class MESH;
46 class MEDMEM_I_EXPORT MESH_i: virtual public POA_SALOME_MED::MESH,
47               virtual public SALOMEMultiComm,
48               virtual public SALOME::GenericObj_i
49 {
50 public :
51     static std::map < int,::MEDMEM::MESH *> meshMap;
52 private :
53     static int meshIndex;
54
55 private :
56
57 protected:
58     // C++ object containing values
59     ::MEDMEM::MESH * const _mesh;
60     const int      _corbaIndex;
61     std::string         _meshId;
62
63
64 public:
65
66   // Constructors and associated internal methods
67   MESH_i();
68   MESH_i(::MEDMEM::MESH * const m);
69   MESH_i(MESH_i & m);
70   ~MESH_i();
71
72   // IDL Methods 
73   char *          getName()             throw (SALOME::SALOME_Exception);
74   
75   CORBA::Long     getSpaceDimension()   throw (SALOME::SALOME_Exception);
76
77   CORBA::Long     getMeshDimension()    throw (SALOME::SALOME_Exception);
78   
79   CORBA::Boolean  getIsAGrid()          throw (SALOME::SALOME_Exception);
80
81   CORBA::Boolean  existConnectivity
82                       ( SALOME_MED::medConnectivity connectivityType,
83                         SALOME_MED::medEntityMesh entity)
84                          throw (SALOME::SALOME_Exception);
85
86   char *          getCoordinatesSystem() 
87                          throw (SALOME::SALOME_Exception);
88   
89   SALOME_MED::double_array* getCoordinates(SALOME_MED::medModeSwitch typeSwitch)
90                          throw (SALOME::SALOME_Exception);
91
92   SALOME::SenderDouble_ptr getSenderForCoordinates(SALOME_MED::medModeSwitch typeSwitch)
93     throw (SALOME::SALOME_Exception);
94   
95   CORBA::Double  getCoordinate(CORBA::Long Number, CORBA::Long Axis)
96                          throw (SALOME::SALOME_Exception);
97
98   SALOME_MED::string_array* getCoordinatesNames() 
99                          throw (SALOME::SALOME_Exception);
100   
101   SALOME_MED::string_array* getCoordinatesUnits()
102                          throw (SALOME::SALOME_Exception); 
103   
104   CORBA::Long     getNumberOfNodes() 
105                          throw (SALOME::SALOME_Exception);
106   
107   CORBA::Long     getNumberOfTypes       (SALOME_MED::medEntityMesh entity) 
108                          throw   (SALOME::SALOME_Exception);
109   
110   SALOME_MED::medGeometryElement_array* getTypes(SALOME_MED::medEntityMesh entity)
111                          throw   (SALOME::SALOME_Exception);
112
113   SALOME_MED::medGeometryElement   getElementType(SALOME_MED::medEntityMesh entity,
114                                                   CORBA::Long number)
115                          throw   (SALOME::SALOME_Exception);
116
117   
118   CORBA::Long     getNumberOfElements (SALOME_MED::medEntityMesh entity,
119                                        SALOME_MED::medGeometryElement geomElement) 
120                          throw (SALOME::SALOME_Exception);
121   
122   SALOME_MED::long_array*   getConnectivity(SALOME_MED::medModeSwitch typeSwitch, 
123                                          SALOME_MED::medConnectivity mode, 
124                                          SALOME_MED::medEntityMesh entity, 
125                                          SALOME_MED::medGeometryElement geomElement)
126                          throw (SALOME::SALOME_Exception);
127
128   SALOME::SenderInt_ptr getSenderForConnectivity(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*   getConnectivityIndex(SALOME_MED::medConnectivity mode,
135                                               SALOME_MED::medEntityMesh entity)
136                          throw (SALOME::SALOME_Exception);
137   
138   SALOME_MED::long_array*   getGlobalNumberingIndex(SALOME_MED::medEntityMesh entity)
139                          throw (SALOME::SALOME_Exception);
140
141   SALOME::SenderInt_ptr getSenderForPolygonsConnectivity(SALOME_MED::medConnectivity mode,
142                                                          SALOME_MED::medEntityMesh entity)
143     throw (SALOME::SALOME_Exception);
144   SALOME::SenderInt_ptr getSenderForPolygonsConnectivityIndex(SALOME_MED::medConnectivity mode,
145                                                               SALOME_MED::medEntityMesh entity)
146     throw (SALOME::SALOME_Exception);
147
148   SALOME::SenderInt_ptr getSenderForPolyhedronConnectivity(SALOME_MED::medConnectivity mode)
149     throw (SALOME::SALOME_Exception);
150   SALOME::SenderInt_ptr getSenderForPolyhedronIndex(SALOME_MED::medConnectivity mode)
151     throw (SALOME::SALOME_Exception);
152   SALOME::SenderInt_ptr getSenderForPolyhedronFacesIndex()
153     throw (SALOME::SALOME_Exception);
154
155   CORBA::Long            getElementNumber(SALOME_MED::medConnectivity mode,
156                                           SALOME_MED::medEntityMesh entity,
157                                           SALOME_MED::medGeometryElement type,
158                                           const SALOME_MED::long_array& connectivity)
159                          throw  (SALOME::SALOME_Exception);
160
161   SALOME_MED::long_array*   getReverseConnectivity(SALOME_MED::medConnectivity mode)
162                          throw  (SALOME::SALOME_Exception);
163
164   SALOME_MED::long_array*   getReverseConnectivityIndex(SALOME_MED::medConnectivity mode)
165                          throw        (SALOME::SALOME_Exception);
166
167     // Family and Group
168     CORBA::Long               getNumberOfFamilies(SALOME_MED::medEntityMesh entity)
169                                         throw (SALOME::SALOME_Exception);
170     CORBA::Long               getNumberOfGroups(SALOME_MED::medEntityMesh entity) 
171                                         throw (SALOME::SALOME_Exception);
172     SALOME_MED::Family_array* getFamilies(SALOME_MED::medEntityMesh entity) 
173                                         throw (SALOME::SALOME_Exception);
174     SALOME_MED::FAMILY_ptr    getFamily    (SALOME_MED::medEntityMesh entity,
175                                             CORBA::Long i) 
176                                         throw (SALOME::SALOME_Exception);
177     SALOME_MED::Group_array*  getGroups(SALOME_MED::medEntityMesh entity) 
178                                         throw (SALOME::SALOME_Exception);
179     SALOME_MED::GROUP_ptr     getGroup (SALOME_MED::medEntityMesh entity, 
180                                             CORBA::Long i) 
181                                         throw (SALOME::SALOME_Exception);
182     // 
183     SALOME_MED::SUPPORT_ptr getBoundaryElements(SALOME_MED::medEntityMesh entity)
184                                      throw (SALOME::SALOME_Exception);
185     SALOME_MED::SUPPORT_ptr getSupportOnAll(SALOME_MED::medEntityMesh entity)
186                                      throw (SALOME::SALOME_Exception);
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     SALOME_MED::FIELD_ptr getArea          (SALOME_MED::SUPPORT_ptr mySupport)          
193                                      throw (SALOME::SALOME_Exception);
194     SALOME_MED::FIELD_ptr getLength        (SALOME_MED::SUPPORT_ptr mySupport)        
195                                      throw (SALOME::SALOME_Exception);
196     SALOME_MED::FIELD_ptr getNormal        (SALOME_MED::SUPPORT_ptr mySupport)        
197                                      throw (SALOME::SALOME_Exception);
198     SALOME_MED::FIELD_ptr getBarycenter    (SALOME_MED::SUPPORT_ptr mySupport)    
199                                      throw (SALOME::SALOME_Exception);
200     SALOME_MED::FIELD_ptr getNeighbourhood (SALOME_MED::SUPPORT_ptr mySupport) 
201                                      throw (SALOME::SALOME_Exception);
202
203
204     // Others
205     void        addInStudy (SALOMEDS::Study_ptr myStudy, 
206                             SALOME_MED::MESH_ptr myIor)   
207                             throw (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection);
208     void        addInStudy (SALOMEDS::Study_ptr myStudy, 
209                             SALOME_MED::MESH_ptr myIor,
210                             const std::string & fileName)   
211                             throw (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection);
212     CORBA::Long addDriver  (SALOME_MED::medDriverTypes driverType, 
213                             const char* fileName, const char* meshName)
214                                                           throw (SALOME::SALOME_Exception);
215     void        rmDriver   (CORBA::Long i)                throw (SALOME::SALOME_Exception);
216     void        read       (CORBA::Long i)                throw (SALOME::SALOME_Exception);
217     void        write      (CORBA::Long i, const char* driverMeshName)
218                                                           throw (SALOME::SALOME_Exception);
219
220     //                                  Cuisine interne
221     CORBA::Long getCorbaIndex() throw (SALOME::SALOME_Exception);
222     ::MEDMEM::MESH * constructConstMesh() const;
223     SALOME_MED::MESH::meshInfos * getMeshGlobal()
224                                   throw (SALOME::SALOME_Exception);
225     SALOME_MED::MESH::coordinateInfos * getCoordGlobal()
226                                   throw (SALOME::SALOME_Exception);
227     SALOME_MED::MESH::connectivityInfos * getConnectGlobal
228                                   (SALOME_MED::medEntityMesh entity)
229                                   throw (SALOME::SALOME_Exception);
230     CORBA::Boolean areEquals(SALOME_MED::MESH_ptr other);
231
232 };
233 }
234
235 #endif /* _MED_MESH_I_HXX_ */