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