VTK  9.1.0
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=========================================================================*/
25#ifndef vtkContextInteractorStyle_h
26#define vtkContextInteractorStyle_h
27
28#include "vtkInteractorStyle.h"
29#include "vtkNew.h" // For ivars
30#include "vtkViewsContext2DModule.h" // For export macro
31#include "vtkWeakPointer.h" // For ivars
32
34class vtkContextScene;
35
36class VTKVIEWSCONTEXT2D_EXPORT vtkContextInteractorStyle : public vtkInteractorStyle
37{
38public:
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
51
56
60 virtual void OnSceneModified();
61
66 void OnMouseMove() override;
67
72 void OnLeftButtonDown() override;
73
78 void OnLeftButtonUp() override;
79
84 void OnLeftButtonDoubleClick() override;
85
90 void OnMiddleButtonDown() override;
91
96 void OnMiddleButtonUp() override;
97
103
108 void OnRightButtonDown() override;
109
114 void OnRightButtonUp() override;
115
121
126 void OnMouseWheelForward() override;
127
132 void OnMouseWheelBackward() override;
133
138 virtual void OnSelection(unsigned int rect[5]);
139
143 void OnChar() override;
144
148 void OnKeyPress() override;
149
153 void OnKeyRelease() override;
154
155protected:
158
160 vtkObject* object, unsigned long event, void* clientdata, void* calldata);
161
163 vtkObject* object, unsigned long event, void* clientdata, void* calldata);
164
165 virtual void RenderNow();
166
173
180
186
189
190private:
192 void operator=(const vtkContextInteractorStyle&) = delete;
193
194 void ConstructMouseEvent(vtkContextMouseEvent& event, int button);
195 bool ProcessMousePress(const vtkContextMouseEvent& event);
196};
197
198#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:113
provide event-driven interface to the rendering window (defines trackball mode)
abstract base class for most VTK objects
Definition: vtkObject.h:73
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287