#include <TuioServer.h>
During runtime the each frame is marked with the initFrame and commitFrame methods, while the currently present TuioObjects are managed by the server with ADD, UPDATE and REMOVE methods in analogy to the TuioClient's TuioListener interface.
TuioClient *server = new TuioServer();
...
server->initFrame(TuioTime::getSessionTime());
TuioObject *tobj = server->addTuioObject(xpos,ypos, angle);
TuioCursor *tcur = server->addTuioObject(xpos,ypos);
server->commitFrame();
...
server->initFrame(TuioTime::getSessionTime());
server->updateTuioObject(tobj, xpos,ypos, angle);
server->updateTuioCursor(tcur, xpos,ypos);
server->commitFrame();
...
server->initFrame(TuioTime::getSessionTime());
server->removeTuioObject(tobj);
server->removeTuioCursor(tcur);
server->commitFrame();
TuioServer::TuioServer | ( | ) |
The default constructor creates a TuioServer that sends to the default TUIO port 3333 on localhost using the maximum packet size of 65536 bytes to use single packets on the loopback device
TuioServer::TuioServer | ( | char * | host, | |
int | port | |||
) |
This constructor creates a TuioServer that sends to the provided port on the the given host using a default packet size of 1492 bytes to deliver unfragmented UDP packets on a LAN
host | the receiving host name | |
port | the outgoing TUIO UDP port number |
TuioServer::TuioServer | ( | char * | host, | |
int | port, | |||
int | size | |||
) |
This constructor creates a TuioServer that sends to the provided port on the the given host the packet UDP size can be set to a value between 576 and 65536 bytes
host | the receiving host name | |
port | the outgoing TUIO UDP port number | |
size | the maximum UDP packet size |
TuioServer::~TuioServer | ( | ) |
The destructor is doing nothing in particular.
TuioObject * TuioServer::addTuioObject | ( | int | sym, | |
float | xp, | |||
float | yp, | |||
float | a | |||
) |
Creates a new TuioObject based on the given arguments. The new TuioObject is added to the TuioServer's internal list of active TuioObjects and a reference is returned to the caller.
sym | the Symbol ID to assign | |
xp | the X coordinate to assign | |
yp | the Y coordinate to assign | |
a | the angle to assign |
void TuioServer::updateTuioObject | ( | TuioObject * | tobj, | |
float | xp, | |||
float | yp, | |||
float | a | |||
) |
Updates the referenced TuioObject based on the given arguments.
tobj | the TuioObject to update | |
xp | the X coordinate to assign | |
yp | the Y coordinate to assign | |
a | the angle to assign |
void TuioServer::removeTuioObject | ( | TuioObject * | tobj | ) |
Removes the referenced TuioObject from the TuioServer's internal list of TuioObjects and deletes the referenced TuioObject afterwards
tobj | the TuioObject to remove |
void TuioServer::addExternalTuioObject | ( | TuioObject * | tobj | ) |
Adds an externally managed TuioObject to the TuioServer's internal list of active TuioObjects
tobj | the TuioObject to add |
void TuioServer::updateExternalTuioObject | ( | TuioObject * | tobj | ) |
void TuioServer::removeExternalTuioObject | ( | TuioObject * | tobj | ) |
Removes an externally managed TuioObject from the TuioServer's internal list of TuioObjects The referenced TuioObject is not deleted
tobj | the TuioObject to remove |
TuioCursor * TuioServer::addTuioCursor | ( | float | xp, | |
float | yp | |||
) |
Creates a new TuioCursor based on the given arguments. The new TuioCursor is added to the TuioServer's internal list of active TuioCursors and a reference is returned to the caller.
xp | the X coordinate to assign | |
yp | the Y coordinate to assign |
void TuioServer::updateTuioCursor | ( | TuioCursor * | tcur, | |
float | xp, | |||
float | yp | |||
) |
Updates the referenced TuioCursor based on the given arguments.
tcur | the TuioObject to update | |
xp | the X coordinate to assign | |
yp | the Y coordinate to assign |
void TuioServer::removeTuioCursor | ( | TuioCursor * | tcur | ) |
Removes the referenced TuioCursor from the TuioServer's internal list of TuioCursors and deletes the referenced TuioCursor afterwards
tcur | the TuioCursor to remove |
void TuioServer::addExternalTuioCursor | ( | TuioCursor * | tcur | ) |
void TuioServer::updateExternalTuioCursor | ( | TuioCursor * | tcur | ) |
void TuioServer::removeExternalTuioCursor | ( | TuioCursor * | tcur | ) |
Removes an externally managed TuioCursor from the TuioServer's internal list of TuioCursor The referenced TuioCursor is not deleted
tcur | the TuioCursor to remove |
void TuioServer::initFrame | ( | TuioTime | ttime | ) |
void TuioServer::commitFrame | ( | ) |
Commits the current frame. Generates and sends TUIO messages of all currently active and updated TuioObjects and TuioCursors.
long TuioServer::getSessionID | ( | ) |
Returns the next available Session ID for external use.
long TuioServer::getFrameID | ( | ) |
Returns the current frame ID for external use.
TuioTime TuioServer::getFrameTime | ( | ) |
Returns the current frame ID for external use.
void TuioServer::sendFullMessages | ( | ) |
Generates and sends TUIO messages of all currently active TuioObjects and TuioCursors.
void TuioServer::enablePeriodicMessages | ( | int | interval = 1 |
) |
Disables the periodic full update of all currently active TuioObjects and TuioCursors
interval | update interval in seconds, defaults to one second |
void TuioServer::disablePeriodicMessages | ( | ) |
Disables the periodic full update of all currently active TuioObjects and TuioCursors
bool TUIO::TuioServer::periodicMessagesEnabled | ( | ) | [inline] |
Returns true if the periodic full update of all currently active TuioObjects and TuioCursors is enabled.
int TUIO::TuioServer::getUpdateInterval | ( | ) | [inline] |
Returns the periodic update interval in seconds.
std::list< TuioObject * > TuioServer::getUntouchedObjects | ( | ) |
Returns a List of all currently inactive TuioObjects
std::list< TuioCursor * > TuioServer::getUntouchedCursors | ( | ) |
Returns a List of all currently inactive TuioCursors
void TuioServer::stopUntouchedMovingObjects | ( | ) |
Calculates speed and acceleration values for all currently inactive TuioObjects
void TuioServer::stopUntouchedMovingCursors | ( | ) |
Calculates speed and acceleration values for all currently inactive TuioCursors
void TuioServer::removeUntouchedStoppedObjects | ( | ) |
Removes all currently inactive TuioObjects from the TuioServer's internal list of TuioObjects
void TuioServer::removeUntouchedStoppedCursors | ( | ) |
Removes all currently inactive TuioCursors from the TuioServer's internal list of TuioCursors
std::list< TuioObject * > TuioServer::getTuioObjects | ( | ) |
Returns a List of all currently active TuioObjects
std::list< TuioCursor * > TuioServer::getTuioCursors | ( | ) |
Returns a List of all currently active TuioCursors
TuioObject * TuioServer::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
TuioCursor * TuioServer::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
bool TUIO::TuioServer::isConnected | ( | ) | [inline] |
Returns true if this TuioServer is currently connected.
void TUIO::TuioServer::setVerbose | ( | bool | verbose | ) | [inline] |
The TuioServer prints verbose TUIO event messages to the console if set to true.
verbose | verbose message output if set to true |