VTK  9.2.6
vtkContextInteractorStyle.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkContextInteractorStyle.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
28 #ifndef vtkContextInteractorStyle_h
29 #define vtkContextInteractorStyle_h
30 
31 #include "vtkInteractorStyle.h"
32 #include "vtkNew.h" // For ivars
33 #include "vtkViewsContext2DModule.h" // For export macro
34 #include "vtkWeakPointer.h" // For ivars
35 
37 class vtkContextScene;
38 
39 class VTKVIEWSCONTEXT2D_EXPORT vtkContextInteractorStyle : public vtkInteractorStyle
40 {
41 public:
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
53  void SetScene(vtkContextScene* scene);
54 
58  vtkContextScene* GetScene();
59 
63  virtual void OnSceneModified();
64 
69  void OnMouseMove() override;
70 
75  void OnLeftButtonDown() override;
76 
81  void OnLeftButtonUp() override;
82 
87  void OnLeftButtonDoubleClick() override;
88 
93  void OnMiddleButtonDown() override;
94 
99  void OnMiddleButtonUp() override;
100 
105  void OnMiddleButtonDoubleClick() override;
106 
111  void OnRightButtonDown() override;
112 
117  void OnRightButtonUp() override;
118 
123  void OnRightButtonDoubleClick() override;
124 
129  void OnMouseWheelForward() override;
130 
135  void OnMouseWheelBackward() override;
136 
141  virtual void OnSelection(unsigned int rect[5]);
142 
146  void OnChar() override;
147 
151  void OnKeyPress() override;
152 
156  void OnKeyRelease() override;
157 
158 protected:
160  ~vtkContextInteractorStyle() override;
161 
162  static void ProcessSceneEvents(
163  vtkObject* object, unsigned long event, void* clientdata, void* calldata);
164 
165  static void ProcessInteractorEvents(
166  vtkObject* object, unsigned long event, void* clientdata, void* calldata);
167 
168  virtual void RenderNow();
169 
175  void BeginProcessingEvent();
176 
182  void EndProcessingEvent();
183 
189 
192 
193 private:
195  void operator=(const vtkContextInteractorStyle&) = delete;
196 
197  void ConstructMouseEvent(vtkContextMouseEvent& event, int button);
198  bool ProcessMousePress(const vtkContextMouseEvent& event);
199 };
200 
201 #endif
virtual void OnLeftButtonDoubleClick()
virtual void OnLeftButtonDown()
virtual void OnMiddleButtonDown()
virtual void OnRightButtonDown()
abstract base class for most VTK objects
Definition: vtkObject.h:62
void OnChar() override
OnChar is triggered when an ASCII key is pressed.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
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:39
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.