front_idill/extern/fajran-npTuioClient/TuioClient/TuioPoint.h
changeset 24 2bdf5d51d434
parent 21 e4e5f02787a1
child 25 a7b0e40bcab0
--- a/front_idill/extern/fajran-npTuioClient/TuioClient/TuioPoint.h	Fri Apr 06 11:08:26 2012 +0200
+++ b/front_idill/extern/fajran-npTuioClient/TuioClient/TuioPoint.h	Fri Apr 06 11:48:00 2012 +0200
@@ -27,7 +27,7 @@
 class TuioPoint {
 
 	protected:
-		float xpos, ypos;
+		float xpos, ypos, zpos;
 		long timestamp;
 	
 	public:
@@ -37,17 +37,35 @@
 		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
+	*/
 	void update (TuioPoint *tuioPoint) {
 		this->xpos = tuioPoint->getX();
 		this->ypos = tuioPoint->getY();
+		this->zpos = tuioPoint->getZ();
 		timestamp = TUIO_UNDEFINED;
 	};
 	
@@ -56,9 +74,23 @@
 		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; };
 
 	float getDistance(float x, float y) {
 		float dx = xpos-x;
@@ -66,12 +98,32 @@
 		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(TuioPoint *tuioPoint) {
 		float dx = xpos-tuioPoint->getX();
 		float dy = ypos-tuioPoint->getY();
 		return sqrtf(dx*dx+dy*dy);
 	}
 
+	/*
+	* Ajouté 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;