[vtkusers] How to suppress certain messages when using vtkDebugMacro

Elvis Dowson elvis.dowson at mac.com
Tue Oct 28 15:37:01 EDT 2008


Hi,
           How can I suppress certain types of debug information, when  
using vtkDebugMacro. I have a class the inherits from  
vtkRenderWindowInteractor.

In my main.cxx

	// Setup render window interactor and interactor style
	iren = QVTKInteractor::New();
#if VTK_DEBUG_ON
	iren->DebugOn();
#endif

In the QVTKInteractor.cpp file


/*! handle mouse move event
  */
void QVTKInteractor::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
{
	// Display debug information
#if VTK_DEBUG_ON
	vtkDebugMacro(<< "Mouse move event received." << endl
				  << "Item   Position x = " << event->pos().x()		<< ", y = " <<  
event->pos().y()		<< endl
				  << "Scene  Position x = " << event->scenePos().x()	<< ", y = "  
<< event->scenePos().y()	<< endl
				  << "Screen Position x = " << event->screenPos().x()	<< ", y = "  
<< event->screenPos().y()	<< endl);				
#endif

...
}


Here is the output. I just want the debug messages that I want printed  
out, as above, without the additional unnecessary trailing information.

Debug: In /Users/elvis/Project/C4I/Source/cxx/ 
vtkOffScreenRenderingQGraphicsSceneCarbonTest/QVTKInteractor.cpp, line  
138
QVTKInteractor (0x3cb9850): Mouse move event received.
Item   Position x = 0, y = 0
Scene  Position x = 124, y = 663
Screen Position x = 822, y = 874


Debug: In /Users/elvis/Tool/vtk-5.x/install/carbon-shared/include/ 
vtk-5.3/vtkRenderWindowInteractor.h, line 99
QVTKInteractor (0x3cb9858): QVTKInteractor (0x3cb9858): returning  
Enabled of 1

Debug: In /Users/elvis/Tool/vtk-5.x/install/carbon-shared/include/ 
vtk-5.3/vtkRenderWindowInteractor.h, line 281
QVTKInteractor (0x3cb9858): QVTKInteractor (0x3cb9858): returning  
EventPosition pointer 0x3cb98b8

Debug: In /Users/elvis/Tool/vtk-5.x/install/carbon-shared/include/ 
vtk-5.3/vtkRenderWindowInteractor.h, line 281
QVTKInteractor (0x3cb9858): QVTKInteractor (0x3cb9858): returning  
EventPosition pointer 0x3cb98b8

Debug: In /Users/elvis/Tool/vtk-5.x/install/carbon-shared/include/ 
vtk-5.3/vtkRenderWindowInteractor.h, line 214
QVTKInteractor (0x3cb9858): QVTKInteractor (0x3cb9858): returning  
Initialized of 1

Debug: In /Users/elvis/Tool/vtk-5.x/install/carbon-shared/include/ 
vtk-5.3/vtkRenderWindowInteractor.h, line 214
QVTKInteractor (0x3cb9858): QVTKInteractor (0x3cb9858): returning  
Initialized of 1

Focus out event received
Debug: In /Users/elvis/Tool/vtk-5.x/install/carbon-shared/include/ 
vtk-5.3/vtkRenderWindowInteractor.h, line 99
QVTKInteractor (0x3cb9858): QVTKInteractor (0x3cb9858): returning  
Enabled of 1

Debug: In /Users/elvis/Tool/vtk-5.x/install/carbon-shared/include/ 
vtk-5.3/vtkRenderWindowInteractor.h, line 214
QVTKInteractor (0x3cb9858): QVTKInteractor (0x3cb9858): returning  
Initialized of 1

Debug: In /Users/elvis/Tool/vtk-5.x/install/carbon-shared/include/ 
vtk-5.3/vtkRenderWindowInteractor.h, line 214
QVTKInteractor (0x3cb9858): QVTKInteractor (0x3cb9858): returning  
Initialized of 1

Best regards,

Elvis Dowson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081028/3e52cae6/attachment.htm>


More information about the vtkusers mailing list