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 =========================================================================*/
27 #ifndef vtkContextInteractorStyle_h
28 #define vtkContextInteractorStyle_h
29 
30 #include "vtkViewsContext2DModule.h" // For export macro
31 #include "vtkInteractorStyle.h"
32 #include "vtkNew.h" // For ivars
33 #include "vtkWeakPointer.h" // For ivars
34 
36 class vtkContextScene;
37 
39 {
40 public:
43  void PrintSelf(ostream& os, vtkIndent indent);
44 
49  void SetScene(vtkContextScene* scene);
50 
52  vtkContextScene* GetScene();
53 
55  virtual void OnSceneModified();
56 
59  virtual void OnMouseMove();
60 
63  virtual void OnLeftButtonDown();
64 
67  virtual void OnLeftButtonUp();
68 
71  virtual void OnMiddleButtonDown();
72 
75  virtual void OnMiddleButtonUp();
76 
79  virtual void OnRightButtonDown();
80 
83  virtual void OnRightButtonUp();
84 
87  virtual void OnMouseWheelForward();
88 
91  virtual void OnMouseWheelBackward();
92 
95  virtual void OnSelection(unsigned int rect[5]);
96 
98  virtual void OnChar();
99 
101  virtual void OnKeyPress();
102 
104  virtual void OnKeyRelease();
105 
106 protected:
109 
110  static void ProcessSceneEvents(vtkObject* object, unsigned long event,
111  void* clientdata, void* calldata);
112 
113  static void ProcessInteractorEvents(vtkObject* object, unsigned long event,
114  void* clientdata, void* calldata);
115 
116  virtual void RenderNow();
117 
121  void BeginProcessingEvent();
122 
126  void EndProcessingEvent();
127 
132  unsigned long int LastSceneRepaintMTime;
133 
134  int TimerId;
136 
137 private:
138  vtkContextInteractorStyle(const vtkContextInteractorStyle&); // Not implemented
139  void operator=(const vtkContextInteractorStyle&); // Not implemented
140 
141  void ConstructMouseEvent(vtkContextMouseEvent &event, int button);
142  bool ProcessMousePress(const vtkContextMouseEvent &event);
143 };
144 
145 #endif
virtual void OnLeftButtonDown()
#define VTKVIEWSCONTEXT2D_EXPORT
virtual void OnMiddleButtonDown()
virtual void OnRightButtonDown()
abstract base class for most VTK objects
Definition: vtkObject.h:61
virtual void OnLeftButtonUp()
static vtkInteractorStyle * New()
virtual void OnMiddleButtonUp()
vtkNew< vtkCallbackCommand > SceneCallbackCommand
virtual void OnMouseWheelForward()
virtual void OnKeyRelease()
virtual void OnKeyPress()
virtual void OnRightButtonUp()
An interactor for chart views It observes the user events (mouse events) and propagates them to the s...
void PrintSelf(ostream &os, vtkIndent indent)
Provides a 2D scene for vtkContextItem objects.
data structure to represent mouse events.
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void OnMouseWheelBackward()
vtkNew< vtkCallbackCommand > InteractorCallbackCommand
vtkWeakPointer< vtkContextScene > Scene
virtual void OnChar()
provide event-driven interface to the rendering window (defines trackball mode)
virtual void OnMouseMove()