© 2006-2007 ETH Zurich

org.ximtec.igesture.io.tuio.tuio3D
Class TuioPoint3D

java.lang.Object
  extended by org.ximtec.igesture.io.tuio.tuio3D.TuioPoint3D
All Implemented Interfaces:
AbstractTuioPoint
Direct Known Subclasses:
TuioCursor3D, TuioObject3D

public class TuioPoint3D
extends Object
implements AbstractTuioPoint

The TuioPoint3D class on the one hand is a simple container and utility class to handle TUIO positions in general, on the other hand the TuioPoint3D is the base class for the TuioCursor3D and TuioObject3D classes.

Version:
1.4
Author:
Martin Kaltenbrunner, Bjorn Puype

Field Summary
protected  TuioTime currentTime
          The time stamp of the last update represented as TuioTime (time since session start)
protected  TuioTime startTime
          The creation time of this TuioPoint3D represented as TuioTime (time since session start)
protected  float xpos
          X coordinate, represented as a floating point value in a range of 0..1
static int XY
          XY plane
static int XZ
          XZ plane
protected  float ypos
          Y coordinate, represented as a floating point value in a range of 0..1
static int YZ
          YZ plane
protected  float zpos
          Z coordinate, represented as a floating point value in a range of 0..1
 
Constructor Summary
TuioPoint3D()
          The default constructor takes no arguments and sets its coordinate attributes to zero and its time stamp to the current session time.
TuioPoint3D(float xp, float yp, float zp)
          This constructor takes three floating point coordinate arguments and sets its coordinate attributes to these values and its time stamp to the current session time.
TuioPoint3D(TuioPoint3D tpoint)
          This constructor takes a TuioPoint3D argument and sets its coordinate attributes to the coordinates of the provided TuioPoint3D and its time stamp to the current session time.
TuioPoint3D(TuioTime ttime, float xp, float yp, float zp)
          This constructor takes a TuioTime object and three floating point coordinate arguments and sets its coordinate attributes to these values and its time stamp to the provided TUIO time object.
 
Method Summary
 float getAngle(int planes, float ap, float bp)
          Returns the angle to the provided coordinates
 float getAngle(int planes, TuioPoint3D tpoint)
          Returns the angle to the provided TuioPoint3D
 float getAngleDegrees(int planes, float ap, float bp)
          Returns the angle in degrees to the provided coordinates
 float getAngleDegrees(int planes, TuioPoint3D tpoint)
          Returns the angle in degrees to the provided TuioPoint
 float getDistance(float xp, float yp, float zp)
          Returns the distance to the provided coordinates
 float getDistance(TuioPoint3D tpoint)
          Returns the distance to the provided TuioPoint3D
 int getScreenX(int width)
          Returns the X coordinate in pixels relative to the provided screen width.
 int getScreenY(int height)
          Returns the Y coordinate in pixels relative to the provided screen height.
 int getScreenZ(int z)
           
 TuioTime getStartTime()
          Returns the start time of this TuioPoint3D as TuioTime.
 TuioTime getTuioTime()
          Returns the time stamp of this TuioPoint3D as TuioTime.
 float getX()
          Returns the X coordinate of this TuioPoint3D.
 float getY()
          Returns the Y coordinate of this TuioPoint3D.
 float getZ()
          Returns the Z coordinate of this TuioPoint3D.
 void update(float xp, float yp, float zp)
          Takes three floating point coordinate arguments and updates its coordinate attributes to the coordinates of the provided TuioPoint3D and leaves its time stamp unchanged.
 void update(TuioPoint3D tpoint)
          Takes a TuioPoint3D argument and updates its coordinate attributes to the coordinates of the provided TuioPoint3D and leaves its time stamp unchanged.
 void update(TuioTime ttime, float xp, float yp, float zp)
          Takes a TuioTime object and three floating point coordinate arguments and updates its coordinate attributes to the coordinates of the provided TuioPoint3D and its time stamp to the provided TUIO time object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XY

public static final int XY
XY plane

See Also:
Constant Field Values

XZ

public static final int XZ
XZ plane

See Also:
Constant Field Values

YZ

public static final int YZ
YZ plane

See Also:
Constant Field Values

xpos

protected float xpos
X coordinate, represented as a floating point value in a range of 0..1


ypos

protected float ypos
Y coordinate, represented as a floating point value in a range of 0..1


zpos

protected float zpos
Z coordinate, represented as a floating point value in a range of 0..1


currentTime

protected TuioTime currentTime
The time stamp of the last update represented as TuioTime (time since session start)


startTime

protected TuioTime startTime
The creation time of this TuioPoint3D represented as TuioTime (time since session start)

Constructor Detail

TuioPoint3D

public TuioPoint3D()
The default constructor takes no arguments and sets its coordinate attributes to zero and its time stamp to the current session time.


TuioPoint3D

public TuioPoint3D(float xp,
                   float yp,
                   float zp)
This constructor takes three floating point coordinate arguments and sets its coordinate attributes to these values and its time stamp to the current session time.

Parameters:
xp - the X coordinate to assign
yp - the Y coordinate to assign
zp - the Z coordinate to assign

TuioPoint3D

public TuioPoint3D(TuioPoint3D tpoint)
This constructor takes a TuioPoint3D argument and sets its coordinate attributes to the coordinates of the provided TuioPoint3D and its time stamp to the current session time.

Parameters:
tpoint - the TuioPoint3D to assign

TuioPoint3D

public TuioPoint3D(TuioTime ttime,
                   float xp,
                   float yp,
                   float zp)
This constructor takes a TuioTime object and three floating point coordinate arguments and sets its coordinate attributes to these values and its time stamp to the provided TUIO time object.

Parameters:
ttime - the TuioTime to assign
xp - the X coordinate to assign
yp - the Y coordinate to assign
zp - the Z coordinate to assign
Method Detail

update

public void update(TuioPoint3D tpoint)
Takes a TuioPoint3D argument and updates its coordinate attributes to the coordinates of the provided TuioPoint3D and leaves its time stamp unchanged.

Parameters:
tpoint - the TuioPoint to assign

update

public void update(float xp,
                   float yp,
                   float zp)
Takes three floating point coordinate arguments and updates its coordinate attributes to the coordinates of the provided TuioPoint3D and leaves its time stamp unchanged.

Parameters:
xp - the X coordinate to assign
yp - the Y coordinate to assign
zp - the Z coordinate to assign

update

public void update(TuioTime ttime,
                   float xp,
                   float yp,
                   float zp)
Takes a TuioTime object and three floating point coordinate arguments and updates its coordinate attributes to the coordinates of the provided TuioPoint3D and its time stamp to the provided TUIO time object.

Parameters:
ttime - the TuioTime to assign
xp - the X coordinate to assign
yp - the Y coordinate to assign
zp - the Z coordinate to assign

getX

public float getX()
Returns the X coordinate of this TuioPoint3D.

Returns:
the X coordinate of this TuioPoint3D

getY

public float getY()
Returns the Y coordinate of this TuioPoint3D.

Returns:
the Y coordinate of this TuioPoint3D

getZ

public float getZ()
Returns the Z coordinate of this TuioPoint3D.

Returns:
the Z coordinate of this TuioPoint3D

getDistance

public float getDistance(float xp,
                         float yp,
                         float zp)
Returns the distance to the provided coordinates

Parameters:
xp - the X coordinate of the distant point
yp - the Y coordinate of the distant point
zp - the Z coordinate of the distant point
Returns:
the distance to the provided coordinates

getDistance

public float getDistance(TuioPoint3D tpoint)
Returns the distance to the provided TuioPoint3D

Parameters:
tpoint - the distant TuioPoint3D
Returns:
the distance to the provided TuioPoint3D

getAngle

public float getAngle(int planes,
                      float ap,
                      float bp)
Returns the angle to the provided coordinates

Parameters:
planes - the planes of which to calculate the angle (XY, XZ or YZ)
ap - the coordinate of the distant point in the first plane
bp - the coordinate of the distant point in the second plane
Returns:
the angle to the provided coordinates

getAngle

public float getAngle(int planes,
                      TuioPoint3D tpoint)
Returns the angle to the provided TuioPoint3D

Parameters:
planes - the planes of which to calculate the angle (XY, XZ or YZ)
tpoint - the distant TuioPoint3D
Returns:
the angle to the provided TuioPoint3D

getAngleDegrees

public float getAngleDegrees(int planes,
                             float ap,
                             float bp)
Returns the angle in degrees to the provided coordinates

Parameters:
planes - the planes of which to calculate the angle (XY, XZ or YZ)
ap - the coordinate of the first plane of the distant point
bp - the coordinate of the second plane of the distant point
Returns:
the angle in degrees to the provided TuioPoint3D

getAngleDegrees

public float getAngleDegrees(int planes,
                             TuioPoint3D tpoint)
Returns the angle in degrees to the provided TuioPoint

Parameters:
planes - the planes of which to calculate the angle (XY, XZ or YZ)
tpoint - the distant TuioPoint
Returns:
the angle in degrees to the provided TuioPoint

getScreenX

public int getScreenX(int width)
Returns the X coordinate in pixels relative to the provided screen width.

Parameters:
width - the screen width
Returns:
the X coordinate of this TuioPoint3D in pixels relative to the provided screen width

getScreenY

public int getScreenY(int height)
Returns the Y coordinate in pixels relative to the provided screen height.

Parameters:
height - the screen height
Returns:
the Y coordinate of this TuioPoint3D in pixels relative to the provided screen height

getScreenZ

public int getScreenZ(int z)

getTuioTime

public TuioTime getTuioTime()
Returns the time stamp of this TuioPoint3D as TuioTime.

Returns:
the time stamp of this TuioPoint3D as TuioTime

getStartTime

public TuioTime getStartTime()
Returns the start time of this TuioPoint3D as TuioTime.

Returns:
the start time of this TuioPoint3D as TuioTime

© 2006-2007 ETH Zurich

Copyright © 2007-2010 Global Information Systems Group, ETH Zurich. All Rights Reserved.