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>
6 #include <cpPlugins/Extensions/cpPlugins_Extensions_Export.h>
8 #include <vtkImageData.h>
9 #include <vtkRenderer.h>
10 #include <vtkRenderWindow.h>
11 #include <vtkSmartPointer.h>
13 // -------------------------------------------------------------------------
14 #define cpPlugins_MPRWithDifferentWindows_ObserverMacro( e ) \
15 inline void Add##e##Observer( vtkCommand* observer ) \
17 for( int i = 0; i < 3; ++i ) \
18 if( this->m_Styles[ i ].GetPointer( ) != NULL ) \
19 this->m_Styles[ i ]->Add##e##Observer( observer ); \
21 inline void Remove##e##Observer( vtkCommand* observer ) \
23 for( int i = 0; i < 3; ++i ) \
24 if( this->m_Styles[ i ].GetPointer( ) != NULL ) \
25 this->m_Styles[ i ]->Remove##e##Observer( observer ); \
27 inline void Remove##e##Observers( ) \
29 for( int i = 0; i < 3; ++i ) \
30 if( this->m_Styles[ i ].GetPointer( ) != NULL ) \
31 this->m_Styles[ i ]->Remove##e##Observers( ); \
38 namespace Visualization
42 class cpPlugins_Extensions_EXPORT MPRWithDifferentWindows
45 typedef cpPlugins::Extensions::Visualization::
47 typedef cpPlugins::Extensions::Visualization::
48 ImageInteractorStyle TStyle;
51 cpPlugins_MPRWithDifferentWindows_ObserverMacro( DoubleClick );
52 cpPlugins_MPRWithDifferentWindows_ObserverMacro( Cursor );
53 cpPlugins_MPRWithDifferentWindows_ObserverMacro( Radius );
56 MPRWithDifferentWindows(
57 vtkRenderWindow* xWin = NULL,
58 vtkRenderWindow* yWin = NULL,
59 vtkRenderWindow* zWin = NULL,
60 vtkRenderWindow* auxWin = NULL
62 virtual ~MPRWithDifferentWindows( );
64 void SetImage( vtkImageData* image );
65 void SetSegmentation( vtkImageData* image );
66 void SetModeToNavigation( );
67 void SetModeToDeformation( );
69 void ResetCamera( const int& id );
71 void Render( const int& id );
76 vtkRenderWindow* m_Windows[ 4 ];
79 vtkSmartPointer< TMPRActors > m_MPRActors;
80 vtkSmartPointer< vtkRenderer > m_Renderers[ 4 ];
81 vtkSmartPointer< TStyle > m_Styles[ 3 ];
90 #endif // __CPPLUGINS__EXTENSIONS__VISUALIZATION__MPRWITHDIFFERENTWINDOWS__H__