TUIO C++ Developer API
TUIO::TuioManager Class Reference

#include <TuioManager.h>

Inheritance diagram for TUIO::TuioManager:
TUIO::TuioDispatcher TUIO::TuioServer

Public Member Functions

 TuioManager ()
 
 ~TuioManager ()
 
TuioObjectaddTuioObject (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)
 
TuioCursoraddTuioCursor (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)
 
TuioBlobaddTuioBlob (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 ()
 
TuioObjectgetClosestTuioObject (float xp, float yp)
 
TuioCursorgetClosestTuioCursor (float xp, float yp)
 
TuioBlobgetClosestTuioBlob (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 ()
 
- Public Member Functions inherited from TUIO::TuioDispatcher
 TuioDispatcher ()
 
 ~TuioDispatcher ()
 
void addTuioListener (TuioListener *listener)
 
void removeTuioListener (TuioListener *listener)
 
void removeAllTuioListeners ()
 
std::list< TuioObject * > getTuioObjects ()
 
std::list< TuioObjectcopyTuioObjects ()
 
std::list< TuioCursor * > getTuioCursors ()
 
std::list< TuioCursorcopyTuioCursors ()
 
std::list< TuioBlob * > getTuioBlobs ()
 
std::list< TuioBlobcopyTuioBlobs ()
 
TuioObjectgetTuioObject (long s_id)
 
TuioCursorgetTuioCursor (long s_id)
 
TuioBlobgetTuioBlob (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
 
- Protected Attributes inherited from TUIO::TuioDispatcher
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
 

Detailed Description

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();

Author
Martin Kaltenbrunner
Version
1.1.6

Constructor & Destructor Documentation

◆ TuioManager()

TuioManager::TuioManager ( )

The default constructor creates a TuioManager

◆ ~TuioManager()

TuioManager::~TuioManager ( )

The destructor is doing nothing in particular.

Member Function Documentation

◆ addExternalTuioBlob()

void TuioManager::addExternalTuioBlob ( TuioBlob tblb)

Updates an externally managed TuioBlob

Parameters
tblbthe TuioBlob to update

◆ addExternalTuioCursor()

void TuioManager::addExternalTuioCursor ( TuioCursor tcur)

Adds an externally managed TuioCursor

Parameters
tcurthe TuioCursor to add

◆ addExternalTuioObject()

void TuioManager::addExternalTuioObject ( TuioObject tobj)

Adds an externally managed TuioObject to the TuioServer's internal list of active TuioObjects

Parameters
tobjthe TuioObject to add

◆ addTuioBlob()

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.

Parameters
xpthe X coordinate to assign
ypthe Y coordinate to assign
anglethe angle to assign
widththe width to assign
heightthe height to assign
areathe area to assign
Returns
reference to the created TuioBlob

◆ addTuioCursor()

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.

Parameters
xpthe X coordinate to assign
ypthe Y coordinate to assign
Returns
reference to the created TuioCursor

◆ addTuioObject()

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.

Parameters
symthe Symbol ID to assign
xpthe X coordinate to assign
ypthe Y coordinate to assign
athe angle to assign
Returns
reference to the created TuioObject

◆ commitFrame()

void TuioManager::commitFrame ( )

Commits the current frame. Generates and sends TUIO messages of all currently active and updated TuioObjects and TuioCursors.

◆ getClosestTuioBlob()

TuioBlob * TuioManager::getClosestTuioBlob ( float  xp,
float  yp 
)

Returns the TuioBlob closest to the provided coordinates or NULL if there isn't any active TuioBlob

Returns
the closest TuioBlob corresponding to the provided coordinates or NULL

◆ getClosestTuioCursor()

TuioCursor * TuioManager::getClosestTuioCursor ( float  xp,
float  yp 
)

Returns the TuioCursor closest to the provided coordinates or NULL if there isn't any active TuioCursor

Returns
the closest TuioCursor corresponding to the provided coordinates or NULL

◆ getClosestTuioObject()

TuioObject * TuioManager::getClosestTuioObject ( float  xp,
float  yp 
)

Returns the TuioObject closest to the provided coordinates or NULL if there isn't any active TuioObject

Returns
the closest TuioObject to the provided coordinates or NULL

◆ getFrameID()

long TuioManager::getFrameID ( )

Returns the current frame ID for external use.

Returns
the current frame ID for external use

◆ getFrameTime()

TuioTime TuioManager::getFrameTime ( )

Returns the current frame ID for external use.

Returns
the current frame ID for external use

◆ getSessionID()

long TuioManager::getSessionID ( )

Returns the next available Session ID for external use.

Returns
the next available Session ID for external use

◆ getUntouchedBlobs()

std::list< TuioBlob * > TuioManager::getUntouchedBlobs ( )

Returns a List of all currently inactive TuioBlobs

Returns
a List of all currently inactive TuioBlobs

◆ getUntouchedCursors()

std::list< TuioCursor * > TuioManager::getUntouchedCursors ( )

Returns a List of all currently inactive TuioCursors

Returns
a List of all currently inactive TuioCursors

◆ getUntouchedObjects()

std::list< TuioObject * > TuioManager::getUntouchedObjects ( )

Returns a List of all currently inactive TuioObjects

Returns
a List of all currently inactive TuioObjects

◆ initFrame()

void TuioManager::initFrame ( TuioTime  ttime)

Initializes a new frame with the given TuioTime

Parameters
ttimethe frame time

◆ removeExternalTuioBlob()

void TuioManager::removeExternalTuioBlob ( TuioBlob tblb)

Removes an externally managed TuioBlob from the TuioServer's internal list of TuioBlob The referenced TuioBlob is not deleted

Parameters
tblbthe TuioBlob to remove

◆ removeExternalTuioCursor()

void TuioManager::removeExternalTuioCursor ( TuioCursor tcur)

Removes an externally managed TuioCursor from the TuioServer's internal list of TuioCursor The referenced TuioCursor is not deleted

Parameters
tcurthe TuioCursor to remove

◆ removeExternalTuioObject()

void TuioManager::removeExternalTuioObject ( TuioObject tobj)

Removes an externally managed TuioObject from the TuioServer's internal list of TuioObjects The referenced TuioObject is not deleted

Parameters
tobjthe TuioObject to remove

◆ removeTuioBlob()

void TuioManager::removeTuioBlob ( TuioBlob tblb)

Removes the referenced TuioBlob from the TuioServer's internal list of TuioBlobs and deletes the referenced TuioBlob afterwards

Parameters
tblbthe TuioBlob to remove

◆ removeTuioCursor()

void TuioManager::removeTuioCursor ( TuioCursor tcur)

Removes the referenced TuioCursor from the TuioServer's internal list of TuioCursors and deletes the referenced TuioCursor afterwards

Parameters
tcurthe TuioCursor to remove

◆ removeTuioObject()

void TuioManager::removeTuioObject ( TuioObject tobj)

Removes the referenced TuioObject from the TuioServer's internal list of TuioObjects and deletes the referenced TuioObject afterwards

Parameters
tobjthe TuioObject to remove

◆ removeUntouchedStoppedBlobs()

void TuioManager::removeUntouchedStoppedBlobs ( )

Removes all currently inactive TuioCursors from the TuioServer's internal list of TuioBlobs

◆ removeUntouchedStoppedCursors()

void TuioManager::removeUntouchedStoppedCursors ( )

Removes all currently inactive TuioCursors from the TuioServer's internal list of TuioCursors

◆ removeUntouchedStoppedObjects()

void TuioManager::removeUntouchedStoppedObjects ( )

Removes all currently inactive TuioObjects from the TuioServer's internal list of TuioObjects

◆ setVerbose()

void TUIO::TuioManager::setVerbose ( bool  verbose)
inline

The TuioServer prints verbose TUIO event messages to the console if set to true.

Parameters
verboseprint verbose messages if set to true

◆ stopUntouchedMovingBlobs()

void TuioManager::stopUntouchedMovingBlobs ( )

Calculates speed and acceleration values for all currently inactive TuioBlobs

◆ stopUntouchedMovingCursors()

void TuioManager::stopUntouchedMovingCursors ( )

Calculates speed and acceleration values for all currently inactive TuioCursors

◆ stopUntouchedMovingObjects()

void TuioManager::stopUntouchedMovingObjects ( )

Calculates speed and acceleration values for all currently inactive TuioObjects

◆ updateExternalTuioBlob()

void TuioManager::updateExternalTuioBlob ( TuioBlob tblb)

Updates an externally managed TuioBlob

Parameters
tblbthe TuioBlob to update

◆ updateExternalTuioCursor()

void TuioManager::updateExternalTuioCursor ( TuioCursor tcur)

Updates an externally managed TuioCursor

Parameters
tcurthe TuioCursor to update

◆ updateExternalTuioObject()

void TuioManager::updateExternalTuioObject ( TuioObject tobj)

Updates an externally managed TuioObject

Parameters
tobjthe TuioObject to update

◆ updateTuioBlob()

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.

Parameters
tblbthe TuioObject to update
xpthe X coordinate to assign
ypthe Y coordinate to assign
anglethe angle to assign
widththe width to assign
heightthe height to assign
areathe area to assign

◆ updateTuioCursor()

void TuioManager::updateTuioCursor ( TuioCursor tcur,
float  xp,
float  yp 
)

Updates the referenced TuioCursor based on the given arguments.

Parameters
tcurthe TuioObject to update
xpthe X coordinate to assign
ypthe Y coordinate to assign

◆ updateTuioObject()

void TuioManager::updateTuioObject ( TuioObject tobj,
float  xp,
float  yp,
float  a 
)

Updates the referenced TuioObject based on the given arguments.

Parameters
tobjthe TuioObject to update
xpthe X coordinate to assign
ypthe Y coordinate to assign
athe angle to assign

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