27 extern int TUIO_CURSOR_ADD_CB;
28 extern int TUIO_CURSOR_REMOVE_CB;
29 extern int TUIO_CURSOR_UPDATE_CB;
30 extern int TUIO_OBJECT_ADD_CB;
31 extern int TUIO_OBJECT_REMOVE_CB;
32 extern int TUIO_OBJECT_UPDATE_CB;
38 m_tuioClient =
new TUIO::TuioClient(m_port);
39 m_tuioClient->addTuioListener(
this);
44 if(m_tuioClient->isConnected())
45 m_tuioClient->disconnect();
46 SAFE_DELETE(m_tuioClient);
51 m_tuioClient->connect();
52 return m_tuioClient->isConnected();
57 m_tuioClient->disconnect();
62 return m_tuioClient->isConnected();
65 void STuioClient::addTuioObject(TUIO::TuioObject *tobj)
67 SCbData* data =
new SCbData(tobj->getSymbolID(), tobj->getX(), tobj->getY(), tobj->getAngle(), tobj->getXSpeed(), tobj->getYSpeed(), tobj->getRotationSpeed());
68 OBJpostEvent(TUIO_OBJECT_ADD_CB, SCOL_PTR
this, (
int)data);
71 void STuioClient::updateTuioObject(TUIO::TuioObject *tobj)
73 SCbData* data =
new SCbData(tobj->getSymbolID(), tobj->getX(), tobj->getY(), tobj->getAngle(), tobj->getXSpeed(), tobj->getYSpeed(), tobj->getRotationSpeed());
74 OBJpostEvent(TUIO_OBJECT_UPDATE_CB, SCOL_PTR
this, (
int)data);
77 void STuioClient::removeTuioObject(TUIO::TuioObject *tobj)
79 OBJpostEvent(TUIO_OBJECT_REMOVE_CB, SCOL_PTR
this, (
int)tobj->getSymbolID());
82 void STuioClient::addTuioCursor(TUIO::TuioCursor *tcur)
84 SCbData* data =
new SCbData(tcur->getCursorID(), tcur->getX(), tcur->getY(), tcur->getXSpeed(), tcur->getYSpeed());
85 OBJpostEvent(TUIO_CURSOR_ADD_CB, SCOL_PTR
this, (
int)data);
88 void STuioClient::updateTuioCursor(TUIO::TuioCursor *tcur)
90 SCbData* data =
new SCbData(tcur->getCursorID(), tcur->getX(), tcur->getY(), tcur->getXSpeed(), tcur->getYSpeed());
91 OBJpostEvent(TUIO_CURSOR_UPDATE_CB, SCOL_PTR
this, (
int)data);
94 void STuioClient::removeTuioCursor(TUIO::TuioCursor *tcur)
96 OBJpostEvent(TUIO_CURSOR_REMOVE_CB, SCOL_PTR
this, (
int)tcur->getCursorID());
100 void STuioClient::addTuioBlob(TUIO::TuioBlob *tblb)
105 void STuioClient::updateTuioBlob(TUIO::TuioBlob *tblb)
110 void STuioClient::removeTuioBlob(TUIO::TuioBlob *tblb)
115 void STuioClient::refresh(TUIO::TuioTime frameTime)