tmp commit
[engrid.git] / egvtkinteractorstyle.h
blob48a8cfa2ae90ccc2d0f69fd860c3eba9a6727b30
1 #ifndef EGVTKINTERACTORSTYLE_H
2 #define EGVTKINTERACTORSTYLE_H
4 #include <vtkInteractorStyle.h>
6 #include "vtkCamera.h"
7 #include "vtkRenderWindowInteractor.h"
8 #include "vtkCallbackCommand.h"
9 #include "vtkRenderer.h"
10 #include "vtkRenderWindow.h"
12 #include <iostream>
13 using namespace std;
15 class VTK_RENDERING_EXPORT egvtkInteractorStyle : public vtkInteractorStyle
17 public:
19 // Event information
20 int AltKey;
21 int ControlKey;
22 int ShiftKey;
23 char KeyCode;
24 int RepeatCount;
25 char* KeySym;
26 int EventPosition[2];
27 int LastEventPosition[2];
28 int EventSize[2];
29 int Size[2];
30 int TimerEventId;
31 int TimerEventType;
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);
55 // Description:
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);
84 };*/
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();
91 virtual void Spin();
92 virtual void Pan();
93 virtual void Dolly();
95 // Description:
96 // Set the apparent sensitivity of the interactor style to mouse motion.
97 vtkSetMacro(MotionFactor,double);
98 vtkGetMacro(MotionFactor,double);
100 protected:
101 egvtkInteractorStyle();
102 ~egvtkInteractorStyle();
104 double MotionFactor;
106 virtual void Dolly(double factor);
108 private:
109 egvtkInteractorStyle(const egvtkInteractorStyle&); // Not implemented.
110 void operator=(const egvtkInteractorStyle&); // Not implemented.
113 #endif