Salome HOME
GPUSPHGUI: show a custom control by setting a functor
[modules/smesh.git] / src / MEDWrapper / V2_2 / MED_V2_2_Wrapper.cxx
index 7222232044f7141f99f79907c79d7c8302c37696..d97a232a12a881b04427759f5647297967018d8f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -26,6 +26,7 @@
 
 #include <med.h>
 #include <med_err.h>
+#include <med_proto.h>
 
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
@@ -99,11 +100,14 @@ namespace MED
       TFile(const TFile&);
       
     public:
-      TFile(const std::string& theFileName): 
+      TFile(const std::string& theFileName, TInt theMinor=-1):
         myCount(0),
         myFid(0), 
-        myFileName(theFileName)
-      {}
+        myFileName(theFileName),
+        myMinor(theMinor)
+      {
+        if ((myMinor < 0) || (myMinor > MED_MINOR_NUM)) myMinor = MED_MINOR_NUM;
+      }
       
       ~TFile()
       { 
@@ -115,12 +119,12 @@ namespace MED
       {
         if(myCount++ == 0){
           const char* aFileName = myFileName.c_str();
-          myFid = MEDfileOpen(aFileName,med_access_mode(theMode));
+          myFid = MEDfileVersionOpen(aFileName,med_access_mode(theMode), MED_MAJOR_NUM, myMinor, MED_RELEASE_NUM);
         }
         if(theErr)
           *theErr = TErr(myFid);
         else if(myFid < 0)
-          EXCEPTION(std::runtime_error,"TFile - MEDfileOpen('"<<myFileName<<"',"<<theMode<<")");
+          EXCEPTION(std::runtime_error,"TFile - MEDfileVersionOpen('"<<myFileName<<"',"<<theMode<<"',"<< MED_MAJOR_NUM<<"',"<< myMinor<<"',"<< MED_RELEASE_NUM<<")");
       }
 
       const TIdt& Id() const 
@@ -140,6 +144,7 @@ namespace MED
       TInt myCount;
       TIdt myFid;
       std::string myFileName;
+      TInt myMinor;
     };
 
 
@@ -147,14 +152,17 @@ namespace MED
     class TFileWrapper
     {
       PFile myFile;
+      TInt myMinor;
 
     public:
-      TFileWrapper(const PFile& theFile, EModeAcces theMode, TErr* theErr = NULL): 
-        myFile(theFile)
+      TFileWrapper(const PFile& theFile, EModeAcces theMode, TErr* theErr = NULL, TInt theMinor=-1):
+        myFile(theFile),
+        myMinor(theMinor)
       {
+        if (myMinor < 0) myMinor = MED_MINOR_NUM;
         myFile->Open(theMode,theErr);
       }
-      
+
       ~TFileWrapper()
       {
         myFile->Close();
@@ -163,17 +171,29 @@ namespace MED
 
 
     //---------------------------------------------------------------
-    TVWrapper::TVWrapper(const std::string& theFileName): 
-      myFile(new TFile(theFileName))
-    {}
-    
-    
+    TVWrapper::TVWrapper(const std::string& theFileName, TInt theMinor):
+      myFile(new TFile(theFileName, theMinor)),
+      myMinor(theMinor)
+    {
+      TErr aRet;
+      myFile->Open( eLECTURE_ECRITURE, &aRet );
+      if(aRet < 0) {
+        myFile->Close();
+        myFile->Open( eLECTURE, &aRet );
+      }
+      if(aRet < 0) {
+        myFile->Close();
+        myFile->Open( eCREATION, &aRet );
+      }
+    }
+
+
     //----------------------------------------------------------------------------
     TInt
     TVWrapper
     ::GetNbMeshes(TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return -1;
@@ -189,7 +209,7 @@ namespace MED
                   MED::TMeshInfo& theInfo,
                   TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return;
@@ -232,7 +252,7 @@ namespace MED
                   EModeAcces theMode,
                   TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,theMode,theErr);
+      TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return;
@@ -301,7 +321,7 @@ namespace MED
     ::GetNbFamilies(const MED::TMeshInfo& theInfo,
                     TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return -1;
@@ -319,7 +339,7 @@ namespace MED
                    const MED::TMeshInfo& theInfo,
                    TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return -1;
@@ -339,7 +359,7 @@ namespace MED
                     const MED::TMeshInfo& theInfo,
                     TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return -1;
@@ -359,7 +379,7 @@ namespace MED
                     MED::TFamilyInfo& theInfo,
                     TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return;
@@ -402,7 +422,7 @@ namespace MED
                     EModeAcces theMode,
                     TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,theMode,theErr);
+      TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return;
@@ -461,7 +481,7 @@ namespace MED
                EGeometrieElement theGeom,
                TErr*             theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return;
@@ -499,7 +519,7 @@ namespace MED
                     EGeometrieElement theGeom,
                     TErr*             theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return;
@@ -537,7 +557,7 @@ namespace MED
                   EGeometrieElement theGeom,
                   TErr*             theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return;
@@ -598,7 +618,7 @@ namespace MED
                EGeometrieElement theGeom,
                TErr*             theErr)
     {
-      TFileWrapper aFileWrapper(myFile,theMode,theErr);
+      TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return;
@@ -654,7 +674,7 @@ namespace MED
                     EGeometrieElement theGeom,
                     TErr*             theErr)
     {
-      TFileWrapper aFileWrapper(myFile,theMode,theErr);
+      TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return;
@@ -708,7 +728,7 @@ namespace MED
                   EGeometrieElement theGeom,
                   TErr*             theErr)
     {
-      TFileWrapper aFileWrapper(myFile,theMode,theErr);
+      TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return;
@@ -746,7 +766,7 @@ namespace MED
                  ETable theTable,
                  TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return -1;
@@ -775,7 +795,7 @@ namespace MED
     ::GetNodeInfo(MED::TNodeInfo& theInfo,
                   TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return;
@@ -852,7 +872,7 @@ namespace MED
                   EModeAcces theMode,
                   TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,theMode,theErr);
+      TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return;
@@ -938,29 +958,26 @@ namespace MED
     ::GetPolygoneInfo(MED::TPolygoneInfo& theInfo,
                       TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
 
       if(theErr && *theErr < 0)
         return;
 
       MED::TMeshInfo& aMeshInfo = *theInfo.myMeshInfo;
 
-      TValueHolder<TString, char> aMeshName(aMeshInfo.myName);
-      TValueHolder<TElemNum, med_int> anIndex(theInfo.myIndex);
-      TInt aNbElem = (TInt)theInfo.myElemNum->size();
-      TValueHolder<TElemNum, med_int> aConn(theInfo.myConn);
-      TValueHolder<EEntiteMaillage, med_entity_type> anEntity(theInfo.myEntity);
+      TValueHolder<TString, char                       > aMeshName(aMeshInfo.myName);
+      TValueHolder<TElemNum, med_int                   > anIndex  (theInfo.myIndex);
+      TValueHolder<TElemNum, med_int                   > aConn    (theInfo.myConn);
+      TValueHolder<EEntiteMaillage, med_entity_type    > anEntity (theInfo.myEntity);
+      TValueHolder<EGeometrieElement, med_geometry_type> aGeom    (theInfo.myGeom);
       TValueHolder<EConnectivite, med_connectivity_mode> aConnMode(theInfo.myConnMode);
+      TInt aNbElem = (TInt)theInfo.myElemNum->size();
 
       TErr aRet;
-      aRet = MEDmeshPolygonRd(myFile->Id(),
-                              &aMeshName,
-                              MED_NO_DT,
-                              MED_NO_IT,
-                              anEntity,
-                              aConnMode,
-                              &anIndex,
-                              &aConn);
+      aRet = MEDmeshPolygon2Rd(myFile->Id(), &aMeshName,
+                               MED_NO_DT, MED_NO_IT,
+                               anEntity, aGeom,
+                               aConnMode, &anIndex, &aConn);
 
       if(theErr) 
         *theErr = aRet;
@@ -968,18 +985,18 @@ namespace MED
         EXCEPTION(std::runtime_error,"GetPolygoneInfo - MEDmeshPolygonRd(...)");
 
       if(theInfo.myIsElemNames){
-        GetNames(theInfo,aNbElem,theInfo.myEntity,ePOLYGONE,&aRet);
+        GetNames(theInfo,aNbElem,theInfo.myEntity,theInfo.myGeom,&aRet);
         if(theErr) 
           *theErr = aRet;
       }
 
       if(theInfo.myIsElemNum){
-        GetNumeration(theInfo,aNbElem,theInfo.myEntity,ePOLYGONE,&aRet);
+        GetNumeration(theInfo,aNbElem,theInfo.myEntity,theInfo.myGeom,&aRet);
         if(theErr) 
           *theErr = aRet;
       }
 
-      GetFamilies(theInfo,aNbElem,theInfo.myEntity,ePOLYGONE,&aRet);
+      GetFamilies(theInfo,aNbElem,theInfo.myEntity,theInfo.myGeom,&aRet);
       if(theErr) 
         *theErr = aRet;
     }
@@ -1000,7 +1017,7 @@ namespace MED
                       EModeAcces theMode,
                       TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,theMode,theErr);
+      TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return;
@@ -1008,37 +1025,32 @@ namespace MED
       MED::TPolygoneInfo& anInfo = const_cast<MED::TPolygoneInfo&>(theInfo);
       MED::TMeshInfo& aMeshInfo = *anInfo.myMeshInfo;
 
-      TValueHolder<TString, char> aMeshName(aMeshInfo.myName);
-      TValueHolder<TElemNum, med_int> anIndex(anInfo.myIndex);
-      TValueHolder<TElemNum, med_int> aConn(anInfo.myConn);
-      TValueHolder<EEntiteMaillage, med_entity_type> anEntity(anInfo.myEntity);
+      TValueHolder<TString, char                       > aMeshName(aMeshInfo.myName);
+      TValueHolder<TElemNum, med_int                   > anIndex  (anInfo.myIndex);
+      TValueHolder<TElemNum, med_int                   > aConn    (anInfo.myConn);
+      TValueHolder<EEntiteMaillage, med_entity_type    > anEntity (anInfo.myEntity);
+      TValueHolder<EGeometrieElement, med_geometry_type> aGeom    (anInfo.myGeom);
       TValueHolder<EConnectivite, med_connectivity_mode> aConnMode(anInfo.myConnMode);
 
-      TErr aRet = MEDmeshPolygonWr(myFile->Id(),
-                                   &aMeshName,
-                                   MED_NO_DT,
-                                   MED_NO_IT,
-                                   MED_UNDEF_DT,
-                                   anEntity,
-                                   aConnMode,
-                                   anInfo.myNbElem + 1,
-                                   &anIndex,
-                                   &aConn);
-      
-      if(theErr) 
+      TErr aRet = MEDmeshPolygon2Wr(myFile->Id(), &aMeshName,
+                                    MED_NO_DT, MED_NO_IT, MED_UNDEF_DT,
+                                    anEntity, aGeom,
+                                    aConnMode, anInfo.myNbElem + 1,
+                                    &anIndex, &aConn);
+      if(theErr)
         *theErr = aRet;
       else if(aRet < 0)
         EXCEPTION(std::runtime_error,"SetPolygoneInfo - MEDmeshPolygonWr(...)");
       
-      SetNames(anInfo,theInfo.myEntity,ePOLYGONE,&aRet);
+      SetNames(anInfo,theInfo.myEntity,anInfo.myGeom,&aRet);
       if(theErr) 
         *theErr = aRet;
       
-      SetNumeration(anInfo,theInfo.myEntity,ePOLYGONE,&aRet);
+      SetNumeration(anInfo,theInfo.myEntity,anInfo.myGeom,&aRet);
       if(theErr) 
         *theErr = aRet;
       
-      SetFamilies(anInfo,theInfo.myEntity,ePOLYGONE,&aRet);
+      SetFamilies(anInfo,theInfo.myEntity,anInfo.myGeom,&aRet);
       if(theErr) 
         *theErr = aRet;
     }
@@ -1064,7 +1076,7 @@ namespace MED
                           EConnectivite theConnMode,
                           TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
 
       if(theErr && *theErr < 0)
         return 0;
@@ -1079,7 +1091,7 @@ namespace MED
                              MED_NO_DT,
                              MED_NO_IT,
                              med_entity_type(theEntity),
-                             MED_POLYGON,
+                             med_geometry_type(theGeom),
                              MED_CONNECTIVITY,
                              med_connectivity_mode(theConnMode),
                              &chgt,
@@ -1098,7 +1110,7 @@ namespace MED
     ::GetPolyedreInfo(TPolyedreInfo& theInfo,
                       TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
 
       if(theErr && *theErr < 0)
         return;
@@ -1161,7 +1173,7 @@ namespace MED
                       EModeAcces theMode,
                       TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,theMode,theErr);
+      TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return;
@@ -1265,7 +1277,7 @@ namespace MED
                           EConnectivite theConnMode,
                           TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
 
       if(theErr && *theErr < 0) 
         EXCEPTION(std::runtime_error,"GetPolyedreConnSize - (...)");
@@ -1314,7 +1326,7 @@ namespace MED
     {
       TEntityInfo anInfo;
       
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return anInfo;
@@ -1415,18 +1427,16 @@ namespace MED
       }
       return anInfo;
     }
-    
-    
+
+
     //-----------------------------------------------------------------
-    TInt
-    TVWrapper
-    ::GetNbCells(const MED::TMeshInfo& theMeshInfo, 
-                 EEntiteMaillage theEntity, 
-                 EGeometrieElement theGeom, 
-                 EConnectivite theConnMode,
-                 TErr* theErr)
+    TInt TVWrapper::GetNbCells(const MED::TMeshInfo& theMeshInfo,
+                               EEntiteMaillage theEntity,
+                               EGeometrieElement theGeom,
+                               EConnectivite theConnMode,
+                               TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
 
       if(theErr && *theErr < 0)
         return -1;
@@ -1434,48 +1444,50 @@ namespace MED
       MED::TMeshInfo& aMeshInfo = const_cast<MED::TMeshInfo&>(theMeshInfo);
       TValueHolder<TString, char> aMeshName(aMeshInfo.myName);
       med_bool chgt,trsf;
-      if(theGeom!=MED::ePOLYGONE && theGeom!=MED::ePOLYEDRE && theGeom != MED::eBALL)
+      switch ( theGeom )
       {
-        return MEDmeshnEntity(myFile->Id(),
-                              &aMeshName,
-                              MED_NO_DT,
-                              MED_NO_IT,
-                              med_entity_type(theEntity),
-                              med_geometry_type(theGeom),
-                              MED_CONNECTIVITY,
-                              med_connectivity_mode(theConnMode),
-                              &chgt,
-                              &trsf);
-      }
-      else if(theGeom==MED::ePOLYGONE)
+      case MED::ePOLYGONE:
+      case MED::ePOLYGON2:
       {
-        return MEDmeshnEntity(myFile->Id(),&aMeshName,MED_NO_DT,MED_NO_IT,med_entity_type(theEntity),
-                              MED_POLYGON,MED_INDEX_NODE,med_connectivity_mode(theConnMode),&chgt,&trsf)-1;
+        return MEDmeshnEntity(myFile->Id(),&aMeshName,
+                              MED_NO_DT,MED_NO_IT,
+                              med_entity_type(theEntity),med_geometry_type(theGeom),
+                              MED_INDEX_NODE,med_connectivity_mode(theConnMode),
+                              &chgt,&trsf)-1;
       }
-      else if ( theGeom==MED::ePOLYEDRE )
+      case MED::ePOLYEDRE:
       {
-        return MEDmeshnEntity(myFile->Id(),&aMeshName,MED_NO_DT,MED_NO_IT,med_entity_type(theEntity),
-                              MED_POLYHEDRON,MED_INDEX_FACE,med_connectivity_mode(theConnMode),&chgt,&trsf)-1;
+        return MEDmeshnEntity(myFile->Id(),&aMeshName,
+                              MED_NO_DT,MED_NO_IT,
+                              med_entity_type(theEntity),MED_POLYHEDRON,
+                              MED_INDEX_FACE,med_connectivity_mode(theConnMode),
+                              &chgt,&trsf)-1;
       }
-      else if ( theGeom==MED::eBALL )
+      case MED::eBALL:
       {
         return GetNbBalls( theMeshInfo );
       }
+      default:
+      {
+        return MEDmeshnEntity(myFile->Id(),&aMeshName,
+                              MED_NO_DT,MED_NO_IT,
+                              med_entity_type(theEntity),med_geometry_type(theGeom),
+                              MED_CONNECTIVITY,med_connectivity_mode(theConnMode),
+                              &chgt,&trsf);
+      }
+      }
       return 0;
     }
 
 
     //----------------------------------------------------------------------------
-    void
-    TVWrapper
-    ::GetCellInfo(MED::TCellInfo& theInfo,
-                  TErr* theErr)
+    void TVWrapper::GetCellInfo(MED::TCellInfo& theInfo, TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
 
       if(theErr && *theErr < 0)
         return;
-      
+
       MED::TMeshInfo& aMeshInfo = *theInfo.myMeshInfo;
 
       TValueHolder<TString, char>                        aMeshName    (aMeshInfo.myName);
@@ -1530,7 +1542,7 @@ namespace MED
                   EModeAcces theMode,
                   TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,theMode,theErr);
+      TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return;
@@ -1611,7 +1623,8 @@ namespace MED
     //! Read geom type of MED_BALL structural element
     EGeometrieElement TVWrapper::GetBallGeom(const TMeshInfo& theMeshInfo)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE);
+      TErr anError;
+      TFileWrapper aFileWrapper(myFile, eLECTURE, &anError, myMinor);
 
       // read med_geometry_type of "MED_BALL" element
       char geotypename[ MED_NAME_SIZE + 1] = MED_BALL_NAME;
@@ -1622,7 +1635,8 @@ namespace MED
     //! Read number of balls in the Mesh
     TInt TVWrapper::GetNbBalls(const TMeshInfo& theMeshInfo)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE);
+      TErr anError;
+      TFileWrapper aFileWrapper(myFile, eLECTURE, &anError, myMinor);
 
       EGeometrieElement ballType = GetBallGeom( theMeshInfo );
       if ( ballType < 0 )
@@ -1635,7 +1649,7 @@ namespace MED
     //! Read a MEDWrapped representation of MED_BALL from the MED file
     void TVWrapper::GetBallInfo(TBallInfo& theInfo, TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
 
       // check geometry of MED_BALL
       if ( theInfo.myGeom == eBALL )
@@ -1674,7 +1688,7 @@ namespace MED
     //! Write a MEDWrapped representation of MED_BALL to the MED file
     void  TVWrapper::SetBallInfo(const TBallInfo& theInfo, EModeAcces theMode, TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,theMode,theErr);
+      TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
 
       TErr ret;
       char ballsupportname[MED_NAME_SIZE+1]="BALL_SUPPORT_MESH";
@@ -1762,7 +1776,7 @@ namespace MED
     TVWrapper
     ::GetNbFields(TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return -1;
@@ -1777,7 +1791,7 @@ namespace MED
     ::GetNbComp(TInt theFieldId,
                 TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return -1;
@@ -1793,7 +1807,7 @@ namespace MED
                    MED::TFieldInfo& theInfo,
                    TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return;
@@ -1843,7 +1857,7 @@ namespace MED
                    EModeAcces theMode,
                    TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,theMode,theErr);
+      TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return;
@@ -1895,7 +1909,7 @@ namespace MED
     TVWrapper
     ::GetNbGauss(TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return -1;
@@ -1910,7 +1924,7 @@ namespace MED
     ::GetGaussPreInfo(TInt theId, 
                       TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
 
       if(theErr && *theErr < 0)
         return TGaussInfo::TInfo( TGaussInfo::TKey(ePOINT1,""),0 );
@@ -1951,7 +1965,7 @@ namespace MED
                    TGaussInfo& theInfo,
                    TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return;
@@ -1982,7 +1996,7 @@ namespace MED
     TVWrapper
     ::GetNbProfiles(TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return -1;
@@ -1995,7 +2009,7 @@ namespace MED
     ::GetProfilePreInfo(TInt theId, 
                         TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
 
       if(theErr && *theErr < 0)
         return TProfileInfo::TInfo();
@@ -2022,7 +2036,7 @@ namespace MED
                      TProfileInfo& theInfo,
                      TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return;
@@ -2047,7 +2061,7 @@ namespace MED
                      EModeAcces          theMode,
                      TErr*               theErr)
     {
-      TFileWrapper aFileWrapper(myFile,theMode,theErr);
+      TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return;
@@ -2095,7 +2109,7 @@ namespace MED
                       TErr* theErr)
     {
       theEntity = EEntiteMaillage(-1);
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
 
       if(theErr){
         if(theEntityInfo.empty())
@@ -2218,7 +2232,7 @@ namespace MED
                        MED::TTimeStampInfo& theInfo,
                        TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
       
       const TGeom2Size& aGeom2Size = theInfo.myGeom2Size;
       
@@ -2313,7 +2327,7 @@ namespace MED
                         const TKey2Gauss& theKey2Gauss,
                         TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return;
@@ -2481,7 +2495,7 @@ namespace MED
                         EModeAcces theMode,
                         TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,theMode,theErr);
+      TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
       
       if(theErr && *theErr < 0)
         return;
@@ -2591,7 +2605,7 @@ namespace MED
     {
       if(theInfo.myMeshInfo->myType != eSTRUCTURE)
         return;
-      TFileWrapper aFileWrapper(myFile,theMode,theErr);
+      TFileWrapper aFileWrapper(myFile,theMode,theErr, myMinor);
       
       if(theErr && *theErr < 0)
           return;
@@ -2668,7 +2682,7 @@ namespace MED
     ::GetGrilleInfo(TGrilleInfo& theInfo,
                     TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
 
       if(theErr && *theErr < 0)
           return;
@@ -2732,7 +2746,7 @@ namespace MED
       }
 
       if(aMaillageType == eSTRUCTURE && aGrilleType != eGRILLE_STANDARD){
-        ETable aTable;
+        ETable aTable = eCOOR_IND1;
         for(med_int anAxis = 1; anAxis <= aMeshInfo.myDim; anAxis++){
           switch(anAxis){
           case 1 :
@@ -2824,7 +2838,7 @@ namespace MED
                     EGrilleType& theGridType,
                     TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
 
       if(theErr && *theErr < 0)
         EXCEPTION(std::runtime_error," GetGrilleType - aFileWrapper (...)");
@@ -2849,7 +2863,7 @@ namespace MED
                       TIntVector& theStruct,
                       TErr* theErr)
     {
-      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr);
+      TFileWrapper aFileWrapper(myFile,eLECTURE,theErr, myMinor);
       
       if(theErr && *theErr < 0)
           return;
@@ -2871,5 +2885,5 @@ namespace MED
         EXCEPTION(std::runtime_error,"GetGrilleInfo - MEDmeshGridStructRd(...)");
     }
 
-  }  
+  }
 }