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
81 vtkImageData* GetInputImage( );
82 const vtkImageData* GetInputImage( ) const;
83 unsigned int GetNumberOfImages( ) const;
85 void SetInterpolate( bool v );
86 void InterpolateOn( );
87 void InterpolateOff( );
89 double GetMinWindow( ) const;
90 double GetMaxWindow( ) const;
91 double GetMinLevel( ) const;
92 double GetMaxLevel( ) const;
93 double GetWindow( ) const;
94 double GetLevel( ) const;
95 void SetWindow( double w );
96 void SetLevel( double l );
97 void SetWindowLevel( double w, double l );
98 void ResetWindowLevel( );
100 int GetSliceNumber( const int& axis ) const;
101 int GetSliceNumberMinValue( const int& axis ) const;
102 int GetSliceNumberMaxValue( const int& axis ) const;
103 void SetSliceNumber( const int& axis, const int& slice );
104 void SetSlice( const int& axis, double* pos );
106 void Render( const double& t );
107 void Render( const int& axis, const double& t );
108 void ResetCamera( const int& axis );
109 void ResetCameras( );
113 virtual ~MPRObjects( );
116 // Purposely not implemented
117 MPRObjects( const Self& );
118 Self& operator=( const Self& );
122 vtkSmartPointer< vtkRenderWindow > m_Windows[ 4 ];
124 // Internal pipelines
125 vtkSmartPointer< MPRActors > m_MPRActors;
126 vtkSmartPointer< vtkRenderer > m_Renderers[ 4 ];
133 #endif // __CPEXTENSIONS__VISUALIZATION__MPROBJECTS__H__