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;
36 typedef void ( *TUpdateCommand )( void* );
39 vtkTypeMacro( ImageSliceActors, vtkPropCollection );
43 static ImageSliceActors* New( );
45 void AddInputConnection( vtkAlgorithmOutput* aout, int axis = 0 );
46 void AddInputData( vtkImageData* data, int axis = 0 );
49 unsigned int GetNumberOfImageActors( ) const;
50 vtkImageActor* GetImageActor( unsigned int id );
51 const vtkImageActor* GetImageActor( unsigned int id ) const;
52 vtkTextActor* GetTextActor( );
53 const vtkTextActor* GetTextActor( ) const;
54 vtkActor* GetPlaneActor( );
55 const vtkActor* GetPlaneActor( ) const;
56 vtkPlane* GetPlaneFunction( );
57 const vtkPlane* GetPlaneFunction( ) const;
59 void AddActor( vtkAlgorithm* algorithm, vtkActor* actor );
60 void AddActor( vtkActor* actor );
62 void SetInterpolate( bool v );
63 void InterpolateOn( );
64 void InterpolateOff( );
66 double* GetDisplayBounds( ) const;
67 void GetDisplayBounds( double bounds[ 6 ] ) const;
70 int GetSliceNumber( ) const;
71 int GetSliceNumberMinValue( ) const;
72 int GetSliceNumberMaxValue( ) const;
73 void SetSliceNumber( const int& slice );
75 void UpdateText( const double& w, const double& l );
77 TUpdateCommand SetUpdateCommand( TUpdateCommand cmd, void* data )
79 this->m_UpdateCommand = cmd;
80 this->m_UpdateData = data;
85 virtual ~ImageSliceActors( );
87 void _ConfigureNewInput( int axis );
90 // Purposely not implemented
91 ImageSliceActors( const Self& );
92 Self& operator=( const Self& );
96 std::vector< vtkSmartPointer< vtkImageSliceMapper > > SliceMappers;
97 std::vector< vtkSmartPointer< vtkImageActor > > ImageActors;
100 std::pair< vtkSmartPointer< vtkAlgorithm >, vtkSmartPointer< vtkActor > >
102 std::vector< TActorPair > OtherActors;
106 vtkSmartPointer< vtkPlane > PlaneFunction;
107 vtkSmartPointer< vtkPolyData > PlaneSource;
108 vtkSmartPointer< vtkPolyDataMapper > PlaneMapper;
109 char TextBuffer[ 1024 ];
110 vtkSmartPointer< vtkTextActor > TextActor;
111 vtkSmartPointer< vtkActor > PlaneActor;
114 TUpdateCommand m_UpdateCommand;
122 #endif // __CPEXTENSIONS__VISUALIZATION__IMAGESLICEACTORS__H__