VTK  9.3.1
vtkContextInteractorStyle.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
16 #ifndef vtkContextInteractorStyle_h
17 #define vtkContextInteractorStyle_h
18 
19 #include "vtkInteractorStyle.h"
20 #include "vtkNew.h" // For ivars
21 #include "vtkViewsContext2DModule.h" // For export macro
22 #include "vtkWeakPointer.h" // For ivars
23 
24 VTK_ABI_NAMESPACE_BEGIN
26 class vtkContextScene;
27 
28 class VTKVIEWSCONTEXT2D_EXPORT vtkContextInteractorStyle : public vtkInteractorStyle
29 {
30 public:
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
42  void SetScene(vtkContextScene* scene);
43 
47  vtkContextScene* GetScene();
48 
52  virtual void OnSceneModified();
53 
58  void OnMouseMove() override;
59 
64  void OnLeftButtonDown() override;
65 
70  void OnLeftButtonUp() override;
71 
76  void OnLeftButtonDoubleClick() override;
77 
82  void OnMiddleButtonDown() override;
83 
88  void OnMiddleButtonUp() override;
89 
94  void OnMiddleButtonDoubleClick() override;
95 
100  void OnRightButtonDown() override;
101 
106  void OnRightButtonUp() override;
107 
112  void OnRightButtonDoubleClick() override;
113 
118  void OnMouseWheelForward() override;
119 
124  void OnMouseWheelBackward() override;
125 
130  virtual void OnSelection(unsigned int rect[5]);
131 
135  void OnChar() override;
136 
140  void OnKeyPress() override;
141 
145  void OnKeyRelease() override;
146 
147 protected:
149  ~vtkContextInteractorStyle() override;
150 
151  static void ProcessSceneEvents(
152  vtkObject* object, unsigned long event, void* clientdata, void* calldata);
153 
154  static void ProcessInteractorEvents(
155  vtkObject* object, unsigned long event, void* clientdata, void* calldata);
156 
157  virtual void RenderNow();
158 
164  void BeginProcessingEvent();
165 
171  void EndProcessingEvent();
172 
178 
181 
182 private:
184  void operator=(const vtkContextInteractorStyle&) = delete;
185 
186  void ConstructMouseEvent(vtkContextMouseEvent& event, int button);
187  bool ProcessMousePress(const vtkContextMouseEvent& event);
188 };
189 
190 VTK_ABI_NAMESPACE_END
191 #endif
virtual void OnLeftButtonDoubleClick()
virtual void OnLeftButtonDown()
virtual void OnMiddleButtonDown()
virtual void OnRightButtonDown()
abstract base class for most VTK objects
Definition: vtkObject.h:51
void OnChar() override
OnChar is triggered when an ASCII key is pressed.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
virtual void OnLeftButtonUp()
static vtkInteractorStyle * New()
This class must be supplied with a vtkRenderWindowInteractor wrapper or parent.
virtual void OnMiddleButtonUp()
vtkNew< vtkCallbackCommand > SceneCallbackCommand
virtual void OnMouseWheelForward()
virtual void OnKeyRelease()
virtual void OnKeyPress()
virtual void OnRightButtonUp()
virtual void OnMiddleButtonDoubleClick()
An interactor for chart views.
Provides a 2D scene for vtkContextItem objects.
data structure to represent mouse events.
virtual void OnRightButtonDoubleClick()
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void OnMouseWheelBackward()
vtkNew< vtkCallbackCommand > InteractorCallbackCommand
vtkWeakPointer< vtkContextScene > Scene
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 OnMouseMove()
Generic event bindings can be overridden in subclasses.