All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
MultiTouch::Pen Class Reference

This class represents a pen. More...

#include <MultiTouch/MultiTouch.hpp>

Public Member Functions

int age () const
 The age of pen (the number of frames it has been around). More...
 
TrackedObject::Id id () const
 Get the id of the pen. More...
 
bool isNull ()
 Check if the pen is null. More...
 
Nimble::Vector2f location () const
 Get the location of the pen. More...
 
bool operator< (const Pen &p) const
 Compare the order of pens. More...
 
bool operator== (const Pen &p) const
 Compare pen equality. More...
 
 Pen (const PenData *self=0)
 Constrct a new pen. More...
 

Friends

class TrackedObject
 

Detailed Description

This class represents a pen.

One should not store these in widgets etc, because this is a proxy object for the actual data laying inside tracker.

Examples:
PenExample.cpp.

Constructor & Destructor Documentation

MultiTouch::Pen::Pen ( const PenData *  self = 0)
inline

Constrct a new pen.

Parameters
selfData to represent with this pen. If none given object will be null.

Member Function Documentation

int MultiTouch::Pen::age ( ) const

The age of pen (the number of frames it has been around).

Returns
age of the pen in samples
TrackedObject::Id MultiTouch::Pen::id ( ) const

Get the id of the pen.

Returns
id for of this pen
bool MultiTouch::Pen::isNull ( )
inline

Check if the pen is null.

Returns
true if the pen data is null; otherwise false
Nimble::Vector2f MultiTouch::Pen::location ( ) const

Get the location of the pen.

Returns
pen location
bool MultiTouch::Pen::operator< ( const Pen p) const
inline

Compare the order of pens.

Pens are sorted by their id.

Parameters
ppen to compare
Returns
true if id of this is less than p's id
bool MultiTouch::Pen::operator== ( const Pen p) const
inline

Compare pen equality.

Pens are equal if their ids are the same.

Parameters
ppen to compare
Returns
true if the pen ids are equal; otherwise false