X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FVisualization%2FMPRObjects.h;h=c800fc1ce626b11602c066f54a10b7ed363341f3;hb=73332fee95f5410c46e3b0cff1e2755d5e4a8b71;hp=71741ef17a9b3f7f38dfa7fee3fe4a509212cbd9;hpb=fdd4f2cec18107de380ebd350cb1019eed7c294c;p=cpPlugins.git diff --git a/lib/cpExtensions/Visualization/MPRObjects.h b/lib/cpExtensions/Visualization/MPRObjects.h index 71741ef..c800fc1 100644 --- a/lib/cpExtensions/Visualization/MPRObjects.h +++ b/lib/cpExtensions/Visualization/MPRObjects.h @@ -8,6 +8,13 @@ #include #include +// ------------------------------------------------------------------------- +#define cpExtensions_MPRObjects_Renderer( DIR ) \ + inline vtkRenderer* Get##DIR##Renderer( ) \ + { return( this->m_Renderers[ Self::MPRDirections_##DIR ] ); } \ + inline const vtkRenderer* Get##DIR##Renderer( ) const \ + { return( this->m_Renderers[ Self::MPRDirections_##DIR ] ); } + namespace cpExtensions { namespace Visualization @@ -20,47 +27,88 @@ namespace cpExtensions public: typedef MPRObjects Self; - typedef MPRActors::TBaseStyle TBaseStyle; - typedef MPRActors::TStyle TStyle; - typedef MPRActors::TSlicesCommand TSlicesCommand; - typedef MPRActors::TWindowLevelCommand TWindowLevelCommand; - typedef MPRActors::TMouseCommand TMouseCommand; - typedef MPRActors::TMouseWheelCommand TMouseWheelCommand; - typedef MPRActors::TKeyCommand TKeyCommand; - typedef MPRActors::TVoidCommand TVoidCommand; + typedef MPRActors::TStyle TStyle; + typedef MPRActors::TMouseCommand TMouseCommand; + typedef MPRActors::TMouseWheelCommand TMouseWheelCommand; + typedef MPRActors::TKeyCommand TKeyCommand; + typedef MPRActors::TVoidCommand TVoidCommand; + typedef MPRActors::TMouseMoveCommand TMouseMoveCommand; + typedef MPRActors::TMouseClickCommand TMouseClickCommand; + typedef MPRActors::TMouseDoubleClickCommand TMouseDoubleClickCommand; + typedef MPRActors::TExposeCommand TExposeCommand; + typedef MPRActors::TConfigureCommand TConfigureCommand; + typedef MPRActors::TEnterCommand TEnterCommand; + typedef MPRActors::TLeaveCommand TLeaveCommand; + + enum MPRDirections + { + MPRDirections_X = 0, + MPRDirections_Y = 1, + MPRDirections_Z = 2, + MPRDirections_W = 3 + }; public: vtkTypeMacro( MPRObjects, vtkObject ); + cpExtensions_MPRObjects_Renderer( X ); + cpExtensions_MPRObjects_Renderer( Y ); + cpExtensions_MPRObjects_Renderer( Z ); + cpExtensions_MPRObjects_Renderer( W ); + public: // Creation static MPRObjects* New( ); + // Association void SetRenderWindows( - vtkRenderWindow* wx, vtkRenderWindow* wy, - vtkRenderWindow* wz, vtkRenderWindow* w3D + vtkRenderWindow* x, vtkRenderWindow* y, + vtkRenderWindow* z, vtkRenderWindow* w ); - void AddImage( vtkImageData* image ); - void ClearAll( ); - - void ResetCamera( const int& id ); - void ResetCameras( ); - void Render( const int& id ); - void RenderAll( ); - vtkRenderer* GetXRenderer( ); - vtkRenderer* GetYRenderer( ); - vtkRenderer* GetZRenderer( ); - vtkRenderer* Get3DRenderer( ); - const vtkRenderer* GetXRenderer( ) const; - const vtkRenderer* GetYRenderer( ) const; - const vtkRenderer* GetZRenderer( ) const; - const vtkRenderer* Get3DRenderer( ) const; - - MPRActors* GetMPRActors( ); - const MPRActors* GetMPRActors( ) const; + void SetInputConnection( vtkAlgorithmOutput* aout ); + void SetInputImage( vtkImageData* data ); + int AddBinaryConnection( + vtkAlgorithmOutput* aout, + const double& r, const double& g, const double& b + ); + int AddBinaryImage( + vtkImageData* data, + const double& r, const double& g, const double& b + ); + void Show( ); + void Hide( ); + void Clear( ); + + vtkImageData* GetInputImage( ); + const vtkImageData* GetInputImage( ) const; + unsigned int GetNumberOfImages( ) const; + + void SetInterpolate( bool v ); + void InterpolateOn( ); + void InterpolateOff( ); + + double GetMinWindow( ) const; + double GetMaxWindow( ) const; + double GetMinLevel( ) const; + double GetMaxLevel( ) const; double GetWindow( ) const; double GetLevel( ) const; + void SetWindow( double w ); + void SetLevel( double l ); + void SetWindowLevel( double w, double l ); + void ResetWindowLevel( ); + + int GetSliceNumber( const int& axis ) const; + int GetSliceNumberMinValue( const int& axis ) const; + int GetSliceNumberMaxValue( const int& axis ) const; + void SetSliceNumber( const int& axis, const int& slice ); + void SetSlice( const int& axis, double* pos ); + + void Render( const double& t ); + void Render( const int& axis, const double& t ); + void ResetCamera( const int& axis ); + void ResetCameras( ); protected: MPRObjects( );