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 
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 
122 
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
vtkContextMouseEvent
data structure to represent mouse events.
Definition: vtkContextMouseEvent.h:40
vtkContextInteractorStyle::OnKeyRelease
virtual void OnKeyRelease()
vtkContextInteractorStyle::~vtkContextInteractorStyle
~vtkContextInteractorStyle()
vtkContextInteractorStyle::SetScene
void SetScene(vtkContextScene *scene)
vtkInteractorStyle.h
vtkContextInteractorStyle::New
static vtkContextInteractorStyle * New()
vtkContextInteractorStyle::GetScene
vtkContextScene * GetScene()
vtkContextInteractorStyle::OnSelection
virtual void OnSelection(unsigned int rect[5])
vtkContextInteractorStyle::OnMiddleButtonDown
virtual void OnMiddleButtonDown()
vtkContextInteractorStyle::OnMouseMove
virtual void OnMouseMove()
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkContextInteractorStyle::Scene
vtkWeakPointer< vtkContextScene > Scene
Definition: vtkContextInteractorStyle.h:128
vtkContextInteractorStyle::RenderNow
virtual void RenderNow()
vtkViewsContext2DModule.h
vtkContextInteractorStyle::InteractorCallbackCommand
vtkNew< vtkCallbackCommand > InteractorCallbackCommand
Definition: vtkContextInteractorStyle.h:130
vtkContextInteractorStyle::EndProcessingEvent
void EndProcessingEvent()
vtkContextInteractorStyle::OnMiddleButtonUp
virtual void OnMiddleButtonUp()
vtkgl::event
struct _cl_event * event
Definition: vtkgl.h:14387
vtkContextInteractorStyle::ProcessingEvents
int ProcessingEvents
Definition: vtkContextInteractorStyle.h:131
vtkContextInteractorStyle::LastSceneRepaintMTime
unsigned long int LastSceneRepaintMTime
Definition: vtkContextInteractorStyle.h:132
vtkContextInteractorStyle::OnRightButtonUp
virtual void OnRightButtonUp()
vtkContextInteractorStyle::TimerId
int TimerId
Definition: vtkContextInteractorStyle.h:134
vtkContextInteractorStyle::OnMouseWheelForward
virtual void OnMouseWheelForward()
vtkContextInteractorStyle::OnMouseWheelBackward
virtual void OnMouseWheelBackward()
vtkContextScene
Provides a 2D scene for vtkContextItem objects.
Definition: vtkContextScene.h:50
vtkContextInteractorStyle::OnChar
virtual void OnChar()
vtkContextInteractorStyle::BeginProcessingEvent
void BeginProcessingEvent()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkContextInteractorStyle::ProcessSceneEvents
static void ProcessSceneEvents(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
vtkContextInteractorStyle::ProcessInteractorEvents
static void ProcessInteractorEvents(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
vtkNew< vtkCallbackCommand >
vtkWeakPointer.h
vtkInteractorStyle
provide event-driven interface to the rendering window (defines trackball mode)
Definition: vtkInteractorStyle.h:136
vtkContextInteractorStyle::vtkContextInteractorStyle
vtkContextInteractorStyle()
vtkContextInteractorStyle::OnSceneModified
virtual void OnSceneModified()
VTKVIEWSCONTEXT2D_EXPORT
#define VTKVIEWSCONTEXT2D_EXPORT
Definition: vtkViewsContext2DModule.h:15
vtkContextInteractorStyle::OnLeftButtonUp
virtual void OnLeftButtonUp()
vtkContextInteractorStyle::OnLeftButtonDown
virtual void OnLeftButtonDown()
vtkNew.h
vtkContextInteractorStyle
An interactor for chart views It observes the user events (mouse events) and propagates them to the s...
Definition: vtkContextInteractorStyle.h:39
vtkContextInteractorStyle::SceneCallbackCommand
vtkNew< vtkCallbackCommand > SceneCallbackCommand
Definition: vtkContextInteractorStyle.h:129
vtkContextInteractorStyle::TimerCallbackInitialized
bool TimerCallbackInitialized
Definition: vtkContextInteractorStyle.h:135
vtkContextInteractorStyle::OnRightButtonDown
virtual void OnRightButtonDown()
vtkContextInteractorStyle::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkWeakPointer< vtkContextScene >
vtkContextInteractorStyle::OnKeyPress
virtual void OnKeyPress()