|
9
|
1 |
/*
|
|
8
|
2 |
* This file is part of the TraKERS\Front Processing package.
|
|
|
3 |
*
|
|
|
4 |
* (c) IRI <http://www.iri.centrepompidou.fr/>
|
|
|
5 |
*
|
|
|
6 |
* For the full copyright and license information, please view the LICENSE_FRONT
|
|
|
7 |
* file that was distributed with this source code.
|
|
|
8 |
*/
|
|
|
9 |
|
|
|
10 |
/*FONCTION DE RECEPTION DES MESSAGES OSC
|
|
|
11 |
Entrée :
|
|
|
12 |
Sortie : Appel aux différentes fonctions de dessin si un message est reçu*/
|
|
|
13 |
void tuioInput()
|
|
|
14 |
{
|
|
|
15 |
Vector tuioCursorList = tuioClient.getTuioCursors();
|
|
|
16 |
|
|
|
17 |
if(tuioCursorList.size() == 1)
|
|
|
18 |
{
|
|
|
19 |
handleOneHand((TuioCursor)tuioCursorList.elementAt(0));
|
|
|
20 |
}
|
|
|
21 |
else if(tuioCursorList.size() == 2)
|
|
|
22 |
{
|
|
|
23 |
handleBothHands(tuioCursorList);
|
|
|
24 |
}
|
|
|
25 |
}
|
|
|
26 |
|
|
|
27 |
/*FONCTION DE GESTION DES COURBES POUR UNE MAIN DETECTEE
|
|
|
28 |
Entrée : Un curseur TUIO
|
|
|
29 |
Sortie : Appel aux différentes fonctions de dessin si un message est reçu*/
|
|
|
30 |
void handleOneHand(TuioCursor handCursor)
|
|
|
31 |
{
|
|
|
32 |
TuioPoint pt = handCursor.getPosition();
|
|
|
33 |
update(pt, null);
|
|
|
34 |
}
|
|
|
35 |
|
|
|
36 |
/*FONCTION DE GESTION DES COURBES POUR DEUX MAINS DETECTEES
|
|
|
37 |
Entrée : La liste des curseurs TUIO
|
|
|
38 |
Sortie : Appel aux différentes fonctions de dessin si un message est reçu*/
|
|
|
39 |
void handleBothHands(Vector tuioCursorList)
|
|
|
40 |
{
|
|
|
41 |
TuioCursor handLeftCursor = (TuioCursor)tuioCursorList.elementAt(0);
|
|
|
42 |
TuioCursor handRightCursor = (TuioCursor)tuioCursorList.elementAt(1);
|
|
|
43 |
TuioPoint _pt1, _pt2;
|
|
|
44 |
|
|
|
45 |
_pt1 = (TuioPoint)handLeftCursor.getPosition();
|
|
|
46 |
_pt2 = (TuioPoint)handRightCursor.getPosition();
|
|
|
47 |
update(_pt1, _pt2);
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
|