]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Interaction/ImageInteractorStyle.h
...
[cpPlugins.git] / lib / cpExtensions / Interaction / ImageInteractorStyle.h
index 78bf7da38a9952962cc891e0dd8c75d3b91444b7..ec54f5e33481b3c3acfd25808d0836cd133dd940 100644 (file)
@@ -6,9 +6,14 @@
 #include <vector>
 
 #include <vtkSmartPointer.h>
+#include <vtkImageActorPointPlacer.h>
 #include <vtkPropPicker.h>
+#include <vtkPointHandleRepresentation3D.h>
+#include <vtkSeedRepresentation.h>
+#include <cpExtensions/Interaction/SeedWidget.h>
 
 // Forward definitions
+class vtkCommand;
 class vtkImageActor;
 
 namespace cpExtensions
@@ -24,12 +29,48 @@ namespace cpExtensions
       typedef ImageInteractorStyle Self;
       vtkTypeMacro( ImageInteractorStyle, BaseInteractorStyle );
 
+      // Callbacks types
+      typedef Superclass::TMouseCommand            TMouseCommand;
+      typedef Superclass::TMouseWheelCommand       TMouseWheelCommand;
+      typedef Superclass::TKeyCommand              TKeyCommand;
+      typedef Superclass::TVoidCommand             TVoidCommand;
+      typedef Superclass::TMouseMoveCommand        TMouseMoveCommand;
+      typedef Superclass::TMouseClickCommand       TMouseClickCommand;
+      typedef Superclass::TMouseDoubleClickCommand TMouseDoubleClickCommand;
+      typedef Superclass::TExposeCommand           TExposeCommand;
+      typedef Superclass::TConfigureCommand        TConfigureCommand;
+      typedef Superclass::TEnterCommand            TEnterCommand;
+      typedef Superclass::TLeaveCommand            TLeaveCommand;
+
+      // Widgets
+      struct TSeedWidget
+      {
+        vtkSmartPointer< vtkImageActorPointPlacer >              Placer;
+        vtkSmartPointer< vtkPointHandleRepresentation3D >        Handle;
+        vtkSmartPointer< vtkSeedRepresentation >         Representation;
+        vtkSmartPointer< SeedWidget > Widget;
+
+        TSeedWidget(
+          vtkRenderWindowInteractor* interactor, vtkImageActor* actor
+          );
+        void On( );
+        void Off( );
+      };
+
     public:
       static Self* New( );
 
       // 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( );
@@ -43,6 +84,8 @@ namespace cpExtensions
 
     protected:
       vtkSmartPointer< vtkPropPicker > m_PropPicker;
+
+      TSeedWidget* m_SeedWidget;
     };
 
   } // ecapseman