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
22 #ifndef MED_V2_2_Wrapper_HeaderFile
23 #define MED_V2_2_Wrapper_HeaderFile
26 #if defined MEDWRAPPER_V2_2_EXPORTS || defined MEDWrapper_V2_2_EXPORTS
28 #define MED_V22_WRAPPER_EXPORT __declspec( dllexport )
30 #define MED_V22_WRAPPER_EXPORT
34 #define MED_V22_WRAPPER_EXPORT __declspec( dllimport )
36 #define MED_V22_WRAPPER_EXPORT
40 #define MED_V22_WRAPPER_EXPORT
43 #include "MED_Structures.hxx"
44 #include "MED_TWrapper.hxx"
49 TInt MED_V22_WRAPPER_EXPORT
50 GetDESCLength<eV2_2>();
53 TInt MED_V22_WRAPPER_EXPORT
54 GetIDENTLength<eV2_2>();
57 TInt MED_V22_WRAPPER_EXPORT
58 GetNOMLength<eV2_2>();
61 TInt MED_V22_WRAPPER_EXPORT
62 GetLNOMLength<eV2_2>();
65 TInt MED_V22_WRAPPER_EXPORT
66 GetPNOMLength<eV2_2>();
69 void MED_V22_WRAPPER_EXPORT
70 GetVersionRelease<eV2_2>(TInt& majeur, TInt& mineur, TInt& release);
73 TInt MED_V22_WRAPPER_EXPORT
74 GetNbConn<eV2_2>(EGeometrieElement typmai,
75 EEntiteMaillage typent,
80 //----------------------------------------------------------------------------
82 typedef boost::shared_ptr<TFile> PFile;
84 typedef enum {eLECTURE, eLECTURE_ECRITURE, eLECTURE_AJOUT, eCREATION} EModeAcces;
86 //----------------------------------------------------------------------------
87 class MED_V22_WRAPPER_EXPORT TVWrapper: public MED::TTWrapper<eV2_2>
90 TVWrapper(const TVWrapper&);
91 TVWrapper& operator=(const TVWrapper&);
94 TVWrapper(const std::string& theFileName, TInt theMinor=-1);
96 //----------------------------------------------------------------------------
99 GetNbMeshes(TErr* theErr = NULL);
103 GetMeshInfo(TInt theMeshId, MED::TMeshInfo&,
104 TErr* theErr = NULL);
108 SetMeshInfo(const MED::TMeshInfo& theInfo,
109 TErr* theErr = NULL);
111 void SetMeshInfo(const MED::TMeshInfo& theInfo,
113 TErr* theErr = NULL);
116 //----------------------------------------------------------------------------
119 GetNbFamilies(const MED::TMeshInfo& theMeshInfo,
120 TErr* theErr = NULL);
124 GetNbFamAttr(TInt theFamId,
125 const MED::TMeshInfo& theInfo,
126 TErr* theErr = NULL);
130 GetNbFamGroup(TInt theFamId,
131 const MED::TMeshInfo& theInfo,
132 TErr* theErr = NULL);
136 GetFamilyInfo(TInt theFamId,
137 MED::TFamilyInfo& theInfo,
138 TErr* theErr = NULL);
142 SetFamilyInfo(const MED::TFamilyInfo& theInfo,
143 TErr* theErr = NULL);
146 SetFamilyInfo(const MED::TFamilyInfo& theInfo,
148 TErr* theErr = NULL);
151 //----------------------------------------------------------------------------
154 GetNames(TElemInfo& theInfo,
156 EEntiteMaillage theEntity,
157 EGeometrieElement theGeom,
158 TErr* theErr = NULL);
162 GetNumeration(TElemInfo& theInfo,
164 EEntiteMaillage theEntity,
165 EGeometrieElement theGeom,
166 TErr* theErr = NULL);
170 GetFamilies(TElemInfo& theInfo,
172 EEntiteMaillage theEntity,
173 EGeometrieElement theGeom,
174 TErr* theErr = NULL);
178 SetNames(const TElemInfo& theInfo,
179 EEntiteMaillage theEntity,
180 EGeometrieElement theGeom,
181 TErr* theErr = NULL);
184 SetNames(const TElemInfo& theInfo,
186 EEntiteMaillage theEntity,
187 EGeometrieElement theGeom,
188 TErr* theErr = NULL);
192 SetNumeration(const TElemInfo& theInfo,
193 EEntiteMaillage theEntity,
194 EGeometrieElement theGeom,
195 TErr* theErr = NULL);
197 SetNumeration(const TElemInfo& theInfo,
199 EEntiteMaillage theEntity,
200 EGeometrieElement theGeom,
201 TErr* theErr = NULL);
205 SetFamilies(const TElemInfo& theInfo,
206 EEntiteMaillage theEntity,
207 EGeometrieElement theGeom,
208 TErr* theErr = NULL);
210 SetFamilies(const TElemInfo& theInfo,
212 EEntiteMaillage theEntity,
213 EGeometrieElement theGeom,
214 TErr* theErr = NULL);
216 //----------------------------------------------------------------------------
219 GetNbNodes(const MED::TMeshInfo& theMeshInfo,
222 return GetNbNodes(theMeshInfo,eCOOR,theErr);
226 GetNbNodes(const MED::TMeshInfo& theMeshInfo,
228 TErr* theErr = NULL);
232 GetNodeInfo(MED::TNodeInfo& theInfo,
233 TErr* theErr = NULL);
237 SetNodeInfo(const MED::TNodeInfo& theInfo,
238 TErr* theErr = NULL);
241 SetNodeInfo(const MED::TNodeInfo& theInfo,
243 TErr* theErr = NULL);
245 //----------------------------------------------------------------------------
248 GetPolygoneInfo(TPolygoneInfo& theInfo,
249 TErr* theErr = NULL);
253 SetPolygoneInfo(const TPolygoneInfo& theInfo,
254 TErr* theErr = NULL);
257 SetPolygoneInfo(const MED::TPolygoneInfo& theInfo,
259 TErr* theErr = NULL);
263 GetNbPolygones(const TMeshInfo& theMeshInfo,
264 EEntiteMaillage theEntity,
265 EGeometrieElement theGeom,
266 EConnectivite theConnMode = eNOD,
267 TErr* theErr = NULL);
271 GetPolygoneConnSize(const TMeshInfo& theMeshInfo,
272 EEntiteMaillage theEntity,
273 EGeometrieElement theGeom,
274 EConnectivite theConnMode = eNOD,
275 TErr* theErr = NULL);
277 //----------------------------------------------------------------------------
280 GetPolyedreInfo(TPolyedreInfo& theInfo,
281 TErr* theErr = NULL);
285 SetPolyedreInfo(const TPolyedreInfo& theInfo,
286 TErr* theErr = NULL);
289 SetPolyedreInfo(const MED::TPolyedreInfo& theInfo,
291 TErr* theErr = NULL);
295 GetNbPolyedres(const TMeshInfo& theMeshInfo,
299 TErr* theErr = NULL);
303 GetPolyedreConnSize(const TMeshInfo& theMeshInfo,
306 EConnectivite theConnMode = eNOD,
307 TErr* theErr = NULL);
309 //----------------------------------------------------------------------------
312 GetEntityInfo(const MED::TMeshInfo& theMeshInfo,
313 EConnectivite theConnMode = eNOD,
314 TErr* theErr = NULL);
318 GetNbCells(const MED::TMeshInfo& theMeshInfo,
321 EConnectivite theConnMode = eNOD,
322 TErr* theErr = NULL);
326 GetCellInfo(MED::TCellInfo& theInfo,
327 TErr* theErr = NULL);
331 SetCellInfo(const MED::TCellInfo& theInfo,
332 TErr* theErr = NULL);
335 SetCellInfo(const MED::TCellInfo& theInfo,
337 TErr* theErr = NULL);
339 //----------------------------------------------------------------------------
340 //! Read geom type of MED_BALL structural element
341 EGeometrieElement GetBallGeom(const TMeshInfo& theMeshInfo);
343 //! Read number of balls in the Mesh
344 virtual TInt GetNbBalls(const TMeshInfo& theMeshInfo);
346 //! Read a MEDWrapped representation of MED_BALL from the MED file
347 virtual void GetBallInfo(TBallInfo& theInfo, TErr* theErr = NULL);
349 //! Write a MEDWrapped representation of MED_BALL to the MED file
350 virtual void SetBallInfo(const TBallInfo& theInfo, TErr* theErr);
352 //! Write a MEDWrapped representation of MED_BALL to the MED file
353 void SetBallInfo(const TBallInfo& theInfo, EModeAcces theMode, TErr* theErr);
355 //----------------------------------------------------------------------------
358 GetNbFields(TErr* theErr = NULL);
362 GetNbComp(TInt theFieldId,
363 TErr* theErr = NULL);
367 GetFieldInfo(TInt theFieldId,
368 MED::TFieldInfo& theInfo,
369 TErr* theErr = NULL);
373 SetFieldInfo(const MED::TFieldInfo& theInfo,
374 TErr* theErr = NULL);
377 SetFieldInfo(const MED::TFieldInfo& theInfo,
379 TErr* theErr = NULL);
381 //----------------------------------------------------------------------------
384 GetNbGauss(TErr* theErr = NULL);
388 GetGaussPreInfo(TInt theId,
389 TErr* theErr = NULL);
393 GetGaussInfo(TInt theId,
395 TErr* theErr = NULL);
397 //----------------------------------------------------------------------------
400 GetNbProfiles(TErr* theErr = NULL);
404 GetProfilePreInfo(TInt theId,
405 TErr* theErr = NULL);
409 GetProfileInfo(TInt theId,
410 TProfileInfo& theInfo,
411 TErr* theErr = NULL);
415 SetProfileInfo(const TProfileInfo& theInfo,
416 TErr* theErr = NULL);
419 SetProfileInfo(const TProfileInfo& theInfo,
421 TErr* theErr = NULL);
423 //----------------------------------------------------------------------------
426 GetNbTimeStamps(const MED::TFieldInfo& theInfo,
427 const MED::TEntityInfo& theEntityInfo,
428 EEntiteMaillage& theEntity,
429 TGeom2Size& theGeom2Size,
430 TErr* theErr = NULL);
434 GetTimeStampInfo(TInt theTimeStampId,
435 MED::TTimeStampInfo& theInfo,
436 TErr* theErr = NULL);
440 GetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
441 const TMKey2Profile& theMKey2Profile,
442 const TKey2Gauss& theKey2Gauss,
443 TErr* theErr = NULL);
447 SetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
448 TErr* theErr = NULL);
451 SetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
453 TErr* theErr = NULL);
456 //----------------------------------------------------------------------------
459 GetGrilleInfo(TGrilleInfo& theGrilleInfo,
460 TErr* theErr = NULL);
464 SetGrilleInfo(const MED::TGrilleInfo& theGrilleInfo,
465 TErr* theErr = NULL);
468 SetGrilleInfo(const MED::TGrilleInfo& theGrilleInfo,
470 TErr* theErr = NULL);
474 GetGrilleType(const MED::TMeshInfo& theMeshInfo,
476 TErr* theErr = NULL);
479 GetGrilleStruct(const MED::TMeshInfo& theMeshInfo,
480 TIntVector& theStruct,
481 TErr* theErr = NULL);