X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FVisualization%2FMPRActors.h;h=5eb3a202003712441265a4aada24d5990166d98f;hb=31e4cf1f3580efa059d3ffad14ba6a15d2372f5c;hp=c8718a31b231cb3f9505fb55f099ec504bdf7d3f;hpb=62d056ccb528d63392d197552830460e980a5aba;p=cpPlugins.git diff --git a/lib/cpExtensions/Visualization/MPRActors.h b/lib/cpExtensions/Visualization/MPRActors.h index c8718a3..5eb3a20 100644 --- a/lib/cpExtensions/Visualization/MPRActors.h +++ b/lib/cpExtensions/Visualization/MPRActors.h @@ -4,17 +4,6 @@ #include #include -#include -#include - -// ------------------------------------------------------------------------- -class vtkAlgorithmOutput; -class vtkImageData; -class vtkRenderer; -class vtkScalarsToColors; -class vtkWindowLevelLookupTable; - -// ------------------------------------------------------------------------- namespace cpExtensions { namespace Visualization @@ -27,49 +16,47 @@ namespace cpExtensions public: typedef MPRActors Self; + typedef ImageSliceActors::TStyle TStyle; + typedef ImageSliceActors::TMouseCommand TMouseCommand; + typedef ImageSliceActors::TMouseWheelCommand TMouseWheelCommand; + typedef ImageSliceActors::TKeyCommand TKeyCommand; + typedef ImageSliceActors::TVoidCommand TVoidCommand; + typedef ImageSliceActors::TMouseMoveCommand TMouseMoveCommand; + typedef ImageSliceActors::TMouseClickCommand TMouseClickCommand; + typedef ImageSliceActors::TMouseDoubleClickCommand TMouseDoubleClickCommand; + typedef ImageSliceActors::TExposeCommand TExposeCommand; + typedef ImageSliceActors::TConfigureCommand TConfigureCommand; + typedef ImageSliceActors::TEnterCommand TEnterCommand; + typedef ImageSliceActors::TLeaveCommand TLeaveCommand; + public: vtkTypeMacro( MPRActors, vtkPropCollection ); - cpPlugins_ImageSliceActors( ImageOutline, vtkImageActor ); - public: // Creation static MPRActors* New( ); ImageSliceActors* GetSliceActors( const int& i ) const; - void SetInputConnection( vtkAlgorithmOutput* aout ); - void SetInputData( vtkImageData* image ); - - void PushDataInto( - vtkRenderer* x, - vtkRenderer* y, - vtkRenderer* z, - vtkRenderer* w + + int AddInputConnection( vtkAlgorithmOutput* aout ); + int AddInputData( vtkImageData* new_image ); + unsigned int GetNumberOfImages( ) const; + + void PushActorsInto( + vtkRenderWindow* x, + vtkRenderWindow* y, + vtkRenderWindow* z, + vtkRenderWindow* w ); - void PopDataFrom( - vtkRenderer* x, - vtkRenderer* y, - vtkRenderer* z, - vtkRenderer* w + void PopActorsFrom( + vtkRenderWindow* x, + vtkRenderWindow* y, + vtkRenderWindow* z, + vtkRenderWindow* w ); - // Lookup table methods - vtkScalarsToColors* GetLookupTable( ) const; - void SetLookupTable( vtkScalarsToColors* lut ); - - // Grayscale window/level lookup - vtkWindowLevelLookupTable* GetLookupTableAsWindowLevel( ) const; - void SetLookupTableToWindowLevel( ); - double GetMinWindow( ) const; - double GetMaxWindow( ) const; - double GetMinLevel( ) const; - double GetMaxLevel( ) const; - double GetWindow( ) const; - double GetLevel( ) const; - void SetWindow( const double& w ); - void SetLevel( const double& l ); - void SetWindowLevel( const double& w, const double& l ); - void ResetWindowLevel( ); + double GetWindow( ); + double GetLevel( ); // Slice access int GetSliceNumberMinValue( const int& axis ) const; @@ -79,15 +66,17 @@ namespace cpExtensions void SetSlice( const int& axis, const double& slice ); void ResetSlices( ); - // General accessors - void GetImageBounds( double bounds[ 6 ] ) const; - protected: MPRActors( ); virtual ~MPRActors( ); - vtkImageData* _InputImage( ) const; - void _UpdateSlices( ); + void _CreateBoundingBox( ); + + static void _SlicesCommand( double* pos, int axis, void* data ); + static void _WindowLevelCommand( + double window, double level, void* data + ); + static void _RenderCommand( void* data ); private: // Purposely not implemented @@ -95,15 +84,8 @@ namespace cpExtensions Self& operator=( const Self& ); protected: - vtkSmartPointer< vtkImageMapToColors > ImageMapToColors; - vtkSmartPointer< vtkActor > ImageOutlineActor; - - typedef - cpExtensions::Visualization::ImageSliceActors - _TSlice; - vtkSmartPointer< _TSlice > Slices[ 2 ][ 3 ]; - - unsigned int ImageOutlineActorIndex; + vtkSmartPointer< vtkActor > ImageOutlineActor; + vtkSmartPointer< ImageSliceActors > Slices[ 2 ][ 3 ]; }; } // ecapseman