VTK  9.3.1
vtkInteractorStyleUser.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
27 #ifndef vtkInteractorStyleUser_h
28 #define vtkInteractorStyleUser_h
29 
30 #include "vtkInteractionStyleModule.h" // For export macro
31 #include "vtkInteractorStyle.h"
32 
33 // new motion flag
34 #define VTKIS_USERINTERACTION 8
35 
36 VTK_ABI_NAMESPACE_BEGIN
37 class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleUser : public vtkInteractorStyle
38 {
39 public:
40  static vtkInteractorStyleUser* New();
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
45 
51  vtkGetVector2Macro(LastPos, int);
53 
55 
60  vtkGetVector2Macro(OldPos, int);
62 
64 
68  vtkGetMacro(ShiftKey, int);
69  vtkGetMacro(CtrlKey, int);
71 
73 
76  vtkGetMacro(Char, int);
78 
80 
84  vtkGetStringMacro(KeySym);
86 
88 
92  vtkGetMacro(Button, int);
94 
96 
99  void OnMouseMove() override;
100  void OnLeftButtonDown() override;
101  void OnLeftButtonUp() override;
102  void OnMiddleButtonDown() override;
103  void OnMiddleButtonUp() override;
104  void OnRightButtonDown() override;
105  void OnRightButtonUp() override;
106  void OnMouseWheelForward() override;
107  void OnMouseWheelBackward() override;
109 
111 
114  void OnChar() override;
115  void OnKeyPress() override;
116  void OnKeyRelease() override;
118 
120 
123  void OnExpose() override;
124  void OnConfigure() override;
125  void OnEnter() override;
126  void OnLeave() override;
128 
129  void OnTimer() override;
130 
131 protected:
133  ~vtkInteractorStyleUser() override;
134 
135  int LastPos[2];
136  int OldPos[2];
137 
138  int ShiftKey;
139  int CtrlKey;
140  int Char;
141  char* KeySym;
142  int Button;
143 
144 private:
146  void operator=(const vtkInteractorStyleUser&) = delete;
147 };
148 
149 VTK_ABI_NAMESPACE_END
150 #endif
virtual void OnLeftButtonDown()
virtual void OnMiddleButtonDown()
virtual void OnRightButtonDown()
void OnChar() override
OnChar is triggered when an ASCII key is pressed.
virtual void OnLeftButtonUp()
static vtkInteractorStyle * New()
This class must be supplied with a vtkRenderWindowInteractor wrapper or parent.
virtual void OnMiddleButtonUp()
virtual void OnMouseWheelForward()
virtual void OnKeyRelease()
virtual void OnKeyPress()
virtual void OnTimer()
OnTimer calls Rotate, Rotate etc which should be overridden by style subclasses.
virtual void OnEnter()
virtual void OnRightButtonUp()
virtual void OnExpose()
These are more esoteric events, but are useful in some cases.
virtual void OnConfigure()
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void OnMouseWheelBackward()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
provide event-driven interface to the rendering window (defines trackball mode)
virtual void OnLeave()
provides customizable interaction routines
virtual void OnMouseMove()
Generic event bindings can be overridden in subclasses.