TUIO C++ Developer API
|
#include <TuioManager.h>
Public Member Functions | |
TuioManager () | |
~TuioManager () | |
TuioObject * | addTuioObject (int sym, float xp, float yp, float a) |
void | updateTuioObject (TuioObject *tobj, float xp, float yp, float a) |
void | removeTuioObject (TuioObject *tobj) |
void | addExternalTuioObject (TuioObject *tobj) |
void | updateExternalTuioObject (TuioObject *tobj) |
void | removeExternalTuioObject (TuioObject *tobj) |
TuioCursor * | addTuioCursor (float xp, float yp) |
void | updateTuioCursor (TuioCursor *tcur, float xp, float yp) |
void | removeTuioCursor (TuioCursor *tcur) |
void | addExternalTuioCursor (TuioCursor *tcur) |
void | updateExternalTuioCursor (TuioCursor *tcur) |
void | removeExternalTuioCursor (TuioCursor *tcur) |
TuioBlob * | addTuioBlob (float xp, float yp, float angle, float width, float height, float area) |
void | updateTuioBlob (TuioBlob *tblb, float xp, float yp, float angle, float width, float height, float area) |
void | removeTuioBlob (TuioBlob *tblb) |
void | addExternalTuioBlob (TuioBlob *tblb) |
void | updateExternalTuioBlob (TuioBlob *tblb) |
void | removeExternalTuioBlob (TuioBlob *tblb) |
void | initFrame (TuioTime ttime) |
void | commitFrame () |
long | getSessionID () |
long | getFrameID () |
TuioTime | getFrameTime () |
std::list< TuioObject * > | getUntouchedObjects () |
std::list< TuioCursor * > | getUntouchedCursors () |
std::list< TuioBlob * > | getUntouchedBlobs () |
void | stopUntouchedMovingObjects () |
void | stopUntouchedMovingCursors () |
void | stopUntouchedMovingBlobs () |
void | removeUntouchedStoppedObjects () |
void | removeUntouchedStoppedCursors () |
void | removeUntouchedStoppedBlobs () |
TuioObject * | getClosestTuioObject (float xp, float yp) |
TuioCursor * | getClosestTuioCursor (float xp, float yp) |
TuioBlob * | getClosestTuioBlob (float xp, float yp) |
void | setVerbose (bool verbose) |
bool | isVerbose () |
void | setInversion (bool ix, bool iy, bool ia) |
void | setInvertXpos (bool ix) |
void | setInvertYpos (bool iy) |
void | setInvertAngle (bool ia) |
bool | getInvertXpos () |
bool | getInvertYpos () |
bool | getInvertAngle () |
void | resetTuioObjects () |
void | resetTuioCursors () |
void | resetTuioBlobs () |
![]() | |
TuioDispatcher () | |
~TuioDispatcher () | |
void | addTuioListener (TuioListener *listener) |
void | removeTuioListener (TuioListener *listener) |
void | removeAllTuioListeners () |
std::list< TuioObject * > | getTuioObjects () |
std::list< TuioObject > | copyTuioObjects () |
std::list< TuioCursor * > | getTuioCursors () |
std::list< TuioCursor > | copyTuioCursors () |
std::list< TuioBlob * > | getTuioBlobs () |
std::list< TuioBlob > | copyTuioBlobs () |
TuioObject * | getTuioObject (long s_id) |
TuioCursor * | getTuioCursor (long s_id) |
TuioBlob * | getTuioBlob (long s_id) |
void | lockObjectList () |
void | unlockObjectList () |
void | lockCursorList () |
void | unlockCursorList () |
void | lockBlobList () |
void | unlockBlobList () |
Protected Attributes | |
std::list< TuioCursor * > | freeCursorList |
std::list< TuioCursor * > | freeCursorBuffer |
std::list< TuioBlob * > | freeBlobList |
std::list< TuioBlob * > | freeBlobBuffer |
TuioTime | currentFrameTime |
long | currentFrame |
int | maxCursorID |
int | maxBlobID |
long | sessionID |
bool | updateObject |
bool | updateCursor |
bool | updateBlob |
bool | verbose |
bool | invert_x |
bool | invert_y |
bool | invert_a |
![]() | |
std::list< TuioListener * > | listenerList |
std::list< TuioObject * > | objectList |
std::list< TuioCursor * > | cursorList |
std::list< TuioBlob * > | blobList |
pthread_mutex_t | objectMutex |
pthread_mutex_t | cursorMutex |
pthread_mutex_t | blobMutex |
The TuioManager class is the central TUIO session management component.
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.
TuioManager *manager = new TuioManager();
...
server->initFrame(TuioTime::getSessionTime());
TuioObject *tobj = server->addTuioObject(xpos,ypos, angle);
TuioCursor *tcur = server->addTuioObject(xpos,ypos);
TuioBlob *tblb = server->addTuioBlob(xpos,ypos,width,height,angle);
server->commitFrame();
...
server->initFrame(TuioTime::getSessionTime());
server->updateTuioObject(tobj, xpos,ypos, angle);
server->updateTuioCursor(tcur, xpos,ypos);
server->updateTuioBlob(tblb, xpos,ypos,width,height,angle);
server->commitFrame();
...
server->initFrame(TuioTime::getSessionTime());
server->removeTuioObject(tobj);
server->removeTuioCursor(tcur);
server->removeTuioBlob(tblb);
server->commitFrame();
TuioManager::TuioManager | ( | ) |
The default constructor creates a TuioManager
TuioManager::~TuioManager | ( | ) |
The destructor is doing nothing in particular.
void TuioManager::addExternalTuioBlob | ( | TuioBlob * | tblb | ) |
void TuioManager::addExternalTuioCursor | ( | TuioCursor * | tcur | ) |
Adds an externally managed TuioCursor
tcur | the TuioCursor to add |
void TuioManager::addExternalTuioObject | ( | TuioObject * | tobj | ) |
Adds an externally managed TuioObject to the TuioServer's internal list of active TuioObjects
tobj | the TuioObject to add |
TuioBlob * TuioManager::addTuioBlob | ( | float | xp, |
float | yp, | ||
float | angle, | ||
float | width, | ||
float | height, | ||
float | area | ||
) |
Creates a new TuioBlob based on the given arguments. The new TuioBlob is added to the TuioServer's internal list of active TuioBlobs and a reference is returned to the caller.
xp | the X coordinate to assign |
yp | the Y coordinate to assign |
angle | the angle to assign |
width | the width to assign |
height | the height to assign |
area | the area to assign |
TuioCursor * TuioManager::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 |
TuioObject * TuioManager::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 TuioManager::commitFrame | ( | ) |
Commits the current frame. Generates and sends TUIO messages of all currently active and updated TuioObjects and TuioCursors.
TuioBlob * TuioManager::getClosestTuioBlob | ( | float | xp, |
float | yp | ||
) |
TuioCursor * TuioManager::getClosestTuioCursor | ( | float | xp, |
float | yp | ||
) |
Returns the TuioCursor closest to the provided coordinates or NULL if there isn't any active TuioCursor
TuioObject * TuioManager::getClosestTuioObject | ( | float | xp, |
float | yp | ||
) |
Returns the TuioObject closest to the provided coordinates or NULL if there isn't any active TuioObject
long TuioManager::getFrameID | ( | ) |
Returns the current frame ID for external use.
TuioTime TuioManager::getFrameTime | ( | ) |
Returns the current frame ID for external use.
long TuioManager::getSessionID | ( | ) |
Returns the next available Session ID for external use.
std::list< TuioBlob * > TuioManager::getUntouchedBlobs | ( | ) |
Returns a List of all currently inactive TuioBlobs
std::list< TuioCursor * > TuioManager::getUntouchedCursors | ( | ) |
Returns a List of all currently inactive TuioCursors
std::list< TuioObject * > TuioManager::getUntouchedObjects | ( | ) |
Returns a List of all currently inactive TuioObjects
void TuioManager::initFrame | ( | TuioTime | ttime | ) |
Initializes a new frame with the given TuioTime
ttime | the frame time |
void TuioManager::removeExternalTuioBlob | ( | TuioBlob * | tblb | ) |
Removes an externally managed TuioBlob from the TuioServer's internal list of TuioBlob The referenced TuioBlob is not deleted
tblb | the TuioBlob to remove |
void TuioManager::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 TuioManager::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 |
void TuioManager::removeTuioBlob | ( | TuioBlob * | tblb | ) |
Removes the referenced TuioBlob from the TuioServer's internal list of TuioBlobs and deletes the referenced TuioBlob afterwards
tblb | the TuioBlob to remove |
void TuioManager::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 TuioManager::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 TuioManager::removeUntouchedStoppedBlobs | ( | ) |
Removes all currently inactive TuioCursors from the TuioServer's internal list of TuioBlobs
void TuioManager::removeUntouchedStoppedCursors | ( | ) |
Removes all currently inactive TuioCursors from the TuioServer's internal list of TuioCursors
void TuioManager::removeUntouchedStoppedObjects | ( | ) |
Removes all currently inactive TuioObjects from the TuioServer's internal list of TuioObjects
|
inline |
The TuioServer prints verbose TUIO event messages to the console if set to true.
verbose | print verbose messages if set to true |
void TuioManager::stopUntouchedMovingBlobs | ( | ) |
Calculates speed and acceleration values for all currently inactive TuioBlobs
void TuioManager::stopUntouchedMovingCursors | ( | ) |
Calculates speed and acceleration values for all currently inactive TuioCursors
void TuioManager::stopUntouchedMovingObjects | ( | ) |
Calculates speed and acceleration values for all currently inactive TuioObjects
void TuioManager::updateExternalTuioBlob | ( | TuioBlob * | tblb | ) |
void TuioManager::updateExternalTuioCursor | ( | TuioCursor * | tcur | ) |
Updates an externally managed TuioCursor
tcur | the TuioCursor to update |
void TuioManager::updateExternalTuioObject | ( | TuioObject * | tobj | ) |
Updates an externally managed TuioObject
tobj | the TuioObject to update |
void TuioManager::updateTuioBlob | ( | TuioBlob * | tblb, |
float | xp, | ||
float | yp, | ||
float | angle, | ||
float | width, | ||
float | height, | ||
float | area | ||
) |
Updates the referenced TuioBlob based on the given arguments.
tblb | the TuioObject to update |
xp | the X coordinate to assign |
yp | the Y coordinate to assign |
angle | the angle to assign |
width | the width to assign |
height | the height to assign |
area | the area to assign |
void TuioManager::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 TuioManager::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 |