From 39ae6a836bc13dbc3165ded6420b638d273d5635 Mon Sep 17 00:00:00 2001 From: Leonardo Florez-Valencia Date: Thu, 19 May 2016 19:15:01 -0500 Subject: [PATCH] ... --- lib/cpExtensions/QT/SimpleMPRWidget.cxx | 34 +- lib/cpExtensions/QT/SimpleMPRWidget.h | 121 +----- lib/cpExtensions/Visualization/Image3DMPR.cxx | 364 ------------------ lib/cpExtensions/Visualization/Image3DMPR.h | 95 ----- 4 files changed, 23 insertions(+), 591 deletions(-) delete mode 100644 lib/cpExtensions/Visualization/Image3DMPR.cxx delete mode 100644 lib/cpExtensions/Visualization/Image3DMPR.h diff --git a/lib/cpExtensions/QT/SimpleMPRWidget.cxx b/lib/cpExtensions/QT/SimpleMPRWidget.cxx index 911921b..73f3b76 100644 --- a/lib/cpExtensions/QT/SimpleMPRWidget.cxx +++ b/lib/cpExtensions/QT/SimpleMPRWidget.cxx @@ -5,32 +5,11 @@ #include #include -/* TODO - #include - #include - double cpExtensions::QT::SimpleMPRWidget:: - cm_Colors[ 8 ][ 3 ] = - { - { 1.0, 0.0, 0.0 }, - { 0.0, 1.0, 0.0 }, - { 0.0, 0.0, 1.0 }, - { 0.0, 1.0, 1.0 }, - { 1.0, 0.0, 1.0 }, - { 1.0, 1.0, 0.0 }, - { 1.0, 0.5, 0.0 }, - { 1.0, 0.0, 0.5 } - }; -*/ - // ------------------------------------------------------------------------- cpExtensions::QT::SimpleMPRWidget:: SimpleMPRWidget( QWidget* parent ) : QWidget( parent ), m_UI( new Ui::SimpleMPRWidget ) - /* - , - m_MainImage( "" ) - */ { this->m_UI->setupUi( this ); @@ -43,20 +22,11 @@ SimpleMPRWidget( QWidget* parent ) for( unsigned int i = 0; i < 4; ++i ) { this->m_Renderers[ i ] = vtkSmartPointer< vtkRenderer >::New( ); - this->m_VTK[ i ]->GetRenderWindow( )->AddRenderer( this->m_Renderers[ i ] ); + this->m_VTK[ i ]->GetRenderWindow( )-> + AddRenderer( this->m_Renderers[ i ] ); } // rof - /* - this->m_MPRObjects = vtkSmartPointer< TMPRObjects >::New( ); - this->m_MPRObjects->SetRenderWindows( - this->m_VTK[ 0 ]->GetRenderWindow( ), - this->m_VTK[ 1 ]->GetRenderWindow( ), - this->m_VTK[ 2 ]->GetRenderWindow( ), - this->m_VTK[ 3 ]->GetRenderWindow( ) - ); - */ - // Connect slots QObject::connect( this->m_UI->TopSplitter, SIGNAL( splitterMoved( int, int ) ), diff --git a/lib/cpExtensions/QT/SimpleMPRWidget.h b/lib/cpExtensions/QT/SimpleMPRWidget.h index 5aed9ec..149abb8 100644 --- a/lib/cpExtensions/QT/SimpleMPRWidget.h +++ b/lib/cpExtensions/QT/SimpleMPRWidget.h @@ -14,19 +14,9 @@ #include #include -/* - #include - #include - #include - #include - #include - #include - #include - #include -*/ +#define cpExtensions_MAX_POLYS 65535 // ------------------------------------------------------------------------- -// TODO: class QTreeWidgetItem; class QVTKWidget; namespace Ui @@ -50,29 +40,16 @@ namespace cpExtensions typedef SimpleMPRWidget Self; typedef cpExtensions::Visualization::ImageSliceActors TActors; - /* TODO - typedef cpExtensions::Visualization::MPRObjects TMPRObjects; - typedef TMPRObjects::TStyle TStyle; - typedef TMPRObjects::TMouseCommand TMouseCommand; - typedef TMPRObjects::TMouseWheelCommand TMouseWheelCommand; - typedef TMPRObjects::TKeyCommand TKeyCommand; - typedef TMPRObjects::TVoidCommand TVoidCommand; - typedef TMPRObjects::TMouseMoveCommand TMouseMoveCommand; - typedef TMPRObjects::TMouseClickCommand TMouseClickCommand; - typedef TMPRObjects::TMouseDoubleClickCommand TMouseDoubleClickCommand; - typedef TMPRObjects::TExposeCommand TExposeCommand; - typedef TMPRObjects::TConfigureCommand TConfigureCommand; - typedef TMPRObjects::TEnterCommand TEnterCommand; - typedef TMPRObjects::TLeaveCommand TLeaveCommand; - */ + /** + */ struct PolyDataActor { vtkSmartPointer< vtkPolyData > Data; vtkSmartPointer< vtkPolyDataNormals > Normals; vtkSmartPointer< vtkStripper > Stripper; vtkSmartPointer< vtkPolyDataMapper > Mapper; - vtkSmartPointer< vtkQuadricLODActor > Actor; + vtkSmartPointer< vtkActor > Actor; void Configure( vtkPolyData* data ) { @@ -83,8 +60,6 @@ namespace cpExtensions this->Normals = vtkSmartPointer< vtkPolyDataNormals >::New( ); this->Stripper = vtkSmartPointer< vtkStripper >::New( ); this->Mapper = vtkSmartPointer< vtkPolyDataMapper >::New( ); - this->Actor = vtkSmartPointer< vtkQuadricLODActor >::New( ); - this->Normals->SetInputData( this->Data ); this->Normals->SetFeatureAngle( 60.0 ); this->Stripper->SetInputConnection( @@ -94,11 +69,23 @@ namespace cpExtensions this->Stripper->GetOutputPort( ) ); this->Mapper->UseLookupTableScalarRangeOff( ); - this->Mapper->SetScalarRange( - r[ 0 ], ( ( r[ 1 ] - r[ 0 ] ) * 0.75 ) + r[ 0 ] - ); - this->Actor->SetMapper( this->Mapper ); - this->Actor->DeferLODConstructionOff( ); + this->Mapper->SetScalarRange( r[ 0 ], r[ 1 ] ); + + unsigned long nPolys = this->Data->GetNumberOfPolys( ); + if( nPolys < cpExtensions_MAX_POLYS ) + { + this->Actor = vtkSmartPointer< vtkActor >::New( ); + this->Actor->SetMapper( this->Mapper ); + } + else + { + vtkSmartPointer< vtkQuadricLODActor > actor = + vtkSmartPointer< vtkQuadricLODActor >::New( ); + actor->SetMapper( this->Mapper ); + actor->DeferLODConstructionOff( ); + this->Actor = actor.GetPointer( ); + + } // fi } }; @@ -114,37 +101,6 @@ namespace cpExtensions // Visual objects vtkRenderWindowInteractor* GetInteractor( unsigned int i ); - - /* TODO - unsigned int GetNumberOfData( ) const; - bool AddData( - vtkImageData* data, const std::string& name, - const std::string& parent - ); - bool AddData( - vtkPolyData* data, const std::string& name - ); - const std::string& GetMainImage( ) const; - bool SetMainImage( const std::string& name ); - void DeleteData( const std::string& name ); - void DeleteAllData( ); - - // Some qt accessors - void SetDataColor( - const std::string& name, - const double& r, const double& g, const double& b - ); - void ShowData( const std::string& name ); - void HideData( const std::string& name ); - void SetWindowLevel( const double& w, const double& l ); - double GetWindow( ) const; - double GetLevel( ) const; - - // Visual objects accessors - std::string GetSelectedData( ) const; - vtkProp* GetProp( const std::string& name ); - */ - private slots: void _SyncBottom( int a, int b ); void _SyncTop( int a, int b ); @@ -158,41 +114,6 @@ namespace cpExtensions vtkSmartPointer< TActors > m_3DSlices[ 3 ]; std::map< vtkPolyData*, PolyDataActor > m_PolyDatas; - - /* TODO - static double cm_Colors[ 8 ][ 3 ]; - vtkSmartPointer< TMPRObjects > m_MPRObjects; - struct PolyDataActor - { - vtkPolyData* Mesh; - vtkPolyDataNormals* Normals; - vtkStripper* Stripper; - vtkPolyDataMapper* Mapper; - vtkQuadricLODActor* Actor; - - PolyDataActor( ); - virtual ~PolyDataActor( ); - void Configure( vtkPolyData* pd ); - }; - - struct Data - { - enum { IMAGE, MESH } Tag; - vtkImageData* Image; - PolyDataActor Mesh; - Data( ); - virtual ~Data( ); - Data& operator=( const Data& data ); - void SetImageData( vtkImageData* data ); - void SetPolyData( vtkPolyData* data ); - vtkImageData* GetImage( ); - vtkPolyData* GetMesh( ); - vtkProp* GetMeshActor( ); - }; - std::string m_MainImage; - std::map< std::string, Data > m_Data; - std::map< std::string, std::string > m_Tree; - */ }; } // ecapseman diff --git a/lib/cpExtensions/Visualization/Image3DMPR.cxx b/lib/cpExtensions/Visualization/Image3DMPR.cxx deleted file mode 100644 index 7812300..0000000 --- a/lib/cpExtensions/Visualization/Image3DMPR.cxx +++ /dev/null @@ -1,364 +0,0 @@ -#include - -#include -#include - -#include - -/** - */ -class cpPlugins_Extensions_Visualization_InteractionModeCallback - : public vtkCommand -{ -public: - static cpPlugins_Extensions_Visualization_InteractionModeCallback* New( ) - { - return( new cpPlugins_Extensions_Visualization_InteractionModeCallback ); - } - virtual void Execute( - vtkObject* caller, unsigned long eventId, void* arguments ) - { - if( eventId == vtkCommand::KeyPressEvent ) - { - vtkRenderWindowInteractor* iren = - static_cast< vtkRenderWindowInteractor* >( caller ); - if( caller == NULL ) - return; - - switch( iren->GetKeyCode( ) ) - { - case 'x': - case 'X': - { - bool eSeed = ( this->SeedWidget->GetProcessEvents( ) == 1 ); - if( eSeed ) - { - this->SeedWidget->ProcessEventsOff( ); - this->WidgetX->InteractionOn( ); - this->WidgetY->InteractionOn( ); - this->WidgetZ->InteractionOn( ); - } - else - { - this->SeedWidget->ProcessEventsOn( ); - this->WidgetX->InteractionOff( ); - this->WidgetY->InteractionOff( ); - this->WidgetZ->InteractionOff( ); - - } // fi - } - break; - case 'z': - case 'Z': - { - this->SeedWidget->ProcessEventsOff( ); - this->WidgetX->InteractionOff( ); - this->WidgetY->InteractionOff( ); - this->WidgetZ->InteractionOff( ); - } - break; - default: - break; - - } // hctiws - - } // fi - } - -public: - vtkImagePlaneWidget* WidgetX; - vtkImagePlaneWidget* WidgetY; - vtkImagePlaneWidget* WidgetZ; - vtkSeedWidget* SeedWidget; -}; - -// ------------------------------------------------------------------------- -cpExtensions::Visualization::Image3DMPR:: -Image3DMPR( ) -{ - this->m_Outline = vtkSmartPointer< vtkOutlineSource >::New( ); - this->m_OutlineMapper = vtkSmartPointer< vtkPolyDataMapper >::New( ); - this->m_OutlineActor = vtkSmartPointer< vtkActor >::New( ); - this->m_Picker = vtkSmartPointer< vtkCellPicker >::New( ); - this->m_WidgetX = vtkSmartPointer< vtkImagePlaneWidget >::New( ); - this->m_WidgetY = vtkSmartPointer< vtkImagePlaneWidget >::New( ); - this->m_WidgetZ = vtkSmartPointer< vtkImagePlaneWidget >::New( ); - this->m_Renderer = vtkSmartPointer< vtkRenderer >::New( ); - this->m_Window = vtkSmartPointer< vtkRenderWindow >::New( ); - this->m_Interactor = vtkSmartPointer< vtkRenderWindowInteractor >::New( ); - this->m_SeedHandleRepresentation = - vtkSmartPointer< vtkPointHandleRepresentation3D >::New( ); - this->m_SeedRepresentation = - vtkSmartPointer< vtkSeedRepresentation >::New( ); - this->m_SeedWidget = vtkSmartPointer::New(); - - this->m_SeedHandleRepresentation->GetProperty()->SetColor( 1, 0, 1 ); - this->m_SeedRepresentation-> - SetHandleRepresentation( this->m_SeedHandleRepresentation ); - this->m_SeedWidget->SetRepresentation( this->m_SeedRepresentation ); - - this->m_WidgetX->KeyPressActivationOff( ); - this->m_WidgetY->KeyPressActivationOff( ); - this->m_WidgetZ->KeyPressActivationOff( ); - this->m_SeedWidget->KeyPressActivationOff( ); - - typedef - cpPlugins_Extensions_Visualization_InteractionModeCallback - _TInteractionCB; - vtkSmartPointer< _TInteractionCB > int_cb = - vtkSmartPointer< _TInteractionCB >::New( ); - int_cb->WidgetX = this->m_WidgetX; - int_cb->WidgetY = this->m_WidgetY; - int_cb->WidgetZ = this->m_WidgetZ; - int_cb->SeedWidget = this->m_SeedWidget; - this->m_Interactor->AddObserver( vtkCommand::KeyPressEvent, int_cb ); - - typedef - cpExtensions::Visualization::SeedWidgetCorrector - _TCorrector; - vtkSmartPointer< _TCorrector > corr_cb = - vtkSmartPointer< _TCorrector >::New( ); - corr_cb->Configure( this->m_Picker ); - this->m_SeedWidget->AddObserver( vtkCommand::PlacePointEvent, corr_cb ); -} - -// ------------------------------------------------------------------------- -cpExtensions::Visualization::Image3DMPR:: -~Image3DMPR( ) -{ -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::Image3DMPR:: -SetImage( vtkImageData* image ) -{ - this->m_Image = image; - - // Outline - this->m_Outline->SetBounds( this->m_Image->GetBounds( ) ); - this->m_OutlineMapper-> - SetInputConnection( this->m_Outline->GetOutputPort( ) ); - this->m_OutlineActor->SetMapper( this->m_OutlineMapper ); - this->m_OutlineActor->GetProperty( )->SetColor( 1, 1, 1 ); - - // Local picker - this->m_Picker->SetTolerance( 0.005 ); - - // Image planes - this->m_WidgetX->DisplayTextOn( ); - this->m_WidgetX->SetInputData( this->m_Image ); - this->m_WidgetX->SetPlaneOrientationToXAxes( ); - this->m_WidgetX->SetSliceIndex( this->m_Image->GetExtent( )[ 0 ] ); - this->m_WidgetX->SetPicker( this->m_Picker ); - this->m_WidgetX->SetKeyPressActivationValue( 'x' ); - this->m_WidgetX->GetPlaneProperty( )->SetLineWidth( 3 ); - this->m_WidgetX->GetPlaneProperty( )->SetColor( 0, 1, 1 ); - - this->m_WidgetY->DisplayTextOn( ); - this->m_WidgetY->SetInputData( this->m_Image ); - this->m_WidgetY->SetPlaneOrientationToYAxes( ); - this->m_WidgetY->SetSliceIndex( this->m_Image->GetExtent( )[ 2 ] ); - this->m_WidgetY->SetPicker( this->m_Picker ); - this->m_WidgetY->SetKeyPressActivationValue( 'y' ); - this->m_WidgetY->GetPlaneProperty( )->SetColor( 1, 0, 1 ); - this->m_WidgetY->GetPlaneProperty( )->SetLineWidth( 3 ); - this->m_WidgetY->SetLookupTable( this->m_WidgetX->GetLookupTable( ) ); - - this->m_WidgetZ->DisplayTextOn( ); - this->m_WidgetZ->SetInputData( this->m_Image ); - this->m_WidgetZ->SetPlaneOrientationToZAxes( ); - this->m_WidgetZ->SetSliceIndex( this->m_Image->GetExtent( )[ 4 ] ); - this->m_WidgetZ->SetPicker( this->m_Picker ); - this->m_WidgetZ->SetKeyPressActivationValue( 'z' ); - this->m_WidgetZ->GetPlaneProperty( )->SetColor( 1, 1, 0 ); - this->m_WidgetZ->GetPlaneProperty( )->SetLineWidth( 3 ); - this->m_WidgetZ->SetLookupTable( this->m_WidgetX->GetLookupTable( ) ); - - // Rendering stuff - this->m_Window->AddRenderer( this->m_Renderer ); - this->m_Interactor->SetRenderWindow( this->m_Window ); - - // Command - double spac[ 3 ]; - this->m_Image->GetSpacing( spac ); - double min_spacing = spac[ 0 ]; - for( unsigned int d = 1; d < 3; d++ ) - min_spacing = ( spac[ d ] < min_spacing )? spac[ d ]: min_spacing; - - vtkInteractorStyleSwitch* iswitch = - dynamic_cast< vtkInteractorStyleSwitch* >( - this->m_Interactor->GetInteractorStyle( ) - ); - if( iswitch != NULL ) - iswitch->SetCurrentStyleToTrackballCamera( ); - - // Add actors - this->m_Renderer->AddActor( this->m_OutlineActor ); - - // Prepare widgets - this->m_WidgetX->SetInteractor( this->m_Interactor ); - this->m_WidgetY->SetInteractor( this->m_Interactor ); - this->m_WidgetZ->SetInteractor( this->m_Interactor ); - this->m_SeedWidget->SetInteractor( this->m_Interactor ); - - this->m_WidgetX->On( ); - this->m_WidgetY->On( ); - this->m_WidgetZ->On( ); - this->m_SeedWidget->On( ); - this->m_SeedWidget->ProcessEventsOff( ); - this->m_Interactor->SetPicker( this->m_Picker ); - /* - this->m_Interactor->GetPickingManager( )->AddPicker( this->m_Picker ); - this->m_Interactor->GetPickingManager( )->EnabledOn( ); - */ -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::Image3DMPR:: -SetBackground( double r, double g, double b ) -{ - this->m_Renderer->SetBackground( r, g, b ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::Image3DMPR:: -SetSize( unsigned int w, unsigned int h ) -{ - this->m_Window->SetSize( w, h ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::Image3DMPR:: -SetWindowLevel( double w, double l ) -{ - this->m_WidgetX->SetWindowLevel( w, l ); - this->m_WidgetY->SetWindowLevel( w, l ); - this->m_WidgetZ->SetWindowLevel( w, l ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::Image3DMPR:: -AddPolyData( vtkPolyData* pd, double opacity ) -{ - unsigned int i = this->m_PolyDatas.size( ); - - this->m_PolyDatas.push_back( pd ); - this->m_Mappers.push_back( vtkSmartPointer< vtkPolyDataMapper >::New( ) ); - this->m_Actors.push_back( vtkSmartPointer< vtkActor >::New( ) ); - - this->m_Mappers[ i ]->SetInputData( pd ); - this->m_Actors[ i ]->SetMapper( this->m_Mappers[ i ] ); - this->m_Actors[ i ]->GetProperty( )->SetOpacity( opacity ); - this->m_Actors[ i ]->GetProperty( )->SetLineWidth( 3 ); - this->m_Actors[ i ]->GetProperty( )->SetPointSize( 5 ); - this->m_Renderer->AddActor( this->m_Actors[ i ] ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::Image3DMPR:: -AddPolyData( vtkPolyData* pd, double r, double g, double b, double opacity ) -{ - unsigned int i = this->m_PolyDatas.size( ); - - this->m_PolyDatas.push_back( pd ); - this->m_Mappers.push_back( vtkSmartPointer< vtkPolyDataMapper >::New( ) ); - this->m_Actors.push_back( vtkSmartPointer< vtkActor >::New( ) ); - - this->m_Mappers[ i ]->SetInputData( pd ); - this->m_Mappers[ i ]->ScalarVisibilityOff( ); - this->m_Actors[ i ]->SetMapper( this->m_Mappers[ i ] ); - this->m_Actors[ i ]->GetProperty( )->SetColor( r, g, b ); - this->m_Actors[ i ]->GetProperty( )->SetOpacity( opacity ); - this->m_Actors[ i ]->GetProperty( )->SetLineWidth( 3 ); - this->m_Actors[ i ]->GetProperty( )->SetPointSize( 5 ); - this->m_Renderer->AddActor( this->m_Actors[ i ] ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::Image3DMPR:: -AddPolyData( vtkPolyData* pd, vtkLookupTable* lut, double opacity ) -{ - unsigned int i = this->m_PolyDatas.size( ); - - this->m_PolyDatas.push_back( pd ); - this->m_Mappers.push_back( vtkSmartPointer< vtkPolyDataMapper >::New( ) ); - this->m_Actors.push_back( vtkSmartPointer< vtkActor >::New( ) ); - - this->m_Mappers[ i ]->SetInputData( pd ); - this->m_Mappers[ i ]->SetLookupTable( lut ); - this->m_Actors[ i ]->SetMapper( this->m_Mappers[ i ] ); - this->m_Actors[ i ]->GetProperty( )->SetOpacity( opacity ); - this->m_Renderer->AddActor( this->m_Actors[ i ] ); -} - -// ------------------------------------------------------------------------- -unsigned int cpExtensions::Visualization::Image3DMPR:: -GetNumberOfSeeds( ) const -{ - return( this->m_SeedRepresentation->GetNumberOfSeeds( ) ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::Image3DMPR:: -GetSeed( int n, double* s ) const -{ - vtkHandleWidget* hWdg = this->m_SeedWidget->GetSeed( n ); - if( hWdg == NULL ) - return; - vtkHandleRepresentation* hRep = - dynamic_cast< vtkHandleRepresentation* >( hWdg->GetRepresentation( ) ); - if( hRep == NULL ) - return; - hRep->GetWorldPosition( s ); -} - -// ------------------------------------------------------------------------- -unsigned int cpExtensions::Visualization::Image3DMPR:: -AddSeed( const double& x, const double& y, const double& z ) const -{ - double pos[ 3 ] = { x, y, z }; - - int hnd_id = this->m_SeedRepresentation->CreateHandle( pos ); - vtkHandleWidget* hnd = this->m_SeedWidget->CreateNewHandle( ); - this->m_SeedRepresentation->GetHandleRepresentation( hnd_id )-> - SetWorldPosition( pos ); - hnd->SetEnabled( 1 ); - - return( this->GetNumberOfSeeds( ) - 1 ); -} - -// ------------------------------------------------------------------------- -vtkRenderWindow* cpExtensions::Visualization::Image3DMPR:: -GetWindow( ) const -{ - return( this->m_Window ); -} - -// ------------------------------------------------------------------------- -vtkRenderer* cpExtensions::Visualization::Image3DMPR:: -GetRenderer( ) const -{ - return( this->m_Renderer ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::Image3DMPR:: -Start( ) -{ - this->m_WidgetX->On( ); - this->m_WidgetY->On( ); - this->m_WidgetZ->On( ); - - this->m_Renderer->ResetCamera( ); - this->m_Interactor->Initialize( ); - this->m_Interactor->Start( ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::Image3DMPR:: -Render( ) -{ - this->m_Window->Render( ); -} - -// eof - $RCSfile$ diff --git a/lib/cpExtensions/Visualization/Image3DMPR.h b/lib/cpExtensions/Visualization/Image3DMPR.h deleted file mode 100644 index 2cbb9b7..0000000 --- a/lib/cpExtensions/Visualization/Image3DMPR.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef __CPEXTENSIONS__VISUALIZATION__IMAGE3DMPR__H__ -#define __CPEXTENSIONS__VISUALIZATION__IMAGE3DMPR__H__ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace cpExtensions -{ - namespace Visualization - { - /** - */ - class cpExtensions_EXPORT Image3DMPR - { - public: - Image3DMPR( ); - virtual ~Image3DMPR( ); - - void SetImage( vtkImageData* image ); - void SetBackground( double r, double g, double b ); - void SetSize( unsigned int w, unsigned int h ); - void SetWindowLevel( double w, double l ); - - void AddPolyData( vtkPolyData* pd, double opacity = double( 1 ) ); - void AddPolyData( - vtkPolyData* pd, - double r, double g, double b, double opacity = double( 1 ) - ); - void AddPolyData( - vtkPolyData* pd, - vtkLookupTable* lut, - double opacity = double( 1 ) - ); - - unsigned int GetNumberOfSeeds( ) const; - void GetSeed( int n, double* s ) const; - unsigned int AddSeed( - const double& x, const double& y, const double& z - ) const; - - vtkRenderWindow* GetWindow( ) const; - vtkRenderer* GetRenderer( ) const; - - void Start( ); - void Render( ); - - protected: - vtkSmartPointer< vtkImageData > m_Image; - vtkSmartPointer< vtkOutlineSource > m_Outline; - vtkSmartPointer< vtkPolyDataMapper > m_OutlineMapper; - vtkSmartPointer< vtkActor > m_OutlineActor; - vtkSmartPointer< vtkCellPicker > m_Picker; - vtkSmartPointer< vtkImagePlaneWidget > m_WidgetX; - vtkSmartPointer< vtkImagePlaneWidget > m_WidgetY; - vtkSmartPointer< vtkImagePlaneWidget > m_WidgetZ; - vtkSmartPointer< vtkRenderer > m_Renderer; - vtkSmartPointer< vtkRenderWindow > m_Window; - vtkSmartPointer< vtkRenderWindowInteractor > m_Interactor; - - std::vector< vtkSmartPointer< vtkPolyData > > m_PolyDatas; - std::vector< vtkSmartPointer< vtkPolyDataMapper > > m_Mappers; - std::vector< vtkSmartPointer< vtkActor > > m_Actors; - - // Create the widget and its representation - vtkSmartPointer< vtkPointHandleRepresentation3D > - m_SeedHandleRepresentation; - vtkSmartPointer< vtkSeedRepresentation > m_SeedRepresentation; - vtkSmartPointer< vtkSeedWidget > m_SeedWidget; - }; - - } // ecapseman - -} // ecapseman - -#endif // __CPEXTENSIONS__VISUALIZATION__IMAGE3DMPR__H__ - -// eof - $RCSfile$ -- 2.45.1