VTK
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 "vtkViewsContext2DModule.h" // For export macro
32 #include "vtkInteractorStyle.h"
33 #include "vtkNew.h" // For ivars
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);
45 
53  void SetScene(vtkContextScene* scene);
54 
58  vtkContextScene* GetScene();
59 
63  virtual void OnSceneModified();
64 
69  virtual void OnMouseMove();
70 
75  virtual void OnLeftButtonDown();
76 
81  virtual void OnLeftButtonUp();
82 
87  virtual void OnMiddleButtonDown();
88 
93  virtual void OnMiddleButtonUp();
94 
99  virtual void OnRightButtonDown();
100 
105  virtual void OnRightButtonUp();
106 
111  virtual void OnMouseWheelForward();
112 
117  virtual void OnMouseWheelBackward();
118 
123  virtual void OnSelection(unsigned int rect[5]);
124 
128  virtual void OnChar();
129 
133  virtual void OnKeyPress();
134 
138  virtual void OnKeyRelease();
139 
140 protected:
143 
144  static void ProcessSceneEvents(vtkObject* object, unsigned long event,
145  void* clientdata, void* calldata);
146 
147  static void ProcessInteractorEvents(vtkObject* object, unsigned long event,
148  void* clientdata, void* calldata);
149 
150  virtual void RenderNow();
151 
157  void BeginProcessingEvent();
158 
164  void EndProcessingEvent();
165 
171 
172  int TimerId;
174 
175 private:
176  vtkContextInteractorStyle(const vtkContextInteractorStyle&) VTK_DELETE_FUNCTION;
177  void operator=(const vtkContextInteractorStyle&) VTK_DELETE_FUNCTION;
178 
179  void ConstructMouseEvent(vtkContextMouseEvent &event, int button);
180  bool ProcessMousePress(const vtkContextMouseEvent &event);
181 };
182 
183 #endif
vtkContextMouseEvent
data structure to represent mouse events.
Definition: vtkContextMouseEvent.h:40
vtkInteractorStyle.h
vtkInteractorStyle::OnKeyRelease
virtual void OnKeyRelease()
Definition: vtkInteractorStyle.h:255
vtkInteractorStyle::OnKeyPress
virtual void OnKeyPress()
Definition: vtkInteractorStyle.h:250
vtkContextInteractorStyle::LastSceneRepaintMTime
vtkMTimeType LastSceneRepaintMTime
Definition: vtkContextInteractorStyle.h:170
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:59
vtkContextInteractorStyle::Scene
vtkWeakPointer< vtkContextScene > Scene
Definition: vtkContextInteractorStyle.h:166
vtkContextInteractorStyle::InteractorCallbackCommand
vtkNew< vtkCallbackCommand > InteractorCallbackCommand
Definition: vtkContextInteractorStyle.h:168
vtkContextInteractorStyle::ProcessingEvents
int ProcessingEvents
Definition: vtkContextInteractorStyle.h:169
vtkInteractorStyle::OnMiddleButtonUp
virtual void OnMiddleButtonUp()
Definition: vtkInteractorStyle.h:225
vtkContextInteractorStyle::TimerId
int TimerId
Definition: vtkContextInteractorStyle.h:172
vtkInteractorStyle::OnMouseMove
virtual void OnMouseMove()
Generic event bindings can be overridden in subclasses.
Definition: vtkInteractorStyle.h:221
vtkMTimeType
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
vtkContextScene
Provides a 2D scene for vtkContextItem objects.
Definition: vtkContextScene.h:50
vtkInteractorStyle::OnMiddleButtonDown
virtual void OnMiddleButtonDown()
Definition: vtkInteractorStyle.h:224
vtkInteractorStyle::OnRightButtonDown
virtual void OnRightButtonDown()
Definition: vtkInteractorStyle.h:226
vtkInteractorStyle::OnMouseWheelForward
virtual void OnMouseWheelForward()
Definition: vtkInteractorStyle.h:228
vtkInteractorStyle::OnLeftButtonDown
virtual void OnLeftButtonDown()
Definition: vtkInteractorStyle.h:222
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkNew< vtkCallbackCommand >
vtkWeakPointer.h
vtkInteractorStyle
provide event-driven interface to the rendering window (defines trackball mode)
Definition: vtkInteractorStyle.h:133
vtkInteractorStyle::OnMouseWheelBackward
virtual void OnMouseWheelBackward()
Definition: vtkInteractorStyle.h:229
vtkInteractorStyle::OnLeftButtonUp
virtual void OnLeftButtonUp()
Definition: vtkInteractorStyle.h:223
vtkNew.h
vtkInteractorStyle::New
static vtkInteractorStyle * New()
This class must be supplied with a vtkRenderWindowInteractor wrapper or parent.
vtkContextInteractorStyle
An interactor for chart views.
Definition: vtkContextInteractorStyle.h:39
vtkContextInteractorStyle::SceneCallbackCommand
vtkNew< vtkCallbackCommand > SceneCallbackCommand
Definition: vtkContextInteractorStyle.h:167
vtkContextInteractorStyle::TimerCallbackInitialized
bool TimerCallbackInitialized
Definition: vtkContextInteractorStyle.h:173
vtkInteractorStyle::OnRightButtonUp
virtual void OnRightButtonUp()
Definition: vtkInteractorStyle.h:227
vtkInteractorStyle::OnChar
virtual void OnChar()
OnChar is triggered when an ASCII key is pressed.
vtkInteractorStyle::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkWeakPointer< vtkContextScene >