Salome HOME
Merge branch 'OCCT780'
[modules/smesh.git] / src / MEDWrapper / MED_Wrapper.cxx
index ad18d170c40a6d67674b5eff553d808de7529215..1510e3c04ebdad1f24f2d35a0175e5a82e64c44d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 
 #include <boost/version.hpp>
 
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-static int MYVALUEDEBUG = 0;
-#else
-// static int MYDEBUG = 0;      // unused in release mode
-// static int MYVALUEDEBUG = 0; // unused in release mode
-#endif
-
 namespace MED
 {
   //---------------------------------------------------------------
@@ -56,13 +48,13 @@ namespace MED
 #else
     boost::detail::thread::lock_ops<TWrapper::TMutex>::lock(myWrapper->myMutex);
 #endif
-    INITMSG(MYDEBUG, "TLockProxy() - this -"<<this<<"; myWrapper = "<<myWrapper<<std::endl);
+    INITMSG("TLockProxy() - this -"<<this<<"; myWrapper = "<<myWrapper<<std::endl);
   }
 
   TLockProxy
   ::~TLockProxy()
   {
-    INITMSG(MYDEBUG, "~TLockProxy() - this -"<<this<<"; myWrapper = "<<myWrapper<<std::endl);
+    INITMSG("~TLockProxy() - this -"<<this<<"; myWrapper = "<<myWrapper<<std::endl);
 #if BOOST_VERSION >= 103500
     myWrapper->myMutex.unlock();
 #else
@@ -147,9 +139,9 @@ namespace MED
 
   public:
     TFileWrapper(const PFileInternal& theFile,
-                 EModeAcces theMode,
-                 TErr* theErr = NULL,
-                 TInt theMinor=-1):
+                 EModeAcces           theMode,
+                 TErr*                theErr = NULL,
+                 TInt                 theMinor=-1):
       myFile(theFile),
       myMinor(theMinor)
     {
@@ -168,7 +160,7 @@ namespace MED
   void
   Print(SharedPtr<TimeStampValueType> theTimeStampValue)
   {
-    INITMSG(MYDEBUG,"Print - TimeStampValue\n");
+    INITMSG("Print - TimeStampValue\n");
     typename TimeStampValueType::TTGeom2Value& aGeom2Value = theTimeStampValue->myGeom2Value;
     typename TimeStampValueType::TTGeom2Value::const_iterator anIter = aGeom2Value.begin();
     for (; anIter != aGeom2Value.end(); anIter++) {
@@ -177,22 +169,22 @@ namespace MED
       TInt aNbElem = aMeshValue.myNbElem;
       TInt aNbGauss = aMeshValue.myNbGauss;
       TInt aNbComp = aMeshValue.myNbComp;
-      INITMSG(MYDEBUG, "aGeom = "<<aGeom<<" - "<<aNbElem<<": ");
+      INITMSG("aGeom = "<<aGeom<<" - "<<aNbElem<<": ");
       for (TInt iElem = 0; iElem < aNbElem; iElem++) {
         typename TimeStampValueType::TTMeshValue::TCValueSliceArr aValueSliceArr =
           aMeshValue.GetGaussValueSliceArr(iElem);
-        ADDMSG(MYVALUEDEBUG, "{");
+        ADDMSG("{");
         for (TInt iGauss = 0; iGauss < aNbGauss; iGauss++) {
           const typename TimeStampValueType::TTMeshValue::TCValueSlice& aValueSlice =
             aValueSliceArr[iGauss];
           for (TInt iComp = 0; iComp < aNbComp; iComp++) {
-            ADDMSG(MYVALUEDEBUG, aValueSlice[iComp]<<" ");
+            ADDMSG(aValueSlice[iComp]<<" ");
           }
-          ADDMSG(MYVALUEDEBUG, "| ");
+          ADDMSG("| ");
         }
-        ADDMSG(MYVALUEDEBUG, "} ");
+        ADDMSG("} ");
       }
-      ADDMSG(MYDEBUG, "\n");
+      ADDMSG("\n");
     }
   }
 
@@ -242,9 +234,9 @@ namespace MED
   //----------------------------------------------------------------------------
   void
   TWrapper
-  ::GetMeshInfo(TInt theMeshId,
+  ::GetMeshInfo(TInt            theMeshId,
                 MED::TMeshInfo& theInfo,
-                TErr* theErr)
+                TErr*           theErr)
   {
     TFileWrapper aFileWrapper(myFile, eLECTURE, theErr, myMinor);
 
@@ -285,7 +277,7 @@ namespace MED
   void
   TWrapper
   ::SetMeshInfo(const MED::TMeshInfo& theInfo,
-                TErr* theErr)
+                TErr*                 theErr)
   {
     TErr aRet;
     SetMeshInfo(theInfo, eLECTURE_ECRITURE, &aRet);
@@ -304,8 +296,8 @@ namespace MED
   void
   TWrapper
   ::SetMeshInfo(const MED::TMeshInfo& theInfo,
-                EModeAcces theMode,
-                TErr* theErr)
+                EModeAcces            theMode,
+                TErr*                 theErr)
   {
     TFileWrapper aFileWrapper(myFile, theMode, theErr, myMinor);
 
@@ -341,7 +333,7 @@ namespace MED
     //if (aRet == 0)
     //  aRet = MEDunvCr(myFile->Id(),&aMeshName);
 
-    INITMSG(MYDEBUG, "TWrapper::SetMeshInfo - MED_MODE_ACCES = "<<theMode<<"; aRet = "<<aRet<<std::endl);
+    INITMSG("TWrapper::SetMeshInfo - MED_MODE_ACCES = "<<theMode<<"; aRet = "<<aRet<<std::endl);
 
     if (theErr)
       *theErr = aRet;
@@ -352,10 +344,10 @@ namespace MED
   //----------------------------------------------------------------------------
   PMeshInfo
   TWrapper
-  ::CrMeshInfo(TInt theDim,
-               TInt theSpaceDim,
+  ::CrMeshInfo(TInt               theDim,
+               TInt               theSpaceDim,
                const std::string& theValue,
-               EMaillage theType,
+               EMaillage          theType,
                const std::string& theDesc)
   {
     return PMeshInfo(new TTMeshInfo
@@ -377,7 +369,7 @@ namespace MED
   //----------------------------------------------------------------------------
   PMeshInfo
   TWrapper
-  ::GetPMeshInfo(TInt theId,
+  ::GetPMeshInfo(TInt  theId,
                  TErr* theErr)
   {
     PMeshInfo anInfo = CrMeshInfo();
@@ -389,7 +381,7 @@ namespace MED
   TInt
   TWrapper
   ::GetNbFamilies(const MED::TMeshInfo& theInfo,
-                  TErr* theErr)
+                  TErr*                 theErr)
   {
     TFileWrapper aFileWrapper(myFile, eLECTURE, theErr, myMinor);
 
@@ -404,9 +396,9 @@ namespace MED
   //----------------------------------------------------------------------------
   TInt
   TWrapper
-  ::GetNbFamAttr(TInt theFamId,
+  ::GetNbFamAttr(TInt                  theFamId,
                  const MED::TMeshInfo& theInfo,
-                 TErr* theErr)
+                 TErr*                 theErr)
   {
     TFileWrapper aFileWrapper(myFile, eLECTURE, theErr, myMinor);
 
@@ -423,9 +415,9 @@ namespace MED
   //----------------------------------------------------------------------------
   TInt
   TWrapper
-  ::GetNbFamGroup(TInt theFamId,
+  ::GetNbFamGroup(TInt                  theFamId,
                   const MED::TMeshInfo& theInfo,
-                  TErr* theErr)
+                  TErr*                 theErr)
   {
     TFileWrapper aFileWrapper(myFile, eLECTURE, theErr, myMinor);
 
@@ -442,9 +434,9 @@ namespace MED
   //----------------------------------------------------------------------------
   void
   TWrapper
-  ::GetFamilyInfo(TInt theFamId,
+  ::GetFamilyInfo(TInt              theFamId,
                   MED::TFamilyInfo& theInfo,
-                  TErr* theErr)
+                  TErr*             theErr)
   {
     TFileWrapper aFileWrapper(myFile, eLECTURE, theErr, myMinor);
 
@@ -485,7 +477,7 @@ namespace MED
   void
   TWrapper
   ::SetFamilyInfo(const MED::TFamilyInfo& theInfo,
-                  TErr* theErr)
+                  TErr*                   theErr)
   {
     TErr aRet;
     SetFamilyInfo(theInfo, eLECTURE_ECRITURE, &aRet);
@@ -501,8 +493,8 @@ namespace MED
   void
   TWrapper
   ::SetFamilyInfo(const MED::TFamilyInfo& theInfo,
-                  EModeAcces theMode,
-                  TErr* theErr)
+                  EModeAcces              theMode,
+                  TErr*                   theErr)
   {
     TFileWrapper aFileWrapper(myFile, theMode, theErr, myMinor);
 
@@ -529,7 +521,7 @@ namespace MED
                             aNbGroup,
                             &aGroupNames);
 
-    INITMSG(MYDEBUG, "TWrapper::SetFamilyInfo - MED_MODE_ACCES = "<<theMode<<"; aRet = "<<aRet<<std::endl);
+    INITMSG("TWrapper::SetFamilyInfo - MED_MODE_ACCES = "<<theMode<<"; aRet = "<<aRet<<std::endl);
 
     if (theErr)
       *theErr = aRet;
@@ -540,10 +532,10 @@ namespace MED
   //----------------------------------------------------------------------------
   PFamilyInfo
   TWrapper
-  ::CrFamilyInfo(const PMeshInfo& theMeshInfo,
-                 TInt theNbGroup,
-                 TInt theNbAttr,
-                 TInt theId,
+  ::CrFamilyInfo(const PMeshInfo&   theMeshInfo,
+                 TInt               theNbGroup,
+                 TInt               theNbAttr,
+                 TInt               theId,
                  const std::string& theValue)
   {
     return PFamilyInfo(new TTFamilyInfo
@@ -557,13 +549,13 @@ namespace MED
   //----------------------------------------------------------------------------
   PFamilyInfo
   TWrapper
-  ::CrFamilyInfo(const PMeshInfo& theMeshInfo,
-                 const std::string& theValue,
-                 TInt theId,
-                 const MED::TStringSet& theGroupNames,
+  ::CrFamilyInfo(const PMeshInfo&          theMeshInfo,
+                 const std::string&        theValue,
+                 TInt                      theId,
+                 const MED::TStringSet&    theGroupNames,
                  const MED::TStringVector& theAttrDescs,
-                 const MED::TIntVector& theAttrIds,
-                 const MED::TIntVector& theAttrVals)
+                 const MED::TIntVector&    theAttrIds,
+                 const MED::TIntVector&    theAttrVals)
   {
     return PFamilyInfo(new TTFamilyInfo
                        (theMeshInfo,
@@ -578,7 +570,7 @@ namespace MED
   //----------------------------------------------------------------------------
   PFamilyInfo
   TWrapper
-  ::CrFamilyInfo(const PMeshInfo& theMeshInfo,
+  ::CrFamilyInfo(const PMeshInfo&   theMeshInfo,
                  const PFamilyInfo& theInfo)
   {
     return PFamilyInfo(new TTFamilyInfo
@@ -590,8 +582,8 @@ namespace MED
   PFamilyInfo
   TWrapper
   ::GetPFamilyInfo(const PMeshInfo& theMeshInfo,
-                   TInt theId,
-                   TErr* theErr)
+                   TInt             theId,
+                   TErr*            theErr)
   {
     // must be reimplemented in connection with mesh type eSTRUCTURE
     //     if (theMeshInfo->GetType() != eNON_STRUCTURE)
@@ -602,17 +594,18 @@ namespace MED
     PFamilyInfo anInfo = CrFamilyInfo(theMeshInfo, aNbGroup, aNbAttr);
     GetFamilyInfo(theId, *anInfo, theErr);
 
-#ifdef _DEBUG_
-    std::string aName = anInfo->GetName();
-    INITMSG(MYDEBUG, "GetPFamilyInfo - aFamilyName = '"<<aName<<
-            "'; andId = "<<anInfo->GetId()<<
-            "; aNbAttr = "<<aNbAttr<<
-            "; aNbGroup = "<<aNbGroup<<"\n");
-    for (TInt iGroup = 0; iGroup < aNbGroup; iGroup++) {
-      aName = anInfo->GetGroupName(iGroup);
-      INITMSG(MYDEBUG, "aGroupName = '"<<aName<<"'\n");
+    if (SALOME::VerbosityActivated())
+    {
+      std::string aName = anInfo->GetName();
+      INITMSG("GetPFamilyInfo - aFamilyName = '"<<aName<<
+              "'; andId = "<<anInfo->GetId()<<
+              "; aNbAttr = "<<aNbAttr<<
+              "; aNbGroup = "<<aNbGroup<<"\n");
+      for (TInt iGroup = 0; iGroup < aNbGroup; iGroup++) {
+        aName = anInfo->GetGroupName(iGroup);
+        INITMSG("aGroupName = '"<<aName<<"'\n");
+      }
     }
-#endif
 
     return anInfo;
   }
@@ -620,11 +613,11 @@ namespace MED
   //----------------------------------------------------------------------------
   void
   TWrapper
-  ::GetNames(TElemInfo& theInfo,
-             TInt /*theNb*/,
-             EEntiteMaillage theEntity,
+  ::GetNames(TElemInfo&        theInfo,
+             TInt            /*theNb*/,
+             EEntiteMaillage   theEntity,
              EGeometrieElement theGeom,
-             TErr* theErr)
+             TErr*             theErr)
   {
     TFileWrapper aFileWrapper(myFile, eLECTURE, theErr, myMinor);
 
@@ -658,10 +651,10 @@ namespace MED
   //----------------------------------------------------------------------------
   void
   TWrapper
-  ::SetNames(const TElemInfo& theInfo,
-             EEntiteMaillage theEntity,
+  ::SetNames(const TElemInfo&  theInfo,
+             EEntiteMaillage   theEntity,
              EGeometrieElement theGeom,
-             TErr* theErr)
+             TErr*             theErr)
   {
     SetNames(theInfo, eLECTURE_ECRITURE, theEntity, theGeom, theErr);
   }
@@ -669,11 +662,11 @@ namespace MED
   //----------------------------------------------------------------------------
   void
   TWrapper
-  ::SetNames(const TElemInfo& theInfo,
-             EModeAcces theMode,
-             EEntiteMaillage theEntity,
+  ::SetNames(const TElemInfo&  theInfo,
+             EModeAcces        theMode,
+             EEntiteMaillage   theEntity,
              EGeometrieElement theGeom,
-             TErr* theErr)
+             TErr*             theErr)
   {
     TFileWrapper aFileWrapper(myFile, theMode, theErr, myMinor);
 
@@ -698,7 +691,7 @@ namespace MED
                                  MED_NO_DT,
                                  MED_NO_IT,
                                  anEntity,
-                                  aGeom,
+                                 aGeom,
                                  (TInt)anInfo.myElemNames->size(),
                                  &anElemNames);
       if (theErr)
@@ -711,11 +704,11 @@ namespace MED
   //----------------------------------------------------------------------------
   void
   TWrapper
-  ::GetNumeration(TElemInfo& theInfo,
-                  TInt /*theNb*/,
-                  EEntiteMaillage theEntity,
+  ::GetNumeration(TElemInfo&        theInfo,
+                  TInt            /*theNb*/,
+                  EEntiteMaillage   theEntity,
                   EGeometrieElement theGeom,
-                  TErr* theErr)
+                  TErr*             theErr)
   {
     TFileWrapper aFileWrapper(myFile, eLECTURE, theErr, myMinor);
 
@@ -749,10 +742,10 @@ namespace MED
   //----------------------------------------------------------------------------
   void
   TWrapper
-  ::SetNumeration(const TElemInfo& theInfo,
-                  EEntiteMaillage theEntity,
+  ::SetNumeration(const TElemInfo&  theInfo,
+                  EEntiteMaillage   theEntity,
                   EGeometrieElement theGeom,
-                  TErr* theErr)
+                  TErr*             theErr)
   {
     SetNumeration(theInfo, eLECTURE_ECRITURE, theEntity, theGeom, theErr);
   }
@@ -760,11 +753,11 @@ namespace MED
   //----------------------------------------------------------------------------
   void
   TWrapper
-  ::SetNumeration(const TElemInfo& theInfo,
-                  EModeAcces theMode,
-                  EEntiteMaillage theEntity,
+  ::SetNumeration(const TElemInfo&  theInfo,
+                  EModeAcces        theMode,
+                  EEntiteMaillage   theEntity,
                   EGeometrieElement theGeom,
-                  TErr* theErr)
+                  TErr*             theErr)
   {
     TFileWrapper aFileWrapper(myFile, theMode, theErr, myMinor);
 
@@ -802,11 +795,11 @@ namespace MED
   //----------------------------------------------------------------------------
   void
   TWrapper
-  ::GetFamilies(TElemInfo& theInfo,
-                TInt /*theNb*/,
-                EEntiteMaillage theEntity,
+  ::GetFamilies(TElemInfo&        theInfo,
+                TInt            /*theNb*/,
+                EEntiteMaillage   theEntity,
                 EGeometrieElement theGeom,
-                TErr* theErr)
+                TErr*             theErr)
   {
     TFileWrapper aFileWrapper(myFile, eLECTURE, theErr, myMinor);
 
@@ -849,10 +842,10 @@ namespace MED
   //----------------------------------------------------------------------------
   void
   TWrapper
-  ::SetFamilies(const TElemInfo& theInfo,
-                EEntiteMaillage theEntity,
+  ::SetFamilies(const TElemInfo&  theInfo,
+                EEntiteMaillage   theEntity,
                 EGeometrieElement theGeom,
-                TErr* theErr)
+                TErr*             theErr)
   {
     SetFamilies(theInfo, eLECTURE_ECRITURE, theEntity, theGeom, theErr);
   }
@@ -860,11 +853,11 @@ namespace MED
   //----------------------------------------------------------------------------
   void
   TWrapper
-  ::SetFamilies(const TElemInfo& theInfo,
-                EModeAcces theMode,
-                EEntiteMaillage theEntity,
+  ::SetFamilies(const TElemInfo&  theInfo,
+                EModeAcces        theMode,
+                EEntiteMaillage   theEntity,
                 EGeometrieElement theGeom,
-                TErr* theErr)
+                TErr*             theErr)
   {
     TFileWrapper aFileWrapper(myFile, theMode, theErr, myMinor);
 
@@ -901,7 +894,7 @@ namespace MED
   TInt
   TWrapper
   ::GetNbNodes(const MED::TMeshInfo& theMeshInfo,
-               TErr* theErr)
+               TErr*                 theErr)
   {
     return GetNbNodes(theMeshInfo, eCOOR, theErr);
   }
@@ -1163,37 +1156,38 @@ namespace MED
     PNodeInfo anInfo = CrNodeInfo(theMeshInfo, aNbElems);
     GetNodeInfo(*anInfo, theErr);
 
-#ifdef _DEBUG_
-    TInt aDim = theMeshInfo->myDim;
-    TInt aNbElem = anInfo->GetNbElem();
-    INITMSG(MYDEBUG, "GetPNodeInfo: ");
+    if (SALOME::VerbosityActivated())
     {
-      INITMSG(MYDEBUG, "aCoords: "<<aNbElem<<": ");
-      TNodeCoord& aCoord = anInfo->myCoord;
-      for (TInt iElem = 0; iElem < aNbElem; iElem++) {
-        for (TInt iDim = 0, anId = iElem*aDim; iDim < aDim; iDim++, anId++) {
-          ADDMSG(MYVALUEDEBUG, aCoord[anId]<<",");
+      TInt aDim = theMeshInfo->myDim;
+      TInt aNbElem = anInfo->GetNbElem();
+      INITMSG("GetPNodeInfo: ");
+      {
+        INITMSG("aCoords: "<<aNbElem<<": ");
+        TNodeCoord& aCoord = anInfo->myCoord;
+        for (TInt iElem = 0; iElem < aNbElem; iElem++) {
+          for (TInt iDim = 0, anId = iElem*aDim; iDim < aDim; iDim++, anId++) {
+            ADDMSG(aCoord[anId]<<",");
+          }
+          ADDMSG(" ");
         }
-        ADDMSG(MYVALUEDEBUG, " ");
-      }
-      ADDMSG(MYDEBUG, std::endl);
+        ADDMSG(std::endl);
 
-      BEGMSG(MYVALUEDEBUG, "GetFamNum: ");
-      for (TInt iElem = 0; iElem < aNbElem; iElem++) {
-        ADDMSG(MYVALUEDEBUG, anInfo->GetFamNum(iElem)<<", ");
-      }
-      ADDMSG(MYVALUEDEBUG, std::endl);
-
-      if (anInfo->IsElemNum()) {
-        BEGMSG(MYVALUEDEBUG, "GetElemNum: ");
+        BEGMSG("GetFamNum: ");
         for (TInt iElem = 0; iElem < aNbElem; iElem++) {
-          ADDMSG(MYVALUEDEBUG, anInfo->GetElemNum(iElem)<<", ");
+          ADDMSG(anInfo->GetFamNum(iElem)<<", ");
+        }
+        ADDMSG(std::endl);
+
+        if (anInfo->IsElemNum()) {
+          BEGMSG("GetElemNum: ");
+          for (TInt iElem = 0; iElem < aNbElem; iElem++) {
+            ADDMSG(anInfo->GetElemNum(iElem)<<", ");
+          }
+          ADDMSG(std::endl);
         }
-        ADDMSG(MYVALUEDEBUG, std::endl);
       }
+      ADDMSG(std::endl);
     }
-    ADDMSG(MYDEBUG, std::endl);
-#endif
 
     return anInfo;
   }
@@ -1548,20 +1542,21 @@ namespace MED
     PPolygoneInfo anInfo = CrPolygoneInfo(theMeshInfo, theEntity, theGeom, aNbElem, aConnSize, theConnMode);
     GetPolygoneInfo(anInfo);
 
-#ifdef _DEBUG_
-    INITMSG(MYDEBUG, "GetPPolygoneInfo"<<
-            " - theGeom = "<<theGeom<<
-            "; aNbElem = "<<aNbElem<<": ");
-    for (TInt iElem = 1; iElem < aNbElem; iElem++) {
-      TCConnSlice aConnSlice = anInfo->GetConnSlice(iElem);
-      TInt aConnDim = aConnSlice.size();
-      for (TInt iConn = 0; iConn < aConnDim; iConn++) {
-        ADDMSG(MYVALUEDEBUG, aConnSlice[iConn]<<",");
+    if (SALOME::VerbosityActivated())
+    {
+      INITMSG("GetPPolygoneInfo"<<
+              " - theGeom = "<<theGeom<<
+              "; aNbElem = "<<aNbElem<<": ");
+      for (TInt iElem = 1; iElem < aNbElem; iElem++) {
+        TCConnSlice aConnSlice = anInfo->GetConnSlice(iElem);
+        TInt aConnDim = aConnSlice.size();
+        for (TInt iConn = 0; iConn < aConnDim; iConn++) {
+          ADDMSG(aConnSlice[iConn]<<",");
+        }
+        ADDMSG(" ");
       }
-      ADDMSG(MYDEBUG, " ");
+      ADDMSG(std::endl);
     }
-    ADDMSG(MYDEBUG, std::endl);
-#endif
 
     return anInfo;
   }
@@ -1858,27 +1853,28 @@ namespace MED
     PPolyedreInfo anInfo = CrPolyedreInfo(theMeshInfo, theEntity, theGeom, aNbElem, aNbFaces, aConnSize, theConnMode);
     GetPolyedreInfo(anInfo);
 
-#ifdef _DEBUG_
-    INITMSG(MYDEBUG, "GetPPolyedreInfo"<<
-            " - theGeom = "<<theGeom<<
-            "; aNbElem = "<<aNbElem<<": ");
-    for (TInt iElem = 0; iElem < aNbElem; iElem++) {
-      TCConnSliceArr aConnSliceArr = anInfo->GetConnSliceArr(iElem);
-      TInt aNbFaces = aConnSliceArr.size();
-      ADDMSG(MYDEBUG, "{");
-      for (TInt iFace = 0; iFace < aNbFaces; iFace++) {
-        TCConnSlice aConnSlice = aConnSliceArr[iFace];
-        TInt aNbConn = aConnSlice.size();
-        ADDMSG(MYDEBUG, "[");
-        for (TInt iConn = 0; iConn < aNbConn; iConn++) {
-          ADDMSG(MYVALUEDEBUG, aConnSlice[iConn]<<",");
+    if (SALOME::VerbosityActivated())
+    {
+      INITMSG("GetPPolyedreInfo"<<
+              " - theGeom = "<<theGeom<<
+              "; aNbElem = "<<aNbElem<<": ");
+      for (TInt iElem = 0; iElem < aNbElem; iElem++) {
+        TCConnSliceArr aConnSliceArr = anInfo->GetConnSliceArr(iElem);
+        TInt aNbFaces = aConnSliceArr.size();
+        ADDMSG("{");
+        for (TInt iFace = 0; iFace < aNbFaces; iFace++) {
+          TCConnSlice aConnSlice = aConnSliceArr[iFace];
+          TInt aNbConn = aConnSlice.size();
+          ADDMSG("[");
+          for (TInt iConn = 0; iConn < aNbConn; iConn++) {
+            ADDMSG(aConnSlice[iConn]<<",");
+          }
+          ADDMSG("] ");
         }
-        ADDMSG(MYDEBUG, "] ");
+        ADDMSG("} ");
       }
-      ADDMSG(MYDEBUG, "} ");
+      ADDMSG(std::endl);
     }
-    ADDMSG(MYDEBUG, std::endl);
-#endif
 
     return anInfo;
   }
@@ -2208,14 +2204,14 @@ namespace MED
   //----------------------------------------------------------------------------
   PCellInfo
   TWrapper
-  ::CrCellInfo(const PMeshInfo& theMeshInfo,
-               EEntiteMaillage theEntity,
+  ::CrCellInfo(const PMeshInfo&  theMeshInfo,
+               EEntiteMaillage   theEntity,
                EGeometrieElement theGeom,
-               TInt theNbElem,
-               EConnectivite theConnMode,
-               EBooleen theIsElemNum,
-               EBooleen theIsElemNames,
-               EModeSwitch theMode)
+               TInt              theNbElem,
+               EConnectivite     theConnMode,
+               EBooleen          theIsElemNum,
+               EBooleen          theIsElemNames,
+               EModeSwitch       theMode)
   {
     return PCellInfo(new TTCellInfo
                      (theMeshInfo,
@@ -2279,34 +2275,35 @@ namespace MED
     PCellInfo anInfo = CrCellInfo(theMeshInfo, theEntity, theGeom, aNbElem, theConnMode);
     GetCellInfo(anInfo, theErr);
 
-#ifdef _DEBUG_
-    TInt aConnDim = anInfo->GetConnDim();
-    INITMSG(MYDEBUG, "GetPCellInfo - theEntity = "<<theEntity<<"; theGeom = "<<theGeom<<"; aConnDim: "<<aConnDim<<"\n");
-    BEGMSG(MYDEBUG, "GetPCellInfo - aNbElem: "<<aNbElem<<": ");
-    for (TInt iElem = 0; iElem < aNbElem; iElem++) {
-      TCConnSlice aConnSlice = anInfo->GetConnSlice(iElem);
-      for (TInt iConn = 0; iConn < aConnDim; iConn++) {
-        ADDMSG(MYVALUEDEBUG, aConnSlice[iConn]<<",");
+    if (SALOME::VerbosityActivated())
+    {
+      TInt aConnDim = anInfo->GetConnDim();
+      INITMSG("GetPCellInfo - theEntity = "<<theEntity<<"; theGeom = "<<theGeom<<"; aConnDim: "<<aConnDim<<"\n");
+      BEGMSG("GetPCellInfo - aNbElem: "<<aNbElem<<": ");
+      for (TInt iElem = 0; iElem < aNbElem; iElem++) {
+        TCConnSlice aConnSlice = anInfo->GetConnSlice(iElem);
+        for (TInt iConn = 0; iConn < aConnDim; iConn++) {
+          ADDMSG(aConnSlice[iConn]<<",");
+        }
+        ADDMSG(" ");
       }
-      ADDMSG(MYVALUEDEBUG, " ");
-    }
-    ADDMSG(MYDEBUG, std::endl);
+      ADDMSG(std::endl);
 
-    BEGMSG(MYVALUEDEBUG, "GetPCellInfo - GetFamNum: ");
-    for (TInt iElem = 0; iElem < aNbElem; iElem++) {
-      ADDMSG(MYVALUEDEBUG, anInfo->GetFamNum(iElem)<<", ");
-    }
-    ADDMSG(MYVALUEDEBUG, std::endl);
-
-    if (anInfo->IsElemNum()) {
-      BEGMSG(MYVALUEDEBUG, "GetPCellInfo - GetElemNum: ");
+      BEGMSG("GetPCellInfo - GetFamNum: ");
       for (TInt iElem = 0; iElem < aNbElem; iElem++) {
-        ADDMSG(MYVALUEDEBUG, anInfo->GetElemNum(iElem)<<", ");
+        ADDMSG(anInfo->GetFamNum(iElem)<<", ");
+      }
+      ADDMSG(std::endl);
+
+      if (anInfo->IsElemNum()) {
+        BEGMSG("GetPCellInfo - GetElemNum: ");
+        for (TInt iElem = 0; iElem < aNbElem; iElem++) {
+          ADDMSG(anInfo->GetElemNum(iElem)<<", ");
+        }
+        ADDMSG(std::endl);
       }
-      ADDMSG(MYVALUEDEBUG, std::endl);
+      ADDMSG(std::endl);
     }
-    ADDMSG(MYDEBUG, std::endl);
-#endif
 
     return anInfo;
   }
@@ -2687,14 +2684,14 @@ namespace MED
     PFieldInfo anInfo = CrFieldInfo(theMeshInfo, aNbComp);
     GetFieldInfo(theId, *anInfo, theErr);
 
-#ifdef _DEBUG_
-    INITMSG(MYDEBUG,
-            "GetPFieldInfo "<<
-            "- aName = '"<<anInfo->GetName()<<"'"<<
-            "; aType = "<<anInfo->GetType()<<
-            "; aNbComp = "<<aNbComp<<
-            std::endl);
-#endif
+    if (SALOME::VerbosityActivated())
+    {
+      INITMSG("GetPFieldInfo "<<
+              "- aName = '"<<anInfo->GetName()<<"'"<<
+              "; aType = "<<anInfo->GetType()<<
+              "; aNbComp = "<<aNbComp<<
+              std::endl);
+    }
 
     return anInfo;
   }
@@ -2896,14 +2893,12 @@ namespace MED
           }
         bool anIsSatisfied =(nval > 0);
         if (anIsSatisfied) {
-          INITMSG(MYDEBUG,
-                  "GetNbTimeStamps aNbTimeStamps = "<<aNbStamps<<
+          INITMSG("GetNbTimeStamps aNbTimeStamps = "<<aNbStamps<<
                   "; aGeom = "<<aGeom<<"; anEntity = "<<anEntity<<"\n");
           if (anIsPerformAdditionalCheck) {
             anIsSatisfied = !strcmp(&aMeshName[0], &aMeshInfo.myName[0]);
             if (!anIsSatisfied) {
-              INITMSG(MYDEBUG,
-                      "GetNbTimeStamps aMeshName = '"<<&aMeshName[0]<<"' != "<<
+              INITMSG("GetNbTimeStamps aMeshName = '"<<&aMeshName[0]<<"' != "<<
                       "; aMeshInfo.myName = '"<<&aMeshInfo.myName[0]<<"'\n");
             }
           }
@@ -3062,15 +3057,16 @@ namespace MED
     PTimeStampInfo anInfo = CrTimeStampInfo(theFieldInfo, theEntity, theGeom2Size);
     GetTimeStampInfo(theId, *anInfo, theErr);
 
-#ifdef _DEBUG_
-    INITMSG(MYDEBUG, "GetPTimeStampInfo - anEntity = "<<anInfo->GetEntity()<<"\n");
-    TGeom2NbGauss& aGeom2NbGauss = anInfo->myGeom2NbGauss;
-    TGeom2NbGauss::const_iterator anIter = aGeom2NbGauss.begin();
-    for (; anIter != aGeom2NbGauss.end(); anIter++) {
-      const EGeometrieElement& aGeom = anIter->first;
-      INITMSG(MYDEBUG, "aGeom = "<<aGeom<<" - "<<aGeom2NbGauss[aGeom]<<";\n");
+    if (SALOME::VerbosityActivated())
+    {
+      INITMSG("GetPTimeStampInfo - anEntity = "<<anInfo->GetEntity()<<"\n");
+      TGeom2NbGauss& aGeom2NbGauss = anInfo->myGeom2NbGauss;
+      TGeom2NbGauss::const_iterator anIter = aGeom2NbGauss.begin();
+      for (; anIter != aGeom2NbGauss.end(); anIter++) {
+        const EGeometrieElement& aGeom = anIter->first;
+        INITMSG("aGeom = "<<aGeom<<" - "<<aGeom2NbGauss[aGeom]<<";\n");
+      }
     }
-#endif
 
     return anInfo;
   }
@@ -3285,8 +3281,7 @@ namespace MED
                                        aNbComp);
       TInt aValueSize = theTimeStampValue->GetValueSize(aGeom);
 
-      INITMSG(MYDEBUG,
-              "TWrapper::GetTimeStampValue - aGeom = "<<aGeom<<
+      INITMSG("TWrapper::GetTimeStampValue - aGeom = "<<aGeom<<
               "; aNbVal = "<<aNbVal<<
               "; aNbValue = "<<aNbValue<<
               "; aNbGauss = "<<aNbGauss<<
@@ -3476,7 +3471,7 @@ namespace MED
 
     }
 
-    INITMSG(MYDEBUG, "TWrapper::SetTimeStampValue - MED_MODE_ACCES = "<<theMode<<"; aRet = "<<aRet<<std::endl);
+    INITMSG("TWrapper::SetTimeStampValue - MED_MODE_ACCES = "<<theMode<<"; aRet = "<<aRet<<std::endl);
   }
 
   //----------------------------------------------------------------------------
@@ -3559,12 +3554,13 @@ namespace MED
                       theMKey2Profile,
                       theKey2Gauss,
                       theErr);
-#ifdef _DEBUG_
-    if (aFieldInfo->GetType() == eFLOAT64)
-      Print<TFloatTimeStampValue>(anInfo);
-    else
-      Print<TIntTimeStampValue>(anInfo);
-#endif
+    if (SALOME::VerbosityActivated())
+    {
+      if (aFieldInfo->GetType() == eFLOAT64)
+        Print<TFloatTimeStampValue>(anInfo);
+      else
+        Print<TIntTimeStampValue>(anInfo);
+    }
     return anInfo;
   }
 
@@ -3694,33 +3690,32 @@ namespace MED
     GetGrilleInfo(anInfo);
     anInfo->SetGrilleType(type);
 
-#ifdef _DEBUG_
-    INITMSG(MYDEBUG, "GetPGrilleInfo: ");
+    if (SALOME::VerbosityActivated())
     {
+      INITMSG("GetPGrilleInfo: ");
+
       TInt aNbElem = anInfo->GetNbNodes();
-      BEGMSG(MYVALUEDEBUG, "GetFamNumNode: ");
+      BEGMSG("GetFamNumNode: ");
       for (TInt iElem = 0; iElem < aNbElem; iElem++) {
-        ADDMSG(MYVALUEDEBUG, anInfo->GetFamNumNode(iElem)<<", ");
+        ADDMSG(anInfo->GetFamNumNode(iElem)<<", ");
       }
       TInt aNbCells = anInfo->GetNbCells();
-      BEGMSG(MYVALUEDEBUG, "GetFamNum: ");
+      BEGMSG("GetFamNum: ");
       for (TInt iElem = 0; iElem < aNbCells; iElem++) {
-        ADDMSG(MYVALUEDEBUG, anInfo->GetFamNum(iElem)<<", ");
+        ADDMSG(anInfo->GetFamNum(iElem)<<", ");
       }
-      ADDMSG(MYVALUEDEBUG, std::endl);
-      BEGMSG(MYVALUEDEBUG, "GetCoordName: ");
+      ADDMSG(std::endl);
+      BEGMSG("GetCoordName: ");
       for (TInt iElem = 0; iElem < theMeshInfo->GetDim(); iElem++) {
-        ADDMSG(MYVALUEDEBUG, anInfo->GetCoordName(iElem)<<", ");
+        ADDMSG(anInfo->GetCoordName(iElem)<<", ");
       }
-      ADDMSG(MYVALUEDEBUG, std::endl);
-      BEGMSG(MYVALUEDEBUG, "GetCoordUnit: ");
+      ADDMSG(std::endl);
+      BEGMSG("GetCoordUnit: ");
       for (TInt iElem = 0; iElem < theMeshInfo->GetDim(); iElem++) {
-        ADDMSG(MYVALUEDEBUG, anInfo->GetCoordUnit(iElem)<<", ");
+        ADDMSG(anInfo->GetCoordUnit(iElem)<<", ");
       }
-      ADDMSG(MYVALUEDEBUG, std::endl);
-
+      ADDMSG(std::endl);
     }
-#endif
 
     return anInfo;
   }