1 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 // + This file is part of enGrid. +
5 // + Copyright 2008-2014 enGits GmbH +
7 // + enGrid is free software: you can redistribute it and/or modify +
8 // + it under the terms of the GNU General Public License as published by +
9 // + the Free Software Foundation, either version 3 of the License, or +
10 // + (at your option) any later version. +
12 // + enGrid is distributed in the hope that it will be useful, +
13 // + but WITHOUT ANY WARRANTY; without even the implied warranty of +
14 // + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
15 // + GNU General Public License for more details. +
17 // + You should have received a copy of the GNU General Public License +
18 // + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
20 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
21 #ifndef EGVTKINTERACTORSTYLE_H
22 #define EGVTKINTERACTORSTYLE_H
24 #include <vtkInteractorStyle.h>
26 #include "vtkCamera.h"
27 #include "vtkRenderWindowInteractor.h"
28 #include "vtkCallbackCommand.h"
29 #include "vtkRenderer.h"
30 #include "vtkRenderWindow.h"
35 class egvtkInteractorStyle
: public vtkInteractorStyle
47 int LastEventPosition
[2];
52 int TimerEventDuration
;
53 int TimerEventPlatformId
;
55 static egvtkInteractorStyle
*New();
56 void PrintSelf(ostream
& os
, vtkIndent indent
);
59 // Event bindings controlling the effects of pressing mouse buttons
60 // or moving the mouse.
62 void OnLeftButtonDown();
63 void OnLeftButtonUp();
64 void OnMiddleButtonDown();
65 void OnMiddleButtonUp();
66 void OnRightButtonDown();
67 void OnRightButtonUp();
68 void OnMouseWheelForward();
69 void OnMouseWheelBackward();
73 cout<<"OnKeyDown "<<this->Interactor->GetKeyCode()<<endl;
74 this->EventCallbackCommand->SetAbortFlag(1);
77 cout<<"OnKeyUp "<<this->Interactor->GetKeyCode()<<endl;
78 this->EventCallbackCommand->SetAbortFlag(1);
81 cout<<"OnKeyPress "<<this->Interactor->GetKeyCode()<<endl;
82 this->EventCallbackCommand->SetAbortFlag(1);
85 cout<<"OnKeyRelease "<<this->Interactor->GetKeyCode()<<endl;
86 this->EventCallbackCommand->SetAbortFlag(1);
89 // These methods for the different interactions in different modes
90 // are overridden in subclasses to perform the correct motion. Since
91 // they are called by OnTimer, they do not have mouse coord parameters
92 // (use interactor's GetEventPosition and GetLastEventPosition)
99 // Set the apparent sensitivity of the interactor style to mouse motion.
102 egvtkInteractorStyle();
103 ~egvtkInteractorStyle();
107 void Dolly(double factor
);
110 egvtkInteractorStyle(const egvtkInteractorStyle
&); // Not implemented.
111 void operator=(const egvtkInteractorStyle
&); // Not implemented.