1 // Copyright (C) 2007-2022 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_Wrapper_HeaderFile
24 #define MED_Wrapper_HeaderFile
26 #include "MED_WrapperDef.hxx"
27 #include "MED_Structures.hxx"
28 #include "MED_Algorithm.hxx"
30 #include <boost/thread/mutex.hpp>
34 //----------------------------------------------------------------------------
36 typedef std::shared_ptr<TFileInternal> PFileInternal;
38 typedef enum {eLECTURE, eLECTURE_ECRITURE, eLECTURE_AJOUT, eCREATION} EModeAcces;
40 //----------------------------------------------------------------------------
41 //! Class that wraps the MED API
42 class MEDWRAPPER_EXPORT TWrapper
44 friend class TLockProxy;
46 typedef boost::mutex TMutex;
47 //! Synchronization primitive that allows supporting thread safety for the MED access
51 TWrapper(const TWrapper&);
52 TWrapper& operator=(const TWrapper&);
55 TWrapper(const std::string& theFileName, bool write, TFileInternal *tfileInst = nullptr, TInt theMajor=-1, TInt theVersion=-1);
60 //! Read number of MED Mesh entities in the MED file
63 GetNbMeshes(TErr* theErr = NULL);
65 //! Read a MEDWrapper MED Mesh representation by its number
68 GetMeshInfo(TInt theMeshId,
72 //! Write the MEDWrapper MED Mesh representation into the MED file
75 SetMeshInfo(const TMeshInfo& theInfo,
79 SetMeshInfo(const MED::TMeshInfo& theInfo,
83 //! Create a MEDWrapper MED Mesh representation
86 CrMeshInfo(TInt theDim = 0,
88 const std::string& theValue = "",
89 EMaillage theType = eNON_STRUCTURE,
90 const std::string& theDesc = "");
92 //! Copy constructor for the MEDWrapper MED Mesh representation
95 CrMeshInfo(const PMeshInfo& theInfo);
97 //! Get a MEDWrapper MED Mesh representation by its number
100 GetPMeshInfo(TInt theId,
101 TErr* theErr = NULL);
103 //! Read number of MED Family entities in the MED file
106 GetNbFamilies(const TMeshInfo& theMeshInfo,
107 TErr* theErr = NULL);
109 //! Read number of attributes for MED Family
112 GetNbFamAttr(TInt theFamId,
113 const TMeshInfo& theInfo,
114 TErr* theErr = NULL);
116 //! Read number of MED Groups to which the MED Family belongs to
119 GetNbFamGroup(TInt theFamId,
120 const TMeshInfo& theInfo,
121 TErr* theErr = NULL);
123 //! Read a MEDWrapper MED Family representation by its number
126 GetFamilyInfo(TInt theFamId,
127 TFamilyInfo& theInfo,
128 TErr* theErr = NULL);
130 //! Write a MEDWrapper MED Family representation into the MED file
133 SetFamilyInfo(const TFamilyInfo& theInfo,
134 TErr* theErr = NULL);
137 SetFamilyInfo(const MED::TFamilyInfo& theInfo,
139 TErr* theErr = NULL);
141 //! Create a MEDWrapper MED Family representation
144 CrFamilyInfo(const PMeshInfo& theMeshInfo,
148 const std::string& theValue = "");
150 //! Create a MEDWrapper MED Family representation
153 CrFamilyInfo(const PMeshInfo& theMeshInfo,
154 const std::string& theValue,
156 const TStringSet& theGroupNames,
157 const TStringVector& theAttrDescs = TStringVector(),
158 const TIntVector& theAttrIds = TIntVector(),
159 const TIntVector& theAttrVals = TIntVector());
161 //! Copy constructor for the MEDWrapper MED Family representation
164 CrFamilyInfo(const PMeshInfo& theMeshInfo,
165 const PFamilyInfo& theInfo);
167 //! Get a MEDWrapper MED Family representation by its number
169 GetPFamilyInfo(const PMeshInfo& theMeshInfo,
171 TErr* theErr = NULL);
173 //! Read sequence of names for any descendant of TElemInfo
176 GetNames(TElemInfo& theInfo,
178 EEntiteMaillage theEntity,
179 EGeometrieElement theGeom,
180 TErr* theErr = NULL);
182 //! Write sequence of names for any descendant of TElemInfo
185 SetNames(const TElemInfo& theInfo,
186 EEntiteMaillage theEntity,
187 EGeometrieElement theGeom,
188 TErr* theErr = NULL);
191 SetNames(const TElemInfo& theInfo,
193 EEntiteMaillage theEntity,
194 EGeometrieElement theGeom,
195 TErr* theErr = NULL);
197 //! Read sequence of numerated data for any descendant of TElemInfo
200 GetNumeration(TElemInfo& theInfo,
202 EEntiteMaillage theEntity,
203 EGeometrieElement theGeom,
204 TErr* theErr = NULL);
206 //! Write sequence of numerated data for any descendant of TElemInfo
209 SetNumeration(const TElemInfo& theInfo,
210 EEntiteMaillage theEntity,
211 EGeometrieElement theGeom,
212 TErr* theErr = NULL);
215 SetNumeration(const TElemInfo& theInfo,
217 EEntiteMaillage theEntity,
218 EGeometrieElement theGeom,
219 TErr* theErr = NULL);
221 //! Read sequence of MED Families' indices for any descendant of TElemInfo
224 GetFamilies(TElemInfo& theInfo,
226 EEntiteMaillage theEntity,
227 EGeometrieElement theGeom,
228 TErr* theErr = NULL);
230 //! Write sequence of MED Families' indices for any descendant of TElemInfo
233 SetFamilies(const TElemInfo& theInfo,
234 EEntiteMaillage theEntity,
235 EGeometrieElement theGeom,
236 TErr* theErr = NULL);
239 SetFamilies(const TElemInfo& theInfo,
241 EEntiteMaillage theEntity,
242 EGeometrieElement theGeom,
243 TErr* theErr = NULL);
245 //! Read number of nodes in MED Mesh
248 GetNbNodes(const TMeshInfo& theMeshInfo,
249 TErr* theErr = NULL);
253 GetNbNodes(const TMeshInfo& theMeshInfo,
255 TErr* theErr = NULL);
257 //! Read a MEDWrapper MED Nodes representation from the MED file
260 GetNodeInfo(TNodeInfo& theInfo,
261 TErr* theErr = NULL);
263 //! Write the MEDWrapper MED Nodes representation into the MED file
266 SetNodeInfo(const TNodeInfo& theInfo,
267 TErr* theErr = NULL);
270 SetNodeInfo(const MED::TNodeInfo& theInfo,
272 TErr* theErr = NULL);
274 //! Create a MEDWrapper MED Nodes representation
277 CrNodeInfo(const PMeshInfo& theMeshInfo,
279 EModeSwitch theMode = eFULL_INTERLACE,
280 ERepere theSystem = eCART,
281 EBooleen theIsElemNum = eVRAI,
282 EBooleen theIsElemNames = eFAUX);
284 //! Create a MEDWrapper MED Nodes representation
287 CrNodeInfo(const PMeshInfo& theMeshInfo,
288 const TFloatVector& theNodeCoords,
289 EModeSwitch theMode = eFULL_INTERLACE,
290 ERepere theSystem = eCART,
291 const TStringVector& theCoordNames = TStringVector(),
292 const TStringVector& theCoordUnits = TStringVector(),
293 const TIntVector& theFamilyNums = TIntVector(),
294 const TIntVector& theElemNums = TIntVector(),
295 const TStringVector& theElemNames = TStringVector());
297 //! Copy constructor for the MEDWrapper MED Nodes representation
300 CrNodeInfo(const PMeshInfo& theMeshInfo,
301 const PNodeInfo& theInfo);
303 //! Get a MEDWrapper MED Nodes representation from the MED file
305 GetPNodeInfo(const PMeshInfo& theMeshInfo,
306 TErr* theErr = NULL);
308 //! Create a MEDWrapper MED Elements representation
311 CrElemInfo(const PMeshInfo& theMeshInfo,
313 EBooleen theIsElemNum = eVRAI,
314 EBooleen theIsElemNames = eVRAI);
316 //! Create a MEDWrapper MED Elements representation
319 CrElemInfo(const PMeshInfo& theMeshInfo,
321 const TIntVector& theFamNum,
322 const TIntVector& aElemNum,
323 const TStringVector& aElemNames);
325 //! Get a MEDWrapper MED Element representation from the MED file
327 GetPElemInfo(const PMeshInfo& theMeshInfo,
328 EEntiteMaillage theEntity = eNOEUD,
329 EGeometrieElement theGeom = ePOINT1,
330 EConnectivite theConnMode = eNOD,
331 TErr* theErr = NULL);
333 //! Read number of MED Polygones in MED Mesh
336 GetNbPolygones(const TMeshInfo& theMeshInfo,
337 EEntiteMaillage theEntity,
338 EGeometrieElement theGeom,
339 EConnectivite theConnMode = eNOD,
340 TErr* theErr = NULL);
342 //! Read connectivity information for the MED Polygones in defined MED Mesh
345 GetPolygoneConnSize(const TMeshInfo& theMeshInfo,
346 EEntiteMaillage theEntity,
347 EGeometrieElement theGeom,
348 EConnectivite theConnMode = eNOD,
349 TErr* theErr = NULL);
351 //! Read a MEDWrapper MED Polygones representation from the MED file
354 GetPolygoneInfo(TPolygoneInfo& theInfo,
355 TErr* theErr = NULL);
357 //! Write a MEDWrapper MED Polygones representation into the MED file
360 SetPolygoneInfo(const TPolygoneInfo& theInfo,
361 TErr* theErr = NULL);
364 SetPolygoneInfo(const MED::TPolygoneInfo& theInfo,
366 TErr* theErr = NULL);
368 //! Create a MEDWrapper MED Polygones representation
371 CrPolygoneInfo(const PMeshInfo& theMeshInfo,
372 EEntiteMaillage theEntity,
373 EGeometrieElement theGeom,
376 EConnectivite theConnMode = eNOD,
377 EBooleen theIsElemNum = eVRAI,
378 EBooleen theIsElemNames = eVRAI);
380 //! Create a MEDWrapper MED Polygones representation
383 CrPolygoneInfo(const PMeshInfo& theMeshInfo,
384 EEntiteMaillage theEntity,
385 EGeometrieElement theGeom,
386 const TIntVector& theIndexes,
387 const TIntVector& theConnectivities,
388 EConnectivite theConnMode = eNOD,
389 const TIntVector& theFamilyNums = TIntVector(),
390 const TIntVector& theElemNums = TIntVector(),
391 const TStringVector& theElemNames = TStringVector());
393 //! Copy constructor for the MEDWrapper MED Polygones representation
396 CrPolygoneInfo(const PMeshInfo& theMeshInfo,
397 const PPolygoneInfo& theInfo);
399 //! Get a MEDWrapper MED Polygones representation from the MED file
401 GetPPolygoneInfo(const PMeshInfo& theMeshInfo,
402 EEntiteMaillage theEntity,
403 EGeometrieElement theGeom,
404 EConnectivite theConnMode = eNOD);
406 //! Read number of MED Polyedres in MED Mesh
409 GetNbPolyedres(const TMeshInfo& theMeshInfo,
410 EEntiteMaillage theEntity,
411 EGeometrieElement theGeom,
412 EConnectivite theConnMode = eNOD,
413 TErr* theErr = NULL);
415 //! Read connectivity information for the MED Polyedres in MED Mesh
418 GetPolyedreConnSize(const TMeshInfo& theMeshInfo,
421 EConnectivite theConnMode = eNOD,
422 TErr* theErr = NULL);
424 //! Read a MEDWrapper MED Polyedres representation from the MED file
427 GetPolyedreInfo(TPolyedreInfo& theInfo,
428 TErr* theErr = NULL);
430 //! Write a MEDWrapper MED Polyedres representation into the MED file
433 SetPolyedreInfo(const TPolyedreInfo& theInfo,
434 TErr* theErr = NULL);
437 SetPolyedreInfo(const MED::TPolyedreInfo& theInfo,
439 TErr* theErr = NULL);
441 //! Create a MEDWrapper MED Polyedres representation
444 CrPolyedreInfo(const PMeshInfo& theMeshInfo,
445 EEntiteMaillage theEntity,
446 EGeometrieElement theGeom,
450 EConnectivite theConnMode = eNOD,
451 EBooleen theIsElemNum = eVRAI,
452 EBooleen theIsElemNames = eVRAI);
454 //! Create a MEDWrapper MED Polyedres representation
457 CrPolyedreInfo(const PMeshInfo& theMeshInfo,
458 EEntiteMaillage theEntity,
459 EGeometrieElement theGeom,
460 const TIntVector& theIndexes,
461 const TIntVector& theFaces,
462 const TIntVector& theConnectivities,
463 EConnectivite theConnMode = eNOD,
464 const TIntVector& theFamilyNums = TIntVector(),
465 const TIntVector& theElemNums = TIntVector(),
466 const TStringVector& theElemNames = TStringVector());
468 //! Copy constructor for the MEDWrapper MED Polyedres representation
471 CrPolyedreInfo(const PMeshInfo& theMeshInfo,
472 const PPolyedreInfo& theInfo);
474 //! Get a MEDWrapper MED Polyedres representation from the MED file
476 GetPPolyedreInfo(const PMeshInfo& theMeshInfo,
477 EEntiteMaillage theEntity,
478 EGeometrieElement theGeom,
479 EConnectivite theConnMode = eNOD);
481 //! Get TEntityInfo which contains brief information about existing cells
482 // and their destribution among MED ENTITIES
485 GetEntityInfo(const TMeshInfo& theMeshInfo,
486 EConnectivite theConnMode = eNOD,
487 TErr* theErr = NULL);
489 //! Read number of cells for defined MED Mesh, ENTITY and geometrical type with given connectivity mode
492 GetNbCells(const TMeshInfo& theMeshInfo,
493 EEntiteMaillage theEntity,
494 EGeometrieElement theGeom,
495 EConnectivite theConnMode = eNOD,
496 TErr* theErr = NULL);
498 //! Read a MEDWrapper MED Cells representation from the MED file
501 GetCellInfo(TCellInfo& theInfo,
502 TErr* theErr = NULL);
504 //! Write the MEDWrapper MED Cells representation into the MED file
507 SetCellInfo(const TCellInfo& theInfo,
508 TErr* theErr = NULL);
511 SetCellInfo(const MED::TCellInfo& theInfo,
513 TErr* theErr = NULL);
515 //! Create a MEDWrapper MED Cells representation
518 CrCellInfo(const PMeshInfo& theMeshInfo,
519 EEntiteMaillage theEntity,
520 EGeometrieElement theGeom,
522 EConnectivite theConnMode = eNOD,
523 EBooleen theIsElemNum = eVRAI,
524 EBooleen theIsElemNames = eFAUX,
525 EModeSwitch theMode = eFULL_INTERLACE);
527 //! Create a MEDWrapper MED Cells representation
530 CrCellInfo(const PMeshInfo& theMeshInfo,
531 EEntiteMaillage theEntity,
532 EGeometrieElement theGeom,
533 const TIntVector& theConnectivities,
534 EConnectivite theConnMode = eNOD,
535 const TIntVector& theFamilyNums = TIntVector(),
536 const TIntVector& theElemNums = TIntVector(),
537 const TStringVector& theElemNames = TStringVector(),
538 EModeSwitch theMode = eFULL_INTERLACE);
540 //! Copy constructor for the MEDWrapper MED Cells representation
543 CrCellInfo(const PMeshInfo& theMeshInfo,
544 const PCellInfo& theInfo);
546 //! Get a MEDWrapper MED Cells representation from the MED file
548 GetPCellInfo(const PMeshInfo& theMeshInfo,
549 EEntiteMaillage theEntity,
550 EGeometrieElement theGeom,
551 EConnectivite theConnMode = eNOD,
552 TErr* theErr = NULL);
554 //! Read geom type of MED_BALL structural element
556 GetBallGeom(const TMeshInfo& theMeshInfo);
558 //! Read number of balls in the Mesh
559 /*! This feature is supported since version 3.0 */
562 GetNbBalls(const TMeshInfo& theMeshInfo);
564 //! Read a MEDWrapper representation of MED_BALL from the MED file
565 /*! This feature is supported since version 3.0 */
568 GetBallInfo(TBallInfo& theInfo,
569 TErr* theErr = NULL);
571 //! Write a MEDWrapper representation of MED_BALL into the MED file
572 /*! This feature is supported since version 3.0 */
575 SetBallInfo(const TBallInfo& theInfo,
576 TErr* theErr = NULL);
579 SetBallInfo(const TBallInfo& theInfo,
583 //! Create a MEDWrapper MED Balls representation
584 /*! This feature is supported since version 3.0 */
587 CrBallInfo(const PMeshInfo& theMeshInfo,
589 EBooleen theIsElemNum = eVRAI);
591 //! Create a MEDWrapper MED Balls representation
592 /*! This feature is supported since version 3.0 */
595 CrBallInfo(const PMeshInfo& theMeshInfo,
596 const TIntVector& theNodes,
597 TFloatVector& theDiameters,
598 const TIntVector& theFamilyNums = TIntVector(),
599 const TIntVector& theElemNums = TIntVector());
601 //! Copy constructor for the MEDWrapper MED Balls representation
602 /*! This feature is supported since version 3.0 */
605 CrBallInfo(const PMeshInfo& theMeshInfo,
606 const PBallInfo& theInfo);
608 //! Get a MEDWrapper MED Balls representation from the MED file
609 /*! This feature is supported since version 3.0 */
612 GetPBallInfo(const PMeshInfo& theMeshInfo);
614 //! Read number of MED FIELDS in the MED Mesh
617 GetNbFields(TErr* theErr = NULL);
619 //! Read number of components for the MED FIELD by its order number
622 GetNbComp(TInt theFieldId,
623 TErr* theErr = NULL);
625 //! Read MEDWrapper MED FIELD representation from the MED file by its order number
628 GetFieldInfo(TInt theFieldId,
630 TErr* theErr = NULL);
632 //! Write MEDWrapper MED FIELD representation into the MED file
635 SetFieldInfo(const TFieldInfo& theInfo,
636 TErr* theErr = NULL);
639 SetFieldInfo(const MED::TFieldInfo& theInfo,
641 TErr* theErr = NULL);
643 //! Create a MEDWrapper MED FIELD representation
646 CrFieldInfo(const PMeshInfo& theMeshInfo,
648 ETypeChamp theType = eFLOAT64,
649 const std::string& theValue = "",
650 EBooleen theIsLocal = eVRAI,
653 //! Copy constructor for the MEDWrapper MED FIELD representation
656 CrFieldInfo(const PMeshInfo& theMeshInfo,
657 const PFieldInfo& theInfo);
659 //! Get a MEDWrapper MED FIELD representation from the MED file
661 GetPFieldInfo(const PMeshInfo& theMeshInfo,
663 TErr* theErr = NULL);
665 //! Read number of MED GAUSS in the MED Mesh
668 GetNbGauss(TErr* theErr = NULL);
670 //! Read brief MED GAUSS information by its order number from the MED file
673 GetGaussPreInfo(TInt theId,
674 TErr* theErr = NULL);
676 //! Read a MEDWrapper MED GAUSS representation by its order number from the MED file
679 GetGaussInfo(TInt theId,
681 TErr* theErr = NULL);
683 //! Create a MEDWrapper MED GAUSS representation
686 CrGaussInfo(const TGaussInfo::TInfo& theInfo,
687 EModeSwitch theMode = eFULL_INTERLACE);
689 //! Read number of MED TIMESTAMPS in the MED Mesh
691 In addition, the following information can be obtained:
692 - what MED ENTITY the MED TIMESTAMP is connected to;
693 - what geometrical types the MED TIMESTAMP is defined on.
697 GetNbTimeStamps(const TFieldInfo& theInfo,
698 const TEntityInfo& theEntityInfo,
699 EEntiteMaillage& theEntity,
700 TGeom2Size& theGeom2Size,
701 TErr* theErr = NULL);
703 //! Read MEDWrapper MED TIMESTAMP representation by its order number from the MED file
706 GetTimeStampInfo(TInt theTimeStampId,
707 TTimeStampInfo& theInfo,
708 TErr* theErr = NULL);
710 //! Create a MEDWrapper MED TIMESTAMP representation
713 CrTimeStampInfo(const PFieldInfo& theFieldInfo,
714 EEntiteMaillage theEntity,
715 const TGeom2Size& theGeom2Size,
716 const TGeom2NbGauss& theGeom2NbGauss = TGeom2NbGauss(),
720 const std::string& theUnitDt = "",
721 const TGeom2Gauss& theGeom2Gauss = TGeom2Gauss());
723 //! Copy constructor for the MEDWrapper MED TIMESTAMP representation
726 CrTimeStampInfo(const PFieldInfo& theFieldInfo,
727 const PTimeStampInfo& theInfo);
729 //! Get MEDWrapper MED TIMESTAMP representation from the MED file
731 GetPTimeStampInfo(const PFieldInfo& theFieldInfo,
732 EEntiteMaillage theEntity,
733 const TGeom2Size& theGeom2Size,
735 TErr* theErr = NULL);
737 //! Read number of MED PROFILES in the MED file
740 GetNbProfiles(TErr* theErr = NULL);
742 //! Read brief MED PROFILE information by its order number from the MED file
745 GetProfilePreInfo(TInt theId,
746 TErr* theErr = NULL);
748 //! Read a MEDWrapper MED PROFILE representation by its order number from the MED file
751 GetProfileInfo(TInt theId,
752 TProfileInfo& theInfo,
753 TErr* theErr = NULL);
755 //! Write a MEDWrapper MED PROFILE representation into the MED file
758 SetProfileInfo(const TProfileInfo& theInfo,
759 TErr* theErr = NULL);
762 SetProfileInfo(const TProfileInfo& theInfo,
764 TErr* theErr = NULL);
766 //! Create a MEDWrapper MED PROFILE representation
769 CrProfileInfo(const TProfileInfo::TInfo& theInfo,
770 EModeProfil theMode = eCOMPACT);
772 //! Get a MEDWrapper MED PROFILE representation from the MED file
774 GetPProfileInfo(TInt theId,
775 EModeProfil theMode = eCOMPACT,
776 TErr* theErr = NULL);
778 //! Read the values for MEDWrapper MED TIMESTAMP from the MED file
781 GetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
782 const TMKey2Profile& theMKey2Profile,
783 const TKey2Gauss& theKey2Gauss,
784 TErr* theErr = NULL);
786 //! Write the values for MEDWrapper MED TIMESTAMP into the MED file
789 SetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
790 TErr* theErr = NULL);
793 SetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
795 TErr* theErr = NULL);
797 //! Create the values for MEDWrapper MED TIMESTAMP representation
800 CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
801 ETypeChamp theTypeChamp,
802 const TGeom2Profile& theGeom2Profile = TGeom2Profile(),
803 EModeSwitch theMode = eFULL_INTERLACE);
805 //! Create the values for MEDWrapper MED TIMESTAMP representation
808 CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
809 const TGeom2Profile& theGeom2Profile = TGeom2Profile(),
810 EModeSwitch theMode = eFULL_INTERLACE);
812 //! Copy constructor for the values for MEDWrapper MED TIMESTAMP representation
815 CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
816 const PTimeStampValueBase& theInfo,
817 ETypeChamp theTypeChamp);
819 //! Copy constructor for the values for MEDWrapper MED TIMESTAMP representation
822 CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
823 const PTimeStampValueBase& theInfo);
825 //! Get the values for MEDWrapper MED TIMESTAMP from the MED file
827 GetPTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
828 const TMKey2Profile& theMKey2Profile,
829 const TKey2Gauss& theKey2Gauss,
830 TErr* theErr = NULL);
833 // Backward compatibility declarations
836 //! Read the values for MEDWrapper MED TIMESTAMP from the MED file
839 GetTimeStampVal(const PTimeStampVal& theVal,
840 const TMKey2Profile& theMKey2Profile,
841 const TKey2Gauss& theKey2Gauss,
842 TErr* theErr = NULL);
844 //! Write the values for MEDWrapper MED TIMESTAMP into the MED file
847 SetTimeStamp(const PTimeStampVal& theVal,
848 TErr* theErr = NULL);
850 //! Create the values for MEDWrapper MED TIMESTAMP representation
853 CrTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
854 const TGeom2Profile& theGeom2Profile = TGeom2Profile(),
855 EModeSwitch theMode = eFULL_INTERLACE);
857 //! Copy constructor for the values for MEDWrapper MED TIMESTAMP representation
860 CrTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
861 const PTimeStampVal& theInfo);
863 //! Get the values for MEDWrapper MED TIMESTAMP from the MED file
865 GetPTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
866 const TMKey2Profile& theMKey2Profile,
867 const TKey2Gauss& theKey2Gauss,
868 TErr* theErr = NULL);
870 //! Read a MEDWrapper MED Grille representation from the MED file
872 GetPGrilleInfo(const PMeshInfo& theMeshInfo);
874 //! Read a MEDWrapper MED Grille representation from the MED file
876 GetPGrilleInfo(const PMeshInfo& theMeshInfo,
877 const PGrilleInfo& theInfo);
879 //! Read a MEDWrapper MED Grille representation from the MED file
882 GetGrilleInfo(TGrilleInfo& theInfo,
883 TErr* theErr = NULL);
885 //! Write the MEDWrapper MED Grille representation into the MED file
888 SetGrilleInfo(const TGrilleInfo& theInfo,
889 TErr* theErr = NULL);
892 SetGrilleInfo(const MED::TGrilleInfo& theGrilleInfo,
894 TErr* theErr = NULL);
896 //! Create the MEDWrapper MED Grille representation
899 CrGrilleInfo(const PMeshInfo& theMeshInfo,
900 const PGrilleInfo& theGrilleInfo);
902 //! Create the MEDWrapper MED Grille representation
905 CrGrilleInfo(const PMeshInfo& theMeshInfo);
907 //! Create the MEDWrapper MED Grille representation
910 CrGrilleInfo(const PMeshInfo& theMeshInfo,
911 const EGrilleType& type);
913 //! Create the MEDWrapper MED Grille representation
916 CrGrilleInfo(const PMeshInfo& theMeshInfo,
917 const EGrilleType& type,
918 const TInt& nbNodes);
920 //! Create the MEDWrapper MED Grille representation
923 CrGrilleInfo(const PMeshInfo& theMeshInfo,
924 const EGrilleType& type,
925 const MED::TIntVector& nbNodeVec);
927 //! Get a MEDWrapper MED Grille type
930 GetGrilleType(const TMeshInfo& theMeshInfo,
932 TErr* theErr = NULL);
934 //! Get a MEDWrapper MED Grille structure
936 GetGrilleStruct(const MED::TMeshInfo& theMeshInfo,
937 TIntVector& theStruct,
938 TErr* theErr = NULL);
941 PFileInternal myFile;
946 //----------------------------------------------------------------------------
947 typedef SharedPtr<TWrapper> PWrapper;
949 //----------------------------------------------------------------------------
950 //! This class provides thread-safety for MEDWrapper interaction
951 class MEDWRAPPER_EXPORT TLockProxy
953 TLockProxy& operator=(const TLockProxy& );
957 TLockProxy(TWrapper* theWrapper);
960 TWrapper* operator->() const;
963 //----------------------------------------------------------------------------
964 //! Specialization of SharedPtr for TWrapper
966 class MEDWRAPPER_EXPORT SharedPtr<TWrapper>: public std::shared_ptr<TWrapper>
971 SharedPtr(TWrapper* p):
972 std::shared_ptr<TWrapper>(p)
976 explicit SharedPtr(Y* p):
977 std::shared_ptr<TWrapper>(p)
981 SharedPtr(const SharedPtr<Y>& r):
982 std::shared_ptr<TWrapper>(boost::dynamic_pointer_cast<TWrapper,Y>(r))
987 operator=(const SharedPtr<Y>& r)
989 SharedPtr<TWrapper>(r).swap(*this);
995 operator()(Y* p) // Y must be complete
997 return operator=<Y>(SharedPtr<Y>(p));
1002 operator()(const SharedPtr<Y>& r) // Y must be complete
1004 return operator=<Y>(SharedPtr<Y>(r));
1008 operator->() const // never throws
1010 return TLockProxy(this->get());
1014 operator const TWrapper&() const;
1016 operator TWrapper&();
1022 get() const // never throws
1024 return std::shared_ptr<TWrapper>::get();
1029 #endif // MED_Wrapper_HeaderFile