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