1 #ifndef __CPEXTENSIONS__VISUALIZATION__MPRWITHDIFFERENTWINDOWS__H__
2 #define __CPEXTENSIONS__VISUALIZATION__MPRWITHDIFFERENTWINDOWS__H__
4 #include <cpExtensions/Visualization/MPRActors.h>
5 #include <cpExtensions/Visualization/ImageInteractorStyle.h>
6 #include <cpExtensions/cpExtensions_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( ); \
34 namespace cpExtensions
36 namespace Visualization
40 class cpExtensions_EXPORT MPRWithDifferentWindows
43 typedef cpExtensions::Visualization::
45 typedef cpExtensions::Visualization::
46 ImageInteractorStyle TStyle;
49 cpPlugins_MPRWithDifferentWindows_ObserverMacro( DoubleClick );
50 cpPlugins_MPRWithDifferentWindows_ObserverMacro( Cursor );
51 cpPlugins_MPRWithDifferentWindows_ObserverMacro( Radius );
54 MPRWithDifferentWindows(
55 vtkRenderWindow* xWin = NULL,
56 vtkRenderWindow* yWin = NULL,
57 vtkRenderWindow* zWin = NULL,
58 vtkRenderWindow* auxWin = NULL
60 virtual ~MPRWithDifferentWindows( );
62 void SetImage( vtkImageData* image );
63 void SetModeToNavigation( );
64 void SetModeToDeformation( );
66 void ResetCamera( const int& id );
68 void Render( const int& id );
71 vtkRenderer* GetRenderer( const int& id ) const;
73 void Add3DActor( vtkProp3D* prop );
77 vtkRenderWindow* m_Windows[ 4 ];
80 vtkSmartPointer< TMPRActors > m_MPRActors;
81 vtkSmartPointer< vtkRenderer > m_Renderers[ 4 ];
82 vtkSmartPointer< TStyle > m_Styles[ 3 ];
89 #endif // __CPEXTENSIONS__VISUALIZATION__MPRWITHDIFFERENTWINDOWS__H__