sofa::core::objectmodel::JoystickEvent::HatEvent Class Reference

Implements an event notifiying changes about a directionnal hat on a device (like a joystick). More...

#include <JoystickEvent.h>

Collaboration diagram for sofa::core::objectmodel::JoystickEvent::HatEvent:

Collaboration graph
[legend]

Public Types

enum  State {
  CENTERED = 0, UP = 1 << 0, RIGHT = 1 << 1, DOWN = 1 << 2,
  LEFT = 1 << 3, UP_RIGHT = UP|RIGHT, DOWN_RIGHT = DOWN|RIGHT, DOWN_LEFT = DOWN|LEFT,
  UP_LEFT = UP|LEFT
}
 Defines possible hat states. More...

Public Member Functions

 HatEvent (const int, const State)
 Constructor.
virtual ~HatEvent ()
 Default destructor.
Accessors
int getIndex () const
 Retrieves the index of the hat.
State getState () const
 Retrieves the state of the hat.

Private Attributes

const int m_index
 The index of the hat.
const State m_state
 The state of the hat.

Detailed Description

Implements an event notifiying changes about a directionnal hat on a device (like a joystick).

Definition at line 157 of file JoystickEvent.h.


Member Enumeration Documentation

Defines possible hat states.

Enumerator:
CENTERED 
UP 
RIGHT 
DOWN 
LEFT 
UP_RIGHT 
DOWN_RIGHT 
DOWN_LEFT 
UP_LEFT 

Definition at line 163 of file JoystickEvent.h.


Constructor & Destructor Documentation

sofa::core::objectmodel::JoystickEvent::HatEvent::HatEvent ( const int  index,
const State  state 
)

Constructor.

Parameters:
index the hat's index
state the hat's state

Definition at line 112 of file JoystickEvent.cpp.

virtual sofa::core::objectmodel::JoystickEvent::HatEvent::~HatEvent (  )  [inline, virtual]

Default destructor.

Definition at line 188 of file JoystickEvent.h.


Member Function Documentation

int sofa::core::objectmodel::JoystickEvent::HatEvent::getIndex (  )  const

Retrieves the index of the hat.

Returns:
the hat's index

Definition at line 120 of file JoystickEvent.cpp.

References m_index.

JoystickEvent::HatEvent::State sofa::core::objectmodel::JoystickEvent::HatEvent::getState (  )  const

Retrieves the state of the hat.

Returns:
the hat's state

Definition at line 127 of file JoystickEvent.cpp.

References m_state.


Field Documentation

The index of the hat.

Definition at line 211 of file JoystickEvent.h.

Referenced by getIndex().

The state of the hat.

Definition at line 212 of file JoystickEvent.h.

Referenced by getState().


The documentation for this class was generated from the following files:

Generated on Sun Nov 23 04:23:45 2008 for Sofa by  doxygen 1.5.7.1