]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/Interaction/SphereWidget.h
...
[cpPlugins.git] / lib / cpExtensions / Interaction / SphereWidget.h
1 #ifndef __CPEXTENSIONS__INTERACTION__SphereWidget__H__
2 #define __CPEXTENSIONS__INTERACTION__SphereWidget__H__
3
4 #include <cpExtensions/cpExtensions_Export.h>
5 #include <cpExtensions/Interaction/BaseInteractorStyle.h>
6 #include <vtkSphereWidget.h>
7
8 namespace cpExtensions
9 {
10   namespace Interaction
11   {
12     /**
13      */
14     class cpExtensions_EXPORT SphereWidget
15       : public vtkSphereWidget
16     {
17     public:
18       typedef SphereWidget Self;
19       vtkTypeMacro( SphereWidget, vtkSphereWidget );
20
21       typedef cpExtensions::Interaction::BaseInteractorStyle TBaseStyle;
22       typedef TBaseStyle::TMouseCommand TMouseCommand;
23       typedef TBaseStyle::TKeyCommand TKeyCommand;
24
25     public:
26       static Self* New( );
27
28       virtual void SetInteractor( vtkRenderWindowInteractor* rwi );
29       void SetCenter(double* center);
30       void SetAxis(int axis);
31       int GetAxis();
32       double * GetPosition();
33     protected:
34       SphereWidget( );
35       virtual ~SphereWidget( );
36
37       static void _Click(
38         void* data, const TBaseStyle::ButtonID& button,
39         int* idx, double* pos, bool alt, bool ctr, bool sft
40         );
41       static void _DoubleClick(
42         void* data, const TBaseStyle::ButtonID& button,
43         int* idx, double* pos, bool alt, bool ctr, bool sft
44         );
45       static void _MouseMove(
46         void* data, const TBaseStyle::ButtonID& button,
47         int* idx, double* pos, bool alt, bool ctr, bool sft
48         );
49      
50       static void _KeyPress(void* data, const char& key);
51        
52       static void SetCenter(void* data, double* center);
53
54       static void SetAxis(void* data, int axis);
55       static int GetAxis(void* data);
56       static double * GetPosition(void* data);
57     private:
58       int m_axis;
59
60       // Purposely not implemented
61       SphereWidget( const Self& );
62       Self& operator=( const Self& );
63     };
64
65   } // ecapseman
66
67 } // ecapseman
68
69 #endif // __CPEXTENSIONS__INTERACTION__SphereWidget__H__
70
71 // eof - $RCSfile$