X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FInteraction%2FSeedWidget.cxx;fp=lib%2FcpExtensions%2FInteraction%2FSeedWidget.cxx;h=0000000000000000000000000000000000000000;hb=2e142df11d6f312a2a2b5097b8da73571ed523e8;hp=509d7c2605056e4d64d8843504eeb702688180f3;hpb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;p=cpPlugins.git diff --git a/lib/cpExtensions/Interaction/SeedWidget.cxx b/lib/cpExtensions/Interaction/SeedWidget.cxx deleted file mode 100644 index 509d7c2..0000000 --- a/lib/cpExtensions/Interaction/SeedWidget.cxx +++ /dev/null @@ -1,165 +0,0 @@ -#include - -#include -#include -#include -#include -#include - -// ------------------------------------------------------------------------- -cpExtensions::Interaction::SeedWidget:: -Self* cpExtensions::Interaction::SeedWidget:: -New( ) -{ - return( new Self ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Interaction::SeedWidget:: -SetInteractor( vtkRenderWindowInteractor* rwi ) -{ - this->Superclass::SetInteractor( rwi ); - /* TODO - if( rwi != NULL ) - { - TBaseStyle* s = - dynamic_cast< TBaseStyle* >( rwi->GetInteractorStyle( ) ); - if( s != NULL ) - { - s->AddMouseClickCommand( Self::_Click, this ); - s->AddMouseDoubleClickCommand( Self::_DoubleClick, this ); - - } // fi - - } // fi - */ -} - -// ------------------------------------------------------------------------- -cpExtensions::Interaction::SeedWidget:: -SeedWidget( ) - : Superclass( ) -{ - // These are the event callbacks supported by this widget - this->CallbackMapper->SetCallbackMethod( - vtkCommand::LeftButtonPressEvent, - vtkWidgetEvent::AddPoint, - this, Self::_AddPointAction - ); - this->CallbackMapper->SetCallbackMethod( - vtkCommand::RightButtonPressEvent, - vtkWidgetEvent::Completed, - this, Self::_CompletedAction - ); - this->CallbackMapper->SetCallbackMethod( - vtkCommand::MouseMoveEvent, - vtkWidgetEvent::Move, - this, Self::_MoveAction - ); - this->CallbackMapper->SetCallbackMethod( - vtkCommand::LeftButtonReleaseEvent, - vtkWidgetEvent::EndSelect, - this, Self::_EndSelectAction - ); - this->CallbackMapper->SetCallbackMethod( - vtkCommand::KeyPressEvent, - vtkEvent::NoModifier, 127, 1, "Delete", - vtkWidgetEvent::Delete, - this, Self::_DeleteAction - ); -} - -// ------------------------------------------------------------------------- -cpExtensions::Interaction::SeedWidget:: -~SeedWidget( ) -{ -} - -// ------------------------------------------------------------------------- -void cpExtensions::Interaction::SeedWidget:: -_AddPointAction( vtkAbstractWidget* wdg ) -{ - Self* self = dynamic_cast< Self* >( wdg ); - if( self == NULL ) - return; - auto iren = self->GetInteractor( ); - if( iren == NULL ) - return; - int shift = iren->GetShiftKey( ); - if( shift == 1 ) - Self::AddPointAction( wdg ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Interaction::SeedWidget:: -_CompletedAction( vtkAbstractWidget* wdg ) -{ - // Do nothing - Self::CompletedAction( wdg ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Interaction::SeedWidget:: -_MoveAction( vtkAbstractWidget* wdg ) -{ - // Do nothing - Self::MoveAction( wdg ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Interaction::SeedWidget:: -_EndSelectAction( vtkAbstractWidget* wdg ) -{ - // Do nothing - Self::EndSelectAction( wdg ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Interaction::SeedWidget:: -_DeleteAction( vtkAbstractWidget* wdg ) -{ - // Do nothing - Self::DeleteAction( wdg ); -} - -// ------------------------------------------------------------------------- -/* TODO - void cpExtensions::Interaction::SeedWidget:: - _Click( - void* data, const TBaseStyle::ButtonID& button, - int* idx, double* pos, bool alt, bool ctr, bool sft - ) - { - SeedWidget* self = reinterpret_cast< SeedWidget* >( data ); - if( self == NULL ) - return; - if( self->WidgetState == vtkSeedWidget::MovingSeed ) - return; - - int st = self->WidgetRep->ComputeInteractionState( idx[ 0 ], idx[ 1 ] ); - if( st == vtkSeedRepresentation::NearSeed ) - { - self->WidgetState = vtkSeedWidget::MovingSeed; - - // Invoke an event on ourself for the handles - self->InvokeEvent( vtkCommand::LeftButtonPressEvent, NULL ); - self->Superclass::StartInteraction( ); - self->InvokeEvent( vtkCommand::StartInteractionEvent, NULL ); - self->EventCallbackCommand->SetAbortFlag( 1 ); - self->Render( ); - - } // fi - } - - // ------------------------------------------------------------------------- - void cpExtensions::Interaction::SeedWidget:: - _DoubleClick( - void* data, const TBaseStyle::ButtonID& button, - int* idx, double* pos, bool alt, bool ctr, bool sft - ) - { - Self::AddPointAction( reinterpret_cast< vtkAbstractWidget* >( data ) ); - } -*/ - -// eof - $RCSfile$