SOFA API  cd4ffb93
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::type::Vec3 &position, const sofa::type::Quat< SReal > &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::type::Vec3 getPosition (void) const
 Get the device coordinates. More...
 
sofa::type::Quat< SReal > 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 chargetClassName () const
 
virtual size_t getEventTypeIndex () const =0
 

Static Public Member Functions

static const charGetClassName ()
 
- Static Public Member Functions inherited from sofa::core::objectmodel::Event
static const charGetClassName ()
 
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

◆ HapticDeviceEvent()

sofa::core::objectmodel::HapticDeviceEvent::HapticDeviceEvent ( const unsigned int  id,
const sofa::type::Vec3 position,
const sofa::type::Quat< SReal > &  orientation,
const unsigned char  button 
)

Constructor.

◆ ~HapticDeviceEvent()

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

Destructor.

Function details

◆ getButton()

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

◆ getButtonState()

unsigned char sofa::core::objectmodel::HapticDeviceEvent::getButtonState ( ) const
inline

Get the device button state.

◆ GetClassName()

static const char* sofa::core::objectmodel::HapticDeviceEvent::GetClassName ( )
inlinestatic

◆ getDeviceId()

unsigned int sofa::core::objectmodel::HapticDeviceEvent::getDeviceId ( ) const
inline

Get the device Id.

◆ getOrientation()

sofa::type::Quat<SReal> sofa::core::objectmodel::HapticDeviceEvent::getOrientation ( void  ) const
inline

Get the device orientation.

◆ getPosition()

sofa::type::Vec3 sofa::core::objectmodel::HapticDeviceEvent::getPosition ( void  ) const
inline

Get the device coordinates.

◆ getPosX()

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

Get the device X coordinate.

◆ getPosY()

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

Get the device Y coordinate.

◆ getPosZ()

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

Get the device Z coordinate.

Enum details

◆ ButtonsStateMask

Define the device state (which button is pressed).

Enumerator
Button1StateMask 
Button2StateMask 
Button3StateMask 
Button4StateMask 
Button5StateMask 
Button6StateMask 
Button7StateMask 
Button8StateMask