This class represents all different objects that can be tracked by Cornerstone, like fingers, hands, pens, and markers. More...
#include <MultiTouch/MultiTouch.hpp>
Public Types | |
| typedef long | Id |
| Object Id type. | |
Public Member Functions | |
| int | age () const |
| Get the age of the tracked object. More... | |
| Finger | asFinger () const |
| Convert the tracked object to a finger. More... | |
| Hand | asHand () const |
| Convert the tracked object to a hand. More... | |
| Marker | asMarker () const |
| Convert the tracked object to a marker. More... | |
| Pen | asPen () const |
| Convert the tracked object to a pen. More... | |
| Id | id () const |
| Get the unique id of the tracked object. More... | |
| Nimble::Vector2 | initLocation () const |
| The initial location of this object. More... | |
| bool | isNull () const |
| Check if the tracked object is null. More... | |
| bool | isVirtual () const |
| Check if the object is a virtual object. More... | |
| Nimble::Vector2 | location () const |
| Get the location of the tracked object. More... | |
| bool | operator< (const TrackedObject &p) const |
| Compare the order of tracked objects. More... | |
| bool | operator== (const TrackedObject &p) const |
| Compare tracked objects for equality. More... | |
| TrackedObject () | |
| Constructs an empty tracked object. isNull returns true for this object. | |
| TrackedObject (const TrackedData *td) | |
| Constuct a tracked object given the data. More... | |
| TrackedObject (Finger f) | |
| Construct a tracked object from the given finger. More... | |
| TrackedObject (Hand h) | |
| Construct a tracked object from the given hand. More... | |
| TrackedObject (Pen p) | |
| Construct a tracked object from the given pen. More... | |
| TrackedObject (Marker p) | |
| Construct a tracked object from the given marker. More... | |
| TrackedObjectType | type () const |
| Get the type of the tracked object. More... | |
This class represents all different objects that can be tracked by Cornerstone, like fingers, hands, pens, and markers.
One should not store these in widgets etc, because this is a proxy object for the actual data laying inside tracker.
| MultiTouch::TrackedObject::TrackedObject | ( | const TrackedData * | td | ) |
Constuct a tracked object given the data.
The data is not freed when the tracked object instance is destroyed.
| td | tracked object data |
| MultiTouch::TrackedObject::TrackedObject | ( | Finger | f | ) |
Construct a tracked object from the given finger.
| f | finger data |
| MultiTouch::TrackedObject::TrackedObject | ( | Hand | h | ) |
Construct a tracked object from the given hand.
| h | hand data |
| MultiTouch::TrackedObject::TrackedObject | ( | Pen | p | ) |
Construct a tracked object from the given pen.
| p | pen data |
| MultiTouch::TrackedObject::TrackedObject | ( | Marker | p | ) |
Construct a tracked object from the given marker.
| p | marker data |
| int MultiTouch::TrackedObject::age | ( | ) | const |
Get the age of the tracked object.
Returns the number of input samples the object has been tracked.
| Finger MultiTouch::TrackedObject::asFinger | ( | ) | const |
Convert the tracked object to a finger.
Finger object returned is null if the object type is not finger.
| Hand MultiTouch::TrackedObject::asHand | ( | ) | const |
Convert the tracked object to a hand.
hand object returned is null if the object type is not hand.
| Marker MultiTouch::TrackedObject::asMarker | ( | ) | const |
Convert the tracked object to a marker.
Marker object returned is null if the object type is not marker.
| Pen MultiTouch::TrackedObject::asPen | ( | ) | const |
Convert the tracked object to a pen.
Pen object returned is null if the object type is not pen.
| Id MultiTouch::TrackedObject::id | ( | ) | const |
Get the unique id of the tracked object.
| Nimble::Vector2 MultiTouch::TrackedObject::initLocation | ( | ) | const |
The initial location of this object.
This function returns the initial location where the object was first detected. At the moment this is only valid for Finger objects, and other object types return the "location" value.
| bool MultiTouch::TrackedObject::isNull | ( | ) | const |
Check if the tracked object is null.
Null objects are objects that have a nullptr as data.
| bool MultiTouch::TrackedObject::isVirtual | ( | ) | const |
Check if the object is a virtual object.
Virtual objects are generated manually by the user and not by the tracker.
| Nimble::Vector2 MultiTouch::TrackedObject::location | ( | ) | const |
Get the location of the tracked object.
|
inline |
Compare the order of tracked objects.
Comparison is done using ids.
| p | object to compare |
|
inline |
Compare tracked objects for equality.
Objects are equal if their ids are the same.
| p | object to compare |
| TrackedObjectType MultiTouch::TrackedObject::type | ( | ) | const |
Get the type of the tracked object.