#ifndef __CPEXTENSIONS__VISUALIZATION__IMAGESLICEACTORS__H__ #define __CPEXTENSIONS__VISUALIZATION__IMAGESLICEACTORS__H__ #include #include #include #include #include #include #include #include #include // ------------------------------------------------------------------------- #define cpPlugins_ImageSliceActors( name, type ) \ inline type* Get##name##Actor( ) const \ { \ return( \ dynamic_cast< type* >( \ const_cast< Self* >( this )-> \ GetItemAsObject( this->name##ActorIndex ) \ ) \ ); \ } // ------------------------------------------------------------------------- class vtkAlgorithmOutput; class vtkImageData; // ------------------------------------------------------------------------- namespace cpExtensions { namespace Visualization { /** */ class cpExtensions_EXPORT ImageSliceActors : public vtkPropCollection { public: typedef ImageSliceActors Self; public: vtkTypeMacro( ImageSliceActors, vtkPropCollection ); cpPlugins_ImageSliceActors( Image, vtkImageActor ); cpPlugins_ImageSliceActors( Text, vtkTextActor ); cpPlugins_ImageSliceActors( Plane, vtkActor ); public: // Creation static ImageSliceActors* New( ); void SetInputConnection( vtkAlgorithmOutput* aout, int axis ); void SetInputData( vtkImageData* data, int axis ); double* GetDisplayBounds( ) const; void GetDisplayBounds( double bounds[ 6 ] ) const; int GetAxis( ) const; int GetSliceNumber( ) const; int GetSliceNumberMinValue( ) const; int GetSliceNumberMaxValue( ) const; void SetSliceNumber( const int& slice ); void UpdateText( ); protected: ImageSliceActors( ); virtual ~ImageSliceActors( ); private: // Purposely not implemented ImageSliceActors( const Self& ); Self& operator=( const Self& ); protected: vtkSmartPointer< vtkImageSliceMapper > SliceMapper; vtkSmartPointer< vtkPolyData > PlaneSource; vtkSmartPointer< vtkPolyDataMapper > PlaneMapper; char TextBuffer[ 1024 ]; vtkSmartPointer< vtkImageActor > ImageActor; vtkSmartPointer< vtkTextActor > TextActor; vtkSmartPointer< vtkActor > PlaneActor; unsigned int ImageActorIndex; unsigned int TextActorIndex; unsigned int PlaneActorIndex; }; } // ecapseman } // ecapseman #endif // __CPEXTENSIONS__VISUALIZATION__IMAGESLICEACTORS__H__ // eof - $RCSfile$