diff -r 6c08d4d7219e -r 9ccef81f02ab front_idill/extern/fajran-npTuioClient/TuioClient/TuioPoint.h --- a/front_idill/extern/fajran-npTuioClient/TuioClient/TuioPoint.h Thu Apr 12 13:09:46 2012 +0200 +++ b/front_idill/extern/fajran-npTuioClient/TuioClient/TuioPoint.h Thu Apr 12 15:33:25 2012 +0200 @@ -1,9 +1,9 @@ /* - TUIO C++ Library - part of the reacTIVision project - http://reactivision.sourceforge.net/ + TUIO C++ Library - part of the reacTIVision project + http://reactivision.sourceforge.net/ - Copyright (c) 2005-2008 Martin Kaltenbrunner - + Copyright (c) 2005-2008 Martin Kaltenbrunner + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -26,129 +26,129 @@ class TuioPoint { - protected: - float xpos, ypos, zpos; - long timestamp; - - public: - TuioPoint (float xpos, float ypos) { - this->xpos = xpos; - this->ypos = ypos; - timestamp = TUIO_UNDEFINED; - }; + protected: + float xpos, ypos, zpos; + long timestamp; + + public: + TuioPoint (float xpos, float ypos) { + this->xpos = xpos; + this->ypos = ypos; + timestamp = TUIO_UNDEFINED; + }; - /* - * Surchargé par alexandre.bastien@iri.centrepompidou.fr - */ - TuioPoint (float xpos, float ypos, float zpos) { - this->xpos = xpos; - this->ypos = ypos; - this->zpos = zpos; - timestamp = TUIO_UNDEFINED; - }; + /* + * Surchargé par alexandre.bastien@iri.centrepompidou.fr + */ + TuioPoint (float xpos, float ypos, float zpos) { + this->xpos = xpos; + this->ypos = ypos; + this->zpos = zpos; + timestamp = TUIO_UNDEFINED; + }; - /* - * Modifié par alexandre.bastien@iri.centrepompidou.fr - */ - TuioPoint (TuioPoint *tuioPoint) { - this->xpos = tuioPoint->getX(); - this->ypos = tuioPoint->getY(); - this->zpos = tuioPoint->getZ(); - timestamp = TUIO_UNDEFINED; - }; - - ~TuioPoint(){}; + /* + * Modifié par alexandre.bastien@iri.centrepompidou.fr + */ + TuioPoint (TuioPoint *tuioPoint) { + this->xpos = tuioPoint->getX(); + this->ypos = tuioPoint->getY(); + this->zpos = tuioPoint->getZ(); + timestamp = TUIO_UNDEFINED; + }; + + ~TuioPoint(){}; - /* - * Modifié par alexandre.bastien@iri.centrepompidou.fr - */ - void update (TuioPoint *tuioPoint) { - this->xpos = tuioPoint->getX(); - this->ypos = tuioPoint->getY(); - this->zpos = tuioPoint->getZ(); - timestamp = TUIO_UNDEFINED; - }; - - void update (float xpos, float ypos) { - this->xpos = xpos; - this->ypos = ypos; - timestamp = TUIO_UNDEFINED; - }; + /* + * Modifié par alexandre.bastien@iri.centrepompidou.fr + */ + void update (TuioPoint *tuioPoint) { + this->xpos = tuioPoint->getX(); + this->ypos = tuioPoint->getY(); + this->zpos = tuioPoint->getZ(); + timestamp = TUIO_UNDEFINED; + }; + + void update (float xpos, float ypos) { + this->xpos = xpos; + this->ypos = ypos; + timestamp = TUIO_UNDEFINED; + }; - /* - * Surchargé par alexandre.bastien@iri.centrepompidou.fr - */ - void update (float xpos, float ypos, float zpos) { - this->xpos = xpos; - this->ypos = ypos; - this->zpos = zpos; - timestamp = TUIO_UNDEFINED; - }; - - float getX() { return xpos; }; - float getY() { return ypos; }; - /* - * Ajouté par alexandre.bastien@iri.centrepompidou.fr - */ - float getZ() { return zpos; }; + /* + * Surchargé par alexandre.bastien@iri.centrepompidou.fr + */ + void update (float xpos, float ypos, float zpos) { + this->xpos = xpos; + this->ypos = ypos; + this->zpos = zpos; + timestamp = TUIO_UNDEFINED; + }; + + float getX() { return xpos; }; + float getY() { return ypos; }; + /* + * Ajouté par alexandre.bastien@iri.centrepompidou.fr + */ + float getZ() { return zpos; }; - float getDistance(float x, float y) { - float dx = xpos-x; - float dy = ypos-y; - return sqrtf(dx*dx+dy*dy); - } - - /* - * Surchargé par alexandre.bastien@iri.centrepompidou.fr - */ - float getDistance(float x, float y, float z) { - float dx = xpos-x; - float dy = ypos-y; - float dz = zpos-z; - return sqrtf(dx*dx+dy*dy+dz*dz); - } + float getDistance(float x, float y) { + float dx = xpos-x; + float dy = ypos-y; + return sqrtf(dx*dx+dy*dy); + } + + /* + * Surchargé par alexandre.bastien@iri.centrepompidou.fr + */ + float getDistance(float x, float y, float z) { + float dx = xpos-x; + float dy = ypos-y; + float dz = zpos-z; + return sqrtf(dx*dx+dy*dy+dz*dz); + } - /* - * Modifié par alexandre.bastien@iri.centrepompidou.fr - */ - float getDistance(TuioPoint *tuioPoint) { - float dx = xpos-tuioPoint->getX(); - float dy = ypos-tuioPoint->getY(); - float dz = zpos-tuioPoint->getZ(); - return sqrtf(dx*dx+dy*dy+dz*dz); - } + /* + * Modifié par alexandre.bastien@iri.centrepompidou.fr + */ + float getDistance(TuioPoint *tuioPoint) { + float dx = xpos-tuioPoint->getX(); + float dy = ypos-tuioPoint->getY(); + float dz = zpos-tuioPoint->getZ(); + return sqrtf(dx*dx+dy*dy+dz*dz); + } - /* - * Modifié par alexandre.bastien@iri.centrepompidou.fr - */ - /*float getDistance3D(TuioPoint *tuioPoint) { - float dx = xpos-tuioPoint->getX(); - float dy = ypos-tuioPoint->getY(); - float dz = zpos-tuioPoint->getZ(); - return sqrtf(dx*dx+dy*dy+dz*dz); - }*/ + /* + * Modifié par alexandre.bastien@iri.centrepompidou.fr + */ + /*float getDistance3D(TuioPoint *tuioPoint) { + float dx = xpos-tuioPoint->getX(); + float dy = ypos-tuioPoint->getY(); + float dz = zpos-tuioPoint->getZ(); + return sqrtf(dx*dx+dy*dy+dz*dz); + }*/ - float getAngle(TuioPoint *tuioPoint) { - - float side = tuioPoint->getX()-xpos; - float height = tuioPoint->getY()-ypos; - float distance = tuioPoint->getDistance(xpos,ypos); - - float angle = (float)(asin(side/distance)+M_PI/2); - if (height<0) angle = 2.0f*(float)M_PI-angle; - - return angle; - } - - float getAngleDegrees(TuioPoint *tuioPoint) { - return ((getAngle(tuioPoint)/(float)M_PI)*180.0f); - } - - float getScreenX(int w) { return xpos*w; }; - float getScreenY(int h) { return ypos*h; }; - - long getUpdateTime() { return timestamp; }; - void setUpdateTime(long timestamp) { this->timestamp = timestamp; }; + float getAngle(TuioPoint *tuioPoint) { + + float side = tuioPoint->getX()-xpos; + float height = tuioPoint->getY()-ypos; + float distance = tuioPoint->getDistance(xpos,ypos); + + float angle = (float)(asin(side/distance)+M_PI/2); + if (height<0) angle = 2.0f*(float)M_PI-angle; + + return angle; + } + + float getAngleDegrees(TuioPoint *tuioPoint) { + return ((getAngle(tuioPoint)/(float)M_PI)*180.0f); + } + + float getScreenX(int w) { return xpos*w; }; + float getScreenY(int h) { return ypos*h; }; + + long getUpdateTime() { return timestamp; }; + void setUpdateTime(long timestamp) { this->timestamp = timestamp; }; };