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 
30 #ifndef vtkContextMouseEvent_h
31 #define vtkContextMouseEvent_h
32 
33 #include "vtkRenderingContext2DModule.h" // For export macro
34 #include "vtkWin32Header.h" // For export macros.
35 #include "vtkVector.h" // Needed for vtkVector2f and vtkVector2i
36 
38 
40 {
41 public:
43 
44  enum {
45  NO_BUTTON = 0,
46  LEFT_BUTTON = 1,
47  MIDDLE_BUTTON = 2,
48  RIGHT_BUTTON = 4
49  };
51 
53 
54  enum {
55  NO_MODIFIER = 0,
56  ALT_MODIFIER = 1,
57  SHIFT_MODIFIER = 2,
58  CONTROL_MODIFIER = 4
59  };
61 
63  {
64  }
65 
67 
69  {
70  this->Interactor = interactor;
71  }
73 
75 
78  {
79  return this->Interactor;
80  }
82 
84 
85  void SetPos(const vtkVector2f &pos) { this->Pos = pos; }
86  vtkVector2f GetPos() const { return this->Pos; }
88 
90 
91  void SetScenePos(const vtkVector2f &pos) { this->ScenePos = pos; }
92  vtkVector2f GetScenePos() const { return this->ScenePos; }
94 
96 
97  void SetScreenPos(const vtkVector2i &pos) { this->ScreenPos = pos; }
98  vtkVector2i GetScreenPos() const { return this->ScreenPos; }
100 
102 
103  void SetLastPos(const vtkVector2f &pos) { this->LastPos = pos; }
104  vtkVector2f GetLastPos() const { return this->LastPos; }
106 
108 
109  void SetLastScenePos(const vtkVector2f &pos) { this->LastScenePos = pos; }
110  vtkVector2f GetLastScenePos() const { return this->LastScenePos; }
112 
114 
115  void SetLastScreenPos(const vtkVector2i &pos) { this->LastScreenPos = pos; }
116  vtkVector2i GetLastScreenPos() const { return this->LastScreenPos; }
118 
120 
122  void SetButton(int button) { this->Button = button; }
123  int GetButton() const { return this->Button; }
125 
129  int GetModifiers() const;
130 
131 protected:
134 
137 
140 
143 
146 
149 
151  int Button;
152 
153 protected:
155 };
156 
157 #endif // vtkContextMouseEvent_h
158 // VTK-HeaderTest-Exclude: vtkContextMouseEvent.h
vtkVector2f GetScenePos() const
vtkVector2i GetScreenPos() const
void SetScenePos(const vtkVector2f &pos)
vtkRenderWindowInteractor * Interactor
vtkVector2i GetLastScreenPos() const
vtkVector2f GetLastPos() const
platform-independent render window interaction including picking and frame rate control.
vtkVector2f GetLastScenePos() const
void SetButton(int button)
#define VTKRENDERINGCONTEXT2D_EXPORT
data structure to represent mouse events.
vtkRenderWindowInteractor * GetInteractor() const
void SetPos(const vtkVector2f &pos)
void SetScreenPos(const vtkVector2i &pos)
void SetLastPos(const vtkVector2f &pos)
void SetInteractor(vtkRenderWindowInteractor *interactor)
void SetLastScenePos(const vtkVector2f &pos)
vtkVector2f GetPos() const
void SetLastScreenPos(const vtkVector2i &pos)