1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 //=============================================================================
23 // File : MEDMEM_Mesh_i.hxx
26 // $Header: /export/home/PAL/MED_SRC/src/MEDMEM_I/MEDMEM_Mesh_i.hxx
27 //=============================================================================
29 #ifndef _MED_MESH_I_HXX_
30 #define _MED_MESH_I_HXX_
32 #include <MEDMEM_I.hxx>
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)
46 class MEDMEM_I_EXPORT MESH_i: virtual public POA_SALOME_MED::MESH,
47 virtual public SALOMEMultiComm,
48 virtual public SALOME::GenericObj_i
51 static std::map < int,::MEDMEM::MESH *> meshMap;
58 // C++ object containing values
59 ::MEDMEM::MESH * const _mesh;
60 const int _corbaIndex;
66 // Constructors and associated internal methods
68 MESH_i(::MEDMEM::MESH * const m);
73 char * getName() throw (SALOME::SALOME_Exception);
75 CORBA::Long getSpaceDimension() throw (SALOME::SALOME_Exception);
77 CORBA::Long getMeshDimension() throw (SALOME::SALOME_Exception);
79 CORBA::Boolean getIsAGrid() throw (SALOME::SALOME_Exception);
81 CORBA::Boolean existConnectivity
82 ( SALOME_MED::medConnectivity connectivityType,
83 SALOME_MED::medEntityMesh entity)
84 throw (SALOME::SALOME_Exception);
86 char * getCoordinatesSystem()
87 throw (SALOME::SALOME_Exception);
89 SALOME_MED::double_array* getCoordinates(SALOME_MED::medModeSwitch typeSwitch)
90 throw (SALOME::SALOME_Exception);
92 SALOME::SenderDouble_ptr getSenderForCoordinates(SALOME_MED::medModeSwitch typeSwitch)
93 throw (SALOME::SALOME_Exception);
95 CORBA::Double getCoordinate(CORBA::Long Number, CORBA::Long Axis)
96 throw (SALOME::SALOME_Exception);
98 SALOME_MED::string_array* getCoordinatesNames()
99 throw (SALOME::SALOME_Exception);
101 SALOME_MED::string_array* getCoordinatesUnits()
102 throw (SALOME::SALOME_Exception);
104 CORBA::Long getNumberOfNodes()
105 throw (SALOME::SALOME_Exception);
107 CORBA::Long getNumberOfTypes (SALOME_MED::medEntityMesh entity)
108 throw (SALOME::SALOME_Exception);
110 SALOME_MED::medGeometryElement_array* getTypes(SALOME_MED::medEntityMesh entity)
111 throw (SALOME::SALOME_Exception);
113 SALOME_MED::medGeometryElement getElementType(SALOME_MED::medEntityMesh entity,
115 throw (SALOME::SALOME_Exception);
118 CORBA::Long getNumberOfElements (SALOME_MED::medEntityMesh entity,
119 SALOME_MED::medGeometryElement geomElement)
120 throw (SALOME::SALOME_Exception);
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);
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);
134 SALOME_MED::long_array* getConnectivityIndex(SALOME_MED::medConnectivity mode,
135 SALOME_MED::medEntityMesh entity)
136 throw (SALOME::SALOME_Exception);
138 SALOME_MED::long_array* getGlobalNumberingIndex(SALOME_MED::medEntityMesh entity)
139 throw (SALOME::SALOME_Exception);
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);
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);
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);
161 SALOME_MED::long_array* getReverseConnectivity(SALOME_MED::medConnectivity mode)
162 throw (SALOME::SALOME_Exception);
164 SALOME_MED::long_array* getReverseConnectivityIndex(SALOME_MED::medConnectivity mode)
165 throw (SALOME::SALOME_Exception);
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,
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,
181 throw (SALOME::SALOME_Exception);
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);
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);
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);
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);
235 #endif /* _MED_MESH_I_HXX_ */