Salome HOME
73370701a5fa8eac0e2e50644517992fceea84e5
[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         Engines::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         char *getName() throw(SALOME::SALOME_Exception);
79         CORBA::Long getSpaceDimension() throw(SALOME::SALOME_Exception);
80         CORBA::Long getMeshDimension() throw(SALOME::SALOME_Exception);
81
82         char *getCoordinateSystem() throw(SALOME::SALOME_Exception);
83         Engines::double_array * getCoordinates(SALOME_MED::medModeSwitch typeSwitch)
84                 throw(SALOME::SALOME_Exception);
85         Engines::string_array * getCoordinatesNames()
86                 throw(SALOME::SALOME_Exception);
87         Engines::string_array * getCoordinatesUnits()
88                 throw(SALOME::SALOME_Exception);
89         CORBA::Long getNumberOfNodes() throw(SALOME::SALOME_Exception);
90
91         CORBA::Long getNumberOfTypes(SALOME_MED::medEntityMesh entity)
92                 throw(SALOME::SALOME_Exception);
93         SALOME_MED::medGeometryElement_array *
94                 getTypes(SALOME_MED::medEntityMesh entity) throw(SALOME::
95                 SALOME_Exception);
96
97         CORBA::Long getNumberOfElements(SALOME_MED::medEntityMesh entity,
98                 SALOME_MED::medGeometryElement geomElement)
99                 throw(SALOME::SALOME_Exception);
100         Engines::long_array * getConnectivity(SALOME_MED::medModeSwitch typeSwitch,
101                 SALOME_MED::medConnectivity mode,
102                 SALOME_MED::medEntityMesh entity,
103                 SALOME_MED::medGeometryElement geomElement)
104                 throw(SALOME::SALOME_Exception);
105         Engines::long_array * getConnectivityIndex(SALOME_MED::medConnectivity mode,
106                 SALOME_MED::medEntityMesh entity) throw(SALOME::SALOME_Exception);
107
108         CORBA::Long getElementNumber(SALOME_MED::medConnectivity mode,
109                 SALOME_MED::medEntityMesh entity,
110                 SALOME_MED::medGeometryElement type,
111                 const Engines::long_array & connectivity)
112                 throw(SALOME::SALOME_Exception);
113
114         Engines::long_array *
115                 getReverseConnectivity(SALOME_MED::medConnectivity mode) throw(SALOME::
116                 SALOME_Exception);
117         Engines::long_array *
118                 getReverseConnectivityIndex(SALOME_MED::
119                 medConnectivity mode) throw(SALOME::SALOME_Exception);
120
121         // Family and Group
122         CORBA::Long getNumberOfFamilies(SALOME_MED::medEntityMesh entity)
123                 throw(SALOME::SALOME_Exception);
124         CORBA::Long getNumberOfGroups(SALOME_MED::medEntityMesh entity)
125                 throw(SALOME::SALOME_Exception);
126         SALOME_MED::Family_array * getFamilies(SALOME_MED::medEntityMesh entity)
127                 throw(SALOME::SALOME_Exception);
128         SALOME_MED::FAMILY_ptr getFamily(SALOME_MED::medEntityMesh entity,
129                 CORBA::Long i) throw(SALOME::SALOME_Exception);
130         SALOME_MED::Group_array * getGroups(SALOME_MED::medEntityMesh entity)
131                 throw(SALOME::SALOME_Exception);
132         SALOME_MED::GROUP_ptr getGroup(SALOME_MED::medEntityMesh entity,
133                 CORBA::Long i) throw(SALOME::SALOME_Exception);
134         // 
135         SALOME_MED::FIELD_ptr getVolume(SALOME_MED::SUPPORT_ptr mySupport)
136                 throw(SALOME::SALOME_Exception);
137         SALOME_MED::FIELD_ptr getArea(SALOME_MED::SUPPORT_ptr mySupport)
138                 throw(SALOME::SALOME_Exception);
139         SALOME_MED::FIELD_ptr getLength(SALOME_MED::SUPPORT_ptr mySupport)
140                 throw(SALOME::SALOME_Exception);
141         SALOME_MED::FIELD_ptr getNormal(SALOME_MED::SUPPORT_ptr mySupport)
142                 throw(SALOME::SALOME_Exception);
143         SALOME_MED::FIELD_ptr getBarycenter(SALOME_MED::SUPPORT_ptr mySupport)
144                 throw(SALOME::SALOME_Exception);
145         SALOME_MED::FIELD_ptr getNeighbourhood(SALOME_MED::SUPPORT_ptr mySupport)
146                 throw(SALOME::SALOME_Exception);
147
148         // Others
149         void addInStudy(SALOMEDS::Study_ptr myStudy,
150                 SALOME_MED::MESH_ptr myIor) throw(SALOME::SALOME_Exception);
151         CORBA::Long addDriver(SALOME_MED::medDriverTypes driverType,
152                 const char *fileName, const char *meshName)
153                 throw(SALOME::SALOME_Exception);
154         void rmDriver(CORBA::Long i) throw(SALOME::SALOME_Exception);
155         void read(CORBA::Long i) throw(SALOME::SALOME_Exception);
156         void write(CORBA::Long i, const char *driverMeshName)
157                 throw(SALOME::SALOME_Exception);
158
159         //                    Cuisine interne
160         CORBA::Long getCorbaIndex() throw(SALOME::SALOME_Exception);
161
162         //
163         void calculeNbElts() throw(SALOME::SALOME_Exception);
164         void createFamilies() throw(SALOME::SALOME_Exception);
165 };
166
167 #endif /* _MED_MESH_I_HXX_ */