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
22 #ifndef MED_TWrapper_HeaderFile
23 #define MED_TWrapper_HeaderFile
25 #include "MED_TStructures.hxx"
26 #include "MED_Wrapper.hxx"
31 template<EVersion eVersion>
32 class TTWrapper: public TWrapper
35 //----------------------------------------------------------------------------
36 //! Gets version of the MED library used for the MED file
44 //----------------------------------------------------------------------------
47 CrMeshInfo(TInt theDim = 0, TInt theSpaceDim = 0,
48 const std::string& theValue = "",
49 EMaillage theType = eNON_STRUCTURE,
50 const std::string& theDesc = "")
52 return PMeshInfo(new TTMeshInfo<eVersion>
62 CrMeshInfo(const PMeshInfo& theInfo)
64 return PMeshInfo(new TTMeshInfo<eVersion>(theInfo));
68 //----------------------------------------------------------------------------
71 CrFamilyInfo(const PMeshInfo& theMeshInfo,
75 const std::string& theValue = "")
77 return PFamilyInfo(new TTFamilyInfo<eVersion>
87 CrFamilyInfo(const PMeshInfo& theMeshInfo,
88 const std::string& theValue,
90 const MED::TStringSet& theGroupNames,
91 const MED::TStringVector& theAttrDescs = MED::TStringVector(),
92 const MED::TIntVector& theAttrIds = MED::TIntVector(),
93 const MED::TIntVector& theAttrVals = MED::TIntVector())
95 return PFamilyInfo(new TTFamilyInfo<eVersion>
107 CrFamilyInfo(const PMeshInfo& theMeshInfo,
108 const PFamilyInfo& theInfo)
110 return PFamilyInfo(new TTFamilyInfo<eVersion>
115 //----------------------------------------------------------------------------
118 CrElemInfo(const PMeshInfo& theMeshInfo,
120 EBooleen theIsElemNum = eVRAI,
121 EBooleen theIsElemNames = eVRAI)
123 return PElemInfo(new TTElemInfo<eVersion>
132 CrElemInfo(const PMeshInfo& theMeshInfo,
134 const TIntVector& theFamNum,
135 const TIntVector& aElemNum,
136 const TStringVector& aElemNames)
138 return PElemInfo(new TTElemInfo<eVersion>
146 //----------------------------------------------------------------------------
149 CrNodeInfo(const PMeshInfo& theMeshInfo,
151 EModeSwitch theMode = eFULL_INTERLACE,
152 ERepere theSystem = eCART,
153 EBooleen theIsElemNum = eVRAI,
154 EBooleen theIsElemNames = eVRAI)
156 return PNodeInfo(new TTNodeInfo<eVersion>
167 CrNodeInfo(const PMeshInfo& theMeshInfo,
168 const TFloatVector& theNodeCoords,
169 EModeSwitch theMode = eFULL_INTERLACE,
170 ERepere theSystem = eCART,
171 const TStringVector& theCoordNames = TStringVector(),
172 const TStringVector& theCoordUnits = TStringVector(),
173 const TIntVector& theFamilyNums = TIntVector(),
174 const TIntVector& theElemNums = TIntVector(),
175 const TStringVector& theElemNames = TStringVector())
177 return PNodeInfo(new TTNodeInfo<eVersion>
191 CrNodeInfo(const PMeshInfo& theMeshInfo,
192 const PNodeInfo& theInfo)
194 return PNodeInfo(new TTNodeInfo<eVersion>
199 //----------------------------------------------------------------------------
202 CrPolygoneInfo(const PMeshInfo& theMeshInfo,
203 EEntiteMaillage theEntity,
204 EGeometrieElement theGeom,
207 EConnectivite theConnMode = eNOD,
208 EBooleen theIsElemNum = eVRAI,
209 EBooleen theIsElemNames = eVRAI)
211 return PPolygoneInfo(new TTPolygoneInfo<eVersion>
224 CrPolygoneInfo(const PMeshInfo& theMeshInfo,
225 EEntiteMaillage theEntity,
226 EGeometrieElement theGeom,
227 const TIntVector& theIndexes,
228 const TIntVector& theConnectivities,
229 EConnectivite theConnMode = eNOD,
230 const TIntVector& theFamilyNums = TIntVector(),
231 const TIntVector& theElemNums = TIntVector(),
232 const TStringVector& theElemNames = TStringVector())
234 return PPolygoneInfo(new TTPolygoneInfo<eVersion>
248 CrPolygoneInfo(const PMeshInfo& theMeshInfo,
249 const PPolygoneInfo& theInfo)
251 return PPolygoneInfo(new TTPolygoneInfo<eVersion>
256 //----------------------------------------------------------------------------
259 CrPolyedreInfo(const PMeshInfo& theMeshInfo,
260 EEntiteMaillage theEntity,
261 EGeometrieElement theGeom,
265 EConnectivite theConnMode = eNOD,
266 EBooleen theIsElemNum = eVRAI,
267 EBooleen theIsElemNames = eVRAI)
269 return PPolyedreInfo(new TTPolyedreInfo<eVersion>
283 CrPolyedreInfo(const PMeshInfo& theMeshInfo,
284 EEntiteMaillage theEntity,
285 EGeometrieElement theGeom,
286 const TIntVector& theIndexes,
287 const TIntVector& theFaces,
288 const TIntVector& theConnectivities,
289 EConnectivite theConnMode = eNOD,
290 const TIntVector& theFamilyNums = TIntVector(),
291 const TIntVector& theElemNums = TIntVector(),
292 const TStringVector& theElemNames = TStringVector())
294 return PPolyedreInfo(new TTPolyedreInfo<eVersion>
309 CrPolyedreInfo(const PMeshInfo& theMeshInfo,
310 const PPolyedreInfo& theInfo)
312 return PPolyedreInfo(new TTPolyedreInfo<eVersion>
317 //----------------------------------------------------------------------------
320 CrCellInfo(const PMeshInfo& theMeshInfo,
321 EEntiteMaillage theEntity,
322 EGeometrieElement theGeom,
324 EConnectivite theConnMode = eNOD,
325 EBooleen theIsElemNum = eVRAI,
326 EBooleen theIsElemNames = eVRAI,
327 EModeSwitch theMode = eFULL_INTERLACE)
329 return PCellInfo(new TTCellInfo<eVersion>
342 CrCellInfo(const PMeshInfo& theMeshInfo,
343 EEntiteMaillage theEntity,
344 EGeometrieElement theGeom,
345 const TIntVector& theConnectivities,
346 EConnectivite theConnMode = eNOD,
347 const TIntVector& theFamilyNums = TIntVector(),
348 const TIntVector& theElemNums = TIntVector(),
349 const TStringVector& theElemNames = TStringVector(),
350 EModeSwitch theMode = eFULL_INTERLACE)
352 return PCellInfo(new TTCellInfo<eVersion>
366 CrCellInfo(const PMeshInfo& theMeshInfo,
367 const PCellInfo& theInfo)
369 return PCellInfo(new TTCellInfo<eVersion>
374 //----------------------------------------------------------------------------
375 //! Creates a MEDWrapper MED Balls representation
376 virtual PBallInfo CrBallInfo(const PMeshInfo& theMeshInfo,
378 EBooleen theIsElemNum = eVRAI)
380 return PBallInfo( new TTBallInfo<eVersion>( theMeshInfo, theNbBalls, theIsElemNum ));
383 //! Creates a MEDWrapper MED Balls representation
384 virtual PBallInfo CrBallInfo(const PMeshInfo& theMeshInfo,
385 const TIntVector& theNodes,
386 TFloatVector& theDiameters,
387 const TIntVector& theFamilyNums = TIntVector(),
388 const TIntVector& theElemNums = TIntVector())
390 return PBallInfo( new TTBallInfo<eVersion>( theMeshInfo, theNodes, theDiameters,
391 theFamilyNums, theElemNums));
394 //! A copy-constructor for the MEDWrapper MED Balls representation
395 virtual PBallInfo CrBallInfo(const PMeshInfo& theMeshInfo,
396 const PBallInfo& theInfo)
398 return PBallInfo( new TTBallInfo<eVersion>( theMeshInfo, theInfo ));
401 //----------------------------------------------------------------------------
404 CrFieldInfo(const PMeshInfo& theMeshInfo,
406 ETypeChamp theType = eFLOAT64,
407 const std::string& theValue = "",
408 EBooleen theIsLocal = eVRAI,
411 return PFieldInfo(new TTFieldInfo<eVersion>
422 CrFieldInfo(const PMeshInfo& theMeshInfo,
423 const PFieldInfo& theInfo)
425 return PFieldInfo(new TTFieldInfo<eVersion>
431 //----------------------------------------------------------------------------
434 CrTimeStampInfo(const PFieldInfo& theFieldInfo,
435 EEntiteMaillage theEntity,
436 const TGeom2Size& theGeom2Size,
437 const TGeom2NbGauss& theGeom2NbGauss = TGeom2NbGauss(),
441 const std::string& theUnitDt = "",
442 const TGeom2Gauss& theGeom2Gauss = TGeom2Gauss())
444 return PTimeStampInfo(new TTTimeStampInfo<eVersion>
458 CrTimeStampInfo(const PFieldInfo& theFieldInfo,
459 const PTimeStampInfo& theInfo)
461 return PTimeStampInfo(new TTTimeStampInfo<eVersion>
467 //----------------------------------------------------------------------------
470 CrGaussInfo(const TGaussInfo::TInfo& theInfo,
471 EModeSwitch theMode = eFULL_INTERLACE)
473 return PGaussInfo(new TTGaussInfo<eVersion>
479 //----------------------------------------------------------------------------
482 CrProfileInfo(const TProfileInfo::TInfo& theInfo,
483 EModeProfil theMode = eCOMPACT)
485 return PProfileInfo(new TTProfileInfo<eVersion>
491 //----------------------------------------------------------------------------
494 CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
495 ETypeChamp theTypeChamp,
496 const TGeom2Profile& theGeom2Profile = TGeom2Profile(),
497 EModeSwitch theMode = eFULL_INTERLACE)
499 if(theTypeChamp == eFLOAT64)
500 return PTimeStampValueBase(new TTTimeStampValue<eVersion, TFloatMeshValue>
505 return PTimeStampValueBase(new TTTimeStampValue<eVersion, TIntMeshValue>
514 CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
515 const PTimeStampValueBase& theInfo,
516 ETypeChamp theTypeChamp)
518 if(theTypeChamp == eFLOAT64)
519 return PTimeStampValueBase(new TTTimeStampValue<eVersion, TFloatMeshValue>
523 return PTimeStampValueBase(new TTTimeStampValue<eVersion, TIntMeshValue>
529 //----------------------------------------------------------------------------
532 CrGrilleInfo(const PMeshInfo& theMeshInfo,
533 const PGrilleInfo& theInfo)
535 return PGrilleInfo(new TTGrilleInfo<eVersion>
541 CrGrilleInfo(const PMeshInfo& theMeshInfo,
542 const EGrilleType& type)
544 return PGrilleInfo(new TTGrilleInfo<eVersion>
551 CrGrilleInfo(const PMeshInfo& theMeshInfo,
552 const EGrilleType& type,
555 return PGrilleInfo(new TTGrilleInfo<eVersion>
563 CrGrilleInfo(const PMeshInfo& theMeshInfo,
564 const EGrilleType& type,
565 const MED::TIntVector& nbNodeVec)
567 return PGrilleInfo(new TTGrilleInfo<eVersion>
572 //----------------------------------------------------------------------------