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

A fully processed sample from the computer vision component. More...

#include <MultiTouch/MultiTouch.hpp>

Public Member Functions

const std::shared_ptr
< MultiTouch::CVResults > 
findCVResults (const QString &type) const
 Gets a handle to some CVExtension results. More...
 
MultiTouch::Finger findFinger (long id) const
 Finds a finger with a given id. More...
 
MultiTouch::Hand findHand (long id) const
 Finds a hand with the given id. More...
 
MultiTouch::Marker findMarker (long id) const
 Finds a marker, based on its id If the sample does not contain a marker with the given id, then a null marker is returned, see Marker::isNull. More...
 
MultiTouch::Pen findPen (long id) const
 Find a pen by its id. More...
 
MultiTouch::TrackedObject findTrackedObject (long id)
 Find a tracked object by its id. More...
 
MultiTouch::Finger finger (size_t n) const
 Returns the nth finger. More...
 
size_t fingerCount () const
 Returns the number of fingers. More...
 
MultiTouch::Hand hand (size_t n) const
 Returns the nth hand. More...
 
size_t handCount () const
 Returns the number of hands. More...
 
int index () const
 Returns the index of this sample that is monotonically increasing and unique for each sample. More...
 
bool isNull () const
 Check if the sample is invalid. More...
 
MultiTouch::Marker marker (size_t n) const
 Returns the nth marker. More...
 
size_t markerCount () const
 Returns the number of markers. More...
 
MultiTouch::Pen pen (size_t n) const
 Return the nth pen. More...
 
size_t penCount () const
 Returns the number of pens in the sample. More...
 
 Sample (__Sample *self=0)
 Constructs a sample. More...
 
MultiTouch::TrackedObject trackedObject (size_t n) const
 Return the nth tracked object. More...
 
size_t trackedObjectCount () const
 Return the number of tracked objects in the sample. More...
 
void write (FILE *f) const
 Writes the contents of this sample to the file. More...
 
void write (Radiant::BinaryData *bd, int version) const
 Writes the contents of this sample to data buffer. More...
 
 ~Sample ()
 Destructor.
 

Detailed Description

A fully processed sample from the computer vision component.

A sample contains all the fingers, hands markers and pens that could be seen with the multiple cameras during one frame. The MultiTouch::Hand, MultiTouch::Finger, MultiTouch::Marker and MultiTouch::Pen objects that are returned by the sample are valid until the next time the Screen::update function is called. After the update call, you should reload all of the objects, since their validity is no longer guaranteed.

Constructor & Destructor Documentation

MultiTouch::Sample::Sample ( __Sample *  self = 0)
inline

Constructs a sample.

Parameters
selfData for constructing the sample

Member Function Documentation

const std::shared_ptr<MultiTouch::CVResults> MultiTouch::Sample::findCVResults ( const QString &  type) const

Gets a handle to some CVExtension results.

This method is used to gain access to the results that the CVResults objects encapsulate (which have been originally calculated by CVExtension objects).

Parameters
typeCV extension type whose results to query
Returns
result for the matching CV extension or null if no match is found
MultiTouch::Finger MultiTouch::Sample::findFinger ( long  id) const

Finds a finger with a given id.

If the sample does not contain a finger with the given id, then a null finger is returned, see Finger::isNull.

Parameters
idid to search for
Returns
finger with the matching id or null finger
MultiTouch::Hand MultiTouch::Sample::findHand ( long  id) const

Finds a hand with the given id.

If the sample does not contain a hand with the given id, then a null hand is returned, see Hand::isNull.

Parameters
idhand id to search for
Returns
hand with the matching the id or null hand
MultiTouch::Marker MultiTouch::Sample::findMarker ( long  id) const

Finds a marker, based on its id If the sample does not contain a marker with the given id, then a null marker is returned, see Marker::isNull.

Parameters
idmarker id to search for
Returns
marker with the matching id or null marker
MultiTouch::Pen MultiTouch::Sample::findPen ( long  id) const

Find a pen by its id.

Parameters
idpen id
Returns
pen with the given id or null pen if not found
MultiTouch::TrackedObject MultiTouch::Sample::findTrackedObject ( long  id)

Find a tracked object by its id.

Parameters
idobject id
Returns
tracked object or null object if not found
MultiTouch::Finger MultiTouch::Sample::finger ( size_t  n) const

Returns the nth finger.

Returns null finger if given index is too large.

See Also
Finger::isNull
Parameters
nfinger index
Returns
finger with the given index
size_t MultiTouch::Sample::fingerCount ( ) const

Returns the number of fingers.

Returns
number of fingers in the sample
MultiTouch::Hand MultiTouch::Sample::hand ( size_t  n) const

Returns the nth hand.

Parameters
nhand index
Returns
hand with the given index
size_t MultiTouch::Sample::handCount ( ) const

Returns the number of hands.

Returns
number of hands in the sample
int MultiTouch::Sample::index ( ) const

Returns the index of this sample that is monotonically increasing and unique for each sample.

Returns
Sample index
bool MultiTouch::Sample::isNull ( ) const
inline

Check if the sample is invalid.

Returns
true if the data is null; otherwise false
MultiTouch::Marker MultiTouch::Sample::marker ( size_t  n) const

Returns the nth marker.

Parameters
nindex of the marker
Returns
marker with the given index
size_t MultiTouch::Sample::markerCount ( ) const

Returns the number of markers.

Returns
number of markers in the sample
MultiTouch::Pen MultiTouch::Sample::pen ( size_t  n) const

Return the nth pen.

Parameters
npen index
Returns
pen with the given index
size_t MultiTouch::Sample::penCount ( ) const

Returns the number of pens in the sample.

Returns
number of markers in the sample
MultiTouch::TrackedObject MultiTouch::Sample::trackedObject ( size_t  n) const

Return the nth tracked object.

Returns null object if given index is too large.

Parameters
ntracked object index
Returns
nth tracked object
size_t MultiTouch::Sample::trackedObjectCount ( ) const

Return the number of tracked objects in the sample.

Returns
number of tracked objects
void MultiTouch::Sample::write ( FILE *  f) const

Writes the contents of this sample to the file.

Parameters
fFile to write
void MultiTouch::Sample::write ( Radiant::BinaryData bd,
int  version 
) const

Writes the contents of this sample to data buffer.

This function is mostly for internal use and is used to support network bridging.

Parameters
bdThis sample is written into this object
versionprotocol version