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