front_processing/src/Trakers_gestures/Trakers_gestures.pde
changeset 8 e4e7db2435f8
parent 4 f4e52a4c34b3
child 9 0f44b7360c8d
equal deleted inserted replaced
7:8a21bec5d45f 8:e4e7db2435f8
       
     1 /*
       
     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 
     1 import TUIO.*;
    10 import TUIO.*;
     2 TuioProcessing tuioClient;
    11 TuioProcessing tuioClient;
     3 
    12 
     4 /*FONCTION D'INITIALISATION
    13 /*FONCTION D'INITIALISATION
     5 Entrée :
    14 Entrée :
    18 Entrée :
    27 Entrée :
    19 Sortie : Appel à la fonction de traitement d'input du serveur toutes les n millisecondes*/
    28 Sortie : Appel à la fonction de traitement d'input du serveur toutes les n millisecondes*/
    20 void draw()
    29 void draw()
    21 {
    30 {
    22     fill(0);
    31     fill(0);
    23     tuioStringInput();
    32     tuioInput();
    24     noStroke();
    33     noStroke();
    25 }
    34 }
    26 
    35 
    27 /*FONCTION DE GENERATION DU MASQUE
    36 /*FONCTION DE GENERATION DU MASQUE
    28 Entrée :
    37 Entrée :
    32     background(0);
    41     background(0);
    33     fill(255);
    42     fill(255);
    34     rect(0, 80, width, height-130);
    43     rect(0, 80, width, height-130);
    35 }
    44 }
    36 
    45 
    37 /*FONCTION DE RECEPTION DES MESSAGES OSC
       
    38 Entrée :
       
    39 Sortie : Appel aux différentes fonctions de dessin si un message est reçu*/
       
    40 void tuioStringInput()
       
    41 {
       
    42     fill(255);
       
    43     Vector tuioStringList = tuioClient.getTuioStrings();
       
    44     if(tuioStringList == null || tuioStringList.size() <= 0)
       
    45     {
       
    46         showMask();
       
    47         text("Gesture non détectée.", width/2 - 20, 20);
       
    48     }
       
    49     else
       
    50     {
       
    51         showMask();
       
    52         showGestureMessage((TuioString)tuioStringList.elementAt(0));
       
    53     }
       
    54 }
       
    55 
       
    56 /*FONCTION D'AFFICHAGE DU CODE DE LA GESTURE DETECTEE
    46 /*FONCTION D'AFFICHAGE DU CODE DE LA GESTURE DETECTEE
    57 Entree :
    47 Entree :
    58 Sortie : Affichage du code de la gesture*/
    48 Sortie : Affichage du code de la gesture*/
    59 void showGestureMessage(TuioString tstr)
    49 void showGestureMessage(TuioString tstr)
    60 {
    50 {