TUIO C++ Developer API
TUIO::TuioPoint Class Reference

#include <TuioPoint.h>

Inheritance diagram for TUIO::TuioPoint:
TUIO::TuioContainer TUIO::TuioBlob TUIO::TuioCursor TUIO::TuioObject

Public Member Functions

 TuioPoint (float xp, float yp)
 
 TuioPoint (TuioTime ttime, float xp, float yp)
 
 TuioPoint (TuioPoint *tpoint)
 
virtual ~TuioPoint ()
 
void update (TuioPoint *tpoint)
 
void update (float xp, float yp)
 
void update (TuioTime ttime, float xp, float yp)
 
float getX () const
 
float getY () const
 
float getDistance (float xp, float yp) const
 
float getScreenDistance (float xp, float yp, int w, int h) const
 
float getDistance (TuioPoint *tpoint) const
 
float getAngle (float xp, float yp) const
 
float getAngle (TuioPoint *tpoint) const
 
float getAngleDegrees (float xp, float yp) const
 
float getAngleDegrees (TuioPoint *tpoint) const
 
int getScreenX (int width) const
 
int getScreenY (int height) const
 
TuioTime getTuioTime () const
 
TuioTime getStartTime () const
 
void addPositionThreshold (float thresh)
 
void removePositionThreshold ()
 
void addPositionFilter (float mcut, float beta)
 
void removePositionFilter ()
 

Protected Attributes

float xpos
 
float ypos
 
TuioTime currentTime
 
TuioTime startTime
 
OneEuroFilterxposFilter
 
OneEuroFilteryposFilter
 
float posThreshold
 

Detailed Description

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.

Author
Martin Kaltenbrunner
Version
1.1.6

Constructor & Destructor Documentation

◆ TuioPoint() [1/3]

TuioPoint::TuioPoint ( float  xp,
float  yp 
)

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

◆ TuioPoint() [2/3]

TuioPoint::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
ttimethe TuioTime to assign
xpthe X coordinate to assign
ypthe Y coordinate to assign

◆ TuioPoint() [3/3]

TuioPoint::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
tpointthe TuioPoint to assign

◆ ~TuioPoint()

virtual TUIO::TuioPoint::~TuioPoint ( )
inlinevirtual

The destructor is doing nothing in particular.

Member Function Documentation

◆ getAngle() [1/2]

float TuioPoint::getAngle ( float  xp,
float  yp 
) const

Returns the angle to the provided coordinates

Parameters
xpthe X coordinate of the distant point
ypthe Y coordinate of the distant point
Returns
the angle to the provided coordinates

◆ getAngle() [2/2]

float TuioPoint::getAngle ( TuioPoint tpoint) const

Returns the angle to the provided TuioPoint

Parameters
tpointthe distant TuioPoint
Returns
the angle to the provided TuioPoint

◆ getAngleDegrees() [1/2]

float TuioPoint::getAngleDegrees ( float  xp,
float  yp 
) const

Returns the angle in degrees to the provided coordinates

Parameters
xpthe X coordinate of the distant point
ypthe Y coordinate of the distant point
Returns
the angle in degrees to the provided TuioPoint

◆ getAngleDegrees() [2/2]

float TuioPoint::getAngleDegrees ( TuioPoint tpoint) const

Returns the angle in degrees to the provided TuioPoint

Parameters
tpointthe distant TuioPoint
Returns
the angle in degrees to the provided TuioPoint

◆ getDistance() [1/2]

float TuioPoint::getDistance ( float  xp,
float  yp 
) const

Returns the distance to the provided coordinates

Parameters
xpthe X coordinate of the distant point
ypthe Y coordinate of the distant point
Returns
the distance to the provided coordinates

◆ getDistance() [2/2]

float TuioPoint::getDistance ( TuioPoint tpoint) const

Returns the distance to the provided TuioPoint

Parameters
tpointthe distant TuioPoint
Returns
the distance to the provided TuioPoint

◆ getScreenDistance()

float TuioPoint::getScreenDistance ( float  xp,
float  yp,
int  w,
int  h 
) const

Returns the distance to the provided coordinates

Parameters
xpthe X coordinate of the distant point
ypthe Y coordinate of the distant point
Returns
the distance to the provided coordinates

◆ getScreenX()

int TuioPoint::getScreenX ( int  width) const

Returns the X coordinate in pixels relative to the provided screen width.

Parameters
widththe screen width
Returns
the X coordinate of this TuioPoint in pixels relative to the provided screen width

◆ getStartTime()

TuioTime TuioPoint::getStartTime ( ) const

Returns the start time of this TuioPoint as TuioTime.

Returns
the start time of this TuioPoint as TuioTime

◆ getTuioTime()

TuioTime TuioPoint::getTuioTime ( ) const

Returns current time stamp of this TuioPoint as TuioTime

Returns
the time stamp of this TuioPoint as TuioTime

◆ getX()

float TuioPoint::getX ( ) const

Returns the X coordinate of this TuioPoint.

Returns
the X coordinate of this TuioPoint

◆ getY()

float TuioPoint::getY ( ) const

Returns the Y coordinate of this TuioPoint.

Returns
the Y coordinate of this TuioPoint

◆ update() [1/3]

void TuioPoint::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
tpointthe TuioPoint to assign

◆ update() [2/3]

void TuioPoint::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
xpthe X coordinate to assign
ypthe Y coordinate to assign

◆ update() [3/3]

void TuioPoint::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
ttimethe TuioTime to assign
xpthe X coordinate to assign
ypthe Y coordinate to assign

Member Data Documentation

◆ currentTime

TuioTime TUIO::TuioPoint::currentTime
protected

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

◆ startTime

TuioTime TUIO::TuioPoint::startTime
protected

The creation time of this TuioPoint represented as TuioTime (time since session start)

◆ xpos

float TUIO::TuioPoint::xpos
protected

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

◆ ypos

float TUIO::TuioPoint::ypos
protected

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


The documentation for this class was generated from the following files: