VTK
vtkContextMouseEvent.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkContextMouseEvent.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 =========================================================================*/
15 
31 #ifndef vtkContextMouseEvent_h
32 #define vtkContextMouseEvent_h
33 
34 #include "vtkRenderingContext2DModule.h" // For export macro
35 #include "vtkWin32Header.h" // For export macros.
36 #include "vtkVector.h" // Needed for vtkVector2f and vtkVector2i
37 
39 
40 class VTKRENDERINGCONTEXT2D_EXPORT vtkContextMouseEvent
41 {
42 public:
46  enum {
47  NO_BUTTON = 0,
48  LEFT_BUTTON = 1,
49  MIDDLE_BUTTON = 2,
50  RIGHT_BUTTON = 4
51  };
52 
56  enum {
57  NO_MODIFIER = 0,
58  ALT_MODIFIER = 1,
59  SHIFT_MODIFIER = 2,
60  CONTROL_MODIFIER = 4
61  };
62 
64  {
65  }
66 
71  {
72  this->Interactor = interactor;
73  }
74 
80  {
81  return this->Interactor;
82  }
83 
87  void SetPos(const vtkVector2f &pos) { this->Pos = pos; }
88  vtkVector2f GetPos() const { return this->Pos; }
89 
93  void SetScenePos(const vtkVector2f &pos) { this->ScenePos = pos; }
94  vtkVector2f GetScenePos() const { return this->ScenePos; }
95 
99  void SetScreenPos(const vtkVector2i &pos) { this->ScreenPos = pos; }
100  vtkVector2i GetScreenPos() const { return this->ScreenPos; }
101 
105  void SetLastPos(const vtkVector2f &pos) { this->LastPos = pos; }
106  vtkVector2f GetLastPos() const { return this->LastPos; }
107 
111  void SetLastScenePos(const vtkVector2f &pos) { this->LastScenePos = pos; }
112  vtkVector2f GetLastScenePos() const { return this->LastScenePos; }
113 
117  void SetLastScreenPos(const vtkVector2i &pos) { this->LastScreenPos = pos; }
118  vtkVector2i GetLastScreenPos() const { return this->LastScreenPos; }
119 
124  void SetButton(int button) { this->Button = button; }
125  int GetButton() const { return this->Button; }
126 
131  int GetModifiers() const;
132 
133 protected:
138 
143 
148 
153 
158 
163 
167  int Button;
168 
169 protected:
171 };
172 
173 #endif // vtkContextMouseEvent_h
174 // VTK-HeaderTest-Exclude: vtkContextMouseEvent.h
vtkVector2f GetScenePos() const
vtkVector2i GetScreenPos() const
vtkVector2f ScenePos
Position of the mouse the scene coordinate system.
vtkVector2f LastPos
`Pos' at the previous mouse event.
void SetScenePos(const vtkVector2f &pos)
Set/get the position of the mouse in scene coordinates.
int Button
Mouse button that caused the event, using the anonymous enumeration.
vtkVector2f Pos
Position of the mouse in item coordinate system.
vtkRenderWindowInteractor * Interactor
vtkVector2i LastScreenPos
`ScreenPos' at the previous mouse event.
vtkVector2i GetLastScreenPos() const
vtkVector2f GetLastPos() const
platform-independent render window interaction including picking and frame rate control.
vtkVector2i ScreenPos
Position of the mouse in screen coordinates.
vtkVector2f GetLastScenePos() const
void SetButton(int button)
Set/get the mouse button that caused the event, with possible values being NO_BUTTON, LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON.
data structure to represent mouse events.
vtkRenderWindowInteractor * GetInteractor() const
Get the interactor for the mouse event.
void SetPos(const vtkVector2f &pos)
Set/get the position of the mouse in the item's coordinates.
Some derived classes for the different vectors commonly used.
Definition: vtkVector.h:408
vtkVector2f LastScenePos
`ScenePos'at the previous mouse event.
void SetScreenPos(const vtkVector2i &pos)
Set/get the position of the mouse in screen coordinates.
void SetLastPos(const vtkVector2f &pos)
Set/get the position of the mouse in the item's coordinates.
void SetInteractor(vtkRenderWindowInteractor *interactor)
Set the interactor for the mouse event.
void SetLastScenePos(const vtkVector2f &pos)
Set/get the position of the mouse in scene coordinates.
vtkVector2f GetPos() const
void SetLastScreenPos(const vtkVector2i &pos)
Set/get the position of the mouse in screen coordinates.