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
24 class cpExtensions_EXPORT MPRObjects
28 typedef MPRObjects Self;
30 typedef MPRActors::TStyle TStyle;
31 typedef MPRActors::TMouseCommand TMouseCommand;
32 typedef MPRActors::TMouseWheelCommand TMouseWheelCommand;
33 typedef MPRActors::TKeyCommand TKeyCommand;
34 typedef MPRActors::TVoidCommand TVoidCommand;
35 typedef MPRActors::TMouseMoveCommand TMouseMoveCommand;
36 typedef MPRActors::TMouseClickCommand TMouseClickCommand;
37 typedef MPRActors::TMouseDoubleClickCommand TMouseDoubleClickCommand;
38 typedef MPRActors::TExposeCommand TExposeCommand;
39 typedef MPRActors::TConfigureCommand TConfigureCommand;
40 typedef MPRActors::TEnterCommand TEnterCommand;
41 typedef MPRActors::TLeaveCommand TLeaveCommand;
52 vtkTypeMacro( MPRObjects, vtkObject );
54 cpExtensions_MPRObjects_Renderer( X );
55 cpExtensions_MPRObjects_Renderer( Y );
56 cpExtensions_MPRObjects_Renderer( Z );
57 cpExtensions_MPRObjects_Renderer( W );
61 static MPRObjects* New( );
64 void SetRenderWindows(
65 vtkRenderWindow* x, vtkRenderWindow* y,
66 vtkRenderWindow* z, vtkRenderWindow* w
69 void SetInputConnection( vtkAlgorithmOutput* aout );
70 void SetInputImage( vtkImageData* data );
71 int AddBinaryConnection(
72 vtkAlgorithmOutput* aout,
73 const double& r, const double& g, const double& b
77 const double& r, const double& g, const double& b
83 vtkImageData* GetInputImage( );
84 const vtkImageData* GetInputImage( ) const;
85 unsigned int GetNumberOfImages( ) const;
87 void SetInterpolate( bool v );
88 void InterpolateOn( );
89 void InterpolateOff( );
91 double GetMinWindow( ) const;
92 double GetMaxWindow( ) const;
93 double GetMinLevel( ) const;
94 double GetMaxLevel( ) const;
95 double GetWindow( ) const;
96 double GetLevel( ) const;
97 void SetWindow( double w );
98 void SetLevel( double l );
99 void SetWindowLevel( double w, double l );
100 void ResetWindowLevel( );
102 int GetSliceNumber( const int& axis ) const;
103 int GetSliceNumberMinValue( const int& axis ) const;
104 int GetSliceNumberMaxValue( const int& axis ) const;
105 void SetSliceNumber( const int& axis, const int& slice );
106 void SetSlice( const int& axis, double* pos );
108 void Render( const double& t );
109 void Render( const int& axis, const double& t );
110 void ResetCamera( const int& axis );
111 void ResetCameras( );
115 virtual ~MPRObjects( );
118 // Purposely not implemented
119 MPRObjects( const Self& );
120 Self& operator=( const Self& );
124 vtkSmartPointer< vtkRenderWindow > m_Windows[ 4 ];
126 // Internal pipelines
127 vtkSmartPointer< MPRActors > m_MPRActors;
128 vtkSmartPointer< vtkRenderer > m_Renderers[ 4 ];
135 #endif // __CPEXTENSIONS__VISUALIZATION__MPROBJECTS__H__