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 );
58 void AddActor( vtkActor* actor );
60 void SetInterpolate( bool v );
61 void InterpolateOn( );
62 void InterpolateOff( );
64 double* GetDisplayBounds( ) const;
65 void GetDisplayBounds( double bounds[ 6 ] ) const;
68 int GetSliceNumber( ) const;
69 int GetSliceNumberMinValue( ) const;
70 int GetSliceNumberMaxValue( ) const;
71 void SetSliceNumber( const int& slice );
73 void UpdateText( const double& w, const double& l );
77 virtual ~ImageSliceActors( );
79 void _ConfigureNewInput( int axis );
82 // Purposely not implemented
83 ImageSliceActors( const Self& );
84 Self& operator=( const Self& );
88 std::vector< vtkSmartPointer< vtkImageSliceMapper > > SliceMappers;
89 std::vector< vtkSmartPointer< vtkImageActor > > ImageActors;
92 std::pair< vtkSmartPointer< vtkAlgorithm >, vtkSmartPointer< vtkActor > >
94 std::vector< TActorPair > OtherActors;
98 vtkSmartPointer< vtkPlane > PlaneFunction;
99 vtkSmartPointer< vtkPolyData > PlaneSource;
100 vtkSmartPointer< vtkPolyDataMapper > PlaneMapper;
101 char TextBuffer[ 1024 ];
102 vtkSmartPointer< vtkTextActor > TextActor;
103 vtkSmartPointer< vtkActor > PlaneActor;
110 #endif // __CPEXTENSIONS__VISUALIZATION__IMAGESLICEACTORS__H__