#include <vtkCellType.h>
#include <vtkUnstructuredGrid.h>
+#include "utilities.h"
+
using namespace std;
#ifdef DEBUG
vtkDataSet* aDataSet = aGaussMesh->GetOutput();
aDataSet->Update();
int aNbCells = aDataSet->GetNumberOfCells();
- cout<<"aNbCells = "<<aNbCells<<endl;
+ MESSAGE("aNbCells = "<<aNbCells);
for(int anCellId = 0; anCellId < aNbCells; anCellId++){
VISU::TGaussPointID anObjID = aGaussMesh->GetObjID(anCellId);
cout<<anObjID.first<<"; "<<anObjID.second<<"; "<<aGaussMesh->GetNodeVTKID(anObjID.first)<<endl;
for(anCellId = 0; anCellId < aNbCells; anCellId++){
anObjID = anIDMapper->GetElemObjID(anCellId);
aVTKID = anIDMapper->GetElemVTKID(anObjID);
- cout<<anObjID<<"; "<<aVTKID<<endl;
+ MESSAGE(anObjID<<"; "<<aVTKID);
}
#endif
}
#include <vtk3DWidget.h>
#include <vtkProperty.h>
+#include "utilities.h"
+
void PrintMissing(){
- cout<<"VISUPipeLine : ";
- cout<<"missing operand after `VISUPipeLine'"<<endl;
-
- cout<<"VISUPipeLine : ";
- cout<<"Try `VISUPipeLine -h' for more information."<<endl;
+ MESSAGE(std::endl << "VISUPipeLine : missing operand after `VISUPipeLine'" <<
+ std::endl << "VISUPipeLine : Try `VISUPipeLine -h' for more information.");
}
void PrintHelp(){
- cout<<" Usage: VISUPipeLine filename meshname fieldname [timestamp] [component] " <<endl;
- cout<<"filename - Name of the med file. " <<endl;
- cout<<"meshname - Name of the mesh in the med file. " <<endl;
- cout<<"fieldname - Name of the mesh field. " <<endl;
- cout<<"timestamp - Number of the time stamp in the field 1,2,3 ... (optionally)" <<endl;
- cout<<" by default used first time stamp. " <<endl;
- cout<<"component - Number of the component in the field 0,1,2,3 ...(optionally)" <<endl;
- cout<<" 0 - modulus, 1 - first component, 2 - second component, ... " <<endl;
- cout<<" by default used modulus. " <<endl;
+ MESSAGE_ADD(std::endl << " Usage: VISUPipeLine filename meshname fieldname [timestamp] [component] " <<
+ std::endl << "filename - Name of the med file. " <<
+ std::endl << "meshname - Name of the mesh in the med file. " <<
+ std::endl << "fieldname - Name of the mesh field. " <<
+ std::endl << "timestamp - Number of the time stamp in the field 1,2,3 ... (optionally)" <<
+ std::endl << " by default used first time stamp. " <<
+ std::endl << "component - Number of the component in the field 0,1,2,3 ...(optionally)" <<
+ std::endl << " 0 - modulus, 1 - first component, 2 - second component, ... " <<
+ std::endl << " by default used modulus. ");
}
void PrintErr(){
- cout<<"***************************ERROR*****************************************"<<endl;
+ MESSAGE("***************************ERROR*****************************************");
}
if(!isMeshOk) {
PrintErr();
- cout<<"Can not find mesh with name `"<<aMeshName<<"' in the file `"<<aFileName<<"'"<<endl;
+ MESSAGE("Can not find mesh with name `"<<aMeshName<<"' in the file `"<<aFileName<<"'");
PrintErr();
return 1;
}
if(!isFieldOk) {
PrintErr();
- cout<<"Can not find field with name `"<<aFieldName<<"' on the mesh `"<<aMeshName<<"'"<<endl;
+ MESSAGE("Can not find field with name `"<<aFieldName<<"' on the mesh `"<<aMeshName<<"'");
PrintErr();
return 1;
}
if(!isComponentOk) {
PrintErr();
- cout<<"Field field with name `"<<aFieldName<<"' containt less then `"<<aComponentNumber<<"' component(s)."<<endl;
+ MESSAGE("Field field with name `"<<aFieldName<<"' containt less then `"<<aComponentNumber<<"' component(s).");
PrintErr();
return 1;
}
if(!isTimeStampOk) {
PrintErr();
- cout<<"Can not find time stamp with number `"<<aTimeStampNumber<<"' on the field `"<<aFieldName<<"'"<<endl;
+ MESSAGE("Can not find time stamp with number `"<<aTimeStampNumber<<"' on the field `"<<aFieldName<<"'");
PrintErr();
}
}catch(std::exception& exc){
#include <cmath>
#include <string>
+#include "utilities.h"
+
#ifndef WNT
# ifndef GLX_GLXEXT_LEGACY
# define GLX_GLXEXT_LEGACY
{
#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)<<"; "
- <<endl;
+ MESSAGE( "VISU_OpenGLPointSpriteMapper::RenderPiece - "
+ <<(this->GetMTime() > this->BuildTime)<<"; "
+ <<(input->GetMTime() > this->BuildTime)<<"; "
+ <<(act->GetProperty()->GetMTime() > this->BuildTime)<<"; ");
#endif
// sets this->Colors as side effect
this->MapScalars( act->GetProperty()->GetOpacity() );
#include <vtkRenderWindow.h>
+#include "utilities.h"
+
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
::CreateHolder(VISU::VISUType theType,
const VISU::ColoredPrs3dHolder::BasicInput& theInput)
{
- if(MYDEBUG) cout << "CreateHolder " << theType << endl;
+ if(MYDEBUG) MESSAGE ("CreateHolder "<<theType);
CORBA::Float aRequiredMemory = 0.0;
if(IsPossible(theType, theInput, aRequiredMemory, "")){
if(VISU::ColoredPrs3d_i* aColoredPrs3d = CreateColoredPrs3d(theType, theInput)){
::RegisterInHolder(VISU::ColoredPrs3d_i* thePrs3d,
const std::string& theHolderEntry)
{
- if(MYDEBUG) cout << "RegisterInHolder " << theHolderEntry.c_str() << " " << thePrs3d << endl;
+ if(MYDEBUG) MESSAGE("RegisterInHolder "<<theHolderEntry.c_str()<<" "<<thePrs3d);
if(thePrs3d){
TPrs3dPtr aPrs3d(thePrs3d);
myHolderMap[theHolderEntry].push_front(aPrs3d);
::GetLastVisitedPrs(VISU::ColoredPrs3dHolder_i* theHolder)
{
const TLastVisitedPrsList& aList = GetLastVisitedPrsList(theHolder);
- if(MYDEBUG) cout << "GetLastVisitedPrs " << theHolder->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();
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);
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);
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();
{
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++){
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 << "------------------------------------" );
}
}
#include "ReceiverFactory.hxx"
#include "MED_SliceArray.hxx"
+#include "utilities.h"
+
#define USER_INTERLACE MED_FULL_INTERLACE
#ifdef _DEBUG_
else
aGeom2ProfileIds = aSupport->getNumberFromFile(aMGeom);
int aLen = aGeom2ProfileIds->length();
- if(MYDEBUG) MESSAGE(" - aMGeom="<<aMGeom<<"; aNbCells="<<aLen);
+ if(MYDEBUG) MESSAGE_BEGIN(" - aMGeom="<<aMGeom<<"; aNbCells="<<aLen);
for(int i = 0; i < aLen; i++){
int anId = aGeom2ProfileIds[i];
aGeom2Profile.push_back(anId);
- if(MYDEBUG) cout << "------------------------------->" << anId << endl;
+ if(MYDEBUG) MESSAGE_ADD(std::endl << "------------------------------->" << anId);
}
- if(MYDEBUG) cout << endl;
+ if(MYDEBUG) MESSAGE_END(" ");
} catch(...) {
continue;
}
#include "VISU_TableReader.hxx"
#include "VISU_ConvertorUtils.hxx"
+#include "utilities.h"
+
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
SALOMEDS::SObject_var aRealObject = aStudyBuilder->NewObject(aFileObject);
anAttr = aStudyBuilder->FindOrCreateAttribute(aRealObject, "AttributeName");
aName = SALOMEDS::AttributeName::_narrow(anAttr);
- if(MYDEBUG) cout<<"aTable2D.myTitle = "<<aTable2D.myTitle<<endl;
+ if(MYDEBUG) MESSAGE("aTable2D.myTitle = "<<aTable2D.myTitle);
if ( aTable2D.myTitle != "" ) {
aName->SetValue(aTable2D.myTitle.c_str());
} else {
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 = "<<j<<"; kEnd = "<<kEnd<<endl;
+ if(MYDEBUG) MESSAGE("j = "<<j<<"; kEnd = "<<kEnd);
for(int k = 0; k < kEnd; k++){
QString aVal = aNewTable2D.myRows[j].myValues[k].c_str();
#include <qsemaphore.h>
+#include "utilities.h"
+
#include <vtkImageData.h>
#include <vtkImageClip.h>
#include <vtkJPEGWriter.h>
VVTK_ImageWriter
::~VVTK_ImageWriter()
{
- if(MYDEBUG) cout<<"VVTK_ImageWriter::~VVTK_ImageWriter - this = "<<this<<endl;
+ if(MYDEBUG) MESSAGE("VVTK_ImageWriter::~VVTK_ImageWriter - this = "<<this);
}
aWriter->Delete();
myImageData->Delete();
- if(MYDEBUG) cout<<"VVTK_ImageWriter::run "<<
+ if(MYDEBUG) MESSAGE("VVTK_ImageWriter::run "<<
"- this = "<<this<<
"; total = "<<mySemaphore->total()<<
- "; available = "<<mySemaphore->available()<<endl;
+ "; available = "<<mySemaphore->available() );
*mySemaphore -= 1;
}
#include <qsemaphore.h>
-#include <limits>
+#include "utilities.h"
+#include <limits>
#ifdef _DEBUG_
static int MYDEBUG = 0;
int aMax = std::numeric_limits<int>::max() / 2;
mySemaphore = new QSemaphore(aMax);
*mySemaphore += aMax;
- if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::VVTK_ImageWriterMgr "<<
+ if(MYDEBUG) MESSAGE("VVTK_ImageWriterMgr::VVTK_ImageWriterMgr "<<
"- total = "<<mySemaphore->total()<<
- "; available = "<<mySemaphore->available()<<endl;
+ "; available = "<<mySemaphore->available() );
}
VVTK_ImageWriterMgr
::Stop()
{
- if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::Stop "<<
+ if(MYDEBUG) MESSAGE("VVTK_ImageWriterMgr::Stop "<<
"- total = "<<mySemaphore->total()<<
- "; available = "<<mySemaphore->available()<<endl;
- if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::Stop - *mySemaphore += "<<myThreads.size()<<endl;
+ "; available = "<<mySemaphore->available() );
+ if(MYDEBUG) MESSAGE("VVTK_ImageWriterMgr::Stop - *mySemaphore += "<<myThreads.size() );
*mySemaphore += myThreads.size();
for(size_t anId = 0, anEnd = myThreads.size(); anId < anEnd; anId++){
myPaused = myPaused ? 0 : 1;
if(myPaused && !myFrameIndexes.empty()){
myFrameIndexes.back() *= -1;
- if(MYDEBUG) cout<<"VVTK_Recorder::Pause - myFrameIndexes.back() = "<<myFrameIndexes.back()<<endl;
+ if(MYDEBUG) MESSAGE("VVTK_Recorder::Pause - myFrameIndexes.back() = "<<myFrameIndexes.back());
}
}
myFrameIndexes.back() = abs(myFrameIndexes.back());
double aPauseTime = fabs((double)(aFrameIndex - myFrameIndex - 1)) / myNbFPS;
if(MYDEBUG)
- cout<<"VVTK_Recorder::DoRecord - aFrameIndex = "<<aFrameIndex<<
- "; aPauseTime = "<<aPauseTime<<endl;
+ MESSAGE("VVTK_Recorder::DoRecord - aFrameIndex = "<<aFrameIndex<<
+ "; aPauseTime = "<<aPauseTime);
myTimeStart += aPauseTime;
}
}
myFrameIndexes.push_back(myFrameIndex);
- if(MYDEBUG) cout<<"VVTK_Recorder::DoRecord - myFrameIndex = "<<myFrameIndex<<endl;
+ if(MYDEBUG) MESSAGE("VVTK_Recorder::DoRecord - myFrameIndex = "<<myFrameIndex);
myRenderWindow->RemoveObserver(myCommand);
myFilter->Modified();
}
std::string aString(aStream.str());
system(aString.c_str());
- if(MYDEBUG) cout<<"VVTK_Recorder::AddSkippedFrames - "<<aString<<endl;
+ if(MYDEBUG) MESSAGE("VVTK_Recorder::AddSkippedFrames - "<<aString);
}
}
std::string aString(aStream.str());
myErrorStatus = system(aString.c_str());
- if(MYDEBUG) cout<<"VVTK_Recorder::MakeFileAVI - "<<aString<<endl;
+ if(MYDEBUG) MESSAGE("VVTK_Recorder::MakeFileAVI - "<<aString);
QFileInfo aFileInfo(myName.c_str());
QString aDirPath = aFileInfo.dirPath(TRUE);
aCommand =
QString("rm ") + aDirPath + "/" + aBaseName + "*.jpeg";
- if(MYDEBUG) cout<<"VVTK_Recorder::MakeFileAVI - "<<aCommand.latin1()<<endl;
+ if(MYDEBUG) MESSAGE("VVTK_Recorder::MakeFileAVI - "<<aCommand.latin1() );
system(aCommand.latin1());
}