Version: 9.16.0
MED_Wrapper.hxx
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, OPEN CASCADE
2//
3// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5//
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.
10//
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.
15//
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
19//
20// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21//
22
23#ifndef MED_Wrapper_HeaderFile
24#define MED_Wrapper_HeaderFile
25
26#include "MED_WrapperDef.hxx"
27#include "MED_Structures.hxx"
28#include "MED_Algorithm.hxx"
29
30#include <boost/thread/mutex.hpp>
31
32namespace MED
33{
34 //----------------------------------------------------------------------------
35 class TFileInternal;
36 typedef std::shared_ptr<TFileInternal> PFileInternal;
37
39
40 //----------------------------------------------------------------------------
43 {
44 friend class TLockProxy;
45
46 typedef boost::mutex TMutex;
49
53
54 public:
55 TWrapper(const std::string& theFileName, bool write, TFileInternal *tfileInst = nullptr, TInt theMajor=-1, TInt theVersion=-1);
56
57 virtual
58 ~TWrapper();
59
61 virtual
62 TInt
63 GetNbMeshes(TErr* theErr = NULL);
64
66 virtual
67 void
68 GetMeshInfo(TInt theMeshId,
69 TMeshInfo& theInfo,
70 TErr* theErr = NULL);
71
73 virtual
74 void
75 SetMeshInfo(const TMeshInfo& theInfo,
76 TErr* theErr = NULL);
77
78 void
79 SetMeshInfo(const MED::TMeshInfo& theInfo,
80 EModeAcces theMode,
81 TErr* theErr = NULL);
82
84 virtual
86 CrMeshInfo(TInt theDim = 0,
87 TInt theSpaceDim = 0,
88 const std::string& theValue = "",
89 EMaillage theType = eNON_STRUCTURE,
90 const std::string& theDesc = "");
91
93 virtual
95 CrMeshInfo(const PMeshInfo& theInfo);
96
98 virtual
100 GetPMeshInfo(TInt theId,
101 TErr* theErr = NULL);
102
104 virtual
105 TInt
106 GetNbFamilies(const TMeshInfo& theMeshInfo,
107 TErr* theErr = NULL);
108
110 virtual
111 TInt
112 GetNbFamAttr(TInt theFamId,
113 const TMeshInfo& theInfo,
114 TErr* theErr = NULL);
115
117 virtual
118 TInt
119 GetNbFamGroup(TInt theFamId,
120 const TMeshInfo& theInfo,
121 TErr* theErr = NULL);
122
124 virtual
125 void
126 GetFamilyInfo(TInt theFamId,
127 TFamilyInfo& theInfo,
128 TErr* theErr = NULL);
129
131 virtual
132 void
133 SetFamilyInfo(const TFamilyInfo& theInfo,
134 TErr* theErr = NULL);
135
136 void
137 SetFamilyInfo(const MED::TFamilyInfo& theInfo,
138 EModeAcces theMode,
139 TErr* theErr = NULL);
140
142 virtual
144 CrFamilyInfo(const PMeshInfo& theMeshInfo,
145 TInt theNbGroup = 0,
146 TInt theNbAttr = 0,
147 TInt theId = 0,
148 const std::string& theValue = "");
149
151 virtual
153 CrFamilyInfo(const PMeshInfo& theMeshInfo,
154 const std::string& theValue,
155 TInt theId,
156 const TStringSet& theGroupNames,
157 const TStringVector& theAttrDescs = TStringVector(),
158 const TIntVector& theAttrIds = TIntVector(),
159 const TIntVector& theAttrVals = TIntVector());
160
162 virtual
164 CrFamilyInfo(const PMeshInfo& theMeshInfo,
165 const PFamilyInfo& theInfo);
166
169 GetPFamilyInfo(const PMeshInfo& theMeshInfo,
170 TInt theId,
171 TErr* theErr = NULL);
172
174 virtual
175 void
176 GetNames(TElemInfo& theInfo,
177 TInt theNb,
178 EEntiteMaillage theEntity,
179 EGeometrieElement theGeom,
180 TErr* theErr = NULL);
181
183 virtual
184 void
185 SetNames(const TElemInfo& theInfo,
186 EEntiteMaillage theEntity,
187 EGeometrieElement theGeom,
188 TErr* theErr = NULL);
189
190 void
191 SetNames(const TElemInfo& theInfo,
192 EModeAcces theMode,
193 EEntiteMaillage theEntity,
194 EGeometrieElement theGeom,
195 TErr* theErr = NULL);
196
198 virtual
199 void
200 GetNumeration(TElemInfo& theInfo,
201 TInt theNb,
202 EEntiteMaillage theEntity,
203 EGeometrieElement theGeom,
204 TErr* theErr = NULL);
205
207 virtual
208 void
209 SetNumeration(const TElemInfo& theInfo,
210 EEntiteMaillage theEntity,
211 EGeometrieElement theGeom,
212 TErr* theErr = NULL);
213
214 void
215 SetNumeration(const TElemInfo& theInfo,
216 EModeAcces theMode,
217 EEntiteMaillage theEntity,
218 EGeometrieElement theGeom,
219 TErr* theErr = NULL);
220
222 virtual
223 void
224 GetFamilies(TElemInfo& theInfo,
225 TInt theNb,
226 EEntiteMaillage theEntity,
227 EGeometrieElement theGeom,
228 TErr* theErr = NULL);
229
231 virtual
232 void
233 SetFamilies(const TElemInfo& theInfo,
234 EEntiteMaillage theEntity,
235 EGeometrieElement theGeom,
236 TErr* theErr = NULL);
237
238 void
239 SetFamilies(const TElemInfo& theInfo,
240 EModeAcces theMode,
241 EEntiteMaillage theEntity,
242 EGeometrieElement theGeom,
243 TErr* theErr = NULL);
244
246 virtual
247 TInt
248 GetNbNodes(const TMeshInfo& theMeshInfo,
249 TErr* theErr = NULL);
250
251 virtual
252 TInt
253 GetNbNodes(const TMeshInfo& theMeshInfo,
254 ETable theTable,
255 TErr* theErr = NULL);
256
258 virtual
259 void
260 GetNodeInfo(TNodeInfo& theInfo,
261 TErr* theErr = NULL);
262
264 virtual
265 void
266 SetNodeInfo(const TNodeInfo& theInfo,
267 TErr* theErr = NULL);
268
269 void
270 SetNodeInfo(const MED::TNodeInfo& theInfo,
271 EModeAcces theMode,
272 TErr* theErr = NULL);
273
275 virtual
277 CrNodeInfo(const PMeshInfo& theMeshInfo,
278 TInt theNbElem,
280 ERepere theSystem = eCART,
281 EBooleen theIsElemNum = eVRAI,
282 EBooleen theIsElemNames = eFAUX);
283
285 virtual
287 CrNodeInfo(const PMeshInfo& theMeshInfo,
288 const TFloatVector& theNodeCoords,
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());
296
298 virtual
300 CrNodeInfo(const PMeshInfo& theMeshInfo,
301 const PNodeInfo& theInfo);
302
305 GetPNodeInfo(const PMeshInfo& theMeshInfo,
306 TErr* theErr = NULL);
307
309 virtual
311 CrElemInfo(const PMeshInfo& theMeshInfo,
312 TInt theNbElem,
313 EBooleen theIsElemNum = eVRAI,
314 EBooleen theIsElemNames = eVRAI);
315
317 virtual
319 CrElemInfo(const PMeshInfo& theMeshInfo,
320 TInt theNbElem,
321 const TIntVector& theFamNum,
322 const TIntVector& aElemNum,
323 const TStringVector& aElemNames);
324
327 GetPElemInfo(const PMeshInfo& theMeshInfo,
328 EEntiteMaillage theEntity = eNOEUD,
329 EGeometrieElement theGeom = ePOINT1,
330 EConnectivite theConnMode = eNOD,
331 TErr* theErr = NULL);
332
334 virtual
335 TInt
336 GetNbPolygones(const TMeshInfo& theMeshInfo,
337 EEntiteMaillage theEntity,
338 EGeometrieElement theGeom,
339 EConnectivite theConnMode = eNOD,
340 TErr* theErr = NULL);
341
343 virtual
344 TInt
345 GetPolygoneConnSize(const TMeshInfo& theMeshInfo,
346 EEntiteMaillage theEntity,
347 EGeometrieElement theGeom,
348 EConnectivite theConnMode = eNOD,
349 TErr* theErr = NULL);
350
352 virtual
353 void
354 GetPolygoneInfo(TPolygoneInfo& theInfo,
355 TErr* theErr = NULL);
356
358 virtual
359 void
360 SetPolygoneInfo(const TPolygoneInfo& theInfo,
361 TErr* theErr = NULL);
362
363 void
364 SetPolygoneInfo(const MED::TPolygoneInfo& theInfo,
365 EModeAcces theMode,
366 TErr* theErr = NULL);
367
369 virtual
371 CrPolygoneInfo(const PMeshInfo& theMeshInfo,
372 EEntiteMaillage theEntity,
373 EGeometrieElement theGeom,
374 TInt theNbElem,
375 TInt theConnSize,
376 EConnectivite theConnMode = eNOD,
377 EBooleen theIsElemNum = eVRAI,
378 EBooleen theIsElemNames = eVRAI);
379
381 virtual
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());
392
394 virtual
396 CrPolygoneInfo(const PMeshInfo& theMeshInfo,
397 const PPolygoneInfo& theInfo);
398
401 GetPPolygoneInfo(const PMeshInfo& theMeshInfo,
402 EEntiteMaillage theEntity,
403 EGeometrieElement theGeom,
404 EConnectivite theConnMode = eNOD);
405
407 virtual
408 TInt
409 GetNbPolyedres(const TMeshInfo& theMeshInfo,
410 EEntiteMaillage theEntity,
411 EGeometrieElement theGeom,
412 EConnectivite theConnMode = eNOD,
413 TErr* theErr = NULL);
414
416 virtual
417 void
418 GetPolyedreConnSize(const TMeshInfo& theMeshInfo,
419 TInt& theNbFaces,
420 TInt& theConnSize,
421 EConnectivite theConnMode = eNOD,
422 TErr* theErr = NULL);
423
425 virtual
426 void
427 GetPolyedreInfo(TPolyedreInfo& theInfo,
428 TErr* theErr = NULL);
429
431 virtual
432 void
433 SetPolyedreInfo(const TPolyedreInfo& theInfo,
434 TErr* theErr = NULL);
435
436 void
437 SetPolyedreInfo(const MED::TPolyedreInfo& theInfo,
438 EModeAcces theMode,
439 TErr* theErr = NULL);
440
442 virtual
444 CrPolyedreInfo(const PMeshInfo& theMeshInfo,
445 EEntiteMaillage theEntity,
446 EGeometrieElement theGeom,
447 TInt theNbElem,
448 TInt theNbFaces,
449 TInt theConnSize,
450 EConnectivite theConnMode = eNOD,
451 EBooleen theIsElemNum = eVRAI,
452 EBooleen theIsElemNames = eVRAI);
453
455 virtual
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());
467
469 virtual
471 CrPolyedreInfo(const PMeshInfo& theMeshInfo,
472 const PPolyedreInfo& theInfo);
473
476 GetPPolyedreInfo(const PMeshInfo& theMeshInfo,
477 EEntiteMaillage theEntity,
478 EGeometrieElement theGeom,
479 EConnectivite theConnMode = eNOD);
480
482 // and their distribution among MED ENTITIES
483 virtual
485 GetEntityInfo(const TMeshInfo& theMeshInfo,
486 EConnectivite theConnMode = eNOD,
487 TErr* theErr = NULL);
488
490 virtual
491 TInt
492 GetNbCells(const TMeshInfo& theMeshInfo,
493 EEntiteMaillage theEntity,
494 EGeometrieElement theGeom,
495 EConnectivite theConnMode = eNOD,
496 TErr* theErr = NULL);
497
499 virtual
500 void
501 GetCellInfo(TCellInfo& theInfo,
502 TErr* theErr = NULL);
503
505 virtual
506 void
507 SetCellInfo(const TCellInfo& theInfo,
508 TErr* theErr = NULL);
509
510 void
511 SetCellInfo(const MED::TCellInfo& theInfo,
512 EModeAcces theMode,
513 TErr* theErr = NULL);
514
516 virtual
518 CrCellInfo(const PMeshInfo& theMeshInfo,
519 EEntiteMaillage theEntity,
520 EGeometrieElement theGeom,
521 TInt theNbElem,
522 EConnectivite theConnMode = eNOD,
523 EBooleen theIsElemNum = eVRAI,
524 EBooleen theIsElemNames = eFAUX,
525 EModeSwitch theMode = eFULL_INTERLACE);
526
528 virtual
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);
539
541 virtual
543 CrCellInfo(const PMeshInfo& theMeshInfo,
544 const PCellInfo& theInfo);
545
548 GetPCellInfo(const PMeshInfo& theMeshInfo,
549 EEntiteMaillage theEntity,
550 EGeometrieElement theGeom,
551 EConnectivite theConnMode = eNOD,
552 TErr* theErr = NULL);
553
556 GetBallGeom(const TMeshInfo& theMeshInfo);
557
559
560 virtual
561 TInt
562 GetNbBalls(const TMeshInfo& theMeshInfo);
563
565
566 virtual
567 void
568 GetBallInfo(TBallInfo& theInfo,
569 TErr* theErr = NULL);
570
572
573 virtual
574 void
575 SetBallInfo(const TBallInfo& theInfo,
576 TErr* theErr = NULL);
577
578 void
579 SetBallInfo(const TBallInfo& theInfo,
580 EModeAcces theMode,
581 TErr* theErr);
582
584
585 virtual
587 CrBallInfo(const PMeshInfo& theMeshInfo,
588 TInt theNbBalls,
589 EBooleen theIsElemNum = eVRAI);
590
592
593 virtual
595 CrBallInfo(const PMeshInfo& theMeshInfo,
596 const TIntVector& theNodes,
597 TFloatVector& theDiameters,
598 const TIntVector& theFamilyNums = TIntVector(),
599 const TIntVector& theElemNums = TIntVector());
600
602
603 virtual
605 CrBallInfo(const PMeshInfo& theMeshInfo,
606 const PBallInfo& theInfo);
607
609
610 virtual
612 GetPBallInfo(const PMeshInfo& theMeshInfo);
613
615 virtual
616 TInt
617 GetNbFields(TErr* theErr = NULL);
618
620 virtual
621 TInt
622 GetNbComp(TInt theFieldId,
623 TErr* theErr = NULL);
624
626 virtual
627 void
628 GetFieldInfo(TInt theFieldId,
629 TFieldInfo& theInfo,
630 TErr* theErr = NULL);
631
633 virtual
634 void
635 SetFieldInfo(const TFieldInfo& theInfo,
636 TErr* theErr = NULL);
637
638 void
639 SetFieldInfo(const MED::TFieldInfo& theInfo,
640 EModeAcces theMode,
641 TErr* theErr = NULL);
642
644 virtual
646 CrFieldInfo(const PMeshInfo& theMeshInfo,
647 TInt theNbComp = 0,
648 ETypeChamp theType = eFLOAT64,
649 const std::string& theValue = "",
650 EBooleen theIsLocal = eVRAI,
651 TInt theNbRef = 1);
652
654 virtual
656 CrFieldInfo(const PMeshInfo& theMeshInfo,
657 const PFieldInfo& theInfo);
658
661 GetPFieldInfo(const PMeshInfo& theMeshInfo,
662 TInt theId,
663 TErr* theErr = NULL);
664
666 virtual
667 TInt
668 GetNbGauss(TErr* theErr = NULL);
669
671 virtual
673 GetGaussPreInfo(TInt theId,
674 TErr* theErr = NULL);
675
677 virtual
678 void
679 GetGaussInfo(TInt theId,
680 TGaussInfo& theInfo,
681 TErr* theErr = NULL);
682
684 virtual
686 CrGaussInfo(const TGaussInfo::TInfo& theInfo,
687 EModeSwitch theMode = eFULL_INTERLACE);
688
690
695 virtual
696 TInt
697 GetNbTimeStamps(const TFieldInfo& theInfo,
698 const TEntityInfo& theEntityInfo,
699 EEntiteMaillage& theEntity,
700 TGeom2Size& theGeom2Size,
701 TErr* theErr = NULL);
702
704 virtual
705 void
706 GetTimeStampInfo(TInt theTimeStampId,
707 TTimeStampInfo& theInfo,
708 TErr* theErr = NULL);
709
711 virtual
713 CrTimeStampInfo(const PFieldInfo& theFieldInfo,
714 EEntiteMaillage theEntity,
715 const TGeom2Size& theGeom2Size,
716 const TGeom2NbGauss& theGeom2NbGauss = TGeom2NbGauss(),
717 TInt theNumDt = 0,
718 TInt theNumOrd = 0,
719 TFloat theDt = 0,
720 const std::string& theUnitDt = "",
721 const TGeom2Gauss& theGeom2Gauss = TGeom2Gauss());
722
724 virtual
726 CrTimeStampInfo(const PFieldInfo& theFieldInfo,
727 const PTimeStampInfo& theInfo);
728
731 GetPTimeStampInfo(const PFieldInfo& theFieldInfo,
732 EEntiteMaillage theEntity,
733 const TGeom2Size& theGeom2Size,
734 TInt theId,
735 TErr* theErr = NULL);
736
738 virtual
739 TInt
740 GetNbProfiles(TErr* theErr = NULL);
741
743 virtual
745 GetProfilePreInfo(TInt theId,
746 TErr* theErr = NULL);
747
749 virtual
750 void
751 GetProfileInfo(TInt theId,
752 TProfileInfo& theInfo,
753 TErr* theErr = NULL);
754
756 virtual
757 void
758 SetProfileInfo(const TProfileInfo& theInfo,
759 TErr* theErr = NULL);
760
761 void
762 SetProfileInfo(const TProfileInfo& theInfo,
763 EModeAcces theMode,
764 TErr* theErr = NULL);
765
767 virtual
769 CrProfileInfo(const TProfileInfo::TInfo& theInfo,
770 EModeProfil theMode = eCOMPACT);
771
774 GetPProfileInfo(TInt theId,
775 EModeProfil theMode = eCOMPACT,
776 TErr* theErr = NULL);
777
779 virtual
780 void
781 GetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
782 const TMKey2Profile& theMKey2Profile,
783 const TKey2Gauss& theKey2Gauss,
784 TErr* theErr = NULL);
785
787 virtual
788 void
789 SetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
790 TErr* theErr = NULL);
791
792 void
793 SetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
794 EModeAcces theMode,
795 TErr* theErr = NULL);
796
798 virtual
800 CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
801 ETypeChamp theTypeChamp,
802 const TGeom2Profile& theGeom2Profile = TGeom2Profile(),
803 EModeSwitch theMode = eFULL_INTERLACE);
804
806 virtual
808 CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
809 const TGeom2Profile& theGeom2Profile = TGeom2Profile(),
810 EModeSwitch theMode = eFULL_INTERLACE);
811
813 virtual
815 CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
816 const PTimeStampValueBase& theInfo,
817 ETypeChamp theTypeChamp);
818
820 virtual
822 CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
823 const PTimeStampValueBase& theInfo);
824
827 GetPTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
828 const TMKey2Profile& theMKey2Profile,
829 const TKey2Gauss& theKey2Gauss,
830 TErr* theErr = NULL);
831
832 //
833 // Backward compatibility declarations
834 //
835
837 virtual
838 void
839 GetTimeStampVal(const PTimeStampVal& theVal,
840 const TMKey2Profile& theMKey2Profile,
841 const TKey2Gauss& theKey2Gauss,
842 TErr* theErr = NULL);
843
845 virtual
846 void
847 SetTimeStamp(const PTimeStampVal& theVal,
848 TErr* theErr = NULL);
849
851 virtual
853 CrTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
854 const TGeom2Profile& theGeom2Profile = TGeom2Profile(),
855 EModeSwitch theMode = eFULL_INTERLACE);
856
858 virtual
860 CrTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
861 const PTimeStampVal& theInfo);
862
865 GetPTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
866 const TMKey2Profile& theMKey2Profile,
867 const TKey2Gauss& theKey2Gauss,
868 TErr* theErr = NULL);
869
872 GetPGrilleInfo(const PMeshInfo& theMeshInfo);
873
876 GetPGrilleInfo(const PMeshInfo& theMeshInfo,
877 const PGrilleInfo& theInfo);
878
880 virtual
881 void
882 GetGrilleInfo(TGrilleInfo& theInfo,
883 TErr* theErr = NULL);
884
886 virtual
887 void
888 SetGrilleInfo(const TGrilleInfo& theInfo,
889 TErr* theErr = NULL);
890
891 void
892 SetGrilleInfo(const MED::TGrilleInfo& theGrilleInfo,
893 EModeAcces theMode,
894 TErr* theErr = NULL);
895
897 virtual
899 CrGrilleInfo(const PMeshInfo& theMeshInfo,
900 const PGrilleInfo& theGrilleInfo);
901
903 virtual
905 CrGrilleInfo(const PMeshInfo& theMeshInfo);
906
908 virtual
910 CrGrilleInfo(const PMeshInfo& theMeshInfo,
911 const EGrilleType& type);
912
914 virtual
916 CrGrilleInfo(const PMeshInfo& theMeshInfo,
917 const EGrilleType& type,
918 const TInt& nbNodes);
919
921 virtual
923 CrGrilleInfo(const PMeshInfo& theMeshInfo,
924 const EGrilleType& type,
925 const MED::TIntVector& nbNodeVec);
926
928 virtual
929 void
930 GetGrilleType(const TMeshInfo& theMeshInfo,
931 EGrilleType& type,
932 TErr* theErr = NULL);
933
935 void
936 GetGrilleStruct(const MED::TMeshInfo& theMeshInfo,
937 TIntVector& theStruct,
938 TErr* theErr = NULL);
939
940 protected:
944 };
945
946 //----------------------------------------------------------------------------
948
949 //----------------------------------------------------------------------------
952 {
955
956 public:
957 TLockProxy(TWrapper* theWrapper);
958 ~TLockProxy();
959
960 TWrapper* operator->() const;
961 };
962
963 //----------------------------------------------------------------------------
965 template<>
966 class MEDWRAPPER_EXPORT SharedPtr<TWrapper>: public std::shared_ptr<TWrapper>
967 {
968 public:
970
972 std::shared_ptr<TWrapper>(p)
973 {}
974
975 template<class Y>
976 explicit SharedPtr(Y* p):
977 std::shared_ptr<TWrapper>(p)
978 {}
979
980 template<class Y>
982 std::shared_ptr<TWrapper>(boost::dynamic_pointer_cast<TWrapper,Y>(r))
983 {}
984
985 template<class Y>
986 SharedPtr&
988 {
989 SharedPtr<TWrapper>(r).swap(*this);
990 return *this;
991 }
992
993 template<class Y>
994 SharedPtr&
995 operator()(Y* p) // Y must be complete
996 {
997 return operator=<Y>(SharedPtr<Y>(p));
998 }
999
1000 template<class Y>
1001 SharedPtr&
1002 operator()(const SharedPtr<Y>& r) // Y must be complete
1003 {
1004 return operator=<Y>(SharedPtr<Y>(r));
1005 }
1006
1008 operator->() const // never throws
1009 {
1010 return TLockProxy(this->get());
1011 }
1012
1013 protected:
1014 operator const TWrapper&() const;
1015
1016 operator TWrapper&();
1017
1018 TWrapper&
1019 operator*() const;
1020
1021 TWrapper*
1022 get() const // never throws
1023 {
1024 return std::shared_ptr<TWrapper>::get();
1025 }
1026 };
1027}
1028
1029#endif // MED_Wrapper_HeaderFile
#define MEDWRAPPER_EXPORT
Definition: MED_WrapperDef.hxx:33
Specialization of SharedPtr for TWrapper.
Definition: MED_Wrapper.hxx:967
TWrapper & operator*() const
TLockProxy operator->() const
Definition: MED_Wrapper.hxx:1008
SharedPtr & operator()(const SharedPtr< Y > &r)
Definition: MED_Wrapper.hxx:1002
SharedPtr(Y *p)
Definition: MED_Wrapper.hxx:976
TWrapper * get() const
Definition: MED_Wrapper.hxx:1022
SharedPtr & operator=(const SharedPtr< Y > &r)
Definition: MED_Wrapper.hxx:987
SharedPtr & operator()(Y *p)
Definition: MED_Wrapper.hxx:995
SharedPtr(TWrapper *p)
Definition: MED_Wrapper.hxx:971
SharedPtr()
Definition: MED_Wrapper.hxx:969
SharedPtr(const SharedPtr< Y > &r)
Definition: MED_Wrapper.hxx:981
Definition: MED_TFile.hxx:28
This class provides thread-safety for MEDWrapper interaction.
Definition: MED_Wrapper.hxx:952
TLockProxy & operator=(const TLockProxy &)
TWrapper * myWrapper
Definition: MED_Wrapper.hxx:954
Main purpose to introduce the class was to customize operator [].
Definition: MED_Vector.hxx:36
Class that wraps the MED API.
Definition: MED_Wrapper.hxx:43
TInt myMinor
Definition: MED_Wrapper.hxx:943
PFileInternal myFile
Definition: MED_Wrapper.hxx:941
TWrapper & operator=(const TWrapper &)
TWrapper(const TWrapper &)
TMutex myMutex
Synchronization primitive that allows supporting thread safety for the MED access.
Definition: MED_Wrapper.hxx:48
boost::mutex TMutex
Definition: MED_Wrapper.hxx:46
TInt myMajor
Definition: MED_Wrapper.hxx:942
Definition: MED_Algorithm.cxx:28
EEntiteMaillage
Definition: MED_Common.hxx:72
@ eNOEUD
Definition: MED_Common.hxx:72
TVector< std::string > TStringVector
Definition: MED_Common.hxx:83
std::map< EGeometrieElement, TInt > TGeom2NbGauss
Definition: MED_Structures.hxx:495
ERepere
Definition: MED_Common.hxx:60
@ eCART
Definition: MED_Common.hxx:60
PProfileInfo GetProfileInfo(const PWrapper &theWrapper, const std::string &theProfileName, TErr *theErr, EModeProfil theMode)
Get MED PROFILE by its name.
Definition: MED_Algorithm.cxx:261
double TFloat
Definition: MED_Common.hxx:44
EModeProfil
Definition: MED_Common.hxx:74
@ eCOMPACT
Definition: MED_Common.hxx:74
EGeometrieElement
Definition: MED_Common.hxx:64
@ ePOINT1
Definition: MED_Common.hxx:64
std::map< EEntiteMaillage, TGeom2Size > TEntityInfo
Definition: MED_Common.hxx:87
EConnectivite
Definition: MED_Common.hxx:62
@ eNOD
Definition: MED_Common.hxx:62
SharedPtr< TWrapper > PWrapper
Definition: MED_Common.hxx:138
EMaillage
Definition: MED_Common.hxx:58
@ eNON_STRUCTURE
Definition: MED_Common.hxx:58
EBooleen
Definition: MED_Common.hxx:43
@ eFAUX
Definition: MED_Common.hxx:43
@ eVRAI
Definition: MED_Common.hxx:43
TVector< TInt > TIntVector
Definition: MED_Common.hxx:80
boost::tuple< EModeProfil, TKey2Profile > TMKey2Profile
Definition: MED_Algorithm.hxx:49
TInt GetNbNodes(EGeometrieElement typmai)
Definition: MED_Common.cxx:75
std::map< EGeometrieElement, PGaussInfo > TGeom2Gauss
Definition: MED_Structures.hxx:494
herr_t TErr
Definition: MED_Common.hxx:52
std::map< TGaussInfo::TKey, PGaussInfo, TGaussInfo::TLess > TKey2Gauss
Definition: MED_Algorithm.hxx:47
med_int TInt
Definition: MED_Common.hxx:50
EGrilleType
Definition: MED_Common.hxx:76
std::shared_ptr< TFileInternal > PFileInternal
Definition: MED_Wrapper.hxx:36
ETypeChamp
Definition: MED_Common.hxx:56
@ eFLOAT64
Definition: MED_Common.hxx:56
EModeSwitch
Definition: MED_Common.hxx:54
@ eFULL_INTERLACE
Definition: MED_Common.hxx:54
std::set< std::string > TStringSet
Definition: MED_Common.hxx:84
std::map< EGeometrieElement, TInt > TGeom2Size
Definition: MED_Common.hxx:86
ETable
Definition: MED_Common.hxx:78
EModeAcces
Definition: MED_Wrapper.hxx:38
@ eLECTURE_AJOUT
Definition: MED_Wrapper.hxx:38
@ eCREATION
Definition: MED_Wrapper.hxx:38
@ eLECTURE_ECRITURE
Definition: MED_Wrapper.hxx:38
@ eLECTURE
Definition: MED_Wrapper.hxx:38
std::map< EGeometrieElement, PProfileInfo > TGeom2Profile
Definition: MED_Structures.hxx:768
Definition: SMESH_MAT2d.cxx:224
Define a class representing MED_BALL structure element.
Definition: MED_Structures.hxx:346
Define a base class which represents MED Cells entity.
Definition: MED_Structures.hxx:282
Define a parent class for all MED entities that describes mesh entities such as nodes and cells.
Definition: MED_Structures.hxx:188
Define a base class which represents MED Family entity.
Definition: MED_Structures.hxx:135
Define a base class which represents MED Field entity.
Definition: MED_Structures.hxx:393
The class represents MED Gauss entity.
Definition: MED_Structures.hxx:447
boost::tuple< TKey, TInt > TInfo
Definition: MED_Structures.hxx:449
Define a base class which represents MED Grille (structured mesh)
Definition: MED_Structures.hxx:978
Define a base class which represents MED Mesh entity.
Definition: MED_Structures.hxx:112
Define a base class which represents MED Nodes entity.
Definition: MED_Structures.hxx:246
Define a base class which represents MED Polyedre entity.
Definition: MED_Structures.hxx:358
Define a base class which represents MED Polygon entity.
Definition: MED_Structures.hxx:309
The class represents MED Profile entity.
Definition: MED_Structures.hxx:544
boost::tuple< TKey, TInt > TInfo
Definition: MED_Structures.hxx:546
Define a base class which represents MED TimeStamp.
Definition: MED_Structures.hxx:501