X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FInteraction%2FImageInteractorStyle.h;h=ec54f5e33481b3c3acfd25808d0836cd133dd940;hb=e2fb8817731f6231d34941a208e46b36dad425b2;hp=99c0c1f9ff96610b778b94801cd876597aab4118;hpb=7972cb1b826dfeae18ed20fc33897c366a72e4c1;p=cpPlugins.git diff --git a/lib/cpExtensions/Interaction/ImageInteractorStyle.h b/lib/cpExtensions/Interaction/ImageInteractorStyle.h index 99c0c1f..ec54f5e 100644 --- a/lib/cpExtensions/Interaction/ImageInteractorStyle.h +++ b/lib/cpExtensions/Interaction/ImageInteractorStyle.h @@ -13,6 +13,7 @@ #include // Forward definitions +class vtkCommand; class vtkImageActor; namespace cpExtensions @@ -44,36 +45,16 @@ namespace cpExtensions // Widgets struct TSeedWidget { - vtkSmartPointer< vtkImageActorPointPlacer > Placer; - vtkSmartPointer< vtkPointHandleRepresentation3D > Handle; - vtkSmartPointer< vtkSeedRepresentation > Representation; - vtkSmartPointer< TSeedWidget > Widget; - - TSeedWidget( vtkRenderWindowInteractor* interactor, vtkImageActor* actor ) - { - this->Placer = vtkSmartPointer< vtkImageActorPointPlacer >::New( ); - this->Handle = vtkSmartPointer< vtkPointHandleRepresentation3D >::New( ); - this->Representation = vtkSmartPointer< vtkSeedRepresentation >::New( ); - this->Widget = vtkSmartPointer< TSeedWidget >::New( ); - - this->Placer->SetImageActor( actor ); - this->Handle->GetProperty( )->SetColor( 1, 0, 0 ); - this->Handle->SetPointPlacer( this->Placer ); - this->Representation->SetHandleRepresentation( this->Handle ); - this->Widget->SetRepresentation( this->Representation ); - this->Widget->SetInteractor( interactor ); - } - - void On( ) - { - this->Widget->On( ); - } - - void Off( ) - { - this->Widget->Off( ); - } -#error ACA VOY + vtkSmartPointer< vtkImageActorPointPlacer > Placer; + vtkSmartPointer< vtkPointHandleRepresentation3D > Handle; + vtkSmartPointer< vtkSeedRepresentation > Representation; + vtkSmartPointer< SeedWidget > Widget; + + TSeedWidget( + vtkRenderWindowInteractor* interactor, vtkImageActor* actor + ); + void On( ); + void Off( ); }; public: @@ -82,6 +63,14 @@ namespace cpExtensions // Data for local picker virtual void AssociateImageActor( vtkImageActor* actor ); + // Widgets + void SeedWidgetOn( ); + void SeedWidgetOff( ); + void SetSeedWidgetCommand( vtkCommand* cmd ); + unsigned int GetNumberOfSeeds( ) const; + void GetSeedAsPoint( unsigned int id, double pos[ 3 ] ) const; + void GetSeedAsIndex( unsigned int id, int pos[ 3 ] ) const; + protected: ImageInteractorStyle( ); virtual ~ImageInteractorStyle( ); @@ -95,6 +84,8 @@ namespace cpExtensions protected: vtkSmartPointer< vtkPropPicker > m_PropPicker; + + TSeedWidget* m_SeedWidget; }; } // ecapseman