]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/Visualization/MPRActors.h
Widgets updated
[cpPlugins.git] / lib / cpExtensions / Visualization / MPRActors.h
1 #ifndef __CPEXTENSIONS__VISUALIZATION__MPRACTORS__H__
2 #define __CPEXTENSIONS__VISUALIZATION__MPRACTORS__H__
3
4 #include <cpExtensions/cpExtensions_Export.h>
5 #include <cpExtensions/Visualization/ImageSliceActors.h>
6
7 namespace cpExtensions
8 {
9   namespace Visualization
10   {
11     /**
12      */
13     class cpExtensions_EXPORT MPRActors
14       : public vtkPropCollection
15     {
16     public:
17       typedef MPRActors Self;
18
19       typedef ImageSliceActors::TBaseStyle          TBaseStyle;
20       typedef ImageSliceActors::TStyle              TStyle;
21       typedef ImageSliceActors::TSlicesCommand      TSlicesCommand;
22       typedef ImageSliceActors::TWindowLevelCommand TWindowLevelCommand;
23       typedef ImageSliceActors::TMouseCommand       TMouseCommand;
24       typedef ImageSliceActors::TMouseWheelCommand  TMouseWheelCommand;
25       typedef ImageSliceActors::TKeyCommand         TKeyCommand;
26       typedef ImageSliceActors::TVoidCommand        TVoidCommand;
27
28     public:
29       vtkTypeMacro( MPRActors, vtkPropCollection );
30
31     public:
32       // Creation
33       static MPRActors* New( );
34
35       ImageSliceActors* GetSliceActors( const int& i ) const;
36
37       int AddInputConnection( vtkAlgorithmOutput* aout );
38       int AddInputData( vtkImageData* new_image );
39       unsigned int GetNumberOfImages( ) const;
40
41       void PushActorsInto(
42         vtkRenderWindow* x,
43         vtkRenderWindow* y,
44         vtkRenderWindow* z,
45         vtkRenderWindow* w
46         );
47       void PopActorsFrom(
48         vtkRenderWindow* x,
49         vtkRenderWindow* y,
50         vtkRenderWindow* z,
51         vtkRenderWindow* w
52         );
53
54       // Color lookup table
55       void SetLookupTableAsColor(
56         unsigned int i, double r, double g, double b
57         );
58
59       double GetWindow( );
60       double GetLevel( );
61
62       // Slice access
63       int GetSliceNumberMinValue( const int& axis ) const;
64       int GetSliceNumberMaxValue( const int& axis ) const;
65       int GetSlice( const int& axis ) const;
66       void SetSlice( const int& axis, const int& slice );
67       void SetSlice( const int& axis, const double& slice );
68       void ResetSlices( );
69
70     protected:
71       MPRActors( );
72       virtual ~MPRActors( );
73
74       static void _SlicesCommand( double* pos, int axis, void* data );
75       static void _WindowLevelCommand(
76         double window, double level, void* data
77         );
78       static void _RenderCommand( void* data );
79
80     private:
81       // Purposely not implemented
82       MPRActors( const Self& );
83       Self& operator=( const Self& );
84
85     protected:
86       vtkSmartPointer< vtkActor >         ImageOutlineActor;
87       vtkSmartPointer< ImageSliceActors > Slices[ 2 ][ 3 ];
88     };
89
90   } // ecapseman
91
92 } // ecapseman
93
94 #endif //  __CPEXTENSIONS__VISUALIZATION__MPRACTORS__H__
95
96 // eof - $RCSfile$