]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/Visualization/MPRObjects.h
10bf50b4043244b014681c1251e08ef9cbf6aa5f
[cpPlugins.git] / lib / cpExtensions / Visualization / MPRObjects.h
1 #ifndef __CPEXTENSIONS__VISUALIZATION__MPROBJECTS__H__
2 #define __CPEXTENSIONS__VISUALIZATION__MPROBJECTS__H__
3
4 #include <cpExtensions/cpExtensions_Export.h>
5 #include <cpExtensions/Visualization/MPRActors.h>
6
7 #include <vtkObject.h>
8 #include <vtkRenderer.h>
9 #include <vtkRenderWindow.h>
10
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 ] ); }
17
18 namespace cpExtensions
19 {
20   namespace Visualization
21   {
22     /**
23      */
24     /*
25     class cpExtensions_EXPORT MPRObjects
26       : public vtkObject
27     {
28     public:
29       typedef MPRObjects Self;
30
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;
43
44       enum MPRDirections
45       {
46         MPRDirections_X = 0,
47         MPRDirections_Y = 1,
48         MPRDirections_Z = 2,
49         MPRDirections_W = 3
50       };
51
52     public:
53       vtkTypeMacro( MPRObjects, vtkObject );
54
55       cpExtensions_MPRObjects_Renderer( X );
56       cpExtensions_MPRObjects_Renderer( Y );
57       cpExtensions_MPRObjects_Renderer( Z );
58       cpExtensions_MPRObjects_Renderer( W );
59
60     public:
61       // Creation
62       static MPRObjects* New( );
63
64       // Association
65       void SetRenderWindows(
66         vtkRenderWindow* x, vtkRenderWindow* y,
67         vtkRenderWindow* z, vtkRenderWindow* w
68         );
69
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
75         );
76       int AddBinaryImage(
77         vtkImageData* data,
78         const double& r, const double& g, const double& b
79         );
80       void Show( );
81       void Hide( );
82       void Clear( );
83
84       vtkImageData* GetInputImage( );
85       const vtkImageData* GetInputImage( ) const;
86       unsigned int GetNumberOfImages( ) const;
87
88       void SetInterpolate( bool v );
89       void InterpolateOn( );
90       void InterpolateOff( );
91
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( );
102
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 );
108
109       void Render( const double& t );
110       void Render( const int& axis, const double& t );
111       void ResetCamera( const int& axis );
112       void ResetCameras( );
113
114     protected:
115       MPRObjects( );
116       virtual ~MPRObjects( );
117
118     private:
119       // Purposely not implemented
120       MPRObjects( const Self& );
121       Self& operator=( const Self& );
122
123     protected:
124       // Inputs
125       vtkSmartPointer< vtkRenderWindow > m_Windows[ 4 ];
126
127       // Internal pipelines
128       vtkSmartPointer< MPRActors >   m_MPRActors;
129       vtkSmartPointer< vtkRenderer > m_Renderers[ 4 ];
130     };
131     */
132
133   } // ecapseman
134
135 } // ecapseman
136
137 #endif //  __CPEXTENSIONS__VISUALIZATION__MPROBJECTS__H__
138
139 // eof - $RCSfile$