3Gear Systems SDK  v0.9.34
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
HandTrackingClient::HandTrackingMessage Class Referenceabstract

#include <HandTrackingMessage.h>

Inheritance diagram for HandTrackingClient::HandTrackingMessage:
HandTrackingClient::BasicMessage HandTrackingClient::CalibrationMessage HandTrackingClient::PointMessage HandTrackingClient::UserMessage HandTrackingClient::WelcomeMessage HandTrackingClient::BimanualPinchMessage HandTrackingClient::PinchMessage HandTrackingClient::PoseMessage

Public Types

enum  MessageType {
  WELCOME = 0, USER = 100, CALIBRATION = 101, POSE = 200,
  PRESSED = 300, DRAGGED = 301, RELEASED = 302, MOVED = 303,
  SIMULTANEOUSLY_PRESSED = 400, INDIVIDUALLY_PRESSED = 401, SIMULTANEOUSLY_RELEASED = 402, INDIVIDUALLY_RELEASED = 403,
  DRAGGED_BIMANUAL = 404, POINT = 500, INVALID_DATA = 10000
}
 

Public Member Functions

virtual MessageType getType () const =0
 
virtual std::string serialize () const =0
 Serializes the message to send over the network. More...
 

Static Public Member Functions

static const char * messageTypeToString (MessageType m)
 Convert from a MessageType to its string representation; used for serialization.
 
static MessageType stringToMessageType (const std::string &str)
 Convert from a string to a MessageType; used in deserialization.
 
static HandTrackingMessagedeserialize (const std::string &data)
 Given a line of text sent over the network connection, converts it to a valid hand message. More...
 

Protected Member Functions

 HandTrackingMessage ()
 

Detailed Description

Base class for all hand-tracking messages / events.

Member Enumeration Documentation

An enum describing the message type. Used for distinguishing between similar messages, e.g., between PRESSED and RELEASED, which are both PinchMessages.

Enumerator
WELCOME 

Provides server and protocol versions. Type of WelcomeMessage.

USER 

Provides information about the user, such as profile name and skinning information. Type of UserMessage.

CALIBRATION 

User is in a spread / calibrating pose, provides info about scale and percent complete. Type of CalibrationMessage.

POSE 

Provides full skeleton pose information. Type of PoseMessage.

PRESSED 

User pinched index and thumb together. Type of PinchMessage.

DRAGGED 

User moved hand while holding a pinch. Type of PinchMessage.

RELEASED 

User released the pinch. Type of PinchMessage.

MOVED 

User moved without pinching. Type of PinchMessage.

SIMULTANEOUSLY_PRESSED 

User pinched thumb and index finger of both hands at (approximately) the same time. Type of BimanualPinchMessage.

INDIVIDUALLY_PRESSED 

User pinched thumb and index finger of one hand (compare to SIMULTANEOUSLY_PRESSED). Type of BimanualPinchMessage.

SIMULTANEOUSLY_RELEASED 

User released thumb and index finger of both hands at the same time. Type of BimanualPinchMessage.

INDIVIDUALLY_RELEASED 

User released thumb and index finger of one hand (compare to SIMULTANEOUSLY_RELEASED). Type of BimanualPinchMessage.

DRAGGED_BIMANUAL 

User moved hands while both were pinching. Type of BimanualPinchMessage.

POINT 

User pointed at something with the index finger. Type of PointMessage.

INVALID_DATA 

This should never happen; in practice it will be ignored.

Constructor & Destructor Documentation

HandTrackingClient::HandTrackingMessage::HandTrackingMessage ( )
inlineprotected

Constructor is protected; HandTrackingMessage should only be constructed from network data using the deserialize() function.

Member Function Documentation

HandTrackingMessage * HandTrackingClient::HandTrackingMessage::deserialize ( const std::string &  data)
static

Given a line of text sent over the network connection, converts it to a valid hand message.

Callers are responsible for freeing the memory.

virtual MessageType HandTrackingClient::HandTrackingMessage::getType ( ) const
pure virtual

Returns the message type (e.g. PRESSED or DRAGGED). The message type is useful for distinguishing between similar messages, e.g., between PRESSED and RELEASED, which are both PinchMessages.

Implemented in HandTrackingClient::CalibrationMessage, HandTrackingClient::UserMessage, HandTrackingClient::WelcomeMessage, HandTrackingClient::PointMessage, and HandTrackingClient::BasicMessage.

virtual std::string HandTrackingClient::HandTrackingMessage::serialize ( ) const
pure virtual

Serializes the message to send over the network.

Developers should not need to worry about this function unless they write their own networking code.

Implemented in HandTrackingClient::CalibrationMessage, HandTrackingClient::UserMessage, HandTrackingClient::WelcomeMessage, HandTrackingClient::PoseMessage, HandTrackingClient::PointMessage, HandTrackingClient::BimanualPinchMessage, HandTrackingClient::PinchMessage, and HandTrackingClient::BasicMessage.


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