VTK  9.0.1
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 
34 class vtkContextScene;
35 
36 class VTKVIEWSCONTEXT2D_EXPORT vtkContextInteractorStyle : public vtkInteractorStyle
37 {
38 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
50  void SetScene(vtkContextScene* scene);
51 
56 
60  virtual void OnSceneModified();
61 
66  void OnMouseMove() override;
67 
72  void OnLeftButtonDown() override;
73 
78  void OnLeftButtonUp() override;
79 
84  void OnMiddleButtonDown() override;
85 
90  void OnMiddleButtonUp() override;
91 
96  void OnRightButtonDown() override;
97 
102  void OnRightButtonUp() override;
103 
108  void OnMouseWheelForward() override;
109 
114  void OnMouseWheelBackward() override;
115 
120  virtual void OnSelection(unsigned int rect[5]);
121 
125  void OnChar() override;
126 
130  void OnKeyPress() override;
131 
135  void OnKeyRelease() override;
136 
137 protected:
140 
141  static void ProcessSceneEvents(
142  vtkObject* object, unsigned long event, void* clientdata, void* calldata);
143 
145  vtkObject* object, unsigned long event, void* clientdata, void* calldata);
146 
147  virtual void RenderNow();
148 
155 
162 
168 
171 
172 private:
174  void operator=(const vtkContextInteractorStyle&) = delete;
175 
176  void ConstructMouseEvent(vtkContextMouseEvent& event, int button);
177  bool ProcessMousePress(const vtkContextMouseEvent& event);
178 };
179 
180 #endif
vtkContextMouseEvent
data structure to represent mouse events.
Definition: vtkContextMouseEvent.h:35
vtkContextInteractorStyle::OnLeftButtonUp
void OnLeftButtonUp() override
Called when the user releases the mouse left button.
vtkContextInteractorStyle::SetScene
void SetScene(vtkContextScene *scene)
Set the scene to forward user events to.
vtkInteractorStyle.h
vtkContextInteractorStyle::New
static vtkContextInteractorStyle * New()
vtkContextInteractorStyle::GetScene
vtkContextScene * GetScene()
Return the observed scene.
vtkContextInteractorStyle::OnSelection
virtual void OnSelection(unsigned int rect[5])
Place holder for future implementation.
vtkContextInteractorStyle::LastSceneRepaintMTime
vtkMTimeType LastSceneRepaintMTime
Definition: vtkContextInteractorStyle.h:167
vtkContextInteractorStyle::SceneTimerId
int SceneTimerId
Definition: vtkContextInteractorStyle.h:169
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:54
vtkContextInteractorStyle::Scene
vtkWeakPointer< vtkContextScene > Scene
Definition: vtkContextInteractorStyle.h:163
vtkContextInteractorStyle::OnChar
void OnChar() override
Handle key presses.
vtkContextInteractorStyle::RenderNow
virtual void RenderNow()
vtkContextInteractorStyle::OnKeyPress
void OnKeyPress() override
Called when the user presses a key.
vtkContextInteractorStyle::InteractorCallbackCommand
vtkNew< vtkCallbackCommand > InteractorCallbackCommand
Definition: vtkContextInteractorStyle.h:165
vtkContextInteractorStyle::EndProcessingEvent
void EndProcessingEvent()
Inform the interactor style that an event is finished to be processed.
vtkContextInteractorStyle::ProcessingEvents
int ProcessingEvents
Definition: vtkContextInteractorStyle.h:166
vtkContextInteractorStyle::OnMouseWheelForward
void OnMouseWheelForward() override
Called when the user moves the mouse wheel forward.
vtkContextInteractorStyle::OnMouseMove
void OnMouseMove() override
Called when the user moves the mouse Default behavior forwards the event to the observed scene.
vtkContextScene
Provides a 2D scene for vtkContextItem objects.
Definition: vtkContextScene.h:48
vtkContextInteractorStyle::BeginProcessingEvent
void BeginProcessingEvent()
Inform the interactor style that an event is being processed.
vtkContextInteractorStyle::OnMouseWheelBackward
void OnMouseWheelBackward() override
Called when the user moves the mouse wheel backward.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkContextInteractorStyle::ProcessSceneEvents
static void ProcessSceneEvents(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
vtkContextInteractorStyle::OnRightButtonUp
void OnRightButtonUp() override
Called when the user releases the mouse right button.
vtkContextInteractorStyle::~vtkContextInteractorStyle
~vtkContextInteractorStyle() override
vtkContextInteractorStyle::ProcessInteractorEvents
static void ProcessInteractorEvents(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
vtkNew< vtkCallbackCommand >
vtkContextInteractorStyle::OnRightButtonDown
void OnRightButtonDown() override
Called when the user clicks the mouse right button.
vtkContextInteractorStyle::OnKeyRelease
void OnKeyRelease() override
Called when the user releases a key.
vtkWeakPointer.h
vtkInteractorStyle
provide event-driven interface to the rendering window (defines trackball mode)
Definition: vtkInteractorStyle.h:139
vtkContextInteractorStyle::vtkContextInteractorStyle
vtkContextInteractorStyle()
vtkContextInteractorStyle::OnSceneModified
virtual void OnSceneModified()
Called when the scene is modified.
vtkContextInteractorStyle::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkContextInteractorStyle::OnLeftButtonDown
void OnLeftButtonDown() override
Called when the user clicks the mouse left button.
vtkContextInteractorStyle::OnMiddleButtonUp
void OnMiddleButtonUp() override
Called when the user releases the mouse middle button.
vtkNew.h
vtkContextInteractorStyle
An interactor for chart views.
Definition: vtkContextInteractorStyle.h:37
vtkContextInteractorStyle::SceneCallbackCommand
vtkNew< vtkCallbackCommand > SceneCallbackCommand
Definition: vtkContextInteractorStyle.h:164
vtkContextInteractorStyle::TimerCallbackInitialized
bool TimerCallbackInitialized
Definition: vtkContextInteractorStyle.h:170
vtkContextInteractorStyle::OnMiddleButtonDown
void OnMiddleButtonDown() override
Called when the user clicks the mouse middle button.
vtkWeakPointer< vtkContextScene >
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293