VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
24 
25 VTK_ABI_NAMESPACE_BEGIN
27 class vtkContextScene;
28 
29 class VTKVIEWSCONTEXT2D_EXPORT VTK_MARSHALAUTO vtkContextInteractorStyle : public vtkInteractorStyle
30 {
31 public:
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35 
43  void SetScene(vtkContextScene* scene);
44 
48  vtkContextScene* GetScene();
49 
53  virtual void OnSceneModified();
54 
59  void OnMouseMove() override;
60 
65  void OnLeftButtonDown() override;
66 
71  void OnLeftButtonUp() override;
72 
77  void OnLeftButtonDoubleClick() override;
78 
83  void OnMiddleButtonDown() override;
84 
89  void OnMiddleButtonUp() override;
90 
95  void OnMiddleButtonDoubleClick() override;
96 
101  void OnRightButtonDown() override;
102 
107  void OnRightButtonUp() override;
108 
113  void OnRightButtonDoubleClick() override;
114 
119  void OnMouseWheelForward() override;
120 
125  void OnMouseWheelBackward() override;
126 
131  virtual void OnSelection(unsigned int rect[5]);
132 
136  void OnChar() override;
137 
141  void OnKeyPress() override;
142 
146  void OnKeyRelease() override;
147 
148 protected:
150  ~vtkContextInteractorStyle() override;
151 
152  static void ProcessSceneEvents(
153  vtkObject* object, unsigned long event, void* clientdata, void* calldata);
154 
155  static void ProcessInteractorEvents(
156  vtkObject* object, unsigned long event, void* clientdata, void* calldata);
157 
158  virtual void RenderNow();
159 
165  void BeginProcessingEvent();
166 
172  void EndProcessingEvent();
173 
179 
182 
183 private:
185  void operator=(const vtkContextInteractorStyle&) = delete;
186 
187  void ConstructMouseEvent(vtkContextMouseEvent& event, int button);
188  bool ProcessMousePress(const vtkContextMouseEvent& event);
189 };
190 
191 VTK_ABI_NAMESPACE_END
192 #endif
virtual void OnLeftButtonDoubleClick()
virtual void OnLeftButtonDown()
virtual void OnMiddleButtonDown()
virtual void OnRightButtonDown()
abstract base class for most VTK objects
Definition: vtkObject.h:52
void OnChar() override
OnChar is triggered when an ASCII key is pressed.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:318
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)
#define VTK_MARSHALAUTO
virtual void OnMouseMove()
Generic event bindings can be overridden in subclasses.