|
0
|
1 |
/* |
|
|
2 |
TUIO Java backend - part of the reacTIVision project |
|
|
3 |
http://reactivision.sourceforge.net/ |
|
|
4 |
|
|
|
5 |
Copyright (c) 2005-2009 Martin Kaltenbrunner <mkalten@iua.upf.edu> |
|
|
6 |
|
|
|
7 |
This program is free software; you can redistribute it and/or modify |
|
|
8 |
it under the terms of the GNU General Public License as published by |
|
|
9 |
the Free Software Foundation; either version 2 of the License, or |
|
|
10 |
(at your option) any later version. |
|
|
11 |
|
|
|
12 |
This program is distributed in the hope that it will be useful, |
|
|
13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
15 |
GNU General Public License for more details. |
|
|
16 |
|
|
|
17 |
You should have received a copy of the GNU General Public License |
|
|
18 |
along with this program; if not, write to the Free Software |
|
|
19 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
|
20 |
*/ |
|
|
21 |
package TUIO; |
|
|
22 |
|
|
|
23 |
/** |
|
|
24 |
* The TuioCursor class encapsulates /tuio/2Dcur TUIO cursors. |
|
|
25 |
* |
|
|
26 |
* @author Martin Kaltenbrunner |
|
|
27 |
* @version 1.4 |
|
|
28 |
*/ |
|
|
29 |
public class TuioCursor extends TuioContainer { |
|
|
30 |
|
|
|
31 |
/** |
|
|
32 |
* The individual cursor ID number that is assigned to each TuioCursor. |
|
|
33 |
*/ |
|
|
34 |
protected int cursor_id; |
|
|
35 |
|
|
|
36 |
/** |
|
|
37 |
* This constructor takes a TuioTime argument and assigns it along with the provided |
|
|
38 |
* Session ID, Cursor ID, X and Y coordinate to the newly created TuioCursor. |
|
|
39 |
* |
|
|
40 |
* @param ttime the TuioTime to assign |
|
|
41 |
* @param si the Session ID to assign |
|
|
42 |
* @param ci the Cursor ID to assign |
|
|
43 |
* @param xp the X coordinate to assign |
|
|
44 |
* @param yp the Y coordinate to assign |
|
|
45 |
*/ |
|
|
46 |
public TuioCursor (TuioTime ttime, long si, int ci, float xp, float yp) { |
|
|
47 |
super(ttime, si,xp,yp); |
|
|
48 |
this.cursor_id = ci; |
|
|
49 |
} |
|
|
50 |
|
|
|
51 |
/** |
|
3
|
52 |
* This constructor takes a TuioTime argument and assigns it along with the provided |
|
|
53 |
* Session ID, Cursor ID, X, Y and Z coordinate to the newly created TuioCursor. |
|
|
54 |
* |
|
|
55 |
* @param ttime the TuioTime to assign |
|
|
56 |
* @param si the Session ID to assign |
|
|
57 |
* @param ci the Cursor ID to assign |
|
|
58 |
* @param xp the X coordinate to assign |
|
|
59 |
* @param yp the Y coordinate to assign |
|
|
60 |
* @param zp the Z coordinate to assign |
|
|
61 |
*/ |
|
|
62 |
public TuioCursor (TuioTime ttime, long si, int ci, float xp, float yp, float zp) { |
|
|
63 |
super(ttime, si,xp,yp,zp); |
|
|
64 |
this.cursor_id = ci; |
|
|
65 |
} |
|
|
66 |
|
|
|
67 |
/** |
|
0
|
68 |
* This constructor takes the provided Session ID, Cursor ID, X and Y coordinate |
|
|
69 |
* and assigs these values to the newly created TuioCursor. |
|
|
70 |
* |
|
|
71 |
* @param si the Session ID to assign |
|
|
72 |
* @param ci the Cursor ID to assign |
|
|
73 |
* @param xp the X coordinate to assign |
|
|
74 |
* @param yp the Y coordinate to assign |
|
|
75 |
*/ |
|
|
76 |
public TuioCursor (long si, int ci, float xp, float yp) { |
|
|
77 |
super(si,xp,yp); |
|
|
78 |
this.cursor_id = ci; |
|
|
79 |
} |
|
3
|
80 |
|
|
|
81 |
/** |
|
|
82 |
* This constructor takes the provided Session ID, Cursor ID, X, Y and Z coordinate |
|
|
83 |
* and assigs these values to the newly created TuioCursor. |
|
|
84 |
* |
|
|
85 |
* @param si the Session ID to assign |
|
|
86 |
* @param ci the Cursor ID to assign |
|
|
87 |
* @param xp the X coordinate to assign |
|
|
88 |
* @param yp the Y coordinate to assign |
|
|
89 |
* @param zp the Z coordinate to assign |
|
|
90 |
*/ |
|
|
91 |
public TuioCursor (long si, int ci, float xp, float yp, float zp) { |
|
|
92 |
super(si,xp,yp,zp); |
|
|
93 |
this.cursor_id = ci; |
|
|
94 |
} |
|
0
|
95 |
|
|
|
96 |
/** |
|
|
97 |
* This constructor takes the atttibutes of the provided TuioCursor |
|
|
98 |
* and assigs these values to the newly created TuioCursor. |
|
|
99 |
* |
|
|
100 |
* @param tcur the TuioCursor to assign |
|
|
101 |
*/ |
|
|
102 |
public TuioCursor (TuioCursor tcur) { |
|
|
103 |
super(tcur); |
|
|
104 |
this.cursor_id = tcur.getCursorID(); |
|
|
105 |
} |
|
|
106 |
|
|
|
107 |
/** |
|
|
108 |
* Returns the Cursor ID of this TuioCursor. |
|
|
109 |
* @return the Cursor ID of this TuioCursor |
|
|
110 |
*/ |
|
|
111 |
public int getCursorID() { |
|
|
112 |
return cursor_id; |
|
|
113 |
} |
|
|
114 |
|
|
|
115 |
} |