]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
[bos #32517][EDF] Dynamic logging: Removed MYDEBUG.
authorKonstantin LEONTEV <kleontev@ubuntu2004-01.nnov.opencascade.com>
Thu, 13 Oct 2022 07:07:06 +0000 (10:07 +0300)
committerKonstantin LEONTEV <kleontev@ubuntu2004-01.nnov.opencascade.com>
Thu, 13 Oct 2022 07:07:06 +0000 (10:07 +0300)
src/SVTK/SVTK_ImageWriter.cxx
src/SVTK/SVTK_ImageWriterMgr.cxx
src/SVTK/SVTK_Recorder.cxx
src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx

index 2d52dff70667b4805589082db185b67e23a80acd..b56b125a9b741bf98407f443c09e3fe34549319f 100644 (file)
@@ -19,6 +19,8 @@
 
 #include "SVTK_ImageWriter.h"
 
+#include "utilities.h"
+
 #include <QSemaphore>
 
 #include <vtkAlgorithm.h>
 #include <vtkJPEGWriter.h>
 #include <vtkSmartPointer.h>
 
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
-
 
 //----------------------------------------------------------------------------
 SVTK_ImageWriter
@@ -55,7 +51,8 @@ SVTK_ImageWriter
 SVTK_ImageWriter
 ::~SVTK_ImageWriter()
 {
-  if(MYDEBUG) cout<<"SVTK_ImageWriter::~SVTK_ImageWriter - this = "<<this<<endl;
+  if(SALOME::VerbosityActivated())
+    cout << "SVTK_ImageWriter::~SVTK_ImageWriter - this = " << this << endl;
 }
 
 
@@ -101,10 +98,11 @@ SVTK_ImageWriter
   aWriter->Delete();
   myImageData->Delete();
 
-  if(MYDEBUG) cout<<"SVTK_ImageWriter::run "<<
-                "- this = "<<this<<
-                //"; total = "<<mySemaphore->total()<<
-                "; available = "<<mySemaphore->available()<<endl;
+  if(SALOME::VerbosityActivated())
+    cout << "SVTK_ImageWriter::run - this = " << this <<
+    //"; total = "<<mySemaphore->total()<<
+    "; available = " << mySemaphore->available() << endl;
+    
   mySemaphore->release();
 }
 
index 4255c474a53e959d4efddbb5aafb58a8de7756bc..af662569e91c84e372c30b78449e68a92f8f8064 100644 (file)
@@ -20,6 +20,8 @@
 #include "SVTK_ImageWriterMgr.h"
 #include "SVTK_ImageWriter.h"
 
+#include "utilities.h"
+
 #include <vtkAlgorithm.h>
 #include <vtkImageData.h>
 
 
 #include <limits>
 
-
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
-
 //----------------------------------------------------------------------------
 SVTK_ImageWriterMgr
 ::SVTK_ImageWriterMgr()
@@ -41,9 +36,8 @@ SVTK_ImageWriterMgr
   int aMax = std::numeric_limits<int>::max() / 2;
   mySemaphore = new QSemaphore(aMax);
   mySemaphore->acquire( aMax );
-  if(MYDEBUG) cout<<"SVTK_ImageWriterMgr::SVTK_ImageWriterMgr "<<
-                //"- total = "<<mySemaphore->total()<<
-                "; available = "<<mySemaphore->available()<<endl;
+  if(SALOME::VerbosityActivated())
+    cout << "SVTK_ImageWriterMgr::SVTK_ImageWriterMgr; available = " << mySemaphore->available() << endl;
 }
 
 
@@ -84,10 +78,14 @@ void
 SVTK_ImageWriterMgr
 ::Stop()
 {
-  if(MYDEBUG) cout<<"SVTK_ImageWriterMgr::Stop "<<
-                //"- total = "<<mySemaphore->total()<<
-                "; available = "<<mySemaphore->available()<<endl;
-  if(MYDEBUG) cout<<"SVTK_ImageWriterMgr::Stop - *mySemaphore += "<<myThreads.size()<<endl;
+  if(SALOME::VerbosityActivated())
+    cout << "SVTK_ImageWriterMgr::Stop " <<
+    //"- total = "<<mySemaphore->total()<<
+    "; available = " << mySemaphore->available() << endl;
+
+  if(SALOME::VerbosityActivated())
+    cout << "SVTK_ImageWriterMgr::Stop - *mySemaphore += " << myThreads.size() << endl;
+    
   mySemaphore->acquire( (int)myThreads.size() ); //!< TODO: conversion from size_t to int
 
   for(size_t anId = 0, anEnd = myThreads.size(); anId < anEnd; anId++){
index e7ee680d7066d8f6f6779bad38bbb76f6e6c0951..b4ec61b7fa7243e9424ab7410da3ec26fa1b69cb 100644 (file)
 #include <QFileInfo>
 #include <QDir>
 
-//#include "utilities.h"
-
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
+#include "utilities.h"
 
 
 namespace
@@ -313,7 +307,9 @@ SVTK_Recorder
   myPaused = myPaused ? 0 : 1;
   if(myPaused && !myFrameIndexes.empty()){
     myFrameIndexes.back() *= -1;
-    if(MYDEBUG) cout<<"SVTK_Recorder::Pause - myFrameIndexes.back() = "<<myFrameIndexes.back()<<endl;
+
+    if(SALOME::VerbosityActivated())
+      cout << "SVTK_Recorder::Pause - myFrameIndexes.back() = " << myFrameIndexes.back() << endl;
   }
 }
 
@@ -349,9 +345,11 @@ SVTK_Recorder
     if(aLastFrameIndex < 0){
       myFrameIndexes.back() = abs(myFrameIndexes.back());
       double aPauseTime = fabs((double)(aFrameIndex - myFrameIndex - 1)) / myNbFPS;
-      if(MYDEBUG)
-        cout<<"SVTK_Recorder::DoRecord - aFrameIndex = "<<aFrameIndex<<
-          "; aPauseTime = "<<aPauseTime<<endl;
+
+      if(SALOME::VerbosityActivated())
+        cout << "SVTK_Recorder::DoRecord - aFrameIndex = " << aFrameIndex <<
+        "; aPauseTime = " << aPauseTime << endl;
+
       myTimeStart += aPauseTime;
     }
 
@@ -363,7 +361,8 @@ SVTK_Recorder
   }
 
   myFrameIndexes.push_back(myFrameIndex);
-  if(MYDEBUG) cout<<"SVTK_Recorder::DoRecord - myFrameIndex = "<<myFrameIndex<<endl;
+  if(SALOME::VerbosityActivated())
+    cout << "SVTK_Recorder::DoRecord - myFrameIndex = " << myFrameIndex << endl;
 
   myRenderWindow->RemoveObserver(myCommand);
   myFilter->Modified();
@@ -445,7 +444,8 @@ SVTK_Recorder
     }
     std::string aString(aStream.str());
     system(aString.c_str());
-    if(MYDEBUG) cout<<"SVTK_Recorder::AddSkippedFrames - "<<aString<<endl;
+    if(SALOME::VerbosityActivated())
+      cout << "SVTK_Recorder::AddSkippedFrames - " << aString << endl;
   }
 }
 
@@ -471,7 +471,8 @@ SVTK_Recorder
   std::string aString(aStream.str());
   myErrorStatus = system(aString.c_str());
 
-  if(MYDEBUG) cout<<"SVTK_Recorder::MakeFileAVI - "<<aString<<endl;
+  if(SALOME::VerbosityActivated())
+    cout << "SVTK_Recorder::MakeFileAVI - " << aString << endl;
 
   QFileInfo aFileInfo(myName.c_str());
   QString aDirPath = aFileInfo.absoluteDir().path();
@@ -491,6 +492,8 @@ SVTK_Recorder
        ") & (for /f %i in (" + tmpFile + ") do (del \"%i\")) & (del " + tmpFile + "))) > NUL";
 #endif
 
-  if(MYDEBUG) cout<<"SVTK_Recorder::MakeFileAVI - "<<(const char*)aCommand.toUtf8()<<endl;
+  if(SALOME::VerbosityActivated())
+    cout << "SVTK_Recorder::MakeFileAVI - " << (const char*)aCommand.toUtf8() << endl;
+    
   system((const char*)aCommand.toUtf8());
 }
index 4a33aadd71ab9426cd2448aa2383efb47582c75d..0cc0d1883b0109d3d689f5bfc03b4dbde26441a4 100644 (file)
@@ -390,13 +390,13 @@ int VTKViewer_ExtractUnstructuredGrid::RequestData(vtkInformation *vtkNotUsed(re
       cellTypesVec[ *type ] = *type;
   }
 
-/*  if(MYDEBUG){
+/*  
     MESSAGE("Execute - anInput->GetNumberOfCells() = "<<anInput->GetNumberOfCells());
     MESSAGE("Execute - myCellTypes.size() = "<<myCellTypes.size());
     MESSAGE("Execute - myCellIds.size() = "<<myCellIds.size());
     MESSAGE("Execute - myExtractionMode = "<<myExtractionMode);
     MESSAGE("Execute - myChangeMode = "<<myChangeMode);
-  }*/
+*/
   vtkIdType aNbElems = 0;
   if(myExtractionMode == eCells)
   {
@@ -618,12 +618,12 @@ int VTKViewer_ExtractUnstructuredGrid::RequestData(vtkInformation *vtkNotUsed(re
     myPassAll = true;
     TVectorId().swap( myOut2InId );
   }
-/*  if(MYDEBUG){
+/*
     MESSAGE("Execute - anOutput->GetNumberOfCells() = "<<anOutput->GetNumberOfCells());
     if(myStoreMapping){
       MESSAGE("Execute - myOut2InId.size() = "<<myOut2InId.size());
       MESSAGE("Execute - myIn2OutId.size() = "<<myIn2OutId.size());
     }
-  }*/
+*/
   return 1;
 }