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 class vtkAlgorithmOutput;
33 namespace Visualization
37 class cpPlugins_Extensions_EXPORT ImageSliceActors
38 : public vtkPropCollection
41 typedef ImageSliceActors Self;
44 vtkTypeMacro( ImageSliceActors, vtkPropCollection );
46 cpPlugins_ImageSliceActors( Image, vtkImageActor );
47 cpPlugins_ImageSliceActors( Segmentation, vtkImageActor );
48 cpPlugins_ImageSliceActors( Text, vtkTextActor );
49 cpPlugins_ImageSliceActors( Plane, vtkActor );
53 static ImageSliceActors* New( );
55 void SetInputConnection( vtkAlgorithmOutput* aout, int axis );
56 void SetSegmentationConnection( vtkAlgorithmOutput* aout );
59 int GetSliceNumber( ) const;
60 int GetSliceNumberMinValue( ) const;
61 int GetSliceNumberMaxValue( ) const;
62 void SetSliceNumber( const int& slice );
63 void UpdateText( const double& w, const double& l );
67 virtual ~ImageSliceActors( );
70 // Purposely not implemented
71 ImageSliceActors( const Self& );
72 Self& operator=( const Self& );
75 vtkAlgorithmOutput* InputAlgorithm;
76 vtkAlgorithmOutput* SegmentationAlgorithm;
78 vtkSmartPointer< vtkImageSliceMapper > SliceMapper;
79 vtkSmartPointer< vtkImageSliceMapper > SegmentationSliceMapper;
80 vtkSmartPointer< vtkPolyData > PlaneSource;
81 vtkSmartPointer< vtkPolyDataMapper > PlaneMapper;
82 char TextBuffer[ 512 ];
84 vtkSmartPointer< vtkImageActor > ImageActor;
85 vtkSmartPointer< vtkImageActor > SegmentationActor;
86 vtkSmartPointer< vtkTextActor > TextActor;
87 vtkSmartPointer< vtkActor > PlaneActor;
89 unsigned int ImageActorIndex;
90 unsigned int SegmentationActorIndex;
91 unsigned int TextActorIndex;
92 unsigned int PlaneActorIndex;
101 #endif // __CPPLUGINS__EXTENSIONS__VISUALIZATION__IMAGESLICEACTORS__H__