1 #ifndef __CPPLUGINS__EXTENSIONS__VISUALIZATION__IMAGESLICEACTORS__H__
2 #define __CPPLUGINS__EXTENSIONS__VISUALIZATION__IMAGESLICEACTORS__H__
4 #include <cpPlugins/Extensions/cpPlugins_Extensions_Export.h>
7 #include <vtkImageActor.h>
8 #include <vtkImageSliceMapper.h>
9 #include <vtkPolyData.h>
10 #include <vtkPolyDataMapper.h>
11 #include <vtkPropCollection.h>
12 #include <vtkSmartPointer.h>
13 #include <vtkTextActor.h>
15 // -------------------------------------------------------------------------
16 #define cpPlugins_ImageSliceActors( name, type ) \
17 inline type* Get##name##Actor( ) const \
20 dynamic_cast< type* >( \
21 const_cast< Self* >( this )-> \
22 GetItemAsObject( this->name##ActorIndex ) \
27 // -------------------------------------------------------------------------
28 class vtkAlgorithmOutput;
31 // -------------------------------------------------------------------------
36 namespace Visualization
40 class cpPlugins_Extensions_EXPORT ImageSliceActors
41 : public vtkPropCollection
44 typedef ImageSliceActors Self;
47 vtkTypeMacro( ImageSliceActors, vtkPropCollection );
49 cpPlugins_ImageSliceActors( Image, vtkImageActor );
50 cpPlugins_ImageSliceActors( Text, vtkTextActor );
51 cpPlugins_ImageSliceActors( Plane, vtkActor );
55 static ImageSliceActors* New( );
57 void SetInputConnection( vtkAlgorithmOutput* aout, int axis );
58 void SetInputData( vtkImageData* data, int axis );
60 double* GetDisplayBounds( ) const;
61 void GetDisplayBounds( double bounds[ 6 ] ) const;
64 int GetSliceNumber( ) const;
65 int GetSliceNumberMinValue( ) const;
66 int GetSliceNumberMaxValue( ) const;
67 void SetSliceNumber( const int& slice );
72 virtual ~ImageSliceActors( );
75 // Purposely not implemented
76 ImageSliceActors( const Self& );
77 Self& operator=( const Self& );
80 vtkSmartPointer< vtkImageSliceMapper > SliceMapper;
81 vtkSmartPointer< vtkPolyData > PlaneSource;
82 vtkSmartPointer< vtkPolyDataMapper > PlaneMapper;
83 char TextBuffer[ 1024 ];
85 vtkSmartPointer< vtkImageActor > ImageActor;
86 vtkSmartPointer< vtkTextActor > TextActor;
87 vtkSmartPointer< vtkActor > PlaneActor;
89 unsigned int ImageActorIndex;
90 unsigned int TextActorIndex;
91 unsigned int PlaneActorIndex;
100 #endif // __CPPLUGINS__EXTENSIONS__VISUALIZATION__IMAGESLICEACTORS__H__