From 9cc4c8e43318807220af9bf642f7b75e2454414a Mon Sep 17 00:00:00 2001 From: dmv Date: Thu, 19 Jun 2008 10:24:13 +0000 Subject: [PATCH] IPAL 18631 Remove Extra Messages from the Terminal in case of Release Mode --- src/CONVERTOR/VISUConvertor.cxx | 6 ++- src/PIPELINE/VISUPipeLine.cxx | 37 +++++++++---------- src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx | 11 +++--- src/VISU_I/VISU_ColoredPrs3dCache_i.cc | 33 +++++++++-------- src/VISU_I/VISU_CorbaMedConvertor.cxx | 8 ++-- src/VISU_I/VISU_Table_i.cc | 6 ++- src/VVTK/VVTK_ImageWriter.cxx | 8 ++-- src/VVTK/VVTK_ImageWriterMgr.cxx | 13 ++++--- src/VVTK/VVTK_Recorder.cxx | 14 +++---- 9 files changed, 73 insertions(+), 63 deletions(-) diff --git a/src/CONVERTOR/VISUConvertor.cxx b/src/CONVERTOR/VISUConvertor.cxx index df0b03f6..b24988dd 100644 --- a/src/CONVERTOR/VISUConvertor.cxx +++ b/src/CONVERTOR/VISUConvertor.cxx @@ -40,6 +40,8 @@ #include #include +#include "utilities.h" + using namespace std; #ifdef DEBUG @@ -100,7 +102,7 @@ void ParseMEDFile(const char* theFileName) vtkDataSet* aDataSet = aGaussMesh->GetOutput(); aDataSet->Update(); int aNbCells = aDataSet->GetNumberOfCells(); - cout<<"aNbCells = "<GetNodeVTKID(anObjID.first)<GetElemObjID(anCellId); aVTKID = anIDMapper->GetElemVTKID(anObjID); - cout< #include +#include "utilities.h" + void PrintMissing(){ - cout<<"VISUPipeLine : "; - cout<<"missing operand after `VISUPipeLine'"< #include +#include "utilities.h" + #ifndef WNT # ifndef GLX_GLXEXT_LEGACY # define GLX_GLXEXT_LEGACY @@ -557,11 +559,10 @@ void VISU_OpenGLPointSpriteMapper::RenderPiece(vtkRenderer *ren, vtkActor *act) { #ifdef _DEBUG_RENDERING_PERFORMANCE_ // To control when the mapper is recalculated - cout<<"VISU_OpenGLPointSpriteMapper::RenderPiece - " - <<(this->GetMTime() > this->BuildTime)<<"; " - <<(input->GetMTime() > this->BuildTime)<<"; " - <<(act->GetProperty()->GetMTime() > this->BuildTime)<<"; " - <GetMTime() > this->BuildTime)<<"; " + <<(input->GetMTime() > this->BuildTime)<<"; " + <<(act->GetProperty()->GetMTime() > this->BuildTime)<<"; "); #endif // sets this->Colors as side effect this->MapScalars( act->GetProperty()->GetOpacity() ); diff --git a/src/VISU_I/VISU_ColoredPrs3dCache_i.cc b/src/VISU_I/VISU_ColoredPrs3dCache_i.cc index 348ff93b..43225594 100644 --- a/src/VISU_I/VISU_ColoredPrs3dCache_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3dCache_i.cc @@ -45,6 +45,8 @@ #include +#include "utilities.h" + #ifdef _DEBUG_ static int MYDEBUG = 0; #else @@ -388,7 +390,7 @@ VISU::ColoredPrs3dCache_i ::CreateHolder(VISU::VISUType theType, const VISU::ColoredPrs3dHolder::BasicInput& theInput) { - if(MYDEBUG) cout << "CreateHolder " << theType << endl; + if(MYDEBUG) MESSAGE ("CreateHolder "<GetEntry().c_str() << " " << aList.size() << endl; + if(MYDEBUG) MESSAGE("GetLastVisitedPrs " << theHolder->GetEntry().c_str() << " " << aList.size() ); if( !aList.empty() ) return aList.front(); return VISU::TPrs3dPtr(); @@ -620,7 +622,7 @@ VISU::ColoredPrs3dCache_i const VISU::ColoredPrs3dHolder::BasicInput& theInput, VISU::View3D_ptr theView3D) { - if(MYDEBUG) cout << "VISU::ColoredPrs3dCache_i::UpdateLastVisitedPrs" << endl; + if(MYDEBUG) MESSAGE( "VISU::ColoredPrs3dCache_i::UpdateLastVisitedPrs" ); TPrs3dPtr aPrs3d; try{ TPrs3dPtr aLastVisitedPrs3d = GetLastVisitedPrs(theHolder); @@ -631,12 +633,12 @@ VISU::ColoredPrs3dCache_i CORBA::Float aRequiredMemory = 0.0; if(aPrs3d = FindPrsByInput(aLastVisitedPrsList, theInput)){ aLastVisitedPrsList.push_front(aPrs3d); - if(MYDEBUG) cout << "FindPrsByInput " << aPrs3d << endl; + if(MYDEBUG) MESSAGE( "FindPrsByInput " << aPrs3d ); }else if(anIsCheckPossible && IsPossible(aPrsType, theInput, aRequiredMemory, aHolderEntry)){ if( aRequiredMemory > 1.0 / VTK_LARGE_FLOAT ) ClearMemory(aRequiredMemory, aHolderEntry); aPrs3d = CreatePrs(aPrsType, theInput, theHolder); - if(MYDEBUG) cout << "Created " << aPrs3d << endl; + if(MYDEBUG) MESSAGE( "Created " << aPrs3d ); }else{ aPrs3d = aLastVisitedPrsList.back(); aPrs3d->SetResultObject(theInput.myResult); @@ -646,7 +648,7 @@ VISU::ColoredPrs3dCache_i aPrs3d->SetTimeStampNumber(theInput.myTimeStampNumber); aLastVisitedPrsList.pop_back(); aLastVisitedPrsList.push_front(aPrs3d); - if(MYDEBUG) cout << "Move only " << aPrs3d << endl; + if(MYDEBUG) MESSAGE( "Move only " << aPrs3d ); } //if(MYDEBUG) PrintCache(); @@ -770,8 +772,8 @@ VISU::ColoredPrs3dCache_i { if(MYDEBUG) { - cout << "--------------CACHE-----------------" << endl; - cout << "Cache memory - " << GetMemorySize() << " Mb" << endl; + MESSAGE_BEGIN(std::endl << "--------------CACHE-----------------" ); + MESSAGE_ADD(std::endl << "Cache memory - " << GetMemorySize() << " Mb" ); TColoredPrs3dHolderMap::const_iterator aHolderIter = myHolderMap.begin(); TColoredPrs3dHolderMap::const_iterator aHolderIterEnd = myHolderMap.end(); for(; aHolderIter != aHolderIterEnd; aHolderIter++){ @@ -779,19 +781,18 @@ VISU::ColoredPrs3dCache_i TLastVisitedPrsList::const_iterator aPrsIter = aPrsList.begin(); TLastVisitedPrsList::const_iterator aPrsIterEnd = aPrsList.end(); - cout << "--------------------------" << endl; - cout << "Holder - " << aHolderIter->first.c_str() << endl; - cout << "Size - " << aPrsList.size() << endl; + MESSAGE_ADD(std::endl << "--------------------------" ); + MESSAGE_ADD(std::endl << "Holder - " << aHolderIter->first.c_str() ); + MESSAGE_ADD(std::endl << "Size - " << aPrsList.size() ); for(; aPrsIter != aPrsIterEnd; aPrsIter++) if(TPrs3dPtr aPrs3d = *aPrsIter) { - cout << aPrs3d << " (" << aPrs3d->GetMemorySize() << " Mb)"; + MESSAGE_ADD(std::endl << aPrs3d << " (" << aPrs3d->GetMemorySize() << " Mb)"); if(aPrsIter == aPrsList.begin()) - cout << " (device)"; - cout << endl; + MESSAGE_ADD( " (device)" ); } } - cout << "------------------------------------" << endl; + MESSAGE_END(std::endl << "------------------------------------" ); } } diff --git a/src/VISU_I/VISU_CorbaMedConvertor.cxx b/src/VISU_I/VISU_CorbaMedConvertor.cxx index aea4b36c..f8da47ae 100644 --- a/src/VISU_I/VISU_CorbaMedConvertor.cxx +++ b/src/VISU_I/VISU_CorbaMedConvertor.cxx @@ -37,6 +37,8 @@ #include "ReceiverFactory.hxx" #include "MED_SliceArray.hxx" +#include "utilities.h" + #define USER_INTERLACE MED_FULL_INTERLACE #ifdef _DEBUG_ @@ -588,13 +590,13 @@ namespace else aGeom2ProfileIds = aSupport->getNumberFromFile(aMGeom); int aLen = aGeom2ProfileIds->length(); - if(MYDEBUG) MESSAGE(" - aMGeom="<" << anId << endl; + if(MYDEBUG) MESSAGE_ADD(std::endl << "------------------------------->" << anId); } - if(MYDEBUG) cout << endl; + if(MYDEBUG) MESSAGE_END(" "); } catch(...) { continue; } diff --git a/src/VISU_I/VISU_Table_i.cc b/src/VISU_I/VISU_Table_i.cc index 064b7a0a..2b8189ef 100644 --- a/src/VISU_I/VISU_Table_i.cc +++ b/src/VISU_I/VISU_Table_i.cc @@ -36,6 +36,8 @@ #include "VISU_TableReader.hxx" #include "VISU_ConvertorUtils.hxx" +#include "utilities.h" + #ifdef _DEBUG_ static int MYDEBUG = 0; #else @@ -1199,7 +1201,7 @@ VISU::ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy) SALOMEDS::SObject_var aRealObject = aStudyBuilder->NewObject(aFileObject); anAttr = aStudyBuilder->FindOrCreateAttribute(aRealObject, "AttributeName"); aName = SALOMEDS::AttributeName::_narrow(anAttr); - if(MYDEBUG) cout<<"aTable2D.myTitle = "<SetValue(aTable2D.myTitle.c_str()); } else { @@ -1216,7 +1218,7 @@ VISU::ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy) int kEnd = aNewTable2D.myRows[0].myValues.size(); aTableOfReal->SetNbColumns(kEnd); for(int j = 0, jEnd = aNewTable2D.myRows.size(); j < jEnd; j++){ - if(MYDEBUG) cout<<"j = "< #include #include @@ -61,7 +63,7 @@ VVTK_ImageWriter VVTK_ImageWriter ::~VVTK_ImageWriter() { - if(MYDEBUG) cout<<"VVTK_ImageWriter::~VVTK_ImageWriter - this = "< #ifdef _DEBUG_ static int MYDEBUG = 0; @@ -49,9 +50,9 @@ VVTK_ImageWriterMgr int aMax = std::numeric_limits::max() / 2; mySemaphore = new QSemaphore(aMax); *mySemaphore += aMax; - if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::VVTK_ImageWriterMgr "<< + if(MYDEBUG) MESSAGE("VVTK_ImageWriterMgr::VVTK_ImageWriterMgr "<< "- total = "<total()<< - "; available = "<available()<