VTK  9.4.20250402
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
25VTK_ABI_NAMESPACE_BEGIN
27class vtkContextScene;
28
29class VTKVIEWSCONTEXT2D_EXPORT VTK_MARSHALAUTO vtkContextInteractorStyle : public vtkInteractorStyle
30{
31public:
34 void PrintSelf(ostream& os, vtkIndent indent) override;
35
44
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
96
101 void OnRightButtonDown() override;
102
107 void OnRightButtonUp() override;
108
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
148protected:
151
153 vtkObject* object, unsigned long event, void* clientdata, void* calldata);
154
156 vtkObject* object, unsigned long event, void* clientdata, void* calldata);
157
158 virtual void RenderNow();
159
166
173
179
182
183private:
185 void operator=(const vtkContextInteractorStyle&) = delete;
186
187 void ConstructMouseEvent(vtkContextMouseEvent& event, int button);
188 bool ProcessMousePress(const vtkContextMouseEvent& event);
189};
190
191VTK_ABI_NAMESPACE_END
192#endif
An interactor for chart views.
void OnLeftButtonDown() override
Called when the user clicks the mouse left button.
void OnMiddleButtonDown() override
Called when the user clicks the mouse middle button.
void OnRightButtonUp() override
Called when the user releases the mouse right button.
void OnChar() override
Handle key presses.
void OnMouseWheelBackward() override
Called when the user moves the mouse wheel backward.
void EndProcessingEvent()
Inform the interactor style that an event is finished to be processed.
vtkNew< vtkCallbackCommand > InteractorCallbackCommand
virtual void OnSceneModified()
Called when the scene is modified.
void OnLeftButtonDoubleClick() override
Called when the user double-clicks the mouse left button.
void SetScene(vtkContextScene *scene)
Set the scene to forward user events to.
vtkNew< vtkCallbackCommand > SceneCallbackCommand
~vtkContextInteractorStyle() override
static void ProcessInteractorEvents(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
void OnKeyRelease() override
Called when the user releases a key.
static void ProcessSceneEvents(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
virtual void OnSelection(unsigned int rect[5])
Place holder for future implementation.
virtual void RenderNow()
void OnRightButtonDoubleClick() override
Called when the user double-clicks the mouse right button.
vtkWeakPointer< vtkContextScene > Scene
void OnRightButtonDown() override
Called when the user clicks the mouse right button.
void OnMiddleButtonUp() override
Called when the user releases the mouse middle button.
void OnMouseMove() override
Called when the user moves the mouse Default behavior forwards the event to the observed scene.
void OnMiddleButtonDoubleClick() override
Called when the user double-clicks the mouse middle button.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void OnMouseWheelForward() override
Called when the user moves the mouse wheel forward.
vtkContextScene * GetScene()
Return the observed scene.
static vtkContextInteractorStyle * New()
void OnKeyPress() override
Called when the user presses a key.
void BeginProcessingEvent()
Inform the interactor style that an event is being processed.
void OnLeftButtonUp() override
Called when the user releases the mouse left button.
data structure to represent mouse events.
Provides a 2D scene for vtkContextItem objects.
a simple class to control print indentation
Definition vtkIndent.h:108
provide event-driven interface to the rendering window (defines trackball mode)
Allocate and hold a VTK object.
Definition vtkNew.h:167
abstract base class for most VTK objects
Definition vtkObject.h:162
a weak reference to a vtkObject.
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287
#define VTK_MARSHALAUTO