1 // Copyright (C) 2007-2013 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
23 #ifndef MED_V2_2_Wrapper_HeaderFile
24 #define MED_V2_2_Wrapper_HeaderFile
27 #if defined MEDWRAPPER_V2_2_EXPORTS || defined MEDWrapper_V2_2_EXPORTS
29 #define MED_V22_WRAPPER_EXPORT __declspec( dllexport )
31 #define MED_V22_WRAPPER_EXPORT
35 #define MED_V22_WRAPPER_EXPORT __declspec( dllimport )
37 #define MED_V22_WRAPPER_EXPORT
41 #define MED_V22_WRAPPER_EXPORT
44 #include "MED_Structures.hxx"
45 #include "MED_TWrapper.hxx"
50 TInt MED_V22_WRAPPER_EXPORT
51 GetDESCLength<eV2_2>();
54 TInt MED_V22_WRAPPER_EXPORT
55 GetIDENTLength<eV2_2>();
58 TInt MED_V22_WRAPPER_EXPORT
59 GetNOMLength<eV2_2>();
62 TInt MED_V22_WRAPPER_EXPORT
63 GetLNOMLength<eV2_2>();
66 TInt MED_V22_WRAPPER_EXPORT
67 GetPNOMLength<eV2_2>();
70 void MED_V22_WRAPPER_EXPORT
71 GetVersionRelease<eV2_2>(TInt& majeur, TInt& mineur, TInt& release);
74 TInt MED_V22_WRAPPER_EXPORT
75 GetNbConn<eV2_2>(EGeometrieElement typmai,
76 EEntiteMaillage typent,
81 //----------------------------------------------------------------------------
83 typedef boost::shared_ptr<TFile> PFile;
85 typedef enum {eLECTURE, eLECTURE_ECRITURE, eLECTURE_AJOUT, eCREATION} EModeAcces;
87 //----------------------------------------------------------------------------
88 class MED_V22_WRAPPER_EXPORT TVWrapper: public MED::TTWrapper<eV2_2>
91 TVWrapper(const TVWrapper&);
92 TVWrapper& operator=(const TVWrapper&);
95 TVWrapper(const std::string& theFileName);
97 //----------------------------------------------------------------------------
100 GetNbMeshes(TErr* theErr = NULL);
104 GetMeshInfo(TInt theMeshId, MED::TMeshInfo&,
105 TErr* theErr = NULL);
109 SetMeshInfo(const MED::TMeshInfo& theInfo,
110 TErr* theErr = NULL);
112 void SetMeshInfo(const MED::TMeshInfo& theInfo,
114 TErr* theErr = NULL);
117 //----------------------------------------------------------------------------
120 GetNbFamilies(const MED::TMeshInfo& theMeshInfo,
121 TErr* theErr = NULL);
125 GetNbFamAttr(TInt theFamId,
126 const MED::TMeshInfo& theInfo,
127 TErr* theErr = NULL);
131 GetNbFamGroup(TInt theFamId,
132 const MED::TMeshInfo& theInfo,
133 TErr* theErr = NULL);
137 GetFamilyInfo(TInt theFamId,
138 MED::TFamilyInfo& theInfo,
139 TErr* theErr = NULL);
143 SetFamilyInfo(const MED::TFamilyInfo& theInfo,
144 TErr* theErr = NULL);
147 SetFamilyInfo(const MED::TFamilyInfo& theInfo,
149 TErr* theErr = NULL);
152 //----------------------------------------------------------------------------
155 GetNames(TElemInfo& theInfo,
157 EEntiteMaillage theEntity,
158 EGeometrieElement theGeom,
159 TErr* theErr = NULL);
163 GetNumeration(TElemInfo& theInfo,
165 EEntiteMaillage theEntity,
166 EGeometrieElement theGeom,
167 TErr* theErr = NULL);
171 GetFamilies(TElemInfo& theInfo,
173 EEntiteMaillage theEntity,
174 EGeometrieElement theGeom,
175 TErr* theErr = NULL);
179 SetNames(const TElemInfo& theInfo,
180 EEntiteMaillage theEntity,
181 EGeometrieElement theGeom,
182 TErr* theErr = NULL);
185 SetNames(const TElemInfo& theInfo,
187 EEntiteMaillage theEntity,
188 EGeometrieElement theGeom,
189 TErr* theErr = NULL);
193 SetNumeration(const TElemInfo& theInfo,
194 EEntiteMaillage theEntity,
195 EGeometrieElement theGeom,
196 TErr* theErr = NULL);
198 SetNumeration(const TElemInfo& theInfo,
200 EEntiteMaillage theEntity,
201 EGeometrieElement theGeom,
202 TErr* theErr = NULL);
206 SetFamilies(const TElemInfo& theInfo,
207 EEntiteMaillage theEntity,
208 EGeometrieElement theGeom,
209 TErr* theErr = NULL);
211 SetFamilies(const TElemInfo& theInfo,
213 EEntiteMaillage theEntity,
214 EGeometrieElement theGeom,
215 TErr* theErr = NULL);
217 //----------------------------------------------------------------------------
220 GetNbNodes(const MED::TMeshInfo& theMeshInfo,
223 return GetNbNodes(theMeshInfo,eCOOR,theErr);
227 GetNbNodes(const MED::TMeshInfo& theMeshInfo,
229 TErr* theErr = NULL);
233 GetNodeInfo(MED::TNodeInfo& theInfo,
234 TErr* theErr = NULL);
238 SetNodeInfo(const MED::TNodeInfo& theInfo,
239 TErr* theErr = NULL);
242 SetNodeInfo(const MED::TNodeInfo& theInfo,
244 TErr* theErr = NULL);
246 //----------------------------------------------------------------------------
249 GetPolygoneInfo(TPolygoneInfo& theInfo,
250 TErr* theErr = NULL);
254 SetPolygoneInfo(const TPolygoneInfo& theInfo,
255 TErr* theErr = NULL);
258 SetPolygoneInfo(const MED::TPolygoneInfo& theInfo,
260 TErr* theErr = NULL);
264 GetNbPolygones(const TMeshInfo& theMeshInfo,
265 EEntiteMaillage theEntity,
266 EGeometrieElement theGeom,
267 EConnectivite theConnMode = eNOD,
268 TErr* theErr = NULL);
272 GetPolygoneConnSize(const TMeshInfo& theMeshInfo,
273 EEntiteMaillage theEntity,
274 EGeometrieElement theGeom,
275 EConnectivite theConnMode = eNOD,
276 TErr* theErr = NULL);
278 //----------------------------------------------------------------------------
281 GetPolyedreInfo(TPolyedreInfo& theInfo,
282 TErr* theErr = NULL);
286 SetPolyedreInfo(const TPolyedreInfo& theInfo,
287 TErr* theErr = NULL);
290 SetPolyedreInfo(const MED::TPolyedreInfo& theInfo,
292 TErr* theErr = NULL);
296 GetNbPolyedres(const TMeshInfo& theMeshInfo,
300 TErr* theErr = NULL);
304 GetPolyedreConnSize(const TMeshInfo& theMeshInfo,
307 EConnectivite theConnMode = eNOD,
308 TErr* theErr = NULL);
310 //----------------------------------------------------------------------------
313 GetEntityInfo(const MED::TMeshInfo& theMeshInfo,
314 EConnectivite theConnMode = eNOD,
315 TErr* theErr = NULL);
319 GetNbCells(const MED::TMeshInfo& theMeshInfo,
322 EConnectivite theConnMode = eNOD,
323 TErr* theErr = NULL);
327 GetCellInfo(MED::TCellInfo& theInfo,
328 TErr* theErr = NULL);
332 SetCellInfo(const MED::TCellInfo& theInfo,
333 TErr* theErr = NULL);
336 SetCellInfo(const MED::TCellInfo& theInfo,
338 TErr* theErr = NULL);
340 //----------------------------------------------------------------------------
341 //! Read geom type of MED_BALL structural element
342 EGeometrieElement GetBallGeom(const TMeshInfo& theMeshInfo);
344 //! Read number of balls in the Mesh
345 virtual TInt GetNbBalls(const TMeshInfo& theMeshInfo);
347 //! Read a MEDWrapped representation of MED_BALL from the MED file
348 virtual void GetBallInfo(TBallInfo& theInfo, TErr* theErr = NULL);
350 //! Write a MEDWrapped representation of MED_BALL to the MED file
351 virtual void SetBallInfo(const TBallInfo& theInfo, TErr* theErr);
353 //! Write a MEDWrapped representation of MED_BALL to the MED file
354 void SetBallInfo(const TBallInfo& theInfo, EModeAcces theMode, TErr* theErr);
356 //----------------------------------------------------------------------------
359 GetNbFields(TErr* theErr = NULL);
363 GetNbComp(TInt theFieldId,
364 TErr* theErr = NULL);
368 GetFieldInfo(TInt theFieldId,
369 MED::TFieldInfo& theInfo,
370 TErr* theErr = NULL);
374 SetFieldInfo(const MED::TFieldInfo& theInfo,
375 TErr* theErr = NULL);
378 SetFieldInfo(const MED::TFieldInfo& theInfo,
380 TErr* theErr = NULL);
382 //----------------------------------------------------------------------------
385 GetNbGauss(TErr* theErr = NULL);
389 GetGaussPreInfo(TInt theId,
390 TErr* theErr = NULL);
394 GetGaussInfo(TInt theId,
396 TErr* theErr = NULL);
398 //----------------------------------------------------------------------------
401 GetNbProfiles(TErr* theErr = NULL);
405 GetProfilePreInfo(TInt theId,
406 TErr* theErr = NULL);
410 GetProfileInfo(TInt theId,
411 TProfileInfo& theInfo,
412 TErr* theErr = NULL);
416 SetProfileInfo(const TProfileInfo& theInfo,
417 TErr* theErr = NULL);
420 SetProfileInfo(const TProfileInfo& theInfo,
422 TErr* theErr = NULL);
424 //----------------------------------------------------------------------------
427 GetNbTimeStamps(const MED::TFieldInfo& theInfo,
428 const MED::TEntityInfo& theEntityInfo,
429 EEntiteMaillage& theEntity,
430 TGeom2Size& theGeom2Size,
431 TErr* theErr = NULL);
435 GetTimeStampInfo(TInt theTimeStampId,
436 MED::TTimeStampInfo& theInfo,
437 TErr* theErr = NULL);
441 GetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
442 const TMKey2Profile& theMKey2Profile,
443 const TKey2Gauss& theKey2Gauss,
444 TErr* theErr = NULL);
448 SetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
449 TErr* theErr = NULL);
452 SetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
454 TErr* theErr = NULL);
457 //----------------------------------------------------------------------------
460 GetGrilleInfo(TGrilleInfo& theGrilleInfo,
461 TErr* theErr = NULL);
465 SetGrilleInfo(const MED::TGrilleInfo& theGrilleInfo,
466 TErr* theErr = NULL);
469 SetGrilleInfo(const MED::TGrilleInfo& theGrilleInfo,
471 TErr* theErr = NULL);
475 GetGrilleType(const MED::TMeshInfo& theMeshInfo,
477 TErr* theErr = NULL);
480 GetGrilleStruct(const MED::TMeshInfo& theMeshInfo,
481 TIntVector& theStruct,
482 TErr* theErr = NULL);