TUIO
Class TuioPoint

java.lang.Object
  extended by TUIO.TuioPoint
Direct Known Subclasses:
TuioCursor, TuioObject

public class TuioPoint
extends java.lang.Object

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


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 TuioPoint represented as TuioTime (time since session start)
protected  float xpos
          X coordinate, representated as a floating point value in a range of 0..1
protected  float ypos
          Y coordinate, representated as a floating point value in a range of 0..1
 
Constructor Summary
TuioPoint()
          The default constructor takes no arguments and sets its coordinate attributes to zero and its time stamp to the current session time.
TuioPoint(float xp, float yp)
          This constructor takes two floating point coordinate arguments and sets its coordinate attributes to these values and its time stamp to the current session time.
TuioPoint(TuioPoint tpoint)
          This constructor takes a TuioPoint argument and sets its coordinate attributes to the coordinates of the provided TuioPoint and its time stamp to the current session time.
TuioPoint(TuioTime ttime, float xp, float yp)
          This constructor takes a TuioTime object and two 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(float xp, float yp)
          Returns the angle to the provided coordinates
 float getAngle(TuioPoint tpoint)
          Returns the angle to the provided TuioPoint
 float getAngleDegrees(float xp, float yp)
          Returns the angle in degrees to the provided coordinates
 float getAngleDegrees(TuioPoint tpoint)
          Returns the angle in degrees to the provided TuioPoint
 float getDistance(float xp, float yp)
          Returns the distance to the provided coordinates
 float getDistance(TuioPoint tpoint)
          Returns the distance to the provided TuioPoint
 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.
 TuioTime getStartTime()
          Returns the start time of this TuioPoint as TuioTime.
 TuioTime getTuioTime()
          Returns the time stamp of this TuioPoint as TuioTime.
 float getX()
          Returns the X coordinate of this TuioPoint.
 float getY()
          Returns the Y coordinate of this TuioPoint.
 void update(float xp, float yp)
          Takes two floating point coordinate arguments and updates its coordinate attributes to the coordinates of the provided TuioPoint and leaves its time stamp unchanged.
 void update(TuioPoint tpoint)
          Takes a TuioPoint argument and updates its coordinate attributes to the coordinates of the provided TuioPoint and leaves its time stamp unchanged.
 void update(TuioTime ttime, float xp, float yp)
          Takes a TuioTime object and two floating point coordinate arguments and updates its coordinate attributes to the coordinates of the provided TuioPoint 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

xpos

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


ypos

protected float ypos
Y coordinate, representated 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 TuioPoint represented as TuioTime (time since session start)

Constructor Detail

TuioPoint

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


TuioPoint

public TuioPoint(float xp,
                 float yp)
This constructor takes two 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

TuioPoint

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

Parameters:
tpoint - the TuioPoint to assign

TuioPoint

public TuioPoint(TuioTime ttime,
                 float xp,
                 float yp)
This constructor takes a TuioTime object and two 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
Method Detail

update

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

Parameters:
tpoint - the TuioPoint to assign

update

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

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

update

public void update(TuioTime ttime,
                   float xp,
                   float yp)
Takes a TuioTime object and two floating point coordinate arguments and updates its coordinate attributes to the coordinates of the provided TuioPoint 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

getX

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

Returns:
the X coordinate of this TuioPoint

getY

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

Returns:
the Y coordinate of this TuioPoint

getDistance

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

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

getDistance

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

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

getAngle

public float getAngle(float xp,
                      float yp)
Returns the angle to the provided coordinates

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

getAngle

public float getAngle(TuioPoint tpoint)
Returns the angle to the provided TuioPoint

Parameters:
tpoint - the distant TuioPoint
Returns:
the angle to the provided TuioPoint

getAngleDegrees

public float getAngleDegrees(float xp,
                             float yp)
Returns the angle in degrees to the provided coordinates

Parameters:
xp - the X coordinate of the distant point
yp - the Y coordinate of the distant point
Returns:
the angle in degrees to the provided TuioPoint

getAngleDegrees

public float getAngleDegrees(TuioPoint tpoint)
Returns the angle in degrees to the provided TuioPoint

Parameters:
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 TuioPoint 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 TuioPoint in pixels relative to the provided screen height

getTuioTime

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

Returns:
the time stamp of this TuioPoint as TuioTime

getStartTime

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

Returns:
the start time of this TuioPoint as TuioTime