X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FVisualization%2FMPRActors.h;h=5eb3a202003712441265a4aada24d5990166d98f;hb=31e4cf1f3580efa059d3ffad14ba6a15d2372f5c;hp=2566c1dff8ede3c65b3a84dbe8613ef16b858be6;hpb=dc72ea8ea52fc074566d9437048db24af6c0aaab;p=cpPlugins.git diff --git a/lib/cpExtensions/Visualization/MPRActors.h b/lib/cpExtensions/Visualization/MPRActors.h index 2566c1d..5eb3a20 100644 --- a/lib/cpExtensions/Visualization/MPRActors.h +++ b/lib/cpExtensions/Visualization/MPRActors.h @@ -1,22 +1,9 @@ #ifndef __CPEXTENSIONS__VISUALIZATION__MPRACTORS__H__ #define __CPEXTENSIONS__VISUALIZATION__MPRACTORS__H__ -#include - #include #include -#include -#include -#include - -// ------------------------------------------------------------------------- -class vtkAlgorithmOutput; -class vtkImageData; -class vtkRenderer; -class vtkScalarsToColors; - -// ------------------------------------------------------------------------- namespace cpExtensions { namespace Visualization @@ -29,6 +16,19 @@ 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 ); @@ -36,44 +36,27 @@ namespace cpExtensions // Creation static MPRActors* New( ); - // TODO: ImageSliceActors* GetSliceActors( const int& i ) const; + ImageSliceActors* GetSliceActors( const int& i ) const; int AddInputConnection( vtkAlgorithmOutput* aout ); - int AddInputData( vtkImageData* image ); - - /* - void SetInputConnection( vtkAlgorithmOutput* aout ); - void SetInputData( vtkImageData* image ); - */ - - void PushDataInto( - vtkRenderer* x, - vtkRenderer* y, - vtkRenderer* z, - vtkRenderer* w + 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 - void SetLookupTable( unsigned int i, vtkScalarsToColors* lut ); - vtkScalarsToColors* GetLookupTable( unsigned int i ) const; - - // Grayscale window/level lookup - void SetLookupTableToWindowLevel( unsigned int i ); - double GetMinWindow( unsigned int i ) const; - double GetMaxWindow( unsigned int i ) const; - double GetMinLevel( unsigned int i ) const; - double GetMaxLevel( unsigned int i ) const; - double GetWindow( unsigned int i ) const; - double GetLevel( unsigned int i ) const; - void SetWindow( unsigned int i, const double& w ); - void SetLevel( unsigned int i, const double& l ); - void ResetWindowLevel( unsigned int i ); + double GetWindow( ); + double GetLevel( ); // Slice access int GetSliceNumberMinValue( const int& axis ) const; @@ -87,8 +70,13 @@ namespace cpExtensions MPRActors( ); virtual ~MPRActors( ); - vtkImageData* _Image( unsigned int i ) const; - void _Update( unsigned int i ); + 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 @@ -96,7 +84,6 @@ namespace cpExtensions Self& operator=( const Self& ); protected: - std::vector< vtkSmartPointer< vtkImageMapToColors > > ImageMaps; vtkSmartPointer< vtkActor > ImageOutlineActor; vtkSmartPointer< ImageSliceActors > Slices[ 2 ][ 3 ]; };