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 
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 
158 
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
An interactor for chart views.
virtual void OnRightButtonUp()
Called when the user releases the mouse right button.
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.
virtual void OnKeyPress()
Called when the user presses a key.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual void OnChar()
Handle key presses.
virtual void OnMouseWheelBackward()
Called when the user moves the mouse wheel backward.
virtual void OnKeyRelease()
Called when the user releases a key.
static vtkContextInteractorStyle * New()
void SetScene(vtkContextScene *scene)
Set the scene to forward user events to.
vtkNew< vtkCallbackCommand > SceneCallbackCommand
virtual void OnMiddleButtonDown()
Called when the user clicks the mouse middle button.
static void ProcessInteractorEvents(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
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 OnMiddleButtonUp()
Called when the user releases the mouse middle button.
virtual void RenderNow()
vtkWeakPointer< vtkContextScene > Scene
vtkContextScene * GetScene()
Return the observed scene.
virtual void OnMouseMove()
Called when the user moves the mouse Default behavior forwards the event to the observed scene.
virtual void OnLeftButtonUp()
Called when the user releases the mouse left button.
void BeginProcessingEvent()
Inform the interactor style that an event is being processed.
virtual void OnMouseWheelForward()
Called when the user moves the mouse wheel forward.
virtual void OnLeftButtonDown()
Called when the user clicks the mouse left button.
virtual void OnRightButtonDown()
Called when the user clicks the mouse right button.
data structure to represent mouse events.
Provides a 2D scene for vtkContextItem objects.
a simple class to control print indentation
Definition: vtkIndent.h:40
provide event-driven interface to the rendering window (defines trackball mode)
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248