VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
33 
34 // new motion flag
35 #define VTKIS_USERINTERACTION 8
36 
37 VTK_ABI_NAMESPACE_BEGIN
38 class VTKINTERACTIONSTYLE_EXPORT VTK_MARSHALAUTO vtkInteractorStyleUser : public vtkInteractorStyle
39 {
40 public:
41  static vtkInteractorStyleUser* New();
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
46 
52  vtkGetVector2Macro(LastPos, int);
54 
56 
61  vtkGetVector2Macro(OldPos, int);
63 
65 
69  vtkGetMacro(ShiftKey, int);
70  vtkGetMacro(CtrlKey, int);
72 
74 
77  vtkGetMacro(Char, int);
79 
81 
85  vtkGetStringMacro(KeySym);
87 
89 
93  vtkGetMacro(Button, int);
95 
97 
100  void OnMouseMove() override;
101  void OnLeftButtonDown() override;
102  void OnLeftButtonUp() override;
103  void OnMiddleButtonDown() override;
104  void OnMiddleButtonUp() override;
105  void OnRightButtonDown() override;
106  void OnRightButtonUp() override;
107  void OnMouseWheelForward() override;
108  void OnMouseWheelBackward() override;
110 
112 
115  void OnChar() override;
116  void OnKeyPress() override;
117  void OnKeyRelease() override;
119 
121 
124  void OnExpose() override;
125  void OnConfigure() override;
126  void OnEnter() override;
127  void OnLeave() override;
129 
130  void OnTimer() override;
131 
132 protected:
134  ~vtkInteractorStyleUser() override;
135 
136  int LastPos[2];
137  int OldPos[2];
138 
139  int ShiftKey;
140  int CtrlKey;
141  int Char;
142  char* KeySym;
143  int Button;
144 
145 private:
147  void operator=(const vtkInteractorStyleUser&) = delete;
148 };
149 
150 VTK_ABI_NAMESPACE_END
151 #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()
#define VTK_MARSHALAUTO
provides customizable interaction routines
virtual void OnMouseMove()
Generic event bindings can be overridden in subclasses.