1 #ifndef __CPPLUGINS__EXTENSIONS__VISUALIZATION__MPRWITHDIFFERENTWINDOWS__H__
2 #define __CPPLUGINS__EXTENSIONS__VISUALIZATION__MPRWITHDIFFERENTWINDOWS__H__
4 #include <cpPlugins/Extensions/Visualization/MPRActors.h>
5 #include <cpPlugins/Extensions/Visualization/ImageInteractorStyle.h>
7 #include <vtkImageData.h>
8 #include <vtkRenderer.h>
9 #include <vtkRenderWindow.h>
10 #include <vtkSmartPointer.h>
12 // -------------------------------------------------------------------------
13 #define cpPlugins_MPRWithDifferentWindows_ObserverMacro( e ) \
14 inline void Add##e##Observer( vtkCommand* observer ) \
16 for( int i = 0; i < 3; ++i ) \
17 if( this->m_Styles[ i ].GetPointer( ) != NULL ) \
18 this->m_Styles[ i ]->Add##e##Observer( observer ); \
20 inline void Remove##e##Observer( vtkCommand* observer ) \
22 for( int i = 0; i < 3; ++i ) \
23 if( this->m_Styles[ i ].GetPointer( ) != NULL ) \
24 this->m_Styles[ i ]->Remove##e##Observer( observer ); \
26 inline void Remove##e##Observers( ) \
28 for( int i = 0; i < 3; ++i ) \
29 if( this->m_Styles[ i ].GetPointer( ) != NULL ) \
30 this->m_Styles[ i ]->Remove##e##Observers( ); \
37 namespace Visualization
41 class MPRWithDifferentWindows
44 typedef cpPlugins::Extensions::Visualization::
46 typedef cpPlugins::Extensions::Visualization::
47 ImageInteractorStyle TStyle;
50 cpPlugins_MPRWithDifferentWindows_ObserverMacro( DoubleClick );
51 cpPlugins_MPRWithDifferentWindows_ObserverMacro( Cursor );
52 cpPlugins_MPRWithDifferentWindows_ObserverMacro( Radius );
55 MPRWithDifferentWindows(
56 vtkRenderWindow* xWin = NULL,
57 vtkRenderWindow* yWin = NULL,
58 vtkRenderWindow* zWin = NULL,
59 vtkRenderWindow* auxWin = NULL
61 virtual ~MPRWithDifferentWindows( );
64 void SetImage( vtkImageData* image );
65 void SetSegmentation( vtkImageData* image );
67 void ResetCamera( const int& id );
69 void Render( const int& id );
74 vtkRenderWindow* m_Windows[ 4 ];
77 vtkSmartPointer< TMPRActors > m_MPRActors;
78 vtkSmartPointer< vtkRenderer > m_Renderers[ 4 ];
79 vtkSmartPointer< TStyle > m_Styles[ 3 ];
88 #endif // __CPPLUGINS__EXTENSIONS__VISUALIZATION__MPRWITHDIFFERENTWINDOWS__H__