From: Leonardo Florez-Valencia Date: Mon, 30 May 2016 01:19:50 +0000 (-0500) Subject: Old MPR objects removed. X-Git-Tag: v0.1~152 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=6e554087c1bd5e77c1e954e97b9eb2f9282c0ddb;p=cpPlugins.git Old MPR objects removed. --- diff --git a/lib/cpExtensions/Visualization/MPRActors.cxx b/lib/cpExtensions/Visualization/MPRActors.cxx deleted file mode 100644 index d77543f..0000000 --- a/lib/cpExtensions/Visualization/MPRActors.cxx +++ /dev/null @@ -1,502 +0,0 @@ -#include - -/* -#include -#include -#include -#include -#include -#include -#include - -// ------------------------------------------------------------------------- -cpExtensions::Visualization::MPRActors* -cpExtensions::Visualization::MPRActors:: -New( ) -{ - return( new Self( ) ); -} - -// ------------------------------------------------------------------------- -cpExtensions::Visualization:: -ImageSliceActors* cpExtensions::Visualization::MPRActors:: -GetSliceActors( const int& i ) const -{ - if( i < 3 ) - return( this->Slices[ 0 ][ i ] ); - else - return( NULL ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -SetInputConnection( vtkAlgorithmOutput* aout ) -{ - for( int i = 0; i < 2; ++i ) - { - for( int j = 0; j < 3; ++j ) - { - this->Slices[ i ][ j ]->SetInputConnection( aout ); - this->Slices[ i ][ j ]->SetAxis( j ); - - } // rof - - } // rof - this->_CreateBoundingBox( ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -SetInputImage( vtkImageData* data ) -{ - for( int i = 0; i < 2; ++i ) - { - for( int j = 0; j < 3; ++j ) - { - this->Slices[ i ][ j ]->SetInputImage( data ); - this->Slices[ i ][ j ]->SetAxis( j ); - - } // rof - - } // rof - this->_CreateBoundingBox( ); -} - -// ------------------------------------------------------------------------- -int cpExtensions::Visualization::MPRActors:: -AddBinaryConnection( - vtkAlgorithmOutput* aout, - const double& r, const double& g, const double& b - ) -{ - this->Slices[ 0 ][ 0 ]->AddBinaryConnection( aout, r, g, b ); - this->Slices[ 0 ][ 1 ]->AddBinaryConnection( aout, r, g, b ); - this->Slices[ 0 ][ 2 ]->AddBinaryConnection( aout, r, g, b ); - this->Slices[ 1 ][ 0 ]->AddBinaryConnection( aout, r, g, b ); - this->Slices[ 1 ][ 1 ]->AddBinaryConnection( aout, r, g, b ); - return( this->Slices[ 1 ][ 2 ]->AddBinaryConnection( aout, r, g, b ) ); -} - -// ------------------------------------------------------------------------- -int cpExtensions::Visualization::MPRActors:: -AddBinaryImage( - vtkImageData* data, - const double& r, const double& g, const double& b - ) -{ - this->Slices[ 0 ][ 0 ]->AddBinaryImage( data, r, g, b ); - this->Slices[ 0 ][ 1 ]->AddBinaryImage( data, r, g, b ); - this->Slices[ 0 ][ 2 ]->AddBinaryImage( data, r, g, b ); - this->Slices[ 1 ][ 0 ]->AddBinaryImage( data, r, g, b ); - this->Slices[ 1 ][ 1 ]->AddBinaryImage( data, r, g, b ); - return( this->Slices[ 1 ][ 2 ]->AddBinaryImage( data, r, g, b ) ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -Clear( ) -{ - this->Slices[ 0 ][ 0 ]->Clear( ); - this->Slices[ 0 ][ 1 ]->Clear( ); - this->Slices[ 0 ][ 2 ]->Clear( ); - this->Slices[ 1 ][ 0 ]->Clear( ); - this->Slices[ 1 ][ 1 ]->Clear( ); - this->Slices[ 1 ][ 2 ]->Clear( ); -} - -// ------------------------------------------------------------------------- -vtkImageData* cpExtensions::Visualization::MPRActors:: -GetInputImage( ) -{ - return( this->Slices[ 0 ][ 0 ]->GetInputImage( ) ); -} - -// ------------------------------------------------------------------------- -const vtkImageData* cpExtensions::Visualization::MPRActors:: -GetInputImage( ) const -{ - return( this->Slices[ 0 ][ 0 ]->GetInputImage( ) ); -} - -// ------------------------------------------------------------------------- -unsigned int cpExtensions::Visualization::MPRActors:: -GetNumberOfImages( ) const -{ - return( this->Slices[ 0 ][ 0 ]->GetNumberOfImages( ) ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -SetInterpolate( bool v ) -{ - this->Slices[ 0 ][ 0 ]->SetInterpolate( v ); - this->Slices[ 0 ][ 1 ]->SetInterpolate( v ); - this->Slices[ 0 ][ 2 ]->SetInterpolate( v ); - this->Slices[ 1 ][ 0 ]->SetInterpolate( v ); - this->Slices[ 1 ][ 1 ]->SetInterpolate( v ); - this->Slices[ 1 ][ 2 ]->SetInterpolate( v ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -InterpolateOn( ) -{ - this->SetInterpolate( true ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -InterpolateOff( ) -{ - this->SetInterpolate( false ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -PushActorsInto( - vtkRenderWindow* x, - vtkRenderWindow* y, - vtkRenderWindow* z, - vtkRenderWindow* w - ) -{ - this->Slices[ 0 ][ 0 ]->PushActorsInto( x, true ); - this->Slices[ 0 ][ 1 ]->PushActorsInto( y, true ); - this->Slices[ 0 ][ 2 ]->PushActorsInto( z, true ); - this->Slices[ 1 ][ 0 ]->PushActorsInto( w, false ); - this->Slices[ 1 ][ 1 ]->PushActorsInto( w, false ); - this->Slices[ 1 ][ 2 ]->PushActorsInto( w, false ); - - vtkRenderer* wren = - ( w != NULL )? w->GetRenderers( )->GetFirstRenderer( ): NULL; - if( wren != NULL ) - { - wren->AddViewProp( this->ImageOutlineActor ); - wren->AddViewProp( this->Slices[ 1 ][ 0 ]->GetPlaneActor( ) ); - wren->AddViewProp( this->Slices[ 1 ][ 1 ]->GetPlaneActor( ) ); - wren->AddViewProp( this->Slices[ 1 ][ 2 ]->GetPlaneActor( ) ); - - } // fi -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -PopActorsFrom( - vtkRenderWindow* x, - vtkRenderWindow* y, - vtkRenderWindow* z, - vtkRenderWindow* w - ) -{ - this->Slices[ 0 ][ 0 ]->PopActorsFrom( x ); - this->Slices[ 0 ][ 1 ]->PopActorsFrom( y ); - this->Slices[ 0 ][ 2 ]->PopActorsFrom( z ); - this->Slices[ 1 ][ 0 ]->PopActorsFrom( w ); - this->Slices[ 1 ][ 1 ]->PopActorsFrom( w ); - this->Slices[ 1 ][ 2 ]->PopActorsFrom( w ); - - vtkRenderer* wren = - ( w != NULL )? w->GetRenderers( )->GetFirstRenderer( ): NULL; - if( wren != NULL ) - { - wren->RemoveViewProp( this->ImageOutlineActor ); - wren->RemoveViewProp( this->Slices[ 1 ][ 0 ]->GetPlaneActor( ) ); - wren->RemoveViewProp( this->Slices[ 1 ][ 1 ]->GetPlaneActor( ) ); - wren->RemoveViewProp( this->Slices[ 1 ][ 2 ]->GetPlaneActor( ) ); - - } // fi -} - -// ------------------------------------------------------------------------- -double cpExtensions::Visualization::MPRActors:: -GetMinWindow( ) const -{ - return( this->Slices[ 0 ][ 0 ]->GetMinWindow( ) ); -} - -// ------------------------------------------------------------------------- -double cpExtensions::Visualization::MPRActors:: -GetMaxWindow( ) const -{ - return( this->Slices[ 0 ][ 0 ]->GetMaxWindow( ) ); -} - -// ------------------------------------------------------------------------- -double cpExtensions::Visualization::MPRActors:: -GetMinLevel( ) const -{ - return( this->Slices[ 0 ][ 0 ]->GetMinLevel( ) ); -} - -// ------------------------------------------------------------------------- -double cpExtensions::Visualization::MPRActors:: -GetMaxLevel( ) const -{ - return( this->Slices[ 0 ][ 0 ]->GetMaxLevel( ) ); -} - -// ------------------------------------------------------------------------- -double cpExtensions::Visualization::MPRActors:: -GetWindow( ) -{ - return( this->Slices[ 0 ][ 0 ]->GetWindow( ) ); -} - -// ------------------------------------------------------------------------- -double cpExtensions::Visualization::MPRActors:: -GetLevel( ) -{ - return( this->Slices[ 0 ][ 0 ]->GetLevel( ) ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -SetWindow( double w ) -{ - this->Slices[ 0 ][ 0 ]->SetWindow( w ); - this->Slices[ 0 ][ 1 ]->SetWindow( w ); - this->Slices[ 0 ][ 2 ]->SetWindow( w ); - this->Slices[ 1 ][ 0 ]->SetWindow( w ); - this->Slices[ 1 ][ 1 ]->SetWindow( w ); - this->Slices[ 1 ][ 2 ]->SetWindow( w ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -SetLevel( double l ) -{ - this->Slices[ 0 ][ 0 ]->SetLevel( l ); - this->Slices[ 0 ][ 1 ]->SetLevel( l ); - this->Slices[ 0 ][ 2 ]->SetLevel( l ); - this->Slices[ 1 ][ 0 ]->SetLevel( l ); - this->Slices[ 1 ][ 1 ]->SetLevel( l ); - this->Slices[ 1 ][ 2 ]->SetLevel( l ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -SetWindowLevel( double w, double l ) -{ - this->Slices[ 0 ][ 0 ]->SetWindowLevel( w, l ); - this->Slices[ 0 ][ 1 ]->SetWindowLevel( w, l ); - this->Slices[ 0 ][ 2 ]->SetWindowLevel( w, l ); - this->Slices[ 1 ][ 0 ]->SetWindowLevel( w, l ); - this->Slices[ 1 ][ 1 ]->SetWindowLevel( w, l ); - this->Slices[ 1 ][ 2 ]->SetWindowLevel( w, l ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -ResetWindowLevel( ) -{ - this->Slices[ 0 ][ 0 ]->ResetWindowLevel( ); - this->Slices[ 0 ][ 1 ]->ResetWindowLevel( ); - this->Slices[ 0 ][ 2 ]->ResetWindowLevel( ); - this->Slices[ 1 ][ 0 ]->ResetWindowLevel( ); - this->Slices[ 1 ][ 1 ]->ResetWindowLevel( ); - this->Slices[ 1 ][ 2 ]->ResetWindowLevel( ); -} - -// ------------------------------------------------------------------------- -int cpExtensions::Visualization::MPRActors:: -GetSliceNumber( const int& axis ) const -{ - if( axis < 3 ) - return( this->Slices[ 0 ][ axis ]->GetSliceNumber( ) ); - else - return( -1 ); -} - -// ------------------------------------------------------------------------- -int cpExtensions::Visualization::MPRActors:: -GetSliceNumberMinValue( const int& axis ) const -{ - if( axis < 3 ) - return( this->Slices[ 0 ][ axis ]->GetSliceNumberMinValue( ) ); - else - return( -1 ); -} - -// ------------------------------------------------------------------------- -int cpExtensions::Visualization::MPRActors:: -GetSliceNumberMaxValue( const int& axis ) const -{ - if( axis < 3 ) - return( this->Slices[ 0 ][ axis ]->GetSliceNumberMaxValue( ) ); - else - return( -1 ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -SetSliceNumber( const int& axis, const int& slice ) -{ - if( axis < 3 ) - { - this->Slices[ 0 ][ axis ]->SetSliceNumber( slice ); - this->Slices[ 1 ][ axis ]->SetSliceNumber( slice ); - - } // fi -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -SetSlice( const int& axis, double* pos ) -{ - if( axis < 3 ) - { - this->Slices[ 0 ][ axis ]->SetSlice( pos ); - this->Slices[ 1 ][ axis ]->SetSlice( pos ); - - } // fi -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -SetAxesCursor( const int& axis, double* pos ) -{ - if( axis < 3 ) - this->Slices[ 0 ][ axis ]->SetAxesCursor( pos ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -Render( const int& axis ) -{ - if( axis < 3 ) - { - this->Slices[ 0 ][ axis ]->Render( ); - this->Slices[ 1 ][ axis ]->Render( ); - - } // fi -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -Render( ) -{ - this->Render( 0 ); - this->Render( 1 ); - this->Render( 2 ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -ResetCamera( const int& axis ) -{ - if( axis < 3 ) - this->Slices[ 0 ][ axis ]->ResetCamera( ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -ResetCameras( ) -{ - this->ResetCamera( 0 ); - this->ResetCamera( 1 ); - this->ResetCamera( 2 ); -} - -// ------------------------------------------------------------------------- -cpExtensions::Visualization::MPRActors:: -MPRActors( ) - : Superclass( ) -{ - this->ImageOutlineActor = vtkSmartPointer< vtkActor >::New( ); - for( unsigned int i = 0; i < 2; ++i ) - for( unsigned int j = 0; j < 3; ++j ) - this->Slices[ i ][ j ] = vtkSmartPointer< ImageSliceActors >::New( ); - - this->Slices[ 0 ][ 0 ]->AssociateSlice( this->Slices[ 1 ][ 0 ] ); - this->Slices[ 0 ][ 1 ]->AssociateSlice( this->Slices[ 1 ][ 1 ] ); - this->Slices[ 0 ][ 2 ]->AssociateSlice( this->Slices[ 1 ][ 2 ] ); - - for( unsigned int i = 0; i < 3; ++ i ) - { - this->Slices[ 0 ][ i ]->AddRenderCommand( - Self::_RenderCommand, this - ); - this->Slices[ 0 ][ i ]->AddWindowLevelCommand( - Self::_WindowLevelCommand, this - ); - this->Slices[ 0 ][ i ]->AddSlicesCommand( Self::_SlicesCommand, this ); - - } // rof -} - -// ------------------------------------------------------------------------- -cpExtensions::Visualization::MPRActors:: -~MPRActors( ) -{ -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -_CreateBoundingBox( ) -{ - vtkImageData* image = - dynamic_cast< vtkImageData* >( this->Slices[ 0 ][ 0 ]->GetInputImage( ) ); - if( image == NULL ) - return; - - // Create 3D outline - double bb[ 6 ]; - image->GetBounds( bb ); - - vtkSmartPointer< vtkOutlineSource > img_ol = - vtkSmartPointer< vtkOutlineSource >::New( ); - img_ol->SetBounds( bb ); - - vtkSmartPointer< vtkPolyDataMapper > img_ol_mapper = - vtkSmartPointer< vtkPolyDataMapper >::New( ); - img_ol_mapper->SetInputConnection( img_ol->GetOutputPort( ) ); - this->ImageOutlineActor->SetMapper( img_ol_mapper ); - this->ImageOutlineActor->GetProperty( )->SetColor( 1, 1, 1 ); - this->ImageOutlineActor->GetProperty( )->SetLineWidth( 1 ); - - this->AddItem( this->ImageOutlineActor ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -_SlicesCommand( double* pos, int axis, void* data ) -{ - MPRActors* actors = reinterpret_cast< MPRActors* >( data ); - if( actors == NULL ) - return; - for( unsigned int j = 0; j < 3; ++j ) - { - if( actors->Slices[ 0 ][ j ]->GetAxis( ) != axis ) - { - actors->SetSlice( j, pos ); - actors->SetAxesCursor( j, pos ); - actors->Render( j ); - - } // fi - - } // rof -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -_WindowLevelCommand( double window, double level, void* data ) -{ - MPRActors* actors = reinterpret_cast< MPRActors* >( data ); - if( actors == NULL ) - return; - actors->SetWindowLevel( window, level ); - actors->Render( ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRActors:: -_RenderCommand( void* data ) -{ - MPRActors* actors = reinterpret_cast< MPRActors* >( data ); - if( actors == NULL ) - return; - actors->Render( ); -} -*/ - -// eof - $RCSfile$ diff --git a/lib/cpExtensions/Visualization/MPRActors.h b/lib/cpExtensions/Visualization/MPRActors.h deleted file mode 100644 index 295497c..0000000 --- a/lib/cpExtensions/Visualization/MPRActors.h +++ /dev/null @@ -1,130 +0,0 @@ -#ifndef __CPEXTENSIONS__VISUALIZATION__MPRACTORS__H__ -#define __CPEXTENSIONS__VISUALIZATION__MPRACTORS__H__ - -#include -#include - -namespace cpExtensions -{ - namespace Visualization - { - /** - */ - /* - class cpExtensions_EXPORT MPRActors - : public vtkPropCollection - { - 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 ); - - public: - // Creation - static MPRActors* New( ); - - ImageSliceActors* GetSliceActors( const int& i ) 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 Clear( ); - - vtkImageData* GetInputImage( ); - const vtkImageData* GetInputImage( ) const; - - unsigned int GetNumberOfImages( ) const; - - void SetInterpolate( bool v ); - void InterpolateOn( ); - void InterpolateOff( ); - - void PushActorsInto( - vtkRenderWindow* x, - vtkRenderWindow* y, - vtkRenderWindow* z, - vtkRenderWindow* w - ); - void PopActorsFrom( - vtkRenderWindow* x, - vtkRenderWindow* y, - vtkRenderWindow* z, - vtkRenderWindow* w - ); - - double GetMinWindow( ) const; - double GetMaxWindow( ) const; - double GetMinLevel( ) const; - double GetMaxLevel( ) const; - double GetWindow( ); - double GetLevel( ); - void SetWindow( double w ); - void SetLevel( double l ); - void SetWindowLevel( double w, double l ); - void ResetWindowLevel( ); - - // Slice access - 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 SetAxesCursor( const int& axis, double* pos ); - - // Rendering controls - void Render( const int& axis ); - void Render( ); - void ResetCamera( const int& axis ); - void ResetCameras( ); - - protected: - MPRActors( ); - virtual ~MPRActors( ); - - 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 - MPRActors( const Self& ); - Self& operator=( const Self& ); - - protected: - vtkSmartPointer< vtkActor > ImageOutlineActor; - vtkSmartPointer< ImageSliceActors > Slices[ 2 ][ 3 ]; - }; - */ - - } // ecapseman - -} // ecapseman - -#endif // __CPEXTENSIONS__VISUALIZATION__MPRACTORS__H__ - -// eof - $RCSfile$ diff --git a/lib/cpExtensions/Visualization/MPRObjects.cxx b/lib/cpExtensions/Visualization/MPRObjects.cxx deleted file mode 100644 index 49428e6..0000000 --- a/lib/cpExtensions/Visualization/MPRObjects.cxx +++ /dev/null @@ -1,526 +0,0 @@ -#include - -/* -#include -#include -#include - -// ------------------------------------------------------------------------- -cpExtensions::Visualization::MPRObjects* -cpExtensions::Visualization::MPRObjects:: -New( ) -{ - return( new Self( ) ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -SetRenderWindows( - vtkRenderWindow* x, vtkRenderWindow* y, - vtkRenderWindow* z, vtkRenderWindow* w - ) -{ - this->m_Windows[ 0 ] = x; - this->m_Windows[ 1 ] = y; - this->m_Windows[ 2 ] = z; - this->m_Windows[ 3 ] = w; - - // Prepare 2D renderers - for( int i = 0; i < 4; ++i ) - { - // Create renderer, if render window exists - if( this->m_Windows[ i ] != NULL ) - { - this->m_Renderers[ i ] = vtkSmartPointer< vtkRenderer >::New( ); - this->m_Renderers[ i ]->SetBackground( 0.3, 0.3, 0.3 ); - this->m_Windows[ i ]->AddRenderer( this->m_Renderers[ i ] ); - } - else - this->m_Renderers[ i ] = NULL; - - } // rof -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -SetInputConnection( vtkAlgorithmOutput* aout ) -{ - this->m_MPRActors->SetInputConnection( aout ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -SetInputImage( vtkImageData* data ) -{ - this->m_MPRActors->SetInputImage( data ); -} - -// ------------------------------------------------------------------------- -int cpExtensions::Visualization::MPRObjects:: -AddBinaryConnection( - vtkAlgorithmOutput* aout, - const double& r, const double& g, const double& b - ) -{ - return( this->m_MPRActors->AddBinaryConnection( aout, r, g, b ) ); -} - -// ------------------------------------------------------------------------- -int cpExtensions::Visualization::MPRObjects:: -AddBinaryImage( - vtkImageData* data, - const double& r, const double& g, const double& b - ) -{ - return( this->m_MPRActors->AddBinaryImage( data, r, g, b ) ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -Show( ) -{ - this->m_MPRActors->PushActorsInto( - this->m_Windows[ 0 ], - this->m_Windows[ 1 ], - this->m_Windows[ 2 ], - this->m_Windows[ 3 ] - ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -Hide( ) -{ - this->m_MPRActors->PopActorsFrom( - this->m_Windows[ 0 ], - this->m_Windows[ 1 ], - this->m_Windows[ 2 ], - this->m_Windows[ 3 ] - ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -Clear( ) -{ - this->m_MPRActors->Clear( ); -} - -// ------------------------------------------------------------------------- -vtkImageData* cpExtensions::Visualization::MPRObjects:: -GetInputImage( ) -{ - return( this->m_MPRActors->GetInputImage( ) ); -} - -// ------------------------------------------------------------------------- -const vtkImageData* cpExtensions::Visualization::MPRObjects:: -GetInputImage( ) const -{ - return( this->m_MPRActors->GetInputImage( ) ); -} - -// ------------------------------------------------------------------------- -unsigned int cpExtensions::Visualization::MPRObjects:: -GetNumberOfImages( ) const -{ - return( this->m_MPRActors->GetNumberOfImages( ) ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -SetInterpolate( bool v ) -{ - this->m_MPRActors->SetInterpolate( v ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -InterpolateOn( ) -{ - this->m_MPRActors->InterpolateOn( ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -InterpolateOff( ) -{ - this->m_MPRActors->InterpolateOff( ); -} - -// ------------------------------------------------------------------------- -double cpExtensions::Visualization::MPRObjects:: -GetMinWindow( ) const -{ - return( this->m_MPRActors->GetMinWindow( ) ); -} - -// ------------------------------------------------------------------------- -double cpExtensions::Visualization::MPRObjects:: -GetMaxWindow( ) const -{ - return( this->m_MPRActors->GetMaxWindow( ) ); -} - -// ------------------------------------------------------------------------- -double cpExtensions::Visualization::MPRObjects:: -GetMinLevel( ) const -{ - return( this->m_MPRActors->GetMinLevel( ) ); -} - -// ------------------------------------------------------------------------- -double cpExtensions::Visualization::MPRObjects:: -GetMaxLevel( ) const -{ - return( this->m_MPRActors->GetMaxLevel( ) ); -} - -// ------------------------------------------------------------------------- -double cpExtensions::Visualization::MPRObjects:: -GetWindow( ) const -{ - return( this->m_MPRActors->GetWindow( ) ); -} - -// ------------------------------------------------------------------------- -double cpExtensions::Visualization::MPRObjects:: -GetLevel( ) const -{ - return( this->m_MPRActors->GetLevel( ) ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -SetWindow( double w ) -{ - this->m_MPRActors->SetWindow( w ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -SetLevel( double l ) -{ - this->m_MPRActors->SetLevel( l ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -SetWindowLevel( double w, double l ) -{ - this->m_MPRActors->SetWindowLevel( w, l ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -ResetWindowLevel( ) -{ - this->m_MPRActors->ResetWindowLevel( ); -} - -// ------------------------------------------------------------------------- -int cpExtensions::Visualization::MPRObjects:: -GetSliceNumber( const int& axis ) const -{ - return( this->m_MPRActors->GetSliceNumber( axis ) ); -} - -// ------------------------------------------------------------------------- -int cpExtensions::Visualization::MPRObjects:: -GetSliceNumberMinValue( const int& axis ) const -{ - return( this->m_MPRActors->GetSliceNumberMinValue( axis ) ); -} - -// ------------------------------------------------------------------------- -int cpExtensions::Visualization::MPRObjects:: -GetSliceNumberMaxValue( const int& axis ) const -{ - return( this->m_MPRActors->GetSliceNumberMaxValue( axis ) ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -SetSliceNumber( const int& axis, const int& slice ) -{ - this->m_MPRActors->SetSliceNumber( axis, slice ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -SetSlice( const int& axis, double* pos ) -{ - this->m_MPRActors->SetSlice( axis, pos ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -Render( const double& t ) -{ - this->Render( 0, t ); - this->Render( 1, t ); - this->Render( 2, t ); - this->Render( 3, t ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -Render( const int& axis, const double& t ) -{ - if( axis < 4 ) - { - if( this->m_Windows[ axis ].GetPointer( ) != NULL ) - { - if( this->m_Renderers[ axis ].GetPointer( ) != NULL ) - this->m_Renderers[ axis ]->SetAllocatedRenderTime( t ); - this->m_Windows[ axis ]->Render( ); - - } // fi - - } // fi -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -ResetCamera( const int& axis ) -{ - if( axis < 4 ) - if( this->m_Renderers[ axis ].GetPointer( ) != NULL ) - this->m_Renderers[ axis ]->ResetCamera( ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -ResetCameras( ) -{ - this->ResetCamera( 0 ); - this->ResetCamera( 1 ); - this->ResetCamera( 2 ); - this->ResetCamera( 3 ); -} - -// ------------------------------------------------------------------------- -cpExtensions::Visualization::MPRObjects:: -MPRObjects( ) - : vtkObject( ) -{ - this->m_MPRActors = vtkSmartPointer< MPRActors >::New( ); -} - -// ------------------------------------------------------------------------- -cpExtensions::Visualization::MPRObjects:: -~MPRObjects( ) -{ -} - -*/ - - -/* -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -SetRenderWindows( - vtkRenderWindow* wx, vtkRenderWindow* wy, - vtkRenderWindow* wz, vtkRenderWindow* w3D - ) -{ -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -AddImage( vtkImageData* image ) -{ - this->m_MPRActors->AddInputData( image ); - this->m_MPRActors->PushActorsInto( - this->m_Windows[ 0 ], - this->m_Windows[ 1 ], - this->m_Windows[ 2 ], - this->m_Windows[ 3 ] - ); - - // First rendering - if( this->m_MPRActors->GetNumberOfImages( ) == 1 ) - { - this->m_MPRActors->ResetSlices( ); - this->ResetCameras( ); - - } // fi - this->RenderAll( 1e-3 ); -} - -// ------------------------------------------------------------------------- -unsigned int cpExtensions::Visualization::MPRObjects:: -GetNumberOfImages( ) const -{ - return( this->m_MPRActors->GetNumberOfImages( ) ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -ClearAll( ) -{ - this->m_MPRActors->PopActorsFrom( - this->m_Windows[ 0 ], - this->m_Windows[ 1 ], - this->m_Windows[ 2 ], - this->m_Windows[ 3 ] - ); - this->ResetCameras( ); - this->RenderAll( 1e-3 ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -ResetCamera( const int& id ) -{ - if( id < 4 ) - if( this->m_Windows[ id ] != NULL ) - this->m_Renderers[ id ]->ResetCamera( ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -ResetCameras( ) -{ - for( int i = 0; i < 4; ++i ) - if( this->m_Windows[ i ] != NULL ) - this->m_Renderers[ i ]->ResetCamera( ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -Render( const int& id, const double& t ) -{ - if( id < 4 ) - { - if( this->m_Windows[ id ] != NULL ) - { - if( this->m_Renderers[ id ] != NULL ) - this->m_Renderers[ id ]->SetAllocatedRenderTime( t ); - this->m_Windows[ id ]->Render( ); - - } // fi - - } // fi -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::MPRObjects:: -RenderAll( const double& t ) -{ - for( int i = 0; i < 4; ++i ) - { - if( this->m_Windows[ i ] != NULL ) - { - if( this->m_Renderers[ i ] != NULL ) - this->m_Renderers[ i ]->SetAllocatedRenderTime( t ); - this->m_Windows[ i ]->Render( ); - - } // fi - - } // rof -} - -// ------------------------------------------------------------------------- -vtkRenderer* cpExtensions::Visualization::MPRObjects:: -GetXRenderer( ) -{ - return( this->m_Renderers[ 0 ] ); -} - -// ------------------------------------------------------------------------- -vtkRenderer* cpExtensions::Visualization::MPRObjects:: -GetYRenderer( ) -{ - return( this->m_Renderers[ 1 ] ); -} - -// ------------------------------------------------------------------------- -vtkRenderer* cpExtensions::Visualization::MPRObjects:: -GetZRenderer( ) -{ - return( this->m_Renderers[ 2 ] ); -} - -// ------------------------------------------------------------------------- -vtkRenderer* cpExtensions::Visualization::MPRObjects:: -Get3DRenderer( ) -{ - return( this->m_Renderers[ 3 ] ); -} - -// ------------------------------------------------------------------------- -const vtkRenderer* cpExtensions::Visualization::MPRObjects:: -GetXRenderer( ) const -{ - return( this->m_Renderers[ 0 ] ); -} - -// ------------------------------------------------------------------------- -const vtkRenderer* cpExtensions::Visualization::MPRObjects:: -GetYRenderer( ) const -{ - return( this->m_Renderers[ 1 ] ); -} - -// ------------------------------------------------------------------------- -const vtkRenderer* cpExtensions::Visualization::MPRObjects:: -GetZRenderer( ) const -{ - return( this->m_Renderers[ 2 ] ); -} - -// ------------------------------------------------------------------------- -const vtkRenderer* cpExtensions::Visualization::MPRObjects:: -Get3DRenderer( ) const -{ - return( this->m_Renderers[ 3 ] ); -} - -// ------------------------------------------------------------------------- -cpExtensions::Visualization:: -MPRActors* cpExtensions::Visualization::MPRObjects:: -GetMPRActors( ) -{ - return( this->m_MPRActors ); -} - -// ------------------------------------------------------------------------- -const cpExtensions::Visualization:: -MPRActors* cpExtensions::Visualization::MPRObjects:: -GetMPRActors( ) const -{ - return( this->m_MPRActors ); -} - -// ------------------------------------------------------------------------- -double cpExtensions::Visualization::MPRObjects:: -GetWindow( ) const -{ - return( this->m_MPRActors->GetWindow( ) ); -} - -// ------------------------------------------------------------------------- -double cpExtensions::Visualization::MPRObjects:: -GetLevel( ) const -{ - return( this->m_MPRActors->GetLevel( ) ); -} - -// ------------------------------------------------------------------------- -cpExtensions::Visualization::MPRObjects:: -MPRObjects( ) - : vtkObject( ) -{ - // Prepare actors - this->m_MPRActors = vtkSmartPointer< MPRActors >::New( ); -} - -// ------------------------------------------------------------------------- -cpExtensions::Visualization::MPRObjects:: -~MPRObjects( ) -{ -} -*/ - -// eof - $RCSfile$ diff --git a/lib/cpExtensions/Visualization/MPRObjects.h b/lib/cpExtensions/Visualization/MPRObjects.h deleted file mode 100644 index 10bf50b..0000000 --- a/lib/cpExtensions/Visualization/MPRObjects.h +++ /dev/null @@ -1,139 +0,0 @@ -#ifndef __CPEXTENSIONS__VISUALIZATION__MPROBJECTS__H__ -#define __CPEXTENSIONS__VISUALIZATION__MPROBJECTS__H__ - -#include -#include - -#include -#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 - { - /** - */ - /* - class cpExtensions_EXPORT MPRObjects - : public vtkObject - { - public: - typedef MPRObjects Self; - - 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* x, vtkRenderWindow* y, - vtkRenderWindow* z, vtkRenderWindow* w - ); - - 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( ); - virtual ~MPRObjects( ); - - private: - // Purposely not implemented - MPRObjects( const Self& ); - Self& operator=( const Self& ); - - protected: - // Inputs - vtkSmartPointer< vtkRenderWindow > m_Windows[ 4 ]; - - // Internal pipelines - vtkSmartPointer< MPRActors > m_MPRActors; - vtkSmartPointer< vtkRenderer > m_Renderers[ 4 ]; - }; - */ - - } // ecapseman - -} // ecapseman - -#endif // __CPEXTENSIONS__VISUALIZATION__MPROBJECTS__H__ - -// eof - $RCSfile$