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