1 #ifndef EGVTKINTERACTORSTYLE_H
2 #define EGVTKINTERACTORSTYLE_H
4 #include <vtkInteractorStyle.h>
7 #include "vtkRenderWindowInteractor.h"
8 #include "vtkCallbackCommand.h"
9 #include "vtkRenderer.h"
10 #include "vtkRenderWindow.h"
15 class VTK_RENDERING_EXPORT egvtkInteractorStyle
: public vtkInteractorStyle
27 int LastEventPosition
[2];
32 int TimerEventDuration
;
33 int TimerEventPlatformId
;
35 vtkSetMacro(AltKey
, int);
36 vtkGetMacro(AltKey
, int);
37 vtkSetMacro(ControlKey
, int);
38 vtkGetMacro(ControlKey
, int);
39 vtkSetMacro(ShiftKey
, int);
40 vtkGetMacro(ShiftKey
, int);
41 vtkSetMacro(KeyCode
, char);
42 vtkGetMacro(KeyCode
, char);
43 vtkSetMacro(RepeatCount
, int);
44 vtkGetMacro(RepeatCount
, int);
45 vtkSetStringMacro(KeySym
);
46 vtkGetStringMacro(KeySym
);
48 static egvtkInteractorStyle
*New();
49 vtkTypeRevisionMacro(egvtkInteractorStyle
,vtkInteractorStyle
);
50 void PrintSelf(ostream
& os
, vtkIndent indent
);
52 // vtkGetMacro(ShiftKey,int);
53 // vtkGetMacro(CtrlKey,int);
56 // Event bindings controlling the effects of pressing mouse buttons
57 // or moving the mouse.
58 virtual void OnMouseMove();
59 virtual void OnLeftButtonDown();
60 virtual void OnLeftButtonUp();
61 virtual void OnMiddleButtonDown();
62 virtual void OnMiddleButtonUp();
63 virtual void OnRightButtonDown();
64 virtual void OnRightButtonUp();
65 virtual void OnMouseWheelForward();
66 virtual void OnMouseWheelBackward();
67 virtual void OnChar();
69 /* virtual void OnKeyDown (){
70 cout<<"OnKeyDown "<<this->Interactor->GetKeyCode()<<endl;
71 this->EventCallbackCommand->SetAbortFlag(1);
73 virtual void OnKeyUp (){
74 cout<<"OnKeyUp "<<this->Interactor->GetKeyCode()<<endl;
75 this->EventCallbackCommand->SetAbortFlag(1);
77 virtual void OnKeyPress (){
78 cout<<"OnKeyPress "<<this->Interactor->GetKeyCode()<<endl;
79 this->EventCallbackCommand->SetAbortFlag(1);
81 virtual void OnKeyRelease (){
82 cout<<"OnKeyRelease "<<this->Interactor->GetKeyCode()<<endl;
83 this->EventCallbackCommand->SetAbortFlag(1);
86 // These methods for the different interactions in different modes
87 // are overridden in subclasses to perform the correct motion. Since
88 // they are called by OnTimer, they do not have mouse coord parameters
89 // (use interactor's GetEventPosition and GetLastEventPosition)
90 virtual void Rotate();
96 // Set the apparent sensitivity of the interactor style to mouse motion.
97 vtkSetMacro(MotionFactor
,double);
98 vtkGetMacro(MotionFactor
,double);
101 egvtkInteractorStyle();
102 ~egvtkInteractorStyle();
106 virtual void Dolly(double factor
);
109 egvtkInteractorStyle(const egvtkInteractorStyle
&); // Not implemented.
110 void operator=(const egvtkInteractorStyle
&); // Not implemented.