front_idill/extern/fajran-npTuioClient/TuioClient/TuioContainer.h
changeset 24 2bdf5d51d434
parent 21 e4e5f02787a1
child 28 9ccef81f02ab
equal deleted inserted replaced
23:7372c4f249c7 24:2bdf5d51d434
    33 
    33 
    34 class TuioContainer: public TuioPoint {
    34 class TuioContainer: public TuioPoint {
    35 
    35 
    36 	protected:
    36 	protected:
    37 	long session_id;
    37 	long session_id;
    38 	float xpos, ypos;
    38 	float xpos, ypos, zpos;
    39 	float x_speed, y_speed;
    39 	float x_speed, y_speed;
    40 	float motion_speed, motion_accel;
    40 	float motion_speed, motion_accel;
    41 	std::list<TuioPoint> path;
    41 	std::list<TuioPoint> path;
    42 	
    42 	
    43 	int state;
    43 	int state;
    53 		path.push_back(p);
    53 		path.push_back(p);
    54 		
    54 		
    55 		state = TUIO_ADDED;
    55 		state = TUIO_ADDED;
    56 	};
    56 	};
    57 
    57 
       
    58 	/*
       
    59 	* Surchargé par alexandre.bastien@iri.centrepompidou.fr
       
    60 	*/
       
    61 	TuioContainer (long s_id, float xpos, float ypos, float zpos):TuioPoint(xpos,ypos,zpos) {
       
    62 		this->session_id = s_id;
       
    63 		this->x_speed = 0.0f;
       
    64 		this->y_speed = 0.0f;
       
    65 		this->motion_speed = 0.0f;
       
    66 		this->motion_accel = 0.0f;
       
    67 		TuioPoint p(xpos,ypos,zpos);
       
    68 		path.push_back(p);
       
    69 		
       
    70 		state = TUIO_ADDED;
       
    71 	};
       
    72 
       
    73 	/*
       
    74 	* Modifié par alexandre.bastien@iri.centrepompidou.fr
       
    75 	*/
    58 	TuioContainer (TuioContainer *tuioContainer):TuioPoint(tuioContainer) {
    76 	TuioContainer (TuioContainer *tuioContainer):TuioPoint(tuioContainer) {
    59 		this->session_id = tuioContainer->getSessionID();
    77 		this->session_id = tuioContainer->getSessionID();
    60 		this->x_speed = 0.0f;
    78 		this->x_speed = 0.0f;
    61 		this->y_speed = 0.0f;
    79 		this->y_speed = 0.0f;
    62 		this->motion_speed = 0.0f;
    80 		this->motion_speed = 0.0f;
    63 		this->motion_accel = 0.0f;
    81 		this->motion_accel = 0.0f;
    64 		TuioPoint p(xpos,ypos);
    82 		TuioPoint p(xpos,ypos,zpos);
    65 		path.push_back(p);
    83 		path.push_back(p);
    66 		
    84 		
    67 		state = TUIO_ADDED;
    85 		state = TUIO_ADDED;
    68 	};
    86 	};
    69 	
    87 	
    79 		path.push_back(p);
    97 		path.push_back(p);
    80 		
    98 		
    81 		state = TUIO_UPDATED;
    99 		state = TUIO_UPDATED;
    82 	};
   100 	};
    83 
   101 
       
   102 	/*
       
   103 	* Surchargé par alexandre.bastien@iri.centrepompidou.fr
       
   104 	*/
       
   105 	virtual void update (float xpos, float ypos, float zpos, float xspeed, float yspeed,float maccel) {
       
   106 		TuioPoint::update(xpos, ypos, zpos);
       
   107 		this->x_speed = xspeed;
       
   108 		this->y_speed = yspeed;
       
   109 		this->motion_speed = (float)sqrt(xspeed*xspeed+yspeed*yspeed);
       
   110 		this->motion_accel = maccel;
       
   111 		TuioPoint p(xpos,ypos,zpos);
       
   112 		path.push_back(p);
       
   113 		
       
   114 		state = TUIO_UPDATED;
       
   115 	};
       
   116 
       
   117 	/*
       
   118 	* Modifié par alexandre.bastien@iri.centrepompidou.fr
       
   119 	*/
    84 	virtual void update (TuioContainer *tuioContainer) {
   120 	virtual void update (TuioContainer *tuioContainer) {
    85 		TuioPoint::update(tuioContainer);
   121 		TuioPoint::update(tuioContainer);
    86 		this->x_speed = tuioContainer->getXSpeed();
   122 		this->x_speed = tuioContainer->getXSpeed();
    87 		this->y_speed =  tuioContainer->getYSpeed();
   123 		this->y_speed =  tuioContainer->getYSpeed();
    88 		this->motion_speed =  tuioContainer->getMotionSpeed();
   124 		this->motion_speed =  tuioContainer->getMotionSpeed();
    89 		this->motion_accel = tuioContainer->getMotionAccel();
   125 		this->motion_accel = tuioContainer->getMotionAccel();
    90 		TuioPoint p(xpos,ypos);
   126 		TuioPoint p(xpos,ypos,zpos);
    91 		path.push_back(p);
   127 		path.push_back(p);
    92 		
   128 		
    93 		state = TUIO_UPDATED;
   129 		state = TUIO_UPDATED;
    94 	};
   130 	};
    95 	
   131 	
    96 	virtual long getSessionID() { return session_id; };
   132 	virtual long getSessionID() { return session_id; };
    97 				 				 
   133 	
       
   134 	/*
       
   135 	* Modifié par alexandre.bastien@iri.centrepompidou.fr
       
   136 	*/
    98 	virtual TuioPoint getPosition() {
   137 	virtual TuioPoint getPosition() {
    99 		TuioPoint p(xpos,ypos);
   138 		TuioPoint p(xpos,ypos,zpos);
   100 		return p;
   139 		return p;
   101 	};
   140 	};
   102 
   141 
   103 	 virtual std::list<TuioPoint> getPath() {
   142 	 virtual std::list<TuioPoint> getPath() {
   104 		return path;
   143 		return path;