]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To disable changes
authorapo <apo@opencascade.com>
Mon, 21 Nov 2005 10:05:22 +0000 (10:05 +0000)
committerapo <apo@opencascade.com>
Mon, 21 Nov 2005 10:05:22 +0000 (10:05 +0000)
src/CONVERTOR/VISU_ConvertorUtils.cxx
src/CONVERTOR/VISU_ConvertorUtils.hxx
src/CONVERTOR/VISU_MedConvertor.cxx

index 622caf4ea799e81a8c95d2b8e8a905c1e4d1e426..ad26b0eccfbee642b011180e7f4f74f55667ffca 100644 (file)
@@ -30,7 +30,7 @@
 #include <vtkTimerLog.h>
 
 #ifdef _DEBUG_
-static int MYDEBUG = 2;
+static int MYDEBUG = 0;
 #else
 static int MYDEBUG = 0;
 #endif
@@ -51,13 +51,15 @@ namespace VISU
 
 
   TTimerLog
-  ::TTimerLog(const std::string& theName):
+  ::TTimerLog(int theIsDebug,
+             const std::string& theName):
+    myIsDebug(MYDEBUG? MYDEBUG + theIsDebug: MYDEBUG),
     myTimerLog(vtkTimerLog::New()),
-    myPrefixPrinter(MYDEBUG == 1),
+    myPrefixPrinter(myIsDebug == 1),
     myName(theName)
   {
     myCPUTime = myTimerLog->GetCPUTime();
-    BEGMSG(MYDEBUG > 1,"{\n");
+    BEGMSG(myIsDebug > 1,"{\n");
   }
 
   TTimerLog
@@ -65,10 +67,10 @@ namespace VISU
   {
     myCPUTime = myTimerLog->GetCPUTime() - myCPUTime;
 
-    if(MYDEBUG > 1){
-      BEGMSG(MYDEBUG,"} = "<<myCPUTime<<" secs ("<<myName<<")\n");
+    if(myIsDebug > 1){
+      BEGMSG(myIsDebug,"} = "<<myCPUTime<<" secs ("<<myName<<")\n");
     }else{
-      BEGMSG(MYDEBUG,myName<<" takes "<<myCPUTime<<" secs\n");
+      BEGMSG(myIsDebug,myName<<" takes "<<myCPUTime<<" secs\n");
     }
     
     myTimerLog->Delete();
index ae2f0881dffc0950a4370ccb2526334c62ff7274..154589fc7d89ee0002ba2dfcf32858da1501de80 100644 (file)
@@ -48,12 +48,14 @@ namespace VISU{
 
   class TTimerLog
   {
+    int myIsDebug;
     double myCPUTime;
     std::string myName;
     vtkTimerLog* myTimerLog;
     MED::PrefixPrinter myPrefixPrinter;
   public:
-    TTimerLog(const std::string& theName);
+    TTimerLog(int theIsDebug,
+             const std::string& theName);
     ~TTimerLog();
   };
   
index c35eef812e8eee0106c16b1b8e77141c72510ccf..fda34bff2eb49c5ba95882d8120d8cb36490ecb9 100644 (file)
@@ -47,7 +47,7 @@ using MED::TFloat;
 using MED::EBooleen;
 
 #ifdef _DEBUG_
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
 static int MYVALUEDEBUG = 0;
 static int MY_FAMILY_DEBUG = 0;
 static int MY_GROUP_DEBUG = 0;
@@ -308,7 +308,7 @@ namespace
              const MED::TGeom2Size& theGeom2Size,
              VISU::TMEDValForTime& theValForTime)
   {
-    TTimerLog aTimerLog("InitProfile");
+    TTimerLog aTimerLog(MYDEBUG,"InitProfile");
     INITMSG(MYDEBUG,"InitProfile"<<endl);
     
     TProfileMap& aProfileMap = theMeshOnEntity.myProfileMap;
@@ -352,7 +352,7 @@ namespace
              const MED::TGeom2Size& theGeom2Size,
              VISU::TMEDValForTime& theValForTime)
   {
-    TTimerLog aTimerLog("GetGaussKey");
+    TTimerLog aTimerLog(MYDEBUG,"GetGaussKey");
     INITMSG(MYDEBUG,"GetGaussKey"<<endl);
 
     TGaussKey aGaussKey;
@@ -426,7 +426,7 @@ namespace
                const MED::TGeom2Size& theGeom2Size,
                VISU::TMEDValForTime& theValForTime)
   {
-    TTimerLog aTimerLog("InitGaussMesh");
+    TTimerLog aTimerLog(MYDEBUG,"InitGaussMesh");
     INITMSG(MYDEBUG,"InitGaussMesh"<<endl);
 
     if(theMeshOnEntity.myEntity == NODE_ENTITY)
@@ -480,7 +480,7 @@ namespace
                   const MED::TGeom2Size& theGeom2Size,
                   VISU::TMEDValForTime& theValForTime)
   {
-    TTimerLog aTimerLog("InitGaussProfile");
+    TTimerLog aTimerLog(MYDEBUG,"InitGaussProfile");
     INITMSG(MYDEBUG,"InitGaussProfile"<<endl);
 
     // The order of the function calls is important
@@ -506,7 +506,7 @@ namespace
                       const MED::PNodeInfo& theNodeInfo,
                       const MED::PWrapper& theMEDWrapper)
   {
-    TTimerLog aTimerLog("BuildMeshOnEntityMap");
+    TTimerLog aTimerLog(MYDEBUG,"BuildMeshOnEntityMap");
     INITMSG(MYDEBUG,"BuildMeshOnEntityMap"<<endl);
 
     MED::PMeshInfo aMeshInfo = theMesh->myMeshInfo;
@@ -630,13 +630,13 @@ namespace
                const MED::TEntityInfo& theEntityInfo,
                MED::PWrapper theMEDWrapper)
   {
-    TTimerLog aTimerLog("BuildFieldMap");
+    TTimerLog aTimerLog(MYDEBUG,"BuildFieldMap");
     TInt aNbFields = theMEDWrapper->GetNbFields(); 
     MED::PMeshInfo aMeshInfo = theMesh->myMeshInfo;
     const std::string& aMeshName = theMesh->myName;
     INITMSG(MYDEBUG,"BuildFieldMap: aNbFields = "<<aNbFields<<"\n");
     for(TInt iField = 1; iField <= aNbFields; iField++){
-      TTimerLog aTimerLog("GetPFieldInfo");
+      TTimerLog aTimerLog(MYDEBUG,"GetPFieldInfo");
       MED::PFieldInfo aFieldInfo = theMEDWrapper->GetPFieldInfo(aMeshInfo,iField);
       TInt aNbComp = aFieldInfo->GetNbComp();
       std::string aFieldName = aFieldInfo->GetName();
@@ -673,7 +673,7 @@ namespace
       }
       
       for(TInt iTimeStamp = 1; iTimeStamp <= aNbTimeStamps; iTimeStamp++){
-       TTimerLog aTimerLog("GetPTimeStampInfo");
+       TTimerLog aTimerLog(MYDEBUG,"GetPTimeStampInfo");
        MED::PTimeStampInfo aTimeStampInfo = theMEDWrapper->GetPTimeStampInfo(aFieldInfo,
                                                                              aMEntity,
                                                                              aGeom2Size,
@@ -703,7 +703,7 @@ namespace
                 const MED::TFamilyInfoSet& theFamilyInfoSet,
                 MED::PWrapper theMEDWrapper)
   {
-    TTimerLog aTimerLog("BuildFamilyMap");
+    TTimerLog aTimerLog(MYDEBUG,"BuildFamilyMap");
     INITMSG(MYDEBUG,"BuildFamilyMap\n");
 
     MED::PMeshInfo aMeshInfo = theMesh->myMeshInfo;
@@ -775,7 +775,7 @@ namespace
   BuildGroupMap(PMEDMesh theMesh,
                const MED::TFamilyInfoSet& theFamilyInfoSet)
   {
-    TTimerLog aTimerLog("BuildGroupMap");
+    TTimerLog aTimerLog(MYDEBUG,"BuildGroupMap");
     INITMSG(MYDEBUG,"BuildGroupMap\n");
 
     TGroupMap& aGroupMap = theMesh->myGroupMap;
@@ -934,7 +934,7 @@ VISU_Convertor*
 VISU_MedConvertor
 ::BuildEntities()
 {
-  TTimerLog aTimerLog("BuildEntities");
+  TTimerLog aTimerLog(MYDEBUG,"BuildEntities");
   MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
 
   TInt aNbMeshes = aMed->GetNbMeshes();
@@ -946,7 +946,7 @@ VISU_MedConvertor
 #ifndef _DEXCEPT_
     try{
 #endif
-      TTimerLog aTimerLog("GetPMeshInfo");
+      TTimerLog aTimerLog(MYDEBUG,"GetPMeshInfo");
 
       MED::PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh);
       std::string aMeshName = aMeshInfo->GetName();
@@ -1005,7 +1005,7 @@ VISU_Convertor*
 VISU_MedConvertor
 ::BuildFields()
 {
-  TTimerLog aTimerLog("BuildFields");
+  TTimerLog aTimerLog(MYDEBUG,"BuildFields");
   MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
 
   TInt aNbMeshes = aMed->GetNbMeshes();
@@ -1017,7 +1017,7 @@ VISU_MedConvertor
 #ifndef _DEXCEPT_
     try{
 #endif
-      TTimerLog aTimerLog("GetPMeshInfo");
+      TTimerLog aTimerLog(MYDEBUG,"GetPMeshInfo");
 
       MED::PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh);
       std::string aMeshName = aMeshInfo->GetName();
@@ -1062,7 +1062,7 @@ VISU_Convertor*
 VISU_MedConvertor
 ::BuildMinMax()
 {
-  TTimerLog aTimerLog("BuildMinMax");
+  TTimerLog aTimerLog(MYDEBUG,"BuildMinMax");
   MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
 
   MED::TKey2Gauss aKey2Gauss = MED::GetKey2Gauss(aMed);
@@ -1077,7 +1077,7 @@ VISU_MedConvertor
 #ifndef _DEXCEPT_
     try{
 #endif
-      TTimerLog aTimerLog("BuildMinMax - GetPMeshInfo");
+      TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPMeshInfo");
 
       MED::PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh);
       std::string aMeshName = aMeshInfo->GetName();
@@ -1099,7 +1099,7 @@ VISU_MedConvertor
        MED::TEntityInfo anEntityInfo = aMed->GetEntityInfo(aMeshInfo);
 
        for(TInt iField = 1; iField <= aNbFields; iField++){
-         TTimerLog aTimerLog("BuildMinMax - GetPFieldInfo()");
+         TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPFieldInfo()");
          MED::PFieldInfo aFieldInfo = aMed->GetPFieldInfo(aMeshInfo,iField);
          std::string aFieldName = aFieldInfo->GetName();
          INITMSG(MYDEBUG,"- aFieldName = '"<<aFieldName<<"'\n");
@@ -1127,7 +1127,7 @@ VISU_MedConvertor
 
          TMinMaxArr& aMinMaxArr = aField->myMinMaxArr;
          for(TInt iTimeStamp = aNbTimeStamps; iTimeStamp >= 1; iTimeStamp--){
-           TTimerLog aTimerLog("BuildMinMax - GetPTimeStampInfo()");
+           TTimerLog aTimerLog(MYDEBUG,"BuildMinMax - GetPTimeStampInfo()");
            INITMSG(MYDEBUG,"- iTimeStamp = "<<iTimeStamp<<endl);
            
            MED::PTimeStampInfo aTimeStampInfo = aMed->GetPTimeStampInfo(aFieldInfo,
@@ -1223,7 +1223,7 @@ VISU_Convertor*
 VISU_MedConvertor
 ::BuildGroups()
 {
-  TTimerLog aTimerLog("BuildGroups");
+  TTimerLog aTimerLog(MYDEBUG,"BuildGroups");
   MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
 
   TInt aNbMeshes = aMed->GetNbMeshes();
@@ -1235,7 +1235,7 @@ VISU_MedConvertor
 #ifndef _DEXCEPT_
     try{
 #endif
-      TTimerLog aTimerLog("GetPMeshInfo");
+      TTimerLog aTimerLog(MYDEBUG,"GetPMeshInfo");
 
       MED::PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh);
       std::string aMeshName = aMeshInfo->GetName();      
@@ -1292,7 +1292,7 @@ VISU_MedConvertor
 ::LoadMeshOnEntity(VISU::PMeshImpl theMesh,
                   VISU::PMeshOnEntityImpl theMeshOnEntity)
 {
-  TTimerLog aTimerLog("LoadMeshOnEntity");
+  TTimerLog aTimerLog(MYDEBUG,"LoadMeshOnEntity");
   INITMSG(MYDEBUG,"LoadMeshOnEntity"<<endl);
 
   MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
@@ -1317,7 +1317,7 @@ VISU_MedConvertor
                     VISU::PMeshOnEntityImpl theMeshOnEntity, 
                     VISU::PFamilyImpl theFamily)
 {
-  TTimerLog aTimerLog("LoadFamilyOnEntity");
+  TTimerLog aTimerLog(MYDEBUG,"LoadFamilyOnEntity");
   INITMSG(MYDEBUG,"LoadFamilyOnEntity"<<endl);
 
   MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
@@ -1341,7 +1341,7 @@ VISU_MedConvertor
 ::LoadMeshOnGroup(VISU::PMeshImpl theMesh, 
                  const VISU::TFamilySet& theFamilySet)
 {
-  TTimerLog aTimerLog("LoadMeshOnGroup");
+  TTimerLog aTimerLog(MYDEBUG,"LoadMeshOnGroup");
   INITMSG(MYDEBUG,"LoadMeshOnGroup"<<endl);
 
   MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
@@ -1371,7 +1371,7 @@ VISU_MedConvertor
                       VISU::PFieldImpl theField, 
                       VISU::PValForTimeImpl theValForTime)
 {
-  TTimerLog aTimerLog("LoadValForTimeOnMesh");
+  TTimerLog aTimerLog(MYDEBUG,"LoadValForTimeOnMesh");
   INITMSG(MYDEBUG,"LoadValForTimeOnMesh"<<endl);
 
   MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
@@ -1395,7 +1395,7 @@ VISU_MedConvertor
                           VISU::PFieldImpl theField, 
                           VISU::PValForTimeImpl theValForTime)
 {
-  TTimerLog aTimerLog("LoadValForTimeOnGaussPts");
+  TTimerLog aTimerLog(MYDEBUG,"LoadValForTimeOnGaussPts");
   INITMSG(MYDEBUG,"LoadValForTimeOnGaussPts"<<endl);
 
   MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
@@ -1416,7 +1416,7 @@ VISU_MedConvertor
 ::LoadPoints(const MED::PWrapper& theMed,
             VISU::PMEDMesh theMesh) 
 {
-  TTimerLog aTimerLog("LoadValForTimeOnGaussPts");
+  TTimerLog aTimerLog(MYDEBUG,"LoadValForTimeOnGaussPts");
   try{
     //Check on existing family
     PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[VISU::NODE_ENTITY];
@@ -1481,7 +1481,7 @@ VISU_MedConvertor
                     const VISU::PMEDMesh theMesh, 
                     const VISU::PMEDFamily theFamily) 
 {
-  TTimerLog aTimerLog("LoadPointsOnFamily");
+  TTimerLog aTimerLog(MYDEBUG,"LoadPointsOnFamily");
   try{
     if(theFamily->myIsDone) 
       return 0;
@@ -1519,7 +1519,7 @@ VISU_MedConvertor
                    const VISU::PMEDMesh theMesh,
                    const VISU::PMEDMeshOnEntity theMeshOnEntity)
 {
-  TTimerLog aTimerLog("LoadCellsOnEntity");
+  TTimerLog aTimerLog(MYDEBUG,"LoadCellsOnEntity");
 #ifndef _DEXCEPT_
   try{
 #endif
@@ -1746,7 +1746,7 @@ VISU_MedConvertor
                    const VISU::PMEDMeshOnEntity theMeshOnEntity,
                    const VISU::PMEDFamily theFamily)
 {
-  TTimerLog aTimerLog("LoadCellsOnFamily");
+  TTimerLog aTimerLog(MYDEBUG,"LoadCellsOnFamily");
 #ifndef _DEXCEPT_
   try{
 #endif
@@ -1820,7 +1820,7 @@ LoadProfile(const MED::PWrapper& theMed,
            VISU::TMEDValForTime& theValForTime,
            VISU::TMEDMeshOnEntity& theMeshOnEntity)
 {
-  TTimerLog aTimerLog("LoadProfile");
+  TTimerLog aTimerLog(MYDEBUG,"LoadProfile");
   INITMSG(MYDEBUG,"LoadProfile"<<endl);
 
   PMEDProfile aProfile = theValForTime.myProfile;
@@ -1900,7 +1900,7 @@ LoadGaussMesh(const MED::PWrapper& theMed,
              VISU::TMEDValForTime& theValForTime,
              VISU::TMEDMeshOnEntity& theMeshOnEntity)
 {
-  TTimerLog aTimerLog("LoadGaussMesh");
+  TTimerLog aTimerLog(MYDEBUG,"LoadGaussMesh");
   INITMSG(MYDEBUG,"LoadGaussMesh"<<endl);
 
   PMEDGaussMesh aGaussMesh = theValForTime.myGaussMesh;
@@ -2072,7 +2072,7 @@ LoadValForTime(const MED::PWrapper& theMed,
               bool theIsGauss,
               bool& theIsDone)
 {
-  TTimerLog aTimerLog("LoadValForTime");
+  TTimerLog aTimerLog(MYDEBUG,"LoadValForTime");
   INITMSG(MYDEBUG,"LoadValForTime - theIsGauss = "<<theIsGauss<<endl);
 
   //Check on loading already done