SOFA API  6a688117
Open source framework for multi-physics simuation
sofa::core::objectmodel::HapticDeviceEvent Class Reference

#include <HapticDeviceEvent.h>

This event notifies about haptic device interaction. More...

Inheritance diagram for sofa::core::objectmodel::HapticDeviceEvent:

Detailed Description

This event notifies about haptic device interaction.

Public Member Functions

 HapticDeviceEvent (const unsigned int id, const sofa::defaulttype::Vector3 &position, const sofa::defaulttype::Quat &orientation, const unsigned char button)
 Constructor. More...
 
 ~HapticDeviceEvent () override
 Destructor. More...
 
SReal getPosX (void) const
 Get the device X coordinate. More...
 
SReal getPosY (void) const
 Get the device Y coordinate. More...
 
SReal getPosZ (void) const
 Get the device Z coordinate. More...
 
sofa::defaulttype::Vector3 getPosition (void) const
 Get the device coordinates. More...
 
sofa::defaulttype::Quat getOrientation (void) const
 Get the device orientation. More...
 
unsigned char getButtonState () const
 Get the device button state. More...
 
bool getButton (const int id=0) const
 
unsigned int getDeviceId () const
 Get the device Id. More...
 
- Public Member Functions inherited from sofa::core::objectmodel::Event
 Event ()
 
virtual ~Event ()
 
void setHandled ()
 Tag the event as handled, i.e. the event needs not be propagated further. More...
 
bool isHandled () const
 Returns true of the event has been handled. More...
 
virtual const char * getClassName () const
 
virtual size_t getEventTypeIndex () const =0
 

Static Public Member Functions

static const char * GetClassName ()
 
- Static Public Member Functions inherited from sofa::core::objectmodel::Event
static const char * GetClassName ()
 
static size_t getEventTypeCount ()
 

Additional Inherited Members

- Protected Attributes inherited from sofa::core::objectmodel::Event
bool m_handled
 
- Static Protected Attributes inherited from sofa::core::objectmodel::Event
static size_t s_lastEventTypeIndex = 0
 storing the last given id More...
 

Constructor details

sofa::core::objectmodel::HapticDeviceEvent::HapticDeviceEvent ( const unsigned int  id,
const sofa::defaulttype::Vector3 &  position,
const sofa::defaulttype::Quat orientation,
const unsigned char  button 
)

Constructor.

sofa::core::objectmodel::HapticDeviceEvent::~HapticDeviceEvent ( )
override

Destructor.

Function details

bool sofa::core::objectmodel::HapticDeviceEvent::getButton ( const int  id = 0) const
inline
unsigned char sofa::core::objectmodel::HapticDeviceEvent::getButtonState ( ) const
inline

Get the device button state.

static const char* sofa::core::objectmodel::HapticDeviceEvent::GetClassName ( )
inlinestatic
unsigned int sofa::core::objectmodel::HapticDeviceEvent::getDeviceId ( ) const
inline

Get the device Id.

sofa::defaulttype::Quat sofa::core::objectmodel::HapticDeviceEvent::getOrientation ( void  ) const
inline

Get the device orientation.

sofa::defaulttype::Vector3 sofa::core::objectmodel::HapticDeviceEvent::getPosition ( void  ) const
inline

Get the device coordinates.

SReal sofa::core::objectmodel::HapticDeviceEvent::getPosX ( void  ) const
inline

Get the device X coordinate.

SReal sofa::core::objectmodel::HapticDeviceEvent::getPosY ( void  ) const
inline

Get the device Y coordinate.

SReal sofa::core::objectmodel::HapticDeviceEvent::getPosZ ( void  ) const
inline

Get the device Z coordinate.

Enum details

Define the device state (which button is pressed).

Enumerator
Button1StateMask 
Button2StateMask 
Button3StateMask 
Button4StateMask 
Button5StateMask 
Button6StateMask 
Button7StateMask 
Button8StateMask