TUIO C++ Developer API
TuioContainer.h
1 /*
2  TUIO C++ Library
3  Copyright (c) 2005-2017 Martin Kaltenbrunner <martin@tuio.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 3.0 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library.
17 */
18 
19 #ifndef INCLUDED_TUIOCONTAINER_H
20 #define INCLUDED_TUIOCONTAINER_H
21 
22 #include "TuioPoint.h"
23 #include <list>
24 #include <string>
25 
26 #define TUIO_IDLE 0
27 #define TUIO_ADDED 1
28 #define TUIO_ACCELERATING 2
29 #define TUIO_DECELERATING 3
30 #define TUIO_ROTATING 4
31 #define TUIO_STOPPED 5
32 #define TUIO_REMOVED 6
33 
34 #define MAX_PATH_SIZE 128
35 
36 namespace TUIO {
37 
44  class LIBDECL TuioContainer: public TuioPoint {
45 
46 
47  private:
48 
49  TuioPoint *lastPoint;
50 
51  protected:
55  long session_id;
59  float x_speed;
63  float y_speed;
67  float motion_speed;
71  float motion_accel;
72  float x_accel;
73  float y_accel;
77  std::list<TuioPoint> path;
81  int state;
85  int source_id;
89  std::string source_name;
93  std::string source_addr;
94 
95  public:
96  using TuioPoint::update;
97 
107  TuioContainer (TuioTime ttime, long si, float xp, float yp);
108 
117  TuioContainer (long si, float xp, float yp);
118 
126 
130  virtual ~TuioContainer(){};
131 
139  virtual void setTuioSource(int src_id, const char *src_name, const char *src_addr);
140 
144  virtual const char* getTuioSourceName() const;
145 
149  virtual const char* getTuioSourceAddress() const;
150 
154  virtual int getTuioSourceID() const;
155 
165  virtual void update (TuioTime ttime, float xp, float yp);
166 
171  virtual void stop(TuioTime ttime);
172 
185  virtual void update (TuioTime ttime, float xp, float yp, float xs, float ys, float ma);
186 
197  virtual void update (float xp, float yp, float xs, float ys, float ma);
198 
206  virtual void update (TuioContainer *tcon);
207 
214  virtual void remove(TuioTime ttime);
215 
220  virtual long getSessionID() const;
221 
226  virtual void setSessionID(long s_id);
227 
232  virtual float getXSpeed() const;
233 
238  virtual float getYSpeed() const;
239 
244  virtual TuioPoint getPosition() const;
245 
250  virtual std::list<TuioPoint> getPath() const;
251 
256  virtual float getMotionSpeed() const;
257 
262  virtual float getMotionAccel() const;
263 
268  virtual int getTuioState() const;
269 
274  virtual bool isMoving() const;
275 
276  virtual TuioPoint predictPosition();
277  };
278 }
279 #endif
int source_id
Definition: TuioContainer.h:85
Definition: TuioContainer.h:44
Definition: TuioTime.h:48
float x_speed
Definition: TuioContainer.h:59
Definition: FlashSender.h:166
Definition: TuioPoint.h:39
float motion_accel
Definition: TuioContainer.h:71
std::string source_name
Definition: TuioContainer.h:89
long session_id
Definition: TuioContainer.h:55
float y_speed
Definition: TuioContainer.h:63
void update(TuioPoint *tpoint)
Definition: TuioPoint.cpp:59
std::list< TuioPoint > path
Definition: TuioContainer.h:77
float motion_speed
Definition: TuioContainer.h:67
std::string source_addr
Definition: TuioContainer.h:93
virtual ~TuioContainer()
Definition: TuioContainer.h:130
int state
Definition: TuioContainer.h:81