Public Member Functions | Public Attributes | Protected Member Functions

TUIO::TuioClient Class Reference

#include <TuioClient.h>

Inheritance diagram for TUIO::TuioClient:
PacketListener

List of all members.

Public Member Functions

 TuioClient (int port=3333)
 ~TuioClient ()
void connect (bool lock=false)
void disconnect ()
bool isConnected ()
void addTuioListener (TuioListener *listener)
void removeTuioListener (TuioListener *listener)
void removeAllTuioListeners ()
std::list< TuioObject * > getTuioObjects ()
std::list< TuioCursor * > getTuioCursors ()
TuioObjectgetTuioObject (long s_id)
TuioCursorgetTuioCursor (long s_id)
void lockObjectList ()
void unlockObjectList ()
void lockCursorList ()
void unlockCursorList ()
void ProcessPacket (const char *data, int size, const IpEndpointName &remoteEndpoint)

Public Attributes

UdpListeningReceiveSocketsocket

Protected Member Functions

void ProcessBundle (const osc::ReceivedBundle &b, const IpEndpointName &remoteEndpoint)
void ProcessMessage (const osc::ReceivedMessage &message, const IpEndpointName &remoteEndpoint)
void ProcessSMTG ()

Detailed Description

The TuioClient class is the central TUIO protocol decoder component. It provides a simple callback infrastructure using the TuioListener interface. In order to receive and decode TUIO messages an instance of TuioClient needs to be created. The TuioClient instance then generates TUIO events which are broadcasted to all registered classes that implement the TuioListener interface.

TuioClient *client = new TuioClient();
client->addTuioListener(myTuioListener);
client->connect();

Author:
Martin Kaltenbrunner
Version:
1.4

Constructor & Destructor Documentation

TuioClient::TuioClient ( int  port = 3333 )

This constructor creates a TuioClient that listens to the provided port

Parameters:
portthe incoming TUIO UDP port number, defaults to 3333 if no argument is provided
TuioClient::~TuioClient (  )

The destructor is doing nothing in particular.


Member Function Documentation

void TuioClient::addTuioListener ( TuioListener listener )

Adds the provided TuioListener to the list of registered TUIO event listeners

Parameters:
listenerthe TuioListener to add
void TuioClient::connect ( bool  lock = false )

The TuioClient starts listening to TUIO messages on the configured UDP port All received TUIO messages are decoded and the resulting TUIO events are broadcasted to all registered TuioListeners

Parameters:
lockrunning in the background if set to false (default)
void TuioClient::disconnect (  )

The TuioClient stops listening to TUIO messages on the configured UDP port

TuioCursor * TuioClient::getTuioCursor ( long  s_id )

Returns the TuioCursor corresponding to the provided Session ID or NULL if the Session ID does not refer to an active TuioCursor

Returns:
an active TuioCursor corresponding to the provided Session ID or NULL
std::list< TuioCursor * > TuioClient::getTuioCursors (  )

Returns a List of all currently active TuioCursors

Returns:
a List of all currently active TuioCursors
TuioObject * TuioClient::getTuioObject ( long  s_id )

Returns the TuioObject corresponding to the provided Session ID or NULL if the Session ID does not refer to an active TuioObject

Returns:
an active TuioObject corresponding to the provided Session ID or NULL
std::list< TuioObject * > TuioClient::getTuioObjects (  )

Returns a List of all currently active TuioObjects

Returns:
a List of all currently active TuioObjects
bool TUIO::TuioClient::isConnected (  ) [inline]

Returns true if this TuioClient is currently connected.

Returns:
true if this TuioClient is currently connected
void TuioClient::lockCursorList (  )

Locks the TuioCursor list in order to avoid updates during access

void TuioClient::lockObjectList (  )

Locks the TuioObject list in order to avoid updates during access

void TuioClient::ProcessBundle ( const osc::ReceivedBundle b,
const IpEndpointName remoteEndpoint 
) [protected]
void TuioClient::ProcessMessage ( const osc::ReceivedMessage message,
const IpEndpointName remoteEndpoint 
) [protected]

The OSC callback method where all TUIO messages are received and decoded and where the TUIO event callbacks are dispatched

Parameters:
messagethe received OSC message
remoteEndpointthe received OSC message origin
void TuioClient::ProcessPacket ( const char *  data,
int  size,
const IpEndpointName remoteEndpoint 
) [virtual]

Implements PacketListener.

void TuioClient::ProcessSMTG (  ) [protected]

ProcessSMTG()

  • call the Gesture recognition() routine of SMTG Lib with touch information received from TUIO Protocol.
  • process interpreter() after gesture Recognition()

void TUIO::TuioClient::removeAllTuioListeners (  ) [inline]

Removes all TuioListener from the list of registered TUIO event listeners

void TuioClient::removeTuioListener ( TuioListener listener )

Removes the provided TuioListener from the list of registered TUIO event listeners

Parameters:
listenerthe TuioListener to remove
void TuioClient::unlockCursorList (  )

Releases the lock of the TuioCursor list

void TuioClient::unlockObjectList (  )

Releases the lock of the TuioObject list


Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines