VTK
dox/Charts/vtkContextMouseEvent.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkContextMouseEvent.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00015 
00027 #ifndef __vtkContextMouseEvent_h
00028 #define __vtkContextMouseEvent_h
00029 
00030 #include "vtkVector.h"      // Needed for vtkVector2f and vtkVector2i
00031 
00032 class vtkRenderWindowInteractor;
00033 
00034 class vtkContextMouseEvent
00035 {
00036 public:
00038 
00039   enum {
00040     NO_BUTTON = 0,
00041     LEFT_BUTTON = 1,
00042     MIDDLE_BUTTON = 2,
00043     RIGHT_BUTTON = 4
00044   };
00046 
00048 
00049   enum {
00050     NO_MODIFIER = 0,
00051     ALT_MODIFIER = 1,
00052     SHIFT_MODIFIER = 2,
00053     CONTROL_MODIFIER = 4
00054   };
00056 
00057   vtkContextMouseEvent()
00058   {
00059   }
00060 
00061   ~vtkContextMouseEvent()
00062   {
00063   }
00064 
00066 
00067   void SetInteractor(vtkRenderWindowInteractor *interactor)
00068   {
00069     this->Interactor = interactor;
00070   }
00072 
00074 
00076   vtkRenderWindowInteractor* GetInteractor() const
00077   {
00078     return this->Interactor;
00079   }
00081 
00083 
00084   void SetPos(const vtkVector2f &pos) { this->Pos = pos; }
00085   vtkVector2f GetPos() const { return this->Pos; }
00087 
00089 
00090   void SetScenePos(const vtkVector2f &pos) { this->ScenePos = pos; }
00091   vtkVector2f GetScenePos() const { return this->ScenePos; }
00093 
00095 
00096   void SetScreenPos(const vtkVector2i &pos) { this->ScreenPos = pos; }
00097   vtkVector2i GetScreenPos() const { return this->ScreenPos; }
00099 
00101 
00102   void SetLastPos(const vtkVector2f &pos) { this->LastPos = pos; }
00103   vtkVector2f GetLastPos() const { return this->LastPos; }
00105 
00107 
00108   void SetLastScenePos(const vtkVector2f &pos) { this->LastScenePos = pos; }
00109   vtkVector2f GetLastScenePos() const { return this->LastScenePos; }
00111 
00113 
00114   void SetLastScreenPos(const vtkVector2i &pos) { this->LastScreenPos = pos; }
00115   vtkVector2i GetLastScreenPos() const { return this->LastScreenPos; }
00117 
00119 
00121   void SetButton(int button) { this->Button = button; }
00122   int GetButton() const { return this->Button; }
00124 
00128   int GetModifiers() const;
00129 
00130 #ifdef VTK_LEGACY_REMOVE
00131   // Deprecating the public exposure of member variables for mouse events
00132   // Deprecated in VTK 5.9.
00133 protected:
00134 #endif
00135 
00136   vtkVector2f Pos;
00137 
00139   vtkVector2f ScenePos;
00140 
00142   vtkVector2i ScreenPos;
00143 
00145   vtkVector2f LastPos;
00146 
00148   vtkVector2f LastScenePos;
00149 
00151   vtkVector2i LastScreenPos;
00152 
00154   int Button;
00155 
00156 protected:
00157   vtkRenderWindowInteractor *Interactor;
00158 };
00159 
00160 #endif // __vtkContextMouseEvent_h