HandData Class Reference

Simple struct for hand movement data. More...

#include <Psycho/HandData.H>

Collaboration diagram for HandData:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 HandData (const int x_, const int y_, const std::vector< bool > b_)
 !! Fully initialized constructor, no extra data
 HandData (const int mx_, const int my_, const int nmx_, const int nmy_, const bool mlb_, const bool mmb_, const bool mrb_)
 HandData (const char *kbch_)
 HandData (const char *kbch_, const int mx_, const int my_, const int nmx_, const int nmy_, const bool mlb_, const bool mmb_, const bool mrb_)
 HandData (const char *kbch_, const int mx_, const int my_, const int nmx_, const int nmy_, const bool mlb_, const bool mmb_, const bool mrb_, const int x_, const int y_, const std::vector< bool > b_)
 HandData (const int x_, const int y_, const std::vector< bool > b_, rutz::shared_ptr< ParamMap > dat)
 !! Fully initialized constructor, extra data in ParamMap
 HandData (const int mx_, const int my_, const int nmx_, const int nmy_, const bool mlb_, const bool mmb_, const bool mrb_, rutz::shared_ptr< ParamMap > dat)
 HandData (const char *kbch_, rutz::shared_ptr< ParamMap > dat)
 HandData (const char *kbch_, const int mx_, const int my_, const int nmx_, const int nmy_, const bool mlb_, const bool mmb_, const bool mrb_, rutz::shared_ptr< ParamMap > dat)
 HandData (const char *kbch_, const int mx_, const int my_, const int nmx_, const int nmy_, const bool mlb_, const bool mmb_, const bool mrb_, const int x_, const int y_, const std::vector< bool > b_, rutz::shared_ptr< ParamMap > dat)
 ~HandData ()
 Destructor.
Helper functions

bool isPressed (uint &b_) const
 Is the n-th button is pressed?
bool isAnyPressed () const
 Is there any pressed button?
bool isButtonEmpty () const
 Do we have buttons?
bool isValid () const
 Do we have valid (x,y) coordinates?
bool isWithin (const Dims &dims) const
 Are our coordinates within some dims?
bool isMouseValid () const
 Is mouse position valid?
bool isMouseAnyPressed () const
 Is there any pressed mouse button?
bool isKeyboardEmpty () const
 Is keyboard input empty?
bool hasMetaData (const std::string field) const
 Do we have valid extra metadata?
bool hasSpecialMetaData (const std::string field) const
bool isSpecialField (std::string field) const
 Is this field name a special field?
Access functions

size_t numButton () const
 -> If these features are not needed, consider removing them
int getAccelerator () const
 Get Accelerator value.
float getAcceleratorF () const
int getBrake () const
 Get Brake value.
float getBrakeF () const
int getWheelLeft () const
 Get Wheel Left value.
float getWheelLeftF () const
int getWheelRight () const
 Get Wheel Right value.
float getWheelRightF () const
int getWheel () const
 Get Wheel value.
float getWheelF () const
int getX () const
int getAcclBrake () const
 Get Both Accl & Brake value.
float getAcclBrakeF () const
int getY () const
Point2D< int > getPosition () const
 Get All joystick/wheel position.
Point2D< float > getPositionF () const
int getMouseX () const
 Get raw data.
int getMouseY () const
int getNativeX () const
int getNativeY () const
bool getMouseBL () const
bool getMouseBM () const
bool getMouseBR () const
char * getKeyboard () const
 Get raw data.
Extra data management

rutz::shared_ptr< ParamMapgetMetaData () const
 Get all metadata.
std::vector< std::stringgetMetaDataList () const
 Get list of metadata fields.
double getMetaDataField (std::string field) const
 Get one field of metadata.

Helper Functions



void outputData (std::ostream &out) const
 Get text output report.

Detailed Description

Simple struct for hand movement data.

Different joystick/steering wheel trackers may or may not fill all data members. Members that should always be filled are x and y. Note that this class is costly in terms of storage, so typically one would want to use it only to pass data samples around, but not to store a long series of samples in memory. For example, Psycho/HandTrace.H uses a more compact format to internally store eye data, and uses HandData objects to deliver that data to whoever wants it. Originally this function is for joystick only, therefore to maintain code consistency, the naming without mouse or keyboard will refer to joystick

Definition at line 61 of file HandData.H.


Constructor & Destructor Documentation

HandData::HandData ( const int  x_,
const int  y_,
const std::vector< bool >  b_ 
) [inline]

!! Fully initialized constructor, no extra data

!! Without Param Map

HandData Constructors & Destructors

Constructors and Destructors

Definition at line 304 of file HandData.H.

HandData::HandData ( const int  x_,
const int  y_,
const std::vector< bool >  b_,
rutz::shared_ptr< ParamMap dat 
) [inline]

!! Fully initialized constructor, extra data in ParamMap

!! With param map

Definition at line 351 of file HandData.H.

HandData::~HandData (  )  [inline]

Destructor.

Definition at line 400 of file HandData.H.


Member Function Documentation

int HandData::getAccelerator (  )  const [inline]

Get Accelerator value.

These are for single value of wheel's accl,brake,left,right

Definition at line 482 of file HandData.H.

int HandData::getAcclBrake (  )  const [inline]

Get Both Accl & Brake value.

Definition at line 509 of file HandData.H.

int HandData::getBrake (  )  const [inline]

Get Brake value.

Definition at line 487 of file HandData.H.

char * HandData::getKeyboard (  )  const [inline]

Get raw data.

Definition at line 546 of file HandData.H.

rutz::shared_ptr< ParamMap > HandData::getMetaData (  )  const [inline]

Get all metadata.

Extra Data Management

Definition at line 553 of file HandData.H.

Referenced by getMetaDataList().

double HandData::getMetaDataField ( std::string  field  )  const [inline]

Get one field of metadata.

Definition at line 567 of file HandData.H.

References hasMetaData().

Referenced by outputData().

std::vector< std::string > HandData::getMetaDataList (  )  const [inline]

Get list of metadata fields.

Definition at line 556 of file HandData.H.

References getMetaData(), and hasMetaData().

Referenced by outputData().

int HandData::getMouseX (  )  const [inline]

Get raw data.

Definition at line 526 of file HandData.H.

Point2D< int > HandData::getPosition (  )  const [inline]

Get All joystick/wheel position.

These are combined value of all wheel's axis

Definition at line 516 of file HandData.H.

int HandData::getWheel (  )  const [inline]

Get Wheel value.

These are combined value of wheel's axises (accl-brake, left-right)

Definition at line 502 of file HandData.H.

int HandData::getWheelLeft (  )  const [inline]

Get Wheel Left value.

Definition at line 492 of file HandData.H.

int HandData::getWheelRight (  )  const [inline]

Get Wheel Right value.

Definition at line 497 of file HandData.H.

bool HandData::hasMetaData ( const std::string  field = "any"  )  const [inline]

Do we have valid extra metadata?

Metadata.

Only a very few samples in an eye trace have this extra data, possibly none. The data may be present at the onset of each event and contains information about each event.

Definition at line 454 of file HandData.H.

References rutz::shared_ptr< T >::is_valid().

Referenced by getMetaDataField(), getMetaDataList(), and outputData().

bool HandData::isAnyPressed (  )  const [inline]

Is there any pressed button?

Definition at line 419 of file HandData.H.

bool HandData::isButtonEmpty (  )  const [inline]

Do we have buttons?

Definition at line 425 of file HandData.H.

bool HandData::isKeyboardEmpty (  )  const [inline]

Is keyboard input empty?

Keyboard.

Definition at line 448 of file HandData.H.

bool HandData::isMouseAnyPressed (  )  const [inline]

Is there any pressed mouse button?

Definition at line 442 of file HandData.H.

bool HandData::isMouseValid (  )  const [inline]

Is mouse position valid?

Mouse.

Definition at line 438 of file HandData.H.

bool HandData::isPressed ( uint b_  )  const [inline]

Is the n-th button is pressed?

Joystick.

Definition at line 408 of file HandData.H.

bool HandData::isSpecialField ( std::string  field  )  const [inline]

Is this field name a special field?

Definition at line 466 of file HandData.H.

bool HandData::isValid (  )  const [inline]

Do we have valid (x,y) coordinates?

Definition at line 428 of file HandData.H.

Referenced by isWithin().

bool HandData::isWithin ( const Dims dims  )  const [inline]

Are our coordinates within some dims?

Definition at line 431 of file HandData.H.

References Dims::h(), isValid(), and Dims::w().

size_t HandData::numButton (  )  const [inline]

-> If these features are not needed, consider removing them

Check number of buttons

Access Functions

Definition at line 479 of file HandData.H.

void HandData::outputData ( std::ostream &  out  )  const [inline]

Get text output report.

Misc

Definition at line 577 of file HandData.H.

References getMetaDataField(), getMetaDataList(), and hasMetaData().


The documentation for this class was generated from the following file:
Generated on Sun May 8 08:22:07 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3