Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLViewInteractorStyle.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Kitware Inc.
6 
7  See COPYRIGHT.txt
8  or http://www.slicer.org/copyright/copyright.txt for details.
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16 ==============================================================================*/
17 
18 #ifndef __vtkMRMLViewInteractorStyle_h
19 #define __vtkMRMLViewInteractorStyle_h
20 
21 // VTK includes
22 #include "vtkInteractorStyle3D.h"
23 #include "vtkSmartPointer.h"
24 #include "vtkWeakPointer.h"
25 
26 // MRML includes
27 #include "vtkMRMLDisplayableManagerExport.h"
28 
32 class vtkTimerLog;
33 
40 class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLViewInteractorStyle :
41  public vtkInteractorStyle3D
42 {
43 public:
44  static vtkMRMLViewInteractorStyle *New();
45  vtkTypeMacro(vtkMRMLViewInteractorStyle,vtkInteractorStyle3D);
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
48  void OnMouseMove() override;
49  void OnEnter() override;
50  void OnLeave() override;
51  void OnLeftButtonDown() override;
52  void OnLeftButtonUp() override;
53  void OnMiddleButtonDown() override;
54  void OnMiddleButtonUp() override;
55  void OnRightButtonDown() override;
56  void OnRightButtonUp() override;
57  void OnMouseWheelForward() override;
58  void OnMouseWheelBackward() override;
59 
60  // Touch gesture interaction events
61  void OnPinch() override;
62  void OnRotate() override;
63  void OnPan() override;
64  void OnTap() override;
65  void OnLongTap() override;
66 
68  void OnChar() override;
69  void OnKeyPress() override;
70  void OnKeyRelease() override;
71 
73  void OnButton3D(vtkEventData* eventData) override;
74  void OnMove3D(vtkEventData* eventData) override;
75 
76  void OnExpose() override;
77  void OnConfigure() override;
78 
79  void SetDisplayableManagers(vtkMRMLDisplayableManagerGroup* displayableManagers);
80 
85  virtual bool DelegateInteractionEventToDisplayableManagers(unsigned long event);
86 
91  virtual bool DelegateInteractionEventToDisplayableManagers(vtkEventData* inputEventData);
92 
95  virtual bool DelegateInteractionEventDataToDisplayableManagers(vtkMRMLInteractionEventData* eventData);
96 
99  void SetInteractor(vtkRenderWindowInteractor *interactor) override;
100 
101 protected:
103  ~vtkMRMLViewInteractorStyle() override;
104 
105  static void CustomProcessEvents(vtkObject* object, unsigned long event, void* clientdata, void* calldata);
106 
107  void SetMouseCursor(int cursor);
108 
110 
112  vtkSmartPointer<vtkTimerLog> ClickTimer;
115 
116  vtkWeakPointer<vtkMRMLDisplayableManagerGroup> DisplayableManagers;
118 
119 private:
121  void operator=(const vtkMRMLViewInteractorStyle&) = delete;
122 };
123 
124 #endif
vtkMRMLAbstractDisplayableManager * FocusedDisplayableManager
Superclass for displayable manager classes.
vtkWeakPointer< vtkMRMLDisplayableManagerGroup > DisplayableManagers
vtkSmartPointer< vtkTimerLog > ClickTimer
Measures time elapsed since first button press.
Common base class for processing interaction events in MRML views.
DisplayableManagerGroup is a collection of DisplayableManager.