2 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 // + This file is part of enGrid. +
6 // + Copyright 2008-2012 enGits GmbH +
8 // + enGrid is free software: you can redistribute it and/or modify +
9 // + it under the terms of the GNU General Public License as published by +
10 // + the Free Software Foundation, either version 3 of the License, or +
11 // + (at your option) any later version. +
13 // + enGrid is distributed in the hope that it will be useful, +
14 // + but WITHOUT ANY WARRANTY; without even the implied warranty of +
15 // + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
16 // + GNU General Public License for more details. +
18 // + You should have received a copy of the GNU General Public License +
19 // + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
21 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
23 #ifndef EGVTKINTERACTORSTYLE_H
24 #define EGVTKINTERACTORSTYLE_H
26 #include <vtkInteractorStyle.h>
28 #include "vtkCamera.h"
29 #include "vtkRenderWindowInteractor.h"
30 #include "vtkCallbackCommand.h"
31 #include "vtkRenderer.h"
32 #include "vtkRenderWindow.h"
37 class egvtkInteractorStyle
: public vtkInteractorStyle
49 int LastEventPosition
[2];
54 int TimerEventDuration
;
55 int TimerEventPlatformId
;
57 static egvtkInteractorStyle
*New();
58 void PrintSelf(ostream
& os
, vtkIndent indent
);
61 // Event bindings controlling the effects of pressing mouse buttons
62 // or moving the mouse.
64 void OnLeftButtonDown();
65 void OnLeftButtonUp();
66 void OnMiddleButtonDown();
67 void OnMiddleButtonUp();
68 void OnRightButtonDown();
69 void OnRightButtonUp();
70 void OnMouseWheelForward();
71 void OnMouseWheelBackward();
75 cout<<"OnKeyDown "<<this->Interactor->GetKeyCode()<<endl;
76 this->EventCallbackCommand->SetAbortFlag(1);
79 cout<<"OnKeyUp "<<this->Interactor->GetKeyCode()<<endl;
80 this->EventCallbackCommand->SetAbortFlag(1);
83 cout<<"OnKeyPress "<<this->Interactor->GetKeyCode()<<endl;
84 this->EventCallbackCommand->SetAbortFlag(1);
87 cout<<"OnKeyRelease "<<this->Interactor->GetKeyCode()<<endl;
88 this->EventCallbackCommand->SetAbortFlag(1);
91 // These methods for the different interactions in different modes
92 // are overridden in subclasses to perform the correct motion. Since
93 // they are called by OnTimer, they do not have mouse coord parameters
94 // (use interactor's GetEventPosition and GetLastEventPosition)
101 // Set the apparent sensitivity of the interactor style to mouse motion.
104 egvtkInteractorStyle();
105 ~egvtkInteractorStyle();
109 void Dolly(double factor
);
112 egvtkInteractorStyle(const egvtkInteractorStyle
&); // Not implemented.
113 void operator=(const egvtkInteractorStyle
&); // Not implemented.