Event that stores coordinates and the key which is pressed. More...
#include <mitkKeyEvent.h>
Public Member Functions | |
KeyEvent (BaseRenderer *sender, int type, int button, int buttonState, int key, std::string text, const Point2D &displPosition) | |
Constructor with all necessary arguments. | |
const Point2D & | GetDisplayPosition () const |
void | SetDisplayPosition (const Point2D &displPosition) |
const Point3D & | GetWorldPosition () const |
int | GetKey () const |
const char * | GetText () const |
int | GetType () const |
Protected Attributes | |
Point2D | m_DisplayPosition |
int | m_Key |
std::string | m_Text |
Point3D | m_WorldPosition |
bool | m_WorldPositionIsSet |
Event that stores coordinates and the key which is pressed.
Stores display position of the mouse. If requested, the correspondent 3D world position in mm is calculated via picking (delegated to the BaseRenderer).
Definition at line 36 of file mitkKeyEvent.h.
mitk::KeyEvent::KeyEvent | ( | BaseRenderer * | sender, |
int | type, | ||
int | button, | ||
int | buttonState, | ||
int | key, | ||
std::string | text, | ||
const Point2D & | displPosition | ||
) |
Constructor with all necessary arguments.
sender | is the renderer that caused that event |
type,button,buttonState,key,: | information from the Event |
displPosition | is the 2D Position of the mouse |
const Point2D& mitk::KeyEvent::GetDisplayPosition | ( | ) | const [inline] |
Definition at line 47 of file mitkKeyEvent.h.
Referenced by mitk::VtkInteractorCameraController::KeyPressEvent(), and mitk::BaseRenderer::KeyPressEvent().
{ return m_DisplayPosition; }
int mitk::KeyEvent::GetKey | ( | ) | const [inline] |
Reimplemented from mitk::Event.
Definition at line 56 of file mitkKeyEvent.h.
Referenced by mitk::BaseRenderer::KeyPressEvent().
{ return m_Key; }
const char* mitk::KeyEvent::GetText | ( | ) | const [inline] |
Definition at line 61 of file mitkKeyEvent.h.
Referenced by mitk::VtkInteractorCameraController::KeyPressEvent(), and mitk::BaseRenderer::KeyPressEvent().
{ return m_Text.c_str(); }
int mitk::KeyEvent::GetType | ( | ) | const [inline] |
Reimplemented from mitk::Event.
Definition at line 64 of file mitkKeyEvent.h.
Referenced by mitk::BaseRenderer::KeyPressEvent().
{ return m_Type; }
const mitk::Point3D & mitk::KeyEvent::GetWorldPosition | ( | ) | const |
Definition at line 31 of file mitkKeyEvent.cpp.
References m_DisplayPosition, mitk::Event::m_Sender, m_WorldPosition, m_WorldPositionIsSet, and mitk::BaseRenderer::PickWorldPoint().
{ if(m_WorldPositionIsSet) return m_WorldPosition; m_WorldPositionIsSet = true; assert(m_Sender!=NULL); m_Sender->PickWorldPoint(m_DisplayPosition, m_WorldPosition); return m_WorldPosition; }
void mitk::KeyEvent::SetDisplayPosition | ( | const Point2D & | displPosition ) | [inline] |
Definition at line 52 of file mitkKeyEvent.h.
Referenced by mitk::BaseRenderer::KeyPressEvent().
{ m_DisplayPosition = displPosition; }
Point2D mitk::KeyEvent::m_DisplayPosition [protected] |
Definition at line 69 of file mitkKeyEvent.h.
Referenced by GetWorldPosition().
int mitk::KeyEvent::m_Key [protected] |
Reimplemented from mitk::Event.
Definition at line 70 of file mitkKeyEvent.h.
std::string mitk::KeyEvent::m_Text [protected] |
Definition at line 71 of file mitkKeyEvent.h.
Point3D mitk::KeyEvent::m_WorldPosition [mutable, protected] |
Definition at line 72 of file mitkKeyEvent.h.
Referenced by GetWorldPosition().
bool mitk::KeyEvent::m_WorldPositionIsSet [mutable, protected] |
Definition at line 73 of file mitkKeyEvent.h.
Referenced by GetWorldPosition().