--- a/front_idill/extern/fajran-npTuioClient/src/client.cpp Thu Apr 12 13:09:46 2012 +0200
+++ b/front_idill/extern/fajran-npTuioClient/src/client.cpp Thu Apr 12 15:33:25 2012 +0200
@@ -15,6 +15,10 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
+/*
+ Modified by alexandre.bastien@iri.centrepompidou.fr to manage TUIO strings.
+*/
+
#include "client.h"
#include <TuioClient.h>
@@ -24,129 +28,129 @@
static inline void call(TuioEvent type, long sid, int fid, float x, float y, float a)
{
- TuioEventData data;
- data.type = type;
- data.sid = sid;
- data.fid = fid;
- data.x = x;
- data.y = y;
- data.a = a;
- tuio_callback(data);
+ TuioEventData data;
+ data.type = type;
+ data.sid = sid;
+ data.fid = fid;
+ data.x = x;
+ data.y = y;
+ data.a = a;
+ tuio_callback(data);
}
/*
-* Surchargé par alexandre.bastien@iri.centrepompidou.fr
+* Surchargé par alexandre.bastien@iri.centrepompidou.fr
*/
static inline void call(TuioEvent type, long sid, int fid, float x, float y, float z, float a)
{
- TuioEventData data;
- data.type = type;
- data.sid = sid;
- data.fid = fid;
- data.x = x;
- data.y = y;
- data.z = z;
- data.a = a;
- data.code = "";
- tuio_callback(data);
+ TuioEventData data;
+ data.type = type;
+ data.sid = sid;
+ data.fid = fid;
+ data.x = x;
+ data.y = y;
+ data.z = z;
+ data.a = a;
+ data.code = "";
+ tuio_callback(data);
}
/*
-* Ajouté par alexandre.bastien@iri.centrepompidou.fr
+* Ajouté par alexandre.bastien@iri.centrepompidou.fr
*/
static inline void call(TuioEvent type, long sid, const char* code)
{
- TuioEventData data;
- data.type = type;
- data.sid = sid;
- data.code = code;
- tuio_callback(data);
+ TuioEventData data;
+ data.type = type;
+ data.sid = sid;
+ data.code = code;
+ tuio_callback(data);
}
class Listener : public TuioListener
{
public:
- Listener() { };
- ~Listener() { };
+ Listener() { };
+ ~Listener() { };
- void addTuioObject(TuioObject *object)
- {
- call(TE_OBJECT_ADD,
- object->getSessionID(), object->getFiducialID(),
- object->getX(), object->getY(), object->getAngle());
- }
+ void addTuioObject(TuioObject *object)
+ {
+ call(TE_OBJECT_ADD,
+ object->getSessionID(), object->getFiducialID(),
+ object->getX(), object->getY(), object->getAngle());
+ }
- void updateTuioObject(TuioObject *object)
- {
- call(TE_OBJECT_UPDATE,
- object->getSessionID(), object->getFiducialID(),
- object->getX(), object->getY(), object->getAngle());
- }
+ void updateTuioObject(TuioObject *object)
+ {
+ call(TE_OBJECT_UPDATE,
+ object->getSessionID(), object->getFiducialID(),
+ object->getX(), object->getY(), object->getAngle());
+ }
- void removeTuioObject(TuioObject *object)
- {
- call(TE_OBJECT_REMOVE,
- object->getSessionID(), object->getFiducialID(),
- object->getX(), object->getY(), object->getAngle());
- }
-
- /*
- * Modifié par alexandre.bastien@iri.centrepompidou.fr
- */
- void addTuioCursor(TuioCursor *cursor)
- {
- call(TE_CURSOR_ADD,
- cursor->getSessionID(), cursor->getFingerID(),
- cursor->getX(), cursor->getY(), cursor->getZ(), 0);
- }
+ void removeTuioObject(TuioObject *object)
+ {
+ call(TE_OBJECT_REMOVE,
+ object->getSessionID(), object->getFiducialID(),
+ object->getX(), object->getY(), object->getAngle());
+ }
+
+ /*
+ * Modifié par alexandre.bastien@iri.centrepompidou.fr
+ */
+ void addTuioCursor(TuioCursor *cursor)
+ {
+ call(TE_CURSOR_ADD,
+ cursor->getSessionID(), cursor->getFingerID(),
+ cursor->getX(), cursor->getY(), cursor->getZ(), 0);
+ }
- /*
- * Modifié par alexandre.bastien@iri.centrepompidou.fr
- */
- void updateTuioCursor(TuioCursor *cursor)
- {
- call(TE_CURSOR_UPDATE,
- cursor->getSessionID(), cursor->getFingerID(),
- cursor->getX(), cursor->getY(), cursor->getZ(), 0);
- }
+ /*
+ * Modifié par alexandre.bastien@iri.centrepompidou.fr
+ */
+ void updateTuioCursor(TuioCursor *cursor)
+ {
+ call(TE_CURSOR_UPDATE,
+ cursor->getSessionID(), cursor->getFingerID(),
+ cursor->getX(), cursor->getY(), cursor->getZ(), 0);
+ }
- /*
- * Modifié par alexandre.bastien@iri.centrepompidou.fr
- */
- void removeTuioCursor(TuioCursor *cursor)
- {
- call(TE_CURSOR_REMOVE,
- cursor->getSessionID(), cursor->getFingerID(),
- cursor->getX(), cursor->getY(), cursor->getZ(), 0);
- }
+ /*
+ * Modifié par alexandre.bastien@iri.centrepompidou.fr
+ */
+ void removeTuioCursor(TuioCursor *cursor)
+ {
+ call(TE_CURSOR_REMOVE,
+ cursor->getSessionID(), cursor->getFingerID(),
+ cursor->getX(), cursor->getY(), cursor->getZ(), 0);
+ }
- /*
- * Ajouté par alexandre.bastien@iri.centrepompidou.fr
- */
- void addTuioString(TuioString *string)
- {
- call(TE_STRING_ADD, string->getSessionID(), string->getCode());
- }
+ /*
+ * Ajouté par alexandre.bastien@iri.centrepompidou.fr
+ */
+ void addTuioString(TuioString *string)
+ {
+ call(TE_STRING_ADD, string->getSessionID(), string->getCode());
+ }
- /*
- * Ajouté par alexandre.bastien@iri.centrepompidou.fr
- */
- void updateTuioString(TuioString *string)
- {
- call(TE_STRING_UPDATE, string->getSessionID(), string->getCode());
- }
+ /*
+ * Ajouté par alexandre.bastien@iri.centrepompidou.fr
+ */
+ void updateTuioString(TuioString *string)
+ {
+ call(TE_STRING_UPDATE, string->getSessionID(), string->getCode());
+ }
- /*
- * Ajouté par alexandre.bastien@iri.centrepompidou.fr
- */
- void removeTuioString(TuioString *string)
- {
- call(TE_STRING_REMOVE, string->getSessionID(), string->getCode());
- }
-
- void refresh(long timestamp)
- {
- }
+ /*
+ * Ajouté par alexandre.bastien@iri.centrepompidou.fr
+ */
+ void removeTuioString(TuioString *string)
+ {
+ call(TE_STRING_REMOVE, string->getSessionID(), string->getCode());
+ }
+
+ void refresh(long timestamp)
+ {
+ }
};
static TuioClient* client = 0;
@@ -154,26 +158,26 @@
void tuio_start(int port)
{
- if (!client) {
- listener = new Listener();
+ if (!client) {
+ listener = new Listener();
- client = new TuioClient(port);
- client->addTuioListener(listener);
- client->start();
- }
+ client = new TuioClient(port);
+ client->addTuioListener(listener);
+ client->start();
+ }
}
void tuio_stop()
{
- client->stop();
- delete listener;
- delete client;
+ client->stop();
+ delete listener;
+ delete client;
- client = 0;
- listener = 0;
+ client = 0;
+ listener = 0;
}
void t()
{
- std::cout << "t" << std::endl;
+ std::cout << "t" << std::endl;
}
\ No newline at end of file