1 #ifndef __CPEXTENSIONS__VISUALIZATION__IMAGESLICEACTORS__H__
2 #define __CPEXTENSIONS__VISUALIZATION__IMAGESLICEACTORS__H__
4 #include <cpExtensions/cpExtensions_Export.h>
10 #include <vtkImageActor.h>
11 #include <vtkImageSliceMapper.h>
13 #include <vtkPolyData.h>
14 #include <vtkPolyDataMapper.h>
15 #include <vtkPropCollection.h>
16 #include <vtkSmartPointer.h>
17 #include <vtkTextActor.h>
19 // -------------------------------------------------------------------------
20 class vtkAlgorithmOutput;
23 // -------------------------------------------------------------------------
24 namespace cpExtensions
26 namespace Visualization
30 class cpExtensions_EXPORT ImageSliceActors
31 : public vtkPropCollection
34 typedef ImageSliceActors Self;
37 vtkTypeMacro( ImageSliceActors, vtkPropCollection );
41 static ImageSliceActors* New( );
43 void AddInputConnection( vtkAlgorithmOutput* aout, int axis = 0 );
44 void AddInputData( vtkImageData* data, int axis = 0 );
47 unsigned int GetNumberOfImageActors( ) const;
48 vtkImageActor* GetImageActor( unsigned int id );
49 const vtkImageActor* GetImageActor( unsigned int id ) const;
50 vtkTextActor* GetTextActor( );
51 const vtkTextActor* GetTextActor( ) const;
52 vtkActor* GetPlaneActor( );
53 const vtkActor* GetPlaneActor( ) const;
54 vtkPlane* GetPlaneFunction( );
55 const vtkPlane* GetPlaneFunction( ) const;
57 void AddActor( vtkAlgorithm* algorithm, vtkActor* actor );
59 void SetInterpolate( bool v );
60 void InterpolateOn( );
61 void InterpolateOff( );
63 double* GetDisplayBounds( ) const;
64 void GetDisplayBounds( double bounds[ 6 ] ) const;
67 int GetSliceNumber( ) const;
68 int GetSliceNumberMinValue( ) const;
69 int GetSliceNumberMaxValue( ) const;
70 void SetSliceNumber( const int& slice );
72 void UpdateText( const double& w, const double& l );
76 virtual ~ImageSliceActors( );
78 void _ConfigureNewInput( int axis );
81 // Purposely not implemented
82 ImageSliceActors( const Self& );
83 Self& operator=( const Self& );
87 std::vector< vtkSmartPointer< vtkImageSliceMapper > > SliceMappers;
88 std::vector< vtkSmartPointer< vtkImageActor > > ImageActors;
89 std::vector< std::pair< vtkSmartPointer< vtkAlgorithm >, vtkSmartPointer< vtkActor > > > OtherActors;
93 vtkSmartPointer< vtkPlane > PlaneFunction;
94 vtkSmartPointer< vtkPolyData > PlaneSource;
95 vtkSmartPointer< vtkPolyDataMapper > PlaneMapper;
96 char TextBuffer[ 1024 ];
97 vtkSmartPointer< vtkTextActor > TextActor;
98 vtkSmartPointer< vtkActor > PlaneActor;
105 #endif // __CPEXTENSIONS__VISUALIZATION__IMAGESLICEACTORS__H__