1 // Copyright (C) 2007-2016 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, or (at your option) any later version.
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
26 #include "MED_WrapperDef.hxx"
27 #include "MED_Structures.hxx"
28 #include "MED_TWrapper.hxx"
54 GetVersionRelease(TInt& majeur, TInt& mineur, TInt& release);
58 GetNbConn(EGeometrieElement typmai,
59 EEntiteMaillage typent,
64 //----------------------------------------------------------------------------
66 typedef boost::shared_ptr<TFile> PFile;
68 typedef enum {eLECTURE, eLECTURE_ECRITURE, eLECTURE_AJOUT, eCREATION} EModeAcces;
70 //----------------------------------------------------------------------------
71 class MEDWRAPPER_EXPORT TVWrapper: public MED::TTWrapper
74 TVWrapper(const TVWrapper&);
75 TVWrapper& operator=(const TVWrapper&);
78 TVWrapper(const std::string& theFileName);
80 //----------------------------------------------------------------------------
83 GetNbMeshes(TErr* theErr = NULL);
87 GetMeshInfo(TInt theMeshId, MED::TMeshInfo&,
92 SetMeshInfo(const MED::TMeshInfo& theInfo,
95 void SetMeshInfo(const MED::TMeshInfo& theInfo,
100 //----------------------------------------------------------------------------
103 GetNbFamilies(const MED::TMeshInfo& theMeshInfo,
104 TErr* theErr = NULL);
108 GetNbFamAttr(TInt theFamId,
109 const MED::TMeshInfo& theInfo,
110 TErr* theErr = NULL);
114 GetNbFamGroup(TInt theFamId,
115 const MED::TMeshInfo& theInfo,
116 TErr* theErr = NULL);
120 GetFamilyInfo(TInt theFamId,
121 MED::TFamilyInfo& theInfo,
122 TErr* theErr = NULL);
126 SetFamilyInfo(const MED::TFamilyInfo& theInfo,
127 TErr* theErr = NULL);
130 SetFamilyInfo(const MED::TFamilyInfo& theInfo,
132 TErr* theErr = NULL);
135 //----------------------------------------------------------------------------
138 GetNames(TElemInfo& theInfo,
140 EEntiteMaillage theEntity,
141 EGeometrieElement theGeom,
142 TErr* theErr = NULL);
146 GetNumeration(TElemInfo& theInfo,
148 EEntiteMaillage theEntity,
149 EGeometrieElement theGeom,
150 TErr* theErr = NULL);
154 GetFamilies(TElemInfo& theInfo,
156 EEntiteMaillage theEntity,
157 EGeometrieElement theGeom,
158 TErr* theErr = NULL);
162 SetNames(const TElemInfo& theInfo,
163 EEntiteMaillage theEntity,
164 EGeometrieElement theGeom,
165 TErr* theErr = NULL);
168 SetNames(const TElemInfo& theInfo,
170 EEntiteMaillage theEntity,
171 EGeometrieElement theGeom,
172 TErr* theErr = NULL);
176 SetNumeration(const TElemInfo& theInfo,
177 EEntiteMaillage theEntity,
178 EGeometrieElement theGeom,
179 TErr* theErr = NULL);
181 SetNumeration(const TElemInfo& theInfo,
183 EEntiteMaillage theEntity,
184 EGeometrieElement theGeom,
185 TErr* theErr = NULL);
189 SetFamilies(const TElemInfo& theInfo,
190 EEntiteMaillage theEntity,
191 EGeometrieElement theGeom,
192 TErr* theErr = NULL);
194 SetFamilies(const TElemInfo& theInfo,
196 EEntiteMaillage theEntity,
197 EGeometrieElement theGeom,
198 TErr* theErr = NULL);
200 //----------------------------------------------------------------------------
203 GetNbNodes(const MED::TMeshInfo& theMeshInfo,
206 return GetNbNodes(theMeshInfo,eCOOR,theErr);
210 GetNbNodes(const MED::TMeshInfo& theMeshInfo,
212 TErr* theErr = NULL);
216 GetNodeInfo(MED::TNodeInfo& theInfo,
217 TErr* theErr = NULL);
221 SetNodeInfo(const MED::TNodeInfo& theInfo,
222 TErr* theErr = NULL);
225 SetNodeInfo(const MED::TNodeInfo& theInfo,
227 TErr* theErr = NULL);
229 //----------------------------------------------------------------------------
232 GetPolygoneInfo(TPolygoneInfo& theInfo,
233 TErr* theErr = NULL);
237 SetPolygoneInfo(const TPolygoneInfo& theInfo,
238 TErr* theErr = NULL);
241 SetPolygoneInfo(const MED::TPolygoneInfo& theInfo,
243 TErr* theErr = NULL);
247 GetNbPolygones(const TMeshInfo& theMeshInfo,
248 EEntiteMaillage theEntity,
249 EGeometrieElement theGeom,
250 EConnectivite theConnMode = eNOD,
251 TErr* theErr = NULL);
255 GetPolygoneConnSize(const TMeshInfo& theMeshInfo,
256 EEntiteMaillage theEntity,
257 EGeometrieElement theGeom,
258 EConnectivite theConnMode = eNOD,
259 TErr* theErr = NULL);
261 //----------------------------------------------------------------------------
264 GetPolyedreInfo(TPolyedreInfo& theInfo,
265 TErr* theErr = NULL);
269 SetPolyedreInfo(const TPolyedreInfo& theInfo,
270 TErr* theErr = NULL);
273 SetPolyedreInfo(const MED::TPolyedreInfo& theInfo,
275 TErr* theErr = NULL);
279 GetNbPolyedres(const TMeshInfo& theMeshInfo,
283 TErr* theErr = NULL);
287 GetPolyedreConnSize(const TMeshInfo& theMeshInfo,
290 EConnectivite theConnMode = eNOD,
291 TErr* theErr = NULL);
293 //----------------------------------------------------------------------------
296 GetEntityInfo(const MED::TMeshInfo& theMeshInfo,
297 EConnectivite theConnMode = eNOD,
298 TErr* theErr = NULL);
302 GetNbCells(const MED::TMeshInfo& theMeshInfo,
305 EConnectivite theConnMode = eNOD,
306 TErr* theErr = NULL);
310 GetCellInfo(MED::TCellInfo& theInfo,
311 TErr* theErr = NULL);
315 SetCellInfo(const MED::TCellInfo& theInfo,
316 TErr* theErr = NULL);
319 SetCellInfo(const MED::TCellInfo& theInfo,
321 TErr* theErr = NULL);
323 //----------------------------------------------------------------------------
324 //! Read geom type of MED_BALL structural element
325 EGeometrieElement GetBallGeom(const TMeshInfo& theMeshInfo);
327 //! Read number of balls in the Mesh
328 virtual TInt GetNbBalls(const TMeshInfo& theMeshInfo);
330 //! Read a MEDWrapped representation of MED_BALL from the MED file
331 virtual void GetBallInfo(TBallInfo& theInfo, TErr* theErr = NULL);
333 //! Write a MEDWrapped representation of MED_BALL to the MED file
334 virtual void SetBallInfo(const TBallInfo& theInfo, TErr* theErr);
336 //! Write a MEDWrapped representation of MED_BALL to the MED file
337 void SetBallInfo(const TBallInfo& theInfo, EModeAcces theMode, TErr* theErr);
339 //----------------------------------------------------------------------------
342 GetNbFields(TErr* theErr = NULL);
346 GetNbComp(TInt theFieldId,
347 TErr* theErr = NULL);
351 GetFieldInfo(TInt theFieldId,
352 MED::TFieldInfo& theInfo,
353 TErr* theErr = NULL);
357 SetFieldInfo(const MED::TFieldInfo& theInfo,
358 TErr* theErr = NULL);
361 SetFieldInfo(const MED::TFieldInfo& theInfo,
363 TErr* theErr = NULL);
365 //----------------------------------------------------------------------------
368 GetNbGauss(TErr* theErr = NULL);
372 GetGaussPreInfo(TInt theId,
373 TErr* theErr = NULL);
377 GetGaussInfo(TInt theId,
379 TErr* theErr = NULL);
381 //----------------------------------------------------------------------------
384 GetNbProfiles(TErr* theErr = NULL);
388 GetProfilePreInfo(TInt theId,
389 TErr* theErr = NULL);
393 GetProfileInfo(TInt theId,
394 TProfileInfo& theInfo,
395 TErr* theErr = NULL);
399 SetProfileInfo(const TProfileInfo& theInfo,
400 TErr* theErr = NULL);
403 SetProfileInfo(const TProfileInfo& theInfo,
405 TErr* theErr = NULL);
407 //----------------------------------------------------------------------------
410 GetNbTimeStamps(const MED::TFieldInfo& theInfo,
411 const MED::TEntityInfo& theEntityInfo,
412 EEntiteMaillage& theEntity,
413 TGeom2Size& theGeom2Size,
414 TErr* theErr = NULL);
418 GetTimeStampInfo(TInt theTimeStampId,
419 MED::TTimeStampInfo& theInfo,
420 TErr* theErr = NULL);
424 GetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
425 const TMKey2Profile& theMKey2Profile,
426 const TKey2Gauss& theKey2Gauss,
427 TErr* theErr = NULL);
431 SetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
432 TErr* theErr = NULL);
435 SetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
437 TErr* theErr = NULL);
440 //----------------------------------------------------------------------------
443 GetGrilleInfo(TGrilleInfo& theGrilleInfo,
444 TErr* theErr = NULL);
448 SetGrilleInfo(const MED::TGrilleInfo& theGrilleInfo,
449 TErr* theErr = NULL);
452 SetGrilleInfo(const MED::TGrilleInfo& theGrilleInfo,
454 TErr* theErr = NULL);
458 GetGrilleType(const MED::TMeshInfo& theMeshInfo,
460 TErr* theErr = NULL);
463 GetGrilleStruct(const MED::TMeshInfo& theMeshInfo,
464 TIntVector& theStruct,
465 TErr* theErr = NULL);
473 #endif // MED_V2_2_Wrapper_HeaderFile