EventMapper addon for a 3DConnexion Space Navigator. More...
#include <mitkSpaceNavigatorAddOn.h>
Public Member Functions | |
void | DeviceChange (long device, long keys, long programmableKeys) |
void | KeyDown (int keyCode) |
void | KeyUp (int keyCode) |
void | SensorInput (mitk::Vector3D translation, mitk::Vector3D rotation, mitk::ScalarType angle) |
void | ForwardEvent (const mitk::StateEvent *e) |
Static Public Member Functions | |
static SpaceNavigatorAddOn * | GetInstance () |
EventMapper addon for a 3DConnexion Space Navigator.
Documentation in the interface.
Definition at line 35 of file mitkSpaceNavigatorAddOn.h.
void mitk::SpaceNavigatorAddOn::DeviceChange | ( | long | device, |
long | keys, | ||
long | programmableKeys | ||
) |
void mitk::SpaceNavigatorAddOn::ForwardEvent | ( | const mitk::StateEvent * | e ) | [virtual] |
Implements mitk::EventMapperAddOn.
Definition at line 59 of file mitkSpaceNavigatorAddOn.cpp.
References mitk::GlobalInteraction::GetInstance(), and mitk::StateMachine::HandleEvent().
{ mitk::GlobalInteraction::GetInstance()->HandleEvent(e); }
mitk::SpaceNavigatorAddOn * mitk::SpaceNavigatorAddOn::GetInstance | ( | ) | [static] |
Definition at line 27 of file mitkSpaceNavigatorAddOn.cpp.
Referenced by mitk::SpaceNavigatorActivator::RegisterInputDevice(), and mitk::SpaceNavigatorActivator::UnRegisterInputDevice().
{ // only needed for initializiation SpaceNavigatorDriver* spaceNavigatorDriver = SpaceNavigatorDriver::GetInstance(); static SpaceNavigatorAddOn instance; return &instance; }
void mitk::SpaceNavigatorAddOn::KeyDown | ( | int | keyCode ) |
If a button is pressed down an event is fired.
keyCode | the id to the key, that is pressed |
Definition at line 41 of file mitkSpaceNavigatorAddOn.cpp.
References mitk::BS_LeftButton, mitk::EIDSPACENAVIGATORKEYDOWN, mitk::Key_none, and mitk::Type_SpaceNavigatorKeyDown.
{ mitk::Event* e = new mitk::Event(NULL, mitk::Type_SpaceNavigatorKeyDown, mitk::BS_LeftButton, keyCode, mitk::Key_none); mitk::StateEvent* se = new mitk::StateEvent(mitk::EIDSPACENAVIGATORKEYDOWN, e); this->ForwardEvent(se); }
void mitk::SpaceNavigatorAddOn::KeyUp | ( | int | keyCode ) |
void mitk::SpaceNavigatorAddOn::SensorInput | ( | mitk::Vector3D | translation, |
mitk::Vector3D | rotation, | ||
mitk::ScalarType | angle | ||
) |
Reacts on any movement of the mouse and fires events accordingly.
translation | the translation of the mouse as an 3D vector |
rotation | the rotation of the mouse as an 3D vector |
angle | the angle from the mouse as an scalar unit |
Definition at line 52 of file mitkSpaceNavigatorAddOn.cpp.
References mitk::BS_NoButton, and mitk::EIDSPACENAVIGATORINPUT.
{ mitk::SpaceNavigatorEvent* e = new mitk::SpaceNavigatorEvent(mitk::BS_NoButton, translation, rotation, angle); mitk::StateEvent* se = new mitk::StateEvent(mitk::EIDSPACENAVIGATORINPUT, e); this->ForwardEvent(se); }