Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/med.git] / src / MEDWrapper / Base / MED_Wrapper.hxx
1 //  
2 //
3 //  Copyright (C) 2003  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. 
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 //
24 //  File   : 
25 //  Author : 
26 //  Module : 
27 //  $Header$
28
29 #ifndef MED_Wrapper_HeaderFile
30 #define MED_Wrapper_HeaderFile
31
32 #include "MED_WrapperBase.hxx"
33
34 #include "MED_Structures.hxx"
35 #include "MED_Algorithm.hxx"
36
37 #include <boost/thread/mutex.hpp>
38
39 namespace MED
40 {
41
42   //----------------------------------------------------------------------------
43   //! Define a base class that wraps the MED API
44   struct MEDWRAPPER_EXPORT TWrapper
45   {
46     typedef boost::mutex TMutex;
47     //! This is a syncronization primitive which allow to support thread safety for the MED access
48     TMutex myMutex;
49
50     virtual
51     ~TWrapper();
52
53     //----------------------------------------------------------------------------
54     //! Gets version of the MED library used for the MED file
55     virtual 
56     EVersion
57     GetVersion() = 0;
58     
59     //----------------------------------------------------------------------------
60     //! Creates a MEDWrapper MED Mesh representation
61     virtual 
62     PMeshInfo 
63     CrMeshInfo(TInt theDim = 0,
64                const std::string& theValue = "",
65                EMaillage theType = eNON_STRUCTURE,
66                const std::string& theDesc = "") = 0;
67
68     //! A copy-constructor for the MEDWrapper MED Mesh representation
69     virtual 
70     PMeshInfo 
71     CrMeshInfo(const PMeshInfo& theInfo) = 0;
72
73     //! Read number of MED Mesh entities in the defined MED file
74     virtual 
75     TInt 
76     GetNbMeshes(TErr* theErr = NULL) = 0;
77     
78     //! Read a MEDWrapper MED Mesh representation by its number
79     virtual 
80     void 
81     GetMeshInfo(TInt theMeshId, 
82                 TMeshInfo& theInfo,
83                 TErr* theErr = NULL) = 0;
84
85     //! Write the MEDWrapper MED Mesh representation in the defined MED file
86     virtual 
87     void
88     SetMeshInfo(const TMeshInfo& theInfo,
89                 TErr* theErr = NULL) = 0;
90     
91     //! Read a MEDWrapper MED Mesh representation by its number
92     virtual 
93     PMeshInfo
94     GetPMeshInfo(TInt theId,
95                  TErr* theErr = NULL);
96
97
98     //----------------------------------------------------------------------------
99     //! Read number of MED Family entities in the defined MED file
100     virtual 
101     TInt
102     GetNbFamilies(const TMeshInfo& theMeshInfo,
103                   TErr* theErr = NULL) = 0;
104
105     //! Read number of attributes for defined MED Family
106     virtual 
107     TInt
108     GetNbFamAttr(TInt theFamId, 
109                  const TMeshInfo& theInfo,
110                  TErr* theErr = NULL) = 0;
111     
112     //! Read number of MED Groups where MED Family with the number belong to
113     virtual
114     TInt
115     GetNbFamGroup(TInt theFamId, 
116                   const TMeshInfo& theInfo,
117                   TErr* theErr = NULL) = 0;
118     
119     //! Read a MEDWrapper MED Family representation by its number
120     virtual
121     void
122     GetFamilyInfo(TInt theFamId, 
123                   TFamilyInfo& theInfo,
124                   TErr* theErr = NULL) = 0;
125     
126     //! Write a MEDWrapper MED Family representation by its number
127     virtual
128     void
129     SetFamilyInfo(const TFamilyInfo& theInfo,
130                   TErr* theErr = NULL) = 0;
131     
132     //! Creates a MEDWrapper MED Family representation
133     virtual 
134     PFamilyInfo
135     CrFamilyInfo(const PMeshInfo& theMeshInfo,
136                  TInt theNbGroup = 0, 
137                  TInt theNbAttr = 0,
138                  TInt theId = 0,
139                  const std::string& theValue = "") = 0;
140     
141     //! Creates a MEDWrapper MED Family representation
142     virtual 
143     PFamilyInfo
144     CrFamilyInfo(const PMeshInfo& theMeshInfo,
145                  const std::string& theValue,
146                  TInt theId,
147                  const TStringSet& theGroupNames, 
148                  const TStringVector& theAttrDescs = TStringVector(), 
149                  const TIntVector& theAttrIds = TIntVector(), 
150                  const TIntVector& theAttrVals = TIntVector()) = 0;
151     
152     //! A copy-constructor for the MEDWrapper MED Family representation
153     virtual
154     PFamilyInfo
155     CrFamilyInfo(const PMeshInfo& theMeshInfo,
156                  const PFamilyInfo& theInfo) = 0;
157     
158     //! Write a MEDWrapper MED Family representation by its number
159     PFamilyInfo
160     GetPFamilyInfo(const PMeshInfo& theMeshInfo, 
161                    TInt theId,
162                    TErr* theErr = NULL);
163     
164     //----------------------------------------------------------------------------
165     //! Read sequence of names for any descendant of TElemInfo
166     virtual
167     void
168     GetNames(TElemInfo& theInfo,
169              TInt theNb,
170              EEntiteMaillage theEntity, 
171              EGeometrieElement theGeom,
172              TErr* theErr = NULL)
173     {}
174
175     //! Read sequence of numerous for any descendant of TElemInfo
176     virtual
177     void
178     GetNumeration(TElemInfo& theInfo,
179                   TInt theNb,
180                   EEntiteMaillage theEntity, 
181                   EGeometrieElement theGeom,
182                   TErr* theErr = NULL)
183     {}
184
185     //! Read sequence MED Family indexes for any descendant of TElemInfo
186     virtual
187     void
188     GetFamilies(TElemInfo& theInfo,
189                 TInt theNb,
190                 EEntiteMaillage theEntity, 
191                 EGeometrieElement theGeom,
192                 TErr* theErr = NULL)
193     {}
194
195     //! Write sequence of names for any descendant of TElemInfo
196     virtual
197     void
198     SetNames(const TElemInfo& theInfo,
199              EEntiteMaillage theEntity, 
200              EGeometrieElement theGeom,
201              TErr* theErr = NULL)
202     {}
203
204     //! Write sequence of numerous for any descendant of TElemInfo
205     virtual
206     void
207     SetNumeration(const TElemInfo& theInfo,
208                   EEntiteMaillage theEntity, 
209                   EGeometrieElement theGeom,
210                   TErr* theErr = NULL)
211     {}
212
213     //! Write sequence MED Family indexes for any descendant of TElemInfo
214     virtual
215     void
216     SetFamilies(const TElemInfo& theInfo,
217                 EEntiteMaillage theEntity, 
218                 EGeometrieElement theGeom,
219                 TErr* theErr = NULL)
220     {}
221
222     //! Read a MEDWrapper MED Element representation from defined MED file
223     PElemInfo
224     GetPElemInfo(const PMeshInfo& theMeshInfo,
225                  EEntiteMaillage theEntity = eNOEUD, 
226                  EGeometrieElement theGeom = ePOINT1, 
227                  EConnectivite theConnMode = eNOD,
228                  TErr* theErr = NULL);
229
230     //----------------------------------------------------------------------------
231     //! Read number of nodes in defined MED Mesh
232     virtual
233     TInt
234     GetNbNodes(const TMeshInfo& theMeshInfo,
235                TErr* theErr = NULL) = 0;
236     
237     virtual
238     TInt
239     GetNbNodes(const TMeshInfo& theMeshInfo,
240                ETable theTable,
241                TErr* theErr = NULL)
242     {
243       return 0;
244     }
245
246     //! Read a MEDWrapper MED Nodes representation from defined MED file
247     virtual
248     void
249     GetNodeInfo(TNodeInfo& theInfo,
250                 TErr* theErr = NULL) = 0;
251
252     //! Write the MEDWrapper MED Nodes representation into defined MED file
253     virtual 
254     void
255     SetNodeInfo(const TNodeInfo& theInfo,
256                 TErr* theErr = NULL) = 0;
257     
258     //! Creates a MEDWrapper MED Nodes representation
259     virtual 
260     PElemInfo
261     CrElemInfo(const PMeshInfo& theMeshInfo, 
262                TInt theNbElem,
263                EBooleen theIsElemNum = eVRAI,
264                EBooleen theIsElemNames = eVRAI)
265     {
266       return PElemInfo();
267     }
268
269     //! Creates a MEDWrapper MED Nodes representation
270     virtual 
271     PElemInfo
272     CrElemInfo(const PMeshInfo& theMeshInfo, 
273                TInt theNbElem,
274                const TIntVector& theFamNum,
275                const TIntVector& aElemNum,
276                const TStringVector& aElemNames)
277     {
278       return PElemInfo();
279     }
280
281     //! Creates a MEDWrapper MED Nodes representation
282     virtual
283     PNodeInfo
284     CrNodeInfo(const PMeshInfo& theMeshInfo, 
285                TInt theNbElem,
286                EModeSwitch theMode = eFULL_INTERLACE,
287                ERepere theSystem = eCART, 
288                EBooleen theIsElemNum = eVRAI,
289                EBooleen theIsElemNames = eVRAI) = 0;
290
291     //! Creates a MEDWrapper MED Nodes representation
292     virtual 
293     PNodeInfo
294     CrNodeInfo(const PMeshInfo& theMeshInfo, 
295                const TFloatVector& theNodeCoords,
296                EModeSwitch theMode = eFULL_INTERLACE,
297                ERepere theSystem = eCART, 
298                const TStringVector& theCoordNames = TStringVector(),
299                const TStringVector& theCoordUnits = TStringVector(),
300                const TIntVector& theFamilyNums = TIntVector(),
301                const TIntVector& theElemNums = TIntVector(),
302                const TStringVector& theElemNames = TStringVector()) = 0;
303     
304     //! A copy-constructor for the MEDWrapper MED Nodes representation
305     virtual
306     PNodeInfo
307     CrNodeInfo(const PMeshInfo& theMeshInfo,
308                const PNodeInfo& theInfo) = 0;
309     
310     //! Read a MEDWrapper MED Nodes representation from defined MED file
311     PNodeInfo
312     GetPNodeInfo(const PMeshInfo& theMeshInfo,
313                  TErr* theErr = NULL);
314     
315     //----------------------------------------------------------------------------
316     //! Read a MEDWrapper MED Polygones representation from defined MED file
317     /*! This feature is support only for version of 2.2 and higher */
318     virtual
319     void
320     GetPolygoneInfo(TPolygoneInfo& theInfo,
321                     TErr* theErr = NULL) 
322     {}
323
324     //! Write a MEDWrapper MED Polygones representation from defined MED file
325     /*! This feature is support only for version of 2.2 and higher */
326     virtual
327     void
328     SetPolygoneInfo(const TPolygoneInfo& theInfo,
329                     TErr* theErr = NULL) 
330     {}
331
332     //! Read number of MED Polygones in defined MED Mesh
333     /*! This feature is support only for version of 2.2 and higher */
334     virtual
335     TInt
336     GetNbPolygones(const TMeshInfo& theMeshInfo,
337                    EEntiteMaillage theEntity,
338                    EGeometrieElement theGeom,
339                    EConnectivite theConnMode = eNOD,
340                    TErr* theErr = NULL) 
341     { 
342       return 0;
343     }
344
345     //! Read connectivity infroamtion for the MED Polygones in defined MED Mesh
346     /*! This feature is support only for version of 2.2 and higher */
347     virtual
348     TInt
349     GetPolygoneConnSize(const TMeshInfo& theMeshInfo,
350                         EEntiteMaillage theEntity,
351                         EGeometrieElement theGeom,
352                         EConnectivite theConnMode = eNOD,
353                         TErr* theErr = NULL)
354     { 
355       return 0;
356     }
357     
358     //! Creates a MEDWrapper MED Polygones representation
359     /*! This feature is support only for version of 2.2 and higher */
360     virtual 
361     PPolygoneInfo
362     CrPolygoneInfo(const PMeshInfo& theMeshInfo, 
363                    EEntiteMaillage theEntity, 
364                    EGeometrieElement theGeom,
365                    TInt theNbElem,
366                    TInt theConnSize,
367                    EConnectivite theConnMode = eNOD,
368                    EBooleen theIsElemNum = eVRAI,
369                    EBooleen theIsElemNames = eVRAI)
370     {
371       return PPolygoneInfo();
372     }
373     
374     //! Creates a MEDWrapper MED Polygones representation
375     /*! This feature is support only for version of 2.2 and higher */
376     virtual
377     PPolygoneInfo 
378     CrPolygoneInfo(const PMeshInfo& theMeshInfo, 
379                    EEntiteMaillage theEntity, 
380                    EGeometrieElement theGeom,
381                    const TIntVector& theIndexes,
382                    const TIntVector& theConnectivities,
383                    EConnectivite theConnMode = eNOD,
384                    const TIntVector& theFamilyNums = TIntVector(),
385                    const TIntVector& theElemNums = TIntVector(),
386                    const TStringVector& theElemNames = TStringVector())
387     {
388       return PPolygoneInfo();
389     }
390
391     //! A copy-constructor for the MEDWrapper MED Polygones representation
392     virtual
393     PPolygoneInfo
394     CrPolygoneInfo(const PMeshInfo& theMeshInfo,
395                    const PPolygoneInfo& theInfo)
396     {
397       return PPolygoneInfo();
398     }
399     
400     //! Read a MEDWrapper MED Polygones representation from defined MED file
401     /*! This feature is support only for version of 2.2 and higher */
402     PPolygoneInfo
403     GetPPolygoneInfo(const PMeshInfo& theMeshInfo,
404                      EEntiteMaillage theEntity, 
405                      EGeometrieElement theGeom, 
406                      EConnectivite theConnMode = eNOD);
407     
408     //----------------------------------------------------------------------------
409     //! Read a MEDWrapper MED Polyedres representation from defined MED file
410     /*! This feature is support only for version of 2.2 and higher */
411     virtual 
412     void
413     GetPolyedreInfo(TPolyedreInfo& theInfo,
414                     TErr* theErr = NULL) 
415     {}
416
417     //! Write a MEDWrapper MED Polyedres representation from defined MED file
418     /*! This feature is support only for version of 2.2 and higher */
419     virtual
420     void
421     SetPolyedreInfo(const TPolyedreInfo& theInfo,
422                     TErr* theErr = NULL)
423     {}
424     
425     //! Read number of MED Polyedres in defined MED Mesh
426     /*! This feature is support only for version of 2.2 and higher */
427     virtual
428     TInt
429     GetNbPolyedres(const TMeshInfo& theMeshInfo,
430                    EEntiteMaillage theEntity,
431                    EGeometrieElement theGeom,
432                    EConnectivite theConnMode = eNOD,
433                    TErr* theErr = NULL)
434     { 
435       return 0;
436     }
437
438     //! Read connectivity infroamtion for the MED Polyedres in defined MED Mesh
439     /*! This feature is support only for version of 2.2 and higher */
440     virtual 
441     void
442     GetPolyedreConnSize(const TMeshInfo& theMeshInfo,
443                         TInt& theNbFaces,
444                         TInt& theConnSize,
445                         EConnectivite theConnMode = eNOD,
446                         TErr* theErr = NULL)
447     {
448       theNbFaces = theConnSize = 0;
449     }
450     
451     virtual
452     PPolyedreInfo
453     CrPolyedreInfo(const PMeshInfo& theMeshInfo, 
454                    EEntiteMaillage theEntity, 
455                    EGeometrieElement theGeom,
456                    TInt theNbElem,
457                    TInt theNbFaces,
458                    TInt theConnSize,
459                    EConnectivite theConnMode = eNOD,
460                    EBooleen theIsElemNum = eVRAI,
461                    EBooleen theIsElemNames = eVRAI)
462     {
463       return PPolyedreInfo();
464     }
465     
466     //! Creates a MEDWrapper MED Polyedres representation
467     /*! This feature is support only for version of 2.2 and higher */
468     virtual
469     PPolyedreInfo
470     CrPolyedreInfo(const PMeshInfo& theMeshInfo, 
471                    EEntiteMaillage theEntity, 
472                    EGeometrieElement theGeom,
473                    const TIntVector& theIndexes,
474                    const TIntVector& theFaces,
475                    const TIntVector& theConnectivities,
476                    EConnectivite theConnMode = eNOD,
477                    const TIntVector& theFamilyNums = TIntVector(),
478                    const TIntVector& theElemNums = TIntVector(),
479                    const TStringVector& theElemNames = TStringVector())
480     {
481       return PPolyedreInfo();
482     }
483
484     //! A copy-constructor for the MEDWrapper MED Polyedres representation
485     virtual
486     PPolyedreInfo
487     CrPolyedreInfo(const PMeshInfo& theMeshInfo,
488                    const PPolyedreInfo& theInfo)
489     {
490       return PPolyedreInfo();
491     }
492     
493     //! Read a MEDWrapper MED Polyedres representation from defined MED file
494     /*! This feature is support only for version of 2.2 and higher */
495     PPolyedreInfo
496     GetPPolyedreInfo(const PMeshInfo& theMeshInfo,
497                      EEntiteMaillage theEntity, 
498                      EGeometrieElement theGeom, 
499                      EConnectivite theConnMode = eNOD);
500     
501     //----------------------------------------------------------------------------
502     //! Get TEntityInfo which contains brief information about existing cells and their destribution among MED ENTITIES
503     virtual
504     TEntityInfo
505     GetEntityInfo(const TMeshInfo& theMeshInfo,
506                   EConnectivite theConnMode = eNOD,
507                   TErr* theErr = NULL) = 0;
508     
509     //! Read number of cells for defined MED Mesh, ENTITY and geometrical type with define mode of connectivity
510     virtual
511     TInt
512     GetNbCells(const TMeshInfo& theMeshInfo, 
513                EEntiteMaillage theEntity, 
514                EGeometrieElement theGeom, 
515                EConnectivite theConnMode = eNOD,
516                TErr* theErr = NULL) = 0;
517     
518     //! Read a MEDWrapper MED Cells representation from defined MED file
519     virtual
520     void
521     GetCellInfo(TCellInfo& theInfo,
522                 TErr* theErr = NULL) = 0;
523     
524     //! Write the MEDWrapper MED Cells representation into defined MED file
525     virtual 
526     void
527     SetCellInfo(const TCellInfo& theInfo,
528                 TErr* theErr = NULL) = 0;
529     
530     //! Creates a MEDWrapper MED Cells representation
531     virtual
532     PCellInfo
533     CrCellInfo(const PMeshInfo& theMeshInfo, 
534                EEntiteMaillage theEntity, 
535                EGeometrieElement theGeom,
536                TInt theNbElem,
537                EConnectivite theConnMode = eNOD,
538                EBooleen theIsElemNum = eVRAI,
539                EBooleen theIsElemNames = eVRAI,
540                EModeSwitch theMode = eFULL_INTERLACE) = 0;
541     
542     //! Creates a MEDWrapper MED Cells representation
543     virtual
544     PCellInfo
545     CrCellInfo(const PMeshInfo& theMeshInfo, 
546                EEntiteMaillage theEntity, 
547                EGeometrieElement theGeom,
548                const TIntVector& theConnectivities,
549                EConnectivite theConnMode = eNOD,
550                const TIntVector& theFamilyNums = TIntVector(),
551                const TIntVector& theElemNums = TIntVector(),
552                const TStringVector& theElemNames = TStringVector(),
553                EModeSwitch theMode = eFULL_INTERLACE) = 0;
554     
555     //! A copy-constructor for the MEDWrapper MED Cells representation
556     virtual
557     PCellInfo
558     CrCellInfo(const PMeshInfo& theMeshInfo,
559                const PCellInfo& theInfo) = 0;
560     
561     //! Read a MEDWrapper MED Cells representation from defined MED file
562     PCellInfo
563     GetPCellInfo(const PMeshInfo& theMeshInfo,
564                  EEntiteMaillage theEntity, 
565                  EGeometrieElement theGeom, 
566                  EConnectivite theConnMode = eNOD,
567                  TErr* theErr = NULL);
568
569
570     //----------------------------------------------------------------------------
571     //! Read number of MED FIELDS in defined MED Mesh
572     virtual 
573     TInt
574     GetNbFields(TErr* theErr = NULL) = 0;
575     
576     //! Read number of components for the defined MED FIELD by its order number
577     virtual
578     TInt
579     GetNbComp(TInt theFieldId,
580               TErr* theErr = NULL) = 0;
581     
582     //! Read MEDWrapper MED FIELD representation by its order number
583     virtual 
584     void
585     GetFieldInfo(TInt theFieldId, 
586                  TFieldInfo& theInfo,
587                  TErr* theErr = NULL) = 0;
588
589     //! Write MEDWrapper MED FIELD representation into defined MED file
590     virtual 
591     void
592     SetFieldInfo(const TFieldInfo& theInfo,
593                  TErr* theErr = NULL) = 0;
594     
595
596     //! Creates a MEDWrapper MED FIELD representation
597     virtual 
598     PFieldInfo
599     CrFieldInfo(const PMeshInfo& theMeshInfo, 
600                 TInt theNbComp = 0,
601                 ETypeChamp theType = eFLOAT64,
602                 const std::string& theValue = "",
603                 EBooleen theIsLocal = eVRAI,
604                 TInt theNbRef = 1) = 0;
605
606     //! A copy-constructor for the MEDWrapper MED FIELD representation
607     virtual 
608     PFieldInfo
609     CrFieldInfo(const PMeshInfo& theMeshInfo,
610                 const PFieldInfo& theInfo) = 0;
611     
612     //! Read a MEDWrapper MED FIELD representation from defined MED file
613     PFieldInfo
614     GetPFieldInfo(const PMeshInfo& theMeshInfo, 
615                   TInt theId,
616                   TErr* theErr = NULL);
617
618
619     //----------------------------------------------------------------------------
620     //! Read number of MED GAUSS in defined MED Mesh
621     /*! This feature is support only for version of 2.2 and higher */
622     virtual 
623     TInt
624     GetNbGauss(TErr* theErr = NULL)
625     { 
626       return TInt();
627     }
628
629     //! Read brief MED GAUSS information by its order number from defined MED Mesh
630     /*! This feature is support only for version of 2.2 and higher */
631     virtual 
632     TGaussInfo::TInfo
633     GetGaussPreInfo(TInt theId, 
634                     TErr* theErr = NULL)
635     {
636       return TGaussInfo::TInfo( TGaussInfo::TKey(ePOINT1,""),0 );
637     }
638     
639     //! Read a MEDWrapper MED GAUSS representation by its order number from defined MED file
640     /*! This feature is support only for version of 2.2 and higher */
641     virtual 
642     void
643     GetGaussInfo(TInt theId, 
644                  TGaussInfo& theInfo,
645                  TErr* theErr = NULL)
646     {}
647
648     //! Creates a MEDWrapper MED GAUSS representation
649     /*! This feature is support only for version of 2.2 and higher */
650     virtual
651     PGaussInfo
652     CrGaussInfo(const TGaussInfo::TInfo& theInfo,
653                 EModeSwitch theMode = eFULL_INTERLACE) = 0;
654
655
656     //----------------------------------------------------------------------------
657     //! Read number of MED TIMESTAMPS in defined MED Mesh
658     /*!
659       By the way some additional information can be obtained:
660       - to what MED ENTITY the MED TIMESTAMP conntected to;
661       - on what geometrical types the MED TIMESTAMP defined to.
662     */
663     virtual 
664     TInt
665     GetNbTimeStamps(const TFieldInfo& theInfo, 
666                     const TEntityInfo& theEntityInfo,
667                     EEntiteMaillage& theEntity,
668                     TGeom2Size& theGeom2Size,
669                     TErr* theErr = NULL) = 0;
670     
671     //! Read MEDWrapper MED TIMESTAMP representation by its order number
672     virtual 
673     void
674     GetTimeStampInfo(TInt theTimeStampId, 
675                      TTimeStampInfo& theInfo,
676                      TErr* theErr = NULL) = 0;
677
678     //! Creates a MEDWrapper MED TIMESTAMP representation
679     virtual 
680     PTimeStampInfo
681     CrTimeStampInfo(const PFieldInfo& theFieldInfo, 
682                     EEntiteMaillage theEntity,
683                     const TGeom2Size& theGeom2Size,
684                     const TGeom2NbGauss& theGeom2NbGauss = TGeom2NbGauss(),
685                     TInt theNumDt = 0,
686                     TInt theNumOrd = 0,
687                     TFloat theDt = 0,
688                     const std::string& theUnitDt = "",
689                     const TGeom2Gauss& theGeom2Gauss = TGeom2Gauss()) = 0;
690
691     //! A copy-constructor for the MEDWrapper MED TIMESTAMP representation
692     virtual 
693     PTimeStampInfo 
694     CrTimeStampInfo(const PFieldInfo& theFieldInfo,
695                     const PTimeStampInfo& theInfo) = 0;
696     
697     //! Read MEDWrapper MED TIMESTAMP representation by its order number
698     PTimeStampInfo
699     GetPTimeStampInfo(const PFieldInfo& theFieldInfo,
700                       EEntiteMaillage theEntity,
701                       const TGeom2Size& theGeom2Size,
702                       TInt theId,
703                       TErr* theErr = NULL);
704     
705
706     //----------------------------------------------------------------------------
707     //! Read number of MED PROFILES in defined MED Mesh
708     virtual 
709     TInt
710     GetNbProfiles(TErr* theErr = NULL) = 0;
711
712     //! Read brief MED PROFILE information by its order number from defined MED Mesh
713     virtual 
714     TProfileInfo::TInfo
715     GetProfilePreInfo(TInt theId, 
716                       TErr* theErr = NULL) = 0;
717
718     //! Read a MEDWrapper MED PROFILE representation by its order number from defined MED file
719     virtual 
720     void
721     GetProfileInfo(TInt theId, 
722                    TProfileInfo& theInfo,
723                    TErr* theErr = NULL) = 0;
724
725     //! Creates a MEDWrapper MED PROFILE representation
726     virtual
727     PProfileInfo
728     CrProfileInfo(const TProfileInfo::TInfo& theInfo,
729                   EModeProfil theMode = eCOMPACT) = 0;
730
731     //! Write a MEDWrapper MED PROFILE representation
732     virtual
733     void
734     SetProfileInfo(const TProfileInfo& theInfo,
735                    TErr* theErr = NULL) = 0;
736
737     //! Read a MEDWrapper MED PROFILE representation by its order number from defined MED file
738     PProfileInfo
739     GetPProfileInfo(TInt theId,
740                     EModeProfil theMode = eCOMPACT,
741                     TErr* theErr = NULL);
742
743
744     //----------------------------------------------------------------------------
745     //! Read the values for MEDWrapper MED TIEMSTAMP from defined MED file
746     virtual 
747     void
748     GetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
749                       const TMKey2Profile& theMKey2Profile,
750                       const TKey2Gauss& theKey2Gauss,
751                       TErr* theErr = NULL) = 0;
752     
753     //! Write the values for MEDWrapper MED TIEMSTAMP to defined MED file
754     virtual 
755     void
756     SetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
757                       TErr* theErr = NULL) = 0;
758     
759     //! Creates the values for MEDWrapper MED TIEMSTAMP representation
760     virtual
761     PTimeStampValueBase
762     CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
763                      ETypeChamp theTypeChamp,
764                      const TGeom2Profile& theGeom2Profile = TGeom2Profile(),
765                      EModeSwitch theMode = eFULL_INTERLACE) = 0;
766
767     //! Creates the values for MEDWrapper MED TIEMSTAMP representation
768     virtual
769     PTimeStampValueBase
770     CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
771                      const TGeom2Profile& theGeom2Profile = TGeom2Profile(),
772                      EModeSwitch theMode = eFULL_INTERLACE);
773
774     //! A copy-constructor for the values for MEDWrapper MED TIEMSTAMP representation
775     virtual 
776     PTimeStampValueBase
777     CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
778                      const PTimeStampValueBase& theInfo,
779                      ETypeChamp theTypeChamp) = 0;
780     
781     //! A copy-constructor for the values for MEDWrapper MED TIEMSTAMP representation
782     virtual 
783     PTimeStampValueBase
784     CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
785                      const PTimeStampValueBase& theInfo);
786     
787     //! Read the values for MEDWrapper MED TIEMSTAMP from defined MED file
788     PTimeStampValueBase
789     GetPTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
790                        const TMKey2Profile& theMKey2Profile,
791                        const TKey2Gauss& theKey2Gauss,
792                        TErr* theErr = NULL);
793     
794     //----------------------------------------------------------------------------
795     // Backward compatibility  declarations
796     //! Read the values for MEDWrapper MED TIEMSTAMP from defined MED file
797     virtual 
798     void
799     GetTimeStampVal(const PTimeStampVal& theVal,
800                     const TMKey2Profile& theMKey2Profile,
801                     const TKey2Gauss& theKey2Gauss,
802                     TErr* theErr = NULL);
803     
804     //! Write the values for MEDWrapper MED TIEMSTAMP to defined MED file
805     virtual 
806     void
807     SetTimeStamp(const PTimeStampVal& theVal,
808                  TErr* theErr = NULL);
809     
810     //! Creates the values for MEDWrapper MED TIEMSTAMP representation
811     virtual
812     PTimeStampVal
813     CrTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
814                    const TGeom2Profile& theGeom2Profile = TGeom2Profile(),
815                    EModeSwitch theMode = eFULL_INTERLACE);
816
817     //! A copy-constructor for the values for MEDWrapper MED TIEMSTAMP representation
818     virtual 
819     PTimeStampVal
820     CrTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
821                    const PTimeStampVal& theInfo);
822     
823     //! Read the values for MEDWrapper MED TIEMSTAMP from defined MED file
824     PTimeStampVal
825     GetPTimeStampVal(const PTimeStampInfo& theTimeStampInfo,
826                      const TMKey2Profile& theMKey2Profile,
827                      const TKey2Gauss& theKey2Gauss,
828                      TErr* theErr = NULL);
829
830     //----------------------------------------------------------------------------
831     //! Read a MEDWrapper MED Grille representation from defined MED file
832     /*! This feature is support only for version of 2.2 and higher */
833     PGrilleInfo
834     GetPGrilleInfo(const PMeshInfo& theMeshInfo);
835
836     //! Read a MEDWrapper MED Grille representation from defined MED file
837     /*! This feature is support only for version of 2.2 and higher */
838     PGrilleInfo
839     GetPGrilleInfo(const PMeshInfo& theMeshInfo,
840                    const PGrilleInfo& theInfo);
841
842     //! Read a MEDWrapper MED Grille representation from defined MED file
843     /*! This feature is support only for version of 2.2 and higher */
844     virtual
845     void
846     GetGrilleInfo(TGrilleInfo& theInfo,
847                   TErr* theErr = NULL)
848     {}
849
850     //! Write the MEDWrapper MED Grille representation into defined MED file
851     /*! This feature is support only for version of 2.2 and higher */
852     virtual 
853     void
854     SetGrilleInfo(const TGrilleInfo& theInfo,
855                   TErr* theErr = NULL)
856     {}
857
858     /*! This feature is support only for version of 2.2 and higher */
859     virtual
860     PGrilleInfo
861     CrGrilleInfo(const PMeshInfo& theMeshInfo,
862                  const PGrilleInfo& theGrilleInfo)
863     {
864       return PGrilleInfo();
865     }
866
867     /*! This feature is support only for version of 2.2 and higher */
868     virtual
869     PGrilleInfo
870     CrGrilleInfo(const PMeshInfo& theMeshInfo)
871     {
872       return PGrilleInfo();
873     }
874     
875     /*! This feature is support only for version of 2.2 and higher */
876     virtual
877     PGrilleInfo
878     CrGrilleInfo(const PMeshInfo& theMeshInfo,
879                  const EGrilleType& type)
880     {
881       return PGrilleInfo();
882     }
883     
884     /*! This feature is support only for version of 2.2 and higher */
885     virtual
886     PGrilleInfo
887     CrGrilleInfo(const PMeshInfo& theMeshInfo,
888                  const EGrilleType& type,
889                  const TInt& nbNodes)
890     {
891       return PGrilleInfo();
892     }
893
894     /*! This feature is support only for version of 2.2 and higher */
895     virtual
896     PGrilleInfo
897     CrGrilleInfo(const PMeshInfo& theMeshInfo,
898                  const EGrilleType& type,
899                  const MED::TIntVector& nbNodeVec)
900     {
901       return PGrilleInfo();
902     }
903
904     /*! This feature is support only for version of 2.2 and higher */
905     virtual
906     void
907     GetGrilleType(const TMeshInfo& theMeshInfo,
908                   EGrilleType& type,
909                   TErr* theErr = NULL)
910     {
911     }
912     
913   };
914
915
916   //----------------------------------------------------------------------------
917   //! This class provide thread-safety for MEDWrapper interaction
918   class MEDWRAPPER_EXPORT TLockProxy
919   {
920     TLockProxy& operator=(const TLockProxy& );
921     TWrapper* myWrapper;
922
923   public:
924     TLockProxy(TWrapper* theWrapper);
925
926     ~TLockProxy();
927
928     TWrapper * operator-> () const;
929   };
930
931
932   //----------------------------------------------------------------------------
933   //! To specialize the SharedPtr for TWrapper
934   template<> 
935   class MEDWRAPPER_EXPORT SharedPtr<TWrapper>: public boost::shared_ptr<TWrapper>
936   {
937   public:
938     SharedPtr() {}
939
940     template<class Y>
941     explicit SharedPtr(Y * p): 
942       boost::shared_ptr<TWrapper>(p) 
943     {}
944
945     template<class Y>
946     SharedPtr(SharedPtr<Y> const & r):
947       boost::shared_ptr<TWrapper>(r,boost::detail::dynamic_cast_tag())
948     {}
949
950     template<class Y>
951     SharedPtr& 
952     operator=(SharedPtr<Y> const & r)
953     {
954       boost::shared_ptr<TWrapper>(r,boost::detail::dynamic_cast_tag()).swap(*this);
955       return *this;
956     }
957
958     template<class Y> 
959     SharedPtr& 
960     operator()(Y * p) // Y must be complete
961     {
962       return operator=<Y>(SharedPtr<Y>(p));
963     }
964
965     template<class Y> 
966     SharedPtr& 
967     operator()(SharedPtr<Y> const & r) // Y must be complete
968     {
969       return operator=<Y>(SharedPtr<Y>(r));
970     }
971
972     TLockProxy operator-> () const // never throws
973     {
974       return TLockProxy(this->get());
975     }
976     
977   protected:
978     operator const TWrapper& () const;
979
980     operator TWrapper& ();
981
982     TWrapper& operator* () const;
983
984     TWrapper * get() const // never throws
985     {
986       return boost::shared_ptr<TWrapper>::get();
987     }
988   };
989
990   //----------------------------------------------------------------------------
991   typedef SharedPtr<TWrapper> PWrapper;
992 }
993
994 #endif