]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/Visualization/MPRActors.h
Double click widget integrated with segmentation and deformation filters.
[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       double GetWindow( );
59       double GetLevel( );
60
61       // Slice access
62       int GetSliceNumberMinValue( const int& axis ) const;
63       int GetSliceNumberMaxValue( const int& axis ) const;
64       int GetSlice( const int& axis ) const;
65       void SetSlice( const int& axis, const int& slice );
66       void SetSlice( const int& axis, const double& slice );
67       void ResetSlices( );
68
69     protected:
70       MPRActors( );
71       virtual ~MPRActors( );
72
73       void _CreateBoundingBox( );
74
75       static void _SlicesCommand( double* pos, int axis, void* data );
76       static void _WindowLevelCommand(
77         double window, double level, void* data
78         );
79       static void _RenderCommand( void* data );
80
81     private:
82       // Purposely not implemented
83       MPRActors( const Self& );
84       Self& operator=( const Self& );
85
86     protected:
87       vtkSmartPointer< vtkActor >         ImageOutlineActor;
88       vtkSmartPointer< ImageSliceActors > Slices[ 2 ][ 3 ];
89     };
90
91   } // ecapseman
92
93 } // ecapseman
94
95 #endif //  __CPEXTENSIONS__VISUALIZATION__MPRACTORS__H__
96
97 // eof - $RCSfile$