Salome HOME
yfr : Merge with v1.2
[modules/smesh.git] / src / SMESH_I / SMESH_MEDMesh_i.hxx
1 //=============================================================================
2 // File      : SMESH_MEDMesh_i.hxx
3 // Project   : SALOME
4 // Copyright : EDF 2001
5 //=============================================================================
6
7 #ifndef _MED_SMESH_MESH_I_HXX_
8 #define _MED_SMESH_MESH_I_HXX_
9
10 #include <SALOMEconfig.h>
11 #include CORBA_SERVER_HEADER(MED)
12 #include <string>
13 #include <vector>
14 #include <map>
15
16 #include "SMESHDS_Mesh.hxx"
17
18 #include "SMDS_MeshElement.hxx"
19 #include "SMDS_MeshNode.hxx"
20 #include "SMDS_MeshFacesIterator.hxx"
21 #include "SMDS_MeshEdgesIterator.hxx"
22 #include "SMDS_MeshNodesIterator.hxx"
23 #include "SMDS_MeshVolumesIterator.hxx"
24
25 #define MED_NBR_GEOMETRIE_MAILLE 15
26 #define MED_NBR_TYPE 5
27
28
29 class SMESH_Mesh_i;
30
31 class SMESH_MEDMesh_i:
32   public POA_SALOME_MED::MESH,
33   public PortableServer::RefCountServantBase
34 {
35 public :
36
37 private :
38
39 protected:
40   // C++ object containing values
41   ::SMESH_Mesh_i*       _mesh_i;
42   Handle (SMESHDS_Mesh) _meshDS;
43   
44   string                _meshId;
45   bool                  _compte;
46   bool                  _creeFamily;
47   int                   _indexElts; 
48   int                   _indexEnts; 
49   int                   _famIdent;
50
51   map <SALOME_MED::medGeometryElement,int> _mapIndToSeqElts;
52   Engines::long_array_var _seq_elemId[MED_NBR_GEOMETRIE_MAILLE];
53
54   map <SALOME_MED::medEntityMesh,int> _mapNbTypes;
55   map <SALOME_MED::medEntityMesh,int> _mapIndToVectTypes;
56   vector<SALOME_MED::medGeometryElement> _TypesId[MED_NBR_GEOMETRIE_MAILLE];
57
58   vector<SALOME_MED::FAMILY_ptr>   _families;
59 public:
60
61   // Constructors and associated internal methods
62   SMESH_MEDMesh_i();
63   SMESH_MEDMesh_i(SMESH_Mesh_i* m);
64   ~SMESH_MEDMesh_i();
65
66   // IDL Methods 
67   char *        getName()               throw (SALOME::SALOME_Exception);
68   CORBA::Long   getSpaceDimension()     throw (SALOME::SALOME_Exception);
69   CORBA::Long   getMeshDimension()      throw (SALOME::SALOME_Exception);
70
71   char *                  getCoordinateSystem() 
72     throw (SALOME::SALOME_Exception);
73   Engines::double_array* getCoordinates(SALOME_MED::medModeSwitch typeSwitch)
74     throw (SALOME::SALOME_Exception);
75   Engines::string_array* getCoordinatesNames() 
76     throw (SALOME::SALOME_Exception);
77   Engines::string_array* getCoordinatesUnits()
78     throw (SALOME::SALOME_Exception); 
79   CORBA::Long            getNumberOfNodes() 
80     throw (SALOME::SALOME_Exception);
81
82   CORBA::Long            getNumberOfTypes       (SALOME_MED::medEntityMesh entity) 
83     throw   (SALOME::SALOME_Exception);
84   SALOME_MED::medGeometryElement_array* getTypes(SALOME_MED::medEntityMesh entity)
85     throw   (SALOME::SALOME_Exception);
86
87   CORBA::Long      getNumberOfElements (SALOME_MED::medEntityMesh entity,
88                                         SALOME_MED::medGeometryElement geomElement) 
89     throw (SALOME::SALOME_Exception);
90   Engines::long_array*   getConnectivity     (SALOME_MED::medModeSwitch typeSwitch, 
91                                               SALOME_MED::medConnectivity mode, 
92                                               SALOME_MED::medEntityMesh entity, 
93                                               SALOME_MED::medGeometryElement geomElement)
94     throw (SALOME::SALOME_Exception);
95   Engines::long_array*   getConnectivityIndex(SALOME_MED::medConnectivity mode, 
96                                               SALOME_MED::medEntityMesh entity) 
97     throw (SALOME::SALOME_Exception);
98
99   CORBA::Long getElementNumber(SALOME_MED::medConnectivity mode, 
100                                SALOME_MED::medEntityMesh entity, 
101                                SALOME_MED::medGeometryElement type, 
102                                const Engines::long_array & connectivity)
103     throw (SALOME::SALOME_Exception);
104
105   Engines::long_array*   getReverseConnectivity(SALOME_MED::medConnectivity mode)
106
107     throw  (SALOME::SALOME_Exception);
108   Engines::long_array*   getReverseConnectivityIndex(SALOME_MED::medConnectivity mode)
109     throw        (SALOME::SALOME_Exception);
110
111   // Family and Group
112   CORBA::Long        getNumberOfFamilies (SALOME_MED::medEntityMesh entity)
113     throw (SALOME::SALOME_Exception);
114   CORBA::Long        getNumberOfGroups   (SALOME_MED::medEntityMesh entity) 
115     throw (SALOME::SALOME_Exception);
116   SALOME_MED::Family_array* getFamilies  (SALOME_MED::medEntityMesh entity) 
117     throw (SALOME::SALOME_Exception);
118   SALOME_MED::FAMILY_ptr    getFamily    (SALOME_MED::medEntityMesh entity,
119                                           CORBA::Long i) 
120     throw (SALOME::SALOME_Exception);
121   SALOME_MED::Group_array*  getGroups    (SALOME_MED::medEntityMesh entity) 
122     throw (SALOME::SALOME_Exception);
123   SALOME_MED::GROUP_ptr     getGroup     (SALOME_MED::medEntityMesh entity, 
124                                           CORBA::Long i) 
125     throw (SALOME::SALOME_Exception);
126   // 
127   SALOME_MED::FIELD_ptr getVolume        (SALOME_MED::SUPPORT_ptr mySupport)
128     throw (SALOME::SALOME_Exception);
129   SALOME_MED::FIELD_ptr getArea          (SALOME_MED::SUPPORT_ptr mySupport)          
130     throw (SALOME::SALOME_Exception);
131   SALOME_MED::FIELD_ptr getLength        (SALOME_MED::SUPPORT_ptr mySupport)        
132     throw (SALOME::SALOME_Exception);
133   SALOME_MED::FIELD_ptr getNormal        (SALOME_MED::SUPPORT_ptr mySupport)        
134     throw (SALOME::SALOME_Exception);
135   SALOME_MED::FIELD_ptr getBarycenter    (SALOME_MED::SUPPORT_ptr mySupport)    
136     throw (SALOME::SALOME_Exception);
137   SALOME_MED::FIELD_ptr getNeighbourhood (SALOME_MED::SUPPORT_ptr mySupport) 
138     throw (SALOME::SALOME_Exception);
139
140
141   // Others
142   void        addInStudy (SALOMEDS::Study_ptr myStudy, 
143                           SALOME_MED::MESH_ptr myIor) 
144     throw (SALOME::SALOME_Exception);
145   CORBA::Long addDriver  (SALOME_MED::medDriverTypes driverType, 
146                           const char* fileName, const char* meshName)
147     throw (SALOME::SALOME_Exception);
148   void        rmDriver   (CORBA::Long i)        
149     throw (SALOME::SALOME_Exception);
150   void        read       (CORBA::Long i)
151     throw (SALOME::SALOME_Exception);
152   void        write      (CORBA::Long i, const char* driverMeshName)
153     throw (SALOME::SALOME_Exception);
154
155   //                                    Cuisine interne
156   CORBA::Long getCorbaIndex() throw (SALOME::SALOME_Exception);
157
158   //
159   void          calculeNbElts()   throw (SALOME::SALOME_Exception);
160   void          createFamilies()  throw (SALOME::SALOME_Exception);
161 };
162
163 #endif /* _MED_MESH_I_HXX_ */