1 #ifndef __CPEXTENSIONS__VISUALIZATION__MPROBJECTS__H__
2 #define __CPEXTENSIONS__VISUALIZATION__MPROBJECTS__H__
4 #include <cpExtensions/cpExtensions_Export.h>
5 #include <cpExtensions/Visualization/MPRActors.h>
8 #include <vtkRenderer.h>
9 #include <vtkRenderWindow.h>
11 // -------------------------------------------------------------------------
12 #define cpExtensions_MPRObjects_Renderer( DIR ) \
13 inline vtkRenderer* Get##DIR##Renderer( ) \
14 { return( this->m_Renderers[ Self::MPRDirections_##DIR ] ); } \
15 inline const vtkRenderer* Get##DIR##Renderer( ) const \
16 { return( this->m_Renderers[ Self::MPRDirections_##DIR ] ); }
18 namespace cpExtensions
20 namespace Visualization
25 class cpExtensions_EXPORT MPRObjects
29 typedef MPRObjects Self;
31 typedef MPRActors::TStyle TStyle;
32 typedef MPRActors::TMouseCommand TMouseCommand;
33 typedef MPRActors::TMouseWheelCommand TMouseWheelCommand;
34 typedef MPRActors::TKeyCommand TKeyCommand;
35 typedef MPRActors::TVoidCommand TVoidCommand;
36 typedef MPRActors::TMouseMoveCommand TMouseMoveCommand;
37 typedef MPRActors::TMouseClickCommand TMouseClickCommand;
38 typedef MPRActors::TMouseDoubleClickCommand TMouseDoubleClickCommand;
39 typedef MPRActors::TExposeCommand TExposeCommand;
40 typedef MPRActors::TConfigureCommand TConfigureCommand;
41 typedef MPRActors::TEnterCommand TEnterCommand;
42 typedef MPRActors::TLeaveCommand TLeaveCommand;
53 vtkTypeMacro( MPRObjects, vtkObject );
55 cpExtensions_MPRObjects_Renderer( X );
56 cpExtensions_MPRObjects_Renderer( Y );
57 cpExtensions_MPRObjects_Renderer( Z );
58 cpExtensions_MPRObjects_Renderer( W );
62 static MPRObjects* New( );
65 void SetRenderWindows(
66 vtkRenderWindow* x, vtkRenderWindow* y,
67 vtkRenderWindow* z, vtkRenderWindow* w
70 void SetInputConnection( vtkAlgorithmOutput* aout );
71 void SetInputImage( vtkImageData* data );
72 int AddBinaryConnection(
73 vtkAlgorithmOutput* aout,
74 const double& r, const double& g, const double& b
78 const double& r, const double& g, const double& b
84 vtkImageData* GetInputImage( );
85 const vtkImageData* GetInputImage( ) const;
86 unsigned int GetNumberOfImages( ) const;
88 void SetInterpolate( bool v );
89 void InterpolateOn( );
90 void InterpolateOff( );
92 double GetMinWindow( ) const;
93 double GetMaxWindow( ) const;
94 double GetMinLevel( ) const;
95 double GetMaxLevel( ) const;
96 double GetWindow( ) const;
97 double GetLevel( ) const;
98 void SetWindow( double w );
99 void SetLevel( double l );
100 void SetWindowLevel( double w, double l );
101 void ResetWindowLevel( );
103 int GetSliceNumber( const int& axis ) const;
104 int GetSliceNumberMinValue( const int& axis ) const;
105 int GetSliceNumberMaxValue( const int& axis ) const;
106 void SetSliceNumber( const int& axis, const int& slice );
107 void SetSlice( const int& axis, double* pos );
109 void Render( const double& t );
110 void Render( const int& axis, const double& t );
111 void ResetCamera( const int& axis );
112 void ResetCameras( );
116 virtual ~MPRObjects( );
119 // Purposely not implemented
120 MPRObjects( const Self& );
121 Self& operator=( const Self& );
125 vtkSmartPointer< vtkRenderWindow > m_Windows[ 4 ];
127 // Internal pipelines
128 vtkSmartPointer< MPRActors > m_MPRActors;
129 vtkSmartPointer< vtkRenderer > m_Renderers[ 4 ];
137 #endif // __CPEXTENSIONS__VISUALIZATION__MPROBJECTS__H__