]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/Interaction/ImageInteractorStyle.h
MPR objects updated
[cpPlugins.git] / lib / cpExtensions / Interaction / ImageInteractorStyle.h
1 #ifndef __CPEXTENSIONS__INTERACTION__IMAGEINTERACTORSTYLE__H__
2 #define __CPEXTENSIONS__INTERACTION__IMAGEINTERACTORSTYLE__H__
3
4 #include <cpExtensions/Interaction/BaseInteractorStyle.h>
5
6 #include <vector>
7
8 #include <vtkPropPicker.h>
9 #include <vtkSmartPointer.h>
10 /* TODO
11    #include <vtkImageActorPointPlacer.h>
12    #include <vtkPointHandleRepresentation3D.h>
13    #include <vtkSeedRepresentation.h>
14    #include <cpExtensions/Interaction/SeedWidget.h>
15 */
16
17 // Forward definitions
18 class vtkCommand;
19 class vtkImageActor;
20
21 namespace cpExtensions
22 {
23   namespace Interaction
24   {
25     /**
26      */
27     class cpExtensions_EXPORT ImageInteractorStyle
28       : public BaseInteractorStyle
29     {
30     public:
31       typedef ImageInteractorStyle Self;
32       vtkTypeMacro( ImageInteractorStyle, BaseInteractorStyle );
33
34       // Callbacks types
35       typedef Superclass::TMouseCommand            TMouseCommand;
36       typedef Superclass::TMouseWheelCommand       TMouseWheelCommand;
37       typedef Superclass::TKeyCommand              TKeyCommand;
38       typedef Superclass::TVoidCommand             TVoidCommand;
39       typedef Superclass::TMouseMoveCommand        TMouseMoveCommand;
40       typedef Superclass::TMouseClickCommand       TMouseClickCommand;
41       typedef Superclass::TMouseDoubleClickCommand TMouseDoubleClickCommand;
42       typedef Superclass::TExposeCommand           TExposeCommand;
43       typedef Superclass::TConfigureCommand        TConfigureCommand;
44       typedef Superclass::TEnterCommand            TEnterCommand;
45       typedef Superclass::TLeaveCommand            TLeaveCommand;
46
47       // Widgets
48       /* TODO
49          struct TSeedWidget
50          {
51          vtkSmartPointer< vtkImageActorPointPlacer >              Placer;
52          vtkSmartPointer< vtkPointHandleRepresentation3D >        Handle;
53          vtkSmartPointer< vtkSeedRepresentation >         Representation;
54          vtkSmartPointer< SeedWidget > Widget;
55
56          TSeedWidget(
57          vtkRenderWindowInteractor* interactor, vtkImageActor* actor
58          );
59          void On( );
60          void Off( );
61          };
62       */
63
64     public:
65       static Self* New( );
66
67       virtual void SetCurrentRenderer( vtkRenderer* r ) VTK_OVERRIDE;
68
69       // Data for local picker
70       virtual void AssociateImageActor( vtkImageActor* actor );
71
72       // Widgets
73       /* TODO
74          void SeedWidgetOn( );
75          void SeedWidgetOff( );
76          void SetSeedWidgetCommand( vtkCommand* cmd );
77          unsigned int GetNumberOfSeeds( ) const;
78          void GetSeedAsPoint( unsigned int id, double pos[ 3 ] ) const;
79          void GetSeedAsIndex( unsigned int id, int pos[ 3 ] ) const;
80       */
81
82     protected:
83       ImageInteractorStyle( );
84       virtual ~ImageInteractorStyle( );
85
86       void _ConfigureCamera( vtkImageActor* actor );
87       virtual bool _PickPosition( int idx[ 2 ], double pos[ 3 ] );
88
89     private:
90       // Purposely not implemented
91       ImageInteractorStyle( const Self& );
92       Self& operator=( const Self& );
93
94     protected:
95       bool m_Configured;
96       vtkSmartPointer< vtkPropPicker > m_PropPicker;
97       /* TODO
98          TSeedWidget* m_SeedWidget;
99       */
100     };
101
102   } // ecapseman
103
104 } // ecapseman
105
106 #endif // __CPEXTENSIONS__INTERACTION__IMAGEINTERACTORSTYLE__H__
107
108 // eof - $RCSfile$