Salome HOME
merging the main trunk with the BrForComp branch to build a pre V3_0_1
[modules/med.git] / src / MEDMEM_I / MEDMEM_Mesh_i.hxx
1 //=============================================================================
2 // File      : MEDMEM_Mesh_i.hxx
3 // Project   : SALOME
4 // Author    : EDF 
5 // Copyright : EDF 2002
6 // $Header: /export/home/PAL/MED_SRC/src/MEDMEM_I/MEDMEM_Mesh_i.hxx
7 //=============================================================================
8
9 #ifndef _MED_MESH_I_HXX_
10 #define _MED_MESH_I_HXX_
11
12 #include <map>
13 #include <string>
14
15 #include <SALOMEconfig.h>
16 #include "SALOMEMultiComm.hxx"
17 #include CORBA_SERVER_HEADER(MED)
18 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
19 #include CORBA_SERVER_HEADER(SALOME_Comm)
20
21 namespace MEDMEM {
22 class MESH;
23 class MESH_i: public POA_SALOME_MED::MESH,
24               public PortableServer::RefCountServantBase,
25               public SALOMEMultiComm
26 {
27 public :
28     static std::map < int,::MEDMEM::MESH *> meshMap;
29 private :
30     static int meshIndex;
31
32 private :
33
34 protected:
35     // C++ object containing values
36     ::MEDMEM::MESH * const _mesh;
37     const int      _corbaIndex;
38     std::string         _meshId;
39
40
41 public:
42
43   // Constructors and associated internal methods
44   MESH_i();
45   MESH_i(::MEDMEM::MESH * const m);
46   MESH_i(MESH_i & m);
47   ~MESH_i();
48
49   // IDL Methods 
50   char *          getName()             throw (SALOME::SALOME_Exception);
51   
52   CORBA::Long     getSpaceDimension()   throw (SALOME::SALOME_Exception);
53
54   CORBA::Long     getMeshDimension()    throw (SALOME::SALOME_Exception);
55   
56   CORBA::Boolean  getIsAGrid()          throw (SALOME::SALOME_Exception);
57
58   CORBA::Boolean  existConnectivity
59                       ( SALOME_MED::medConnectivity connectivityType,
60                         SALOME_MED::medEntityMesh entity)
61                          throw (SALOME::SALOME_Exception);
62
63   char *          getCoordinatesSystem() 
64                          throw (SALOME::SALOME_Exception);
65   
66   SALOME_MED::double_array* getCoordinates(SALOME_MED::medModeSwitch typeSwitch)
67                          throw (SALOME::SALOME_Exception);
68
69   SALOME::SenderDouble_ptr getSenderForCoordinates(SALOME_MED::medModeSwitch typeSwitch)
70     throw (SALOME::SALOME_Exception);
71   
72   CORBA::Double  getCoordinate(CORBA::Long Number, CORBA::Long Axis)
73                          throw (SALOME::SALOME_Exception);
74
75   SALOME_MED::string_array* getCoordinatesNames() 
76                          throw (SALOME::SALOME_Exception);
77   
78   SALOME_MED::string_array* getCoordinatesUnits()
79                          throw (SALOME::SALOME_Exception); 
80   
81   CORBA::Long     getNumberOfNodes() 
82                          throw (SALOME::SALOME_Exception);
83   
84   CORBA::Long     getNumberOfTypes       (SALOME_MED::medEntityMesh entity) 
85                          throw   (SALOME::SALOME_Exception);
86   
87   SALOME_MED::medGeometryElement_array* getTypes(SALOME_MED::medEntityMesh entity)
88                          throw   (SALOME::SALOME_Exception);
89
90   SALOME_MED::medGeometryElement   getElementType(SALOME_MED::medEntityMesh entity,
91                                                   CORBA::Long number)
92                          throw   (SALOME::SALOME_Exception);
93
94   
95   CORBA::Long     getNumberOfElements (SALOME_MED::medEntityMesh entity,
96                                        SALOME_MED::medGeometryElement geomElement) 
97                          throw (SALOME::SALOME_Exception);
98   
99   SALOME_MED::long_array*   getConnectivity(SALOME_MED::medModeSwitch typeSwitch, 
100                                          SALOME_MED::medConnectivity mode, 
101                                          SALOME_MED::medEntityMesh entity, 
102                                          SALOME_MED::medGeometryElement geomElement)
103                          throw (SALOME::SALOME_Exception);
104
105   SALOME::SenderInt_ptr getSenderForConnectivity(SALOME_MED::medModeSwitch typeSwitch, 
106                                               SALOME_MED::medConnectivity mode, 
107                                               SALOME_MED::medEntityMesh entity, 
108                                               SALOME_MED::medGeometryElement geomElement)
109                          throw (SALOME::SALOME_Exception);
110   
111   SALOME_MED::long_array*   getConnectivityIndex(SALOME_MED::medConnectivity mode,
112                                               SALOME_MED::medEntityMesh entity)
113                          throw (SALOME::SALOME_Exception);
114   
115   SALOME_MED::long_array*   getGlobalNumberingIndex(SALOME_MED::medEntityMesh entity)
116                          throw (SALOME::SALOME_Exception);
117
118   CORBA::Long            getElementNumber(SALOME_MED::medConnectivity mode,
119                                           SALOME_MED::medEntityMesh entity,
120                                           SALOME_MED::medGeometryElement type,
121                                           const SALOME_MED::long_array& connectivity)
122                          throw  (SALOME::SALOME_Exception);
123
124   SALOME_MED::long_array*   getReverseConnectivity(SALOME_MED::medConnectivity mode)
125                          throw  (SALOME::SALOME_Exception);
126
127   SALOME_MED::long_array*   getReverseConnectivityIndex(SALOME_MED::medConnectivity mode)
128                          throw        (SALOME::SALOME_Exception);
129
130     // Family and Group
131     CORBA::Long               getNumberOfFamilies(SALOME_MED::medEntityMesh entity)
132                                         throw (SALOME::SALOME_Exception);
133     CORBA::Long               getNumberOfGroups(SALOME_MED::medEntityMesh entity) 
134                                         throw (SALOME::SALOME_Exception);
135     SALOME_MED::Family_array* getFamilies(SALOME_MED::medEntityMesh entity) 
136                                         throw (SALOME::SALOME_Exception);
137     SALOME_MED::FAMILY_ptr    getFamily    (SALOME_MED::medEntityMesh entity,
138                                             CORBA::Long i) 
139                                         throw (SALOME::SALOME_Exception);
140     SALOME_MED::Group_array*  getGroups(SALOME_MED::medEntityMesh entity) 
141                                         throw (SALOME::SALOME_Exception);
142     SALOME_MED::GROUP_ptr     getGroup (SALOME_MED::medEntityMesh entity, 
143                                             CORBA::Long i) 
144                                         throw (SALOME::SALOME_Exception);
145     // 
146     SALOME_MED::SUPPORT_ptr getBoundaryElements(SALOME_MED::medEntityMesh entity)
147                                      throw (SALOME::SALOME_Exception);
148     SALOME_MED::SUPPORT_ptr getSkin        (SALOME_MED::SUPPORT_ptr mySupport3D)
149                                      throw (SALOME::SALOME_Exception);
150     // 
151     SALOME_MED::FIELD_ptr getVolume        (SALOME_MED::SUPPORT_ptr mySupport)
152                                      throw (SALOME::SALOME_Exception);
153     SALOME_MED::FIELD_ptr getArea          (SALOME_MED::SUPPORT_ptr mySupport)          
154                                      throw (SALOME::SALOME_Exception);
155     SALOME_MED::FIELD_ptr getLength        (SALOME_MED::SUPPORT_ptr mySupport)        
156                                      throw (SALOME::SALOME_Exception);
157     SALOME_MED::FIELD_ptr getNormal        (SALOME_MED::SUPPORT_ptr mySupport)        
158                                      throw (SALOME::SALOME_Exception);
159     SALOME_MED::FIELD_ptr getBarycenter    (SALOME_MED::SUPPORT_ptr mySupport)    
160                                      throw (SALOME::SALOME_Exception);
161     SALOME_MED::FIELD_ptr getNeighbourhood (SALOME_MED::SUPPORT_ptr mySupport) 
162                                      throw (SALOME::SALOME_Exception);
163
164
165     // Others
166     void        addInStudy (SALOMEDS::Study_ptr myStudy, 
167                             SALOME_MED::MESH_ptr myIor)   
168                             throw (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection);
169     void        addInStudy (SALOMEDS::Study_ptr myStudy, 
170                             SALOME_MED::MESH_ptr myIor,
171                             const std::string & fileName)   
172                             throw (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection);
173     CORBA::Long addDriver  (SALOME_MED::medDriverTypes driverType, 
174                             const char* fileName, const char* meshName)
175                                                           throw (SALOME::SALOME_Exception);
176     void        rmDriver   (CORBA::Long i)                throw (SALOME::SALOME_Exception);
177     void        read       (CORBA::Long i)                throw (SALOME::SALOME_Exception);
178     void        write      (CORBA::Long i, const char* driverMeshName)
179                                                           throw (SALOME::SALOME_Exception);
180
181     //                                  Cuisine interne
182     CORBA::Long getCorbaIndex() throw (SALOME::SALOME_Exception);
183     ::MEDMEM::MESH * constructConstMesh() const;
184     SALOME_MED::MESH::meshInfos * getMeshGlobal()
185                                   throw (SALOME::SALOME_Exception);
186     SALOME_MED::MESH::coordinateInfos * getCoordGlobal()
187                                   throw (SALOME::SALOME_Exception);
188     SALOME_MED::MESH::connectivityInfos * getConnectGlobal
189                                   (SALOME_MED::medEntityMesh entity)
190                                   throw (SALOME::SALOME_Exception);
191     CORBA::Boolean areEquals(SALOME_MED::MESH_ptr other);
192
193   void release();
194 };
195 }
196
197 #endif /* _MED_MESH_I_HXX_ */