|
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 |
|
|
4
|
10 |
import TUIO.*;
|
|
|
11 |
TuioProcessing tuioClient;
|
|
|
12 |
|
|
|
13 |
/*FONCTION D'INITIALISATION
|
|
|
14 |
Entrée :
|
|
|
15 |
Sortie : Création de la fenêtre et du client TUIO*/
|
|
|
16 |
void setup()
|
|
|
17 |
{
|
|
|
18 |
size (640, 480);
|
|
|
19 |
showMask();
|
|
|
20 |
tuioClient = new TuioProcessing(this, 80);
|
|
|
21 |
textAlign(CENTER);
|
|
|
22 |
imageMode(CENTER);
|
|
|
23 |
smooth();
|
|
|
24 |
}
|
|
|
25 |
|
|
|
26 |
/*FONCTION DE DESSIN
|
|
|
27 |
Entrée :
|
|
|
28 |
Sortie : Appel à la fonction de traitement d'input du serveur toutes les n millisecondes*/
|
|
|
29 |
void draw()
|
|
|
30 |
{
|
|
|
31 |
fill(0);
|
|
8
|
32 |
tuioInput();
|
|
4
|
33 |
noStroke();
|
|
|
34 |
}
|
|
|
35 |
|
|
|
36 |
/*FONCTION DE GENERATION DU MASQUE
|
|
|
37 |
Entrée :
|
|
|
38 |
Sortie : Place des rectangles autour de la zone de dessin*/
|
|
|
39 |
void showMask()
|
|
|
40 |
{
|
|
|
41 |
background(0);
|
|
|
42 |
fill(255);
|
|
|
43 |
rect(0, 80, width, height-130);
|
|
|
44 |
}
|
|
|
45 |
|
|
|
46 |
/*FONCTION D'AFFICHAGE DU CODE DE LA GESTURE DETECTEE
|
|
|
47 |
Entree :
|
|
|
48 |
Sortie : Affichage du code de la gesture*/
|
|
|
49 |
void showGestureMessage(TuioString tstr)
|
|
|
50 |
{
|
|
|
51 |
text("Gesture détectée : " + tstr.getMessage(), width/2 - 20, 20);
|
|
|
52 |
}
|
|
|
53 |
|