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
28 #ifndef MED_V2_2_Wrapper_HeaderFile
29 #define MED_V2_2_Wrapper_HeaderFile
32 #if defined MEDWRAPPER_V2_2_EXPORTS || defined MEDWrapper_V2_2_EXPORTS
34 #define MED_V22_WRAPPER_EXPORT __declspec( dllexport )
36 #define MED_V22_WRAPPER_EXPORT
40 #define MED_V22_WRAPPER_EXPORT __declspec( dllimport )
42 #define MED_V22_WRAPPER_EXPORT
46 #define MED_V22_WRAPPER_EXPORT
49 #include "MED_Structures.hxx"
50 #include "MED_TWrapper.hxx"
55 TInt MED_V22_WRAPPER_EXPORT
56 GetDESCLength<eV2_2>();
59 TInt MED_V22_WRAPPER_EXPORT
60 GetIDENTLength<eV2_2>();
63 TInt MED_V22_WRAPPER_EXPORT
64 GetNOMLength<eV2_2>();
67 TInt MED_V22_WRAPPER_EXPORT
68 GetLNOMLength<eV2_2>();
71 TInt MED_V22_WRAPPER_EXPORT
72 GetPNOMLength<eV2_2>();
75 void MED_V22_WRAPPER_EXPORT
76 GetVersionRelease<eV2_2>(TInt& majeur, TInt& mineur, TInt& release);
79 TInt MED_V22_WRAPPER_EXPORT
80 GetNbConn<eV2_2>(EGeometrieElement typmai,
81 EEntiteMaillage typent,
86 //----------------------------------------------------------------------------
88 typedef boost::shared_ptr<TFile> PFile;
90 typedef enum {eLECTURE, eLECTURE_ECRITURE, eLECTURE_AJOUT, eCREATION} EModeAcces;
92 //----------------------------------------------------------------------------
93 class MED_V22_WRAPPER_EXPORT TVWrapper: public MED::TTWrapper<eV2_2>
96 TVWrapper(const TVWrapper&);
97 TVWrapper& operator=(const TVWrapper&);
100 TVWrapper(const std::string& theFileName);
102 //----------------------------------------------------------------------------
105 GetNbMeshes(TErr* theErr = NULL);
109 GetMeshInfo(TInt theMeshId, MED::TMeshInfo&,
110 TErr* theErr = NULL);
114 SetMeshInfo(const MED::TMeshInfo& theInfo,
115 TErr* theErr = NULL);
117 void SetMeshInfo(const MED::TMeshInfo& theInfo,
119 TErr* theErr = NULL);
122 //----------------------------------------------------------------------------
125 GetNbFamilies(const MED::TMeshInfo& theMeshInfo,
126 TErr* theErr = NULL);
130 GetNbFamAttr(TInt theFamId,
131 const MED::TMeshInfo& theInfo,
132 TErr* theErr = NULL);
136 GetNbFamGroup(TInt theFamId,
137 const MED::TMeshInfo& theInfo,
138 TErr* theErr = NULL);
142 GetFamilyInfo(TInt theFamId,
143 MED::TFamilyInfo& theInfo,
144 TErr* theErr = NULL);
148 SetFamilyInfo(const MED::TFamilyInfo& theInfo,
149 TErr* theErr = NULL);
152 SetFamilyInfo(const MED::TFamilyInfo& theInfo,
154 TErr* theErr = NULL);
157 //----------------------------------------------------------------------------
160 GetNames(TElemInfo& theInfo,
162 EEntiteMaillage theEntity,
163 EGeometrieElement theGeom,
164 TErr* theErr = NULL);
168 GetNumeration(TElemInfo& theInfo,
170 EEntiteMaillage theEntity,
171 EGeometrieElement theGeom,
172 TErr* theErr = NULL);
176 GetFamilies(TElemInfo& theInfo,
178 EEntiteMaillage theEntity,
179 EGeometrieElement theGeom,
180 TErr* theErr = NULL);
184 SetNames(const TElemInfo& theInfo,
185 EEntiteMaillage theEntity,
186 EGeometrieElement theGeom,
187 TErr* theErr = NULL);
190 SetNames(const TElemInfo& theInfo,
192 EEntiteMaillage theEntity,
193 EGeometrieElement theGeom,
194 TErr* theErr = NULL);
198 SetNumeration(const TElemInfo& theInfo,
199 EEntiteMaillage theEntity,
200 EGeometrieElement theGeom,
201 TErr* theErr = NULL);
203 SetNumeration(const TElemInfo& theInfo,
205 EEntiteMaillage theEntity,
206 EGeometrieElement theGeom,
207 TErr* theErr = NULL);
211 SetFamilies(const TElemInfo& theInfo,
212 EEntiteMaillage theEntity,
213 EGeometrieElement theGeom,
214 TErr* theErr = NULL);
216 SetFamilies(const TElemInfo& theInfo,
218 EEntiteMaillage theEntity,
219 EGeometrieElement theGeom,
220 TErr* theErr = NULL);
222 //----------------------------------------------------------------------------
225 GetNbNodes(const MED::TMeshInfo& theMeshInfo,
228 return GetNbNodes(theMeshInfo,eCOOR,theErr);
232 GetNbNodes(const MED::TMeshInfo& theMeshInfo,
234 TErr* theErr = NULL);
238 GetNodeInfo(MED::TNodeInfo& theInfo,
239 TErr* theErr = NULL);
243 SetNodeInfo(const MED::TNodeInfo& theInfo,
244 TErr* theErr = NULL);
247 SetNodeInfo(const MED::TNodeInfo& theInfo,
249 TErr* theErr = NULL);
251 //----------------------------------------------------------------------------
254 GetPolygoneInfo(TPolygoneInfo& theInfo,
255 TErr* theErr = NULL);
259 SetPolygoneInfo(const TPolygoneInfo& theInfo,
260 TErr* theErr = NULL);
263 SetPolygoneInfo(const MED::TPolygoneInfo& theInfo,
265 TErr* theErr = NULL);
269 GetNbPolygones(const TMeshInfo& theMeshInfo,
270 EEntiteMaillage theEntity,
271 EGeometrieElement theGeom,
272 EConnectivite theConnMode = eNOD,
273 TErr* theErr = NULL);
277 GetPolygoneConnSize(const TMeshInfo& theMeshInfo,
278 EEntiteMaillage theEntity,
279 EGeometrieElement theGeom,
280 EConnectivite theConnMode = eNOD,
281 TErr* theErr = NULL);
283 //----------------------------------------------------------------------------
286 GetPolyedreInfo(TPolyedreInfo& theInfo,
287 TErr* theErr = NULL);
291 SetPolyedreInfo(const TPolyedreInfo& theInfo,
292 TErr* theErr = NULL);
295 SetPolyedreInfo(const MED::TPolyedreInfo& theInfo,
297 TErr* theErr = NULL);
301 GetNbPolyedres(const TMeshInfo& theMeshInfo,
305 TErr* theErr = NULL);
309 GetPolyedreConnSize(const TMeshInfo& theMeshInfo,
312 EConnectivite theConnMode = eNOD,
313 TErr* theErr = NULL);
315 //----------------------------------------------------------------------------
318 GetEntityInfo(const MED::TMeshInfo& theMeshInfo,
319 EConnectivite theConnMode = eNOD,
320 TErr* theErr = NULL);
324 GetNbCells(const MED::TMeshInfo& theMeshInfo,
327 EConnectivite theConnMode = eNOD,
328 TErr* theErr = NULL);
332 GetCellInfo(MED::TCellInfo& theInfo,
333 TErr* theErr = NULL);
337 SetCellInfo(const MED::TCellInfo& theInfo,
338 TErr* theErr = NULL);
341 SetCellInfo(const MED::TCellInfo& theInfo,
343 TErr* theErr = NULL);
345 //----------------------------------------------------------------------------
346 //! Read geom type of MED_BALL structural element
347 EGeometrieElement GetBallGeom(const TMeshInfo& theMeshInfo);
349 //! Read number of balls in the Mesh
350 virtual TInt GetNbBalls(const TMeshInfo& theMeshInfo);
352 //! Read a MEDWrapped representation of MED_BALL from the MED file
353 virtual void GetBallInfo(TBallInfo& theInfo, TErr* theErr = NULL);
355 //! Write a MEDWrapped representation of MED_BALL to the MED file
356 virtual void SetBallInfo(const TBallInfo& theInfo, TErr* theErr);
358 //! Write a MEDWrapped representation of MED_BALL to the MED file
359 void SetBallInfo(const TBallInfo& theInfo, EModeAcces theMode, TErr* theErr);
361 //----------------------------------------------------------------------------
364 GetNbFields(TErr* theErr = NULL);
368 GetNbComp(TInt theFieldId,
369 TErr* theErr = NULL);
373 GetFieldInfo(TInt theFieldId,
374 MED::TFieldInfo& theInfo,
375 TErr* theErr = NULL);
379 SetFieldInfo(const MED::TFieldInfo& theInfo,
380 TErr* theErr = NULL);
383 SetFieldInfo(const MED::TFieldInfo& theInfo,
385 TErr* theErr = NULL);
387 //----------------------------------------------------------------------------
390 GetNbGauss(TErr* theErr = NULL);
394 GetGaussPreInfo(TInt theId,
395 TErr* theErr = NULL);
399 GetGaussInfo(TInt theId,
401 TErr* theErr = NULL);
403 //----------------------------------------------------------------------------
406 GetNbProfiles(TErr* theErr = NULL);
410 GetProfilePreInfo(TInt theId,
411 TErr* theErr = NULL);
415 GetProfileInfo(TInt theId,
416 TProfileInfo& theInfo,
417 TErr* theErr = NULL);
421 SetProfileInfo(const TProfileInfo& theInfo,
422 TErr* theErr = NULL);
425 SetProfileInfo(const TProfileInfo& theInfo,
427 TErr* theErr = NULL);
429 //----------------------------------------------------------------------------
432 GetNbTimeStamps(const MED::TFieldInfo& theInfo,
433 const MED::TEntityInfo& theEntityInfo,
434 EEntiteMaillage& theEntity,
435 TGeom2Size& theGeom2Size,
436 TErr* theErr = NULL);
440 GetTimeStampInfo(TInt theTimeStampId,
441 MED::TTimeStampInfo& theInfo,
442 TErr* theErr = NULL);
446 GetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
447 const TMKey2Profile& theMKey2Profile,
448 const TKey2Gauss& theKey2Gauss,
449 TErr* theErr = NULL);
453 SetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
454 TErr* theErr = NULL);
457 SetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
459 TErr* theErr = NULL);
462 //----------------------------------------------------------------------------
465 GetGrilleInfo(TGrilleInfo& theGrilleInfo,
466 TErr* theErr = NULL);
470 SetGrilleInfo(const MED::TGrilleInfo& theGrilleInfo,
471 TErr* theErr = NULL);
474 SetGrilleInfo(const MED::TGrilleInfo& theGrilleInfo,
476 TErr* theErr = NULL);
480 GetGrilleType(const MED::TMeshInfo& theMeshInfo,
482 TErr* theErr = NULL);
485 GetGrilleStruct(const MED::TMeshInfo& theMeshInfo,
486 TIntVector& theStruct,
487 TErr* theErr = NULL);