PointableListΒΆ

PointableList Class Reference

The PointableList class represents a list of Pointable objects. More...

Inherits Interface.

Public Types

typedef ConstListIterator< PointableList, Pointableconst_iterator
 A C++ iterator type for PointableList objects. More...
 

Public Member Functions

PointableListappend (const PointableList &other)
 Appends the members of the specified PointableList to this PointableList. More...
 
PointableListappend (const FingerList &other)
 Appends the members of the specified FingerList to this PointableList. More...
 
PointableListappend (const ToolList &other)
 Appends the members of the specified ToolList to this PointableList. More...
 
const_iterator begin () const
 The C++ iterator set to the beginning of this PointableList. More...
 
int count () const
 Returns the number of pointable entities in this list. More...
 
const_iterator end () const
 The C++ iterator set to the end of this PointableList. More...
 
PointableList extended () const
 Returns a new list containing those members of the current list that are extended. More...
 
Pointable frontmost () const
 The member of the list that is farthest to the front within the standard Leap Motion frame of reference (i.e has the smallest Z coordinate). More...
 
bool isEmpty () const
 Reports whether the list is empty. More...
 
Pointable leftmost () const
 The member of the list that is farthest to the left within the standard Leap Motion frame of reference (i.e has the smallest X coordinate). More...
 
Pointable operator[] (int index) const
 Access a list member by its position in the list. More...
 
 PointableList (const ListBaseImplementation< Pointable > &)
 
 PointableList ()
 Constructs an empty list of pointable entities. More...
 
Pointable rightmost () const
 The member of the list that is farthest to the right within the standard Leap Motion frame of reference (i.e has the largest X coordinate). More...
 

Detailed Description

The PointableList class represents a list of Pointable objects.

Pointable objects include entities that can be pointed, such as fingers and tools.

Get a PointableList object by calling Frame::pointables() or Hand::pointables().

Leap::PointableList inFrame = frame.pointables();
Since
1.0

Member Typedef Documentation

typedef ConstListIterator<PointableList, Pointable> const_iterator

A C++ iterator type for PointableList objects.

Leap::PointableList pointables = frame.pointables();
for(Leap::PointableList::const_iterator pl = pointables.begin(); pl != pointables.end(); pl++)
std::cout << *pl << std::endl;
Since
1.0

Constructor & Destructor Documentation

PointableList ( const ListBaseImplementation< Pointable > &  )

Constructs an empty list of pointable entities.

Since
1.0

Member Function Documentation

PointableList& append ( const PointableList other)

Appends the members of the specified PointableList to this PointableList.

Parameters
otherA PointableList object containing Pointable objects to append to the end of this PointableList.
Since
1.0
PointableList& append ( const FingerList other)

Appends the members of the specified FingerList to this PointableList.

Parameters
otherA FingerList object containing Finger objects to append to the end of this PointableList.
Since
1.0
PointableList& append ( const ToolList other)

Appends the members of the specified ToolList to this PointableList.

Parameters
otherA ToolList object containing Tool objects to append to the end of this PointableList.
Deprecated:
3.0
const_iterator begin ( ) const

The C++ iterator set to the beginning of this PointableList.

Leap::PointableList pointables = frame.pointables();
for(Leap::PointableList::const_iterator pl = pointables.begin(); pl != pointables.end(); pl++)
std::cout << *pl << std::endl;
Since
1.0
int count ( ) const

Returns the number of pointable entities in this list.

for (int p = 0; p < frame.pointables().count(); p++) {
std::cout << frame.pointables()[p] << std::endl;
}
Returns
The number of pointable entities in this list.
Since
1.0
const_iterator end ( ) const

The C++ iterator set to the end of this PointableList.

Leap::PointableList pointables = frame.pointables();
for(Leap::PointableList::const_iterator pl = pointables.begin(); pl != pointables.end(); pl++)
std::cout << *pl << std::endl;
Since
1.0
PointableList extended ( ) const

Returns a new list containing those members of the current list that are extended.

This includes all tools and any fingers whose isExtended() function is true.

Returns
The list of tools and extended fingers from the current list.
Since
2.0
Pointable frontmost ( ) const

The member of the list that is farthest to the front within the standard Leap Motion frame of reference (i.e has the smallest Z coordinate).

Leap::Pointable furthestFront = frame.pointables().frontmost();
Returns
The frontmost pointable, or invalid if list is empty.
Since
1.0
bool isEmpty ( ) const

Reports whether the list is empty.

if(!hand.pointables().isEmpty()){
//Process this hand's pointables
}
Returns
True, if the list has no members.
Since
1.0
Pointable leftmost ( ) const

The member of the list that is farthest to the left within the standard Leap Motion frame of reference (i.e has the smallest X coordinate).

Leap::Pointable leftmostInFrame = frame.pointables().leftmost();
Returns
The leftmost pointable, or invalid if list is empty.
Since
1.0
Pointable operator[] ( int  index) const

Access a list member by its position in the list.

Leap::PointableList pointablesOfHand = hand.pointables();
for (int index = 0; index < pointablesOfHand.count(); index++) {
std::cout << pointablesOfHand[index] << std::endl;
}
Parameters
indexThe zero-based list position index.
Returns
The Pointable object at the specified index.
Since
1.0
Pointable rightmost ( ) const

The member of the list that is farthest to the right within the standard Leap Motion frame of reference (i.e has the largest X coordinate).

Leap::Pointable rightmostInFrame = frame.pointables().rightmost();
Returns
The rightmost pointable, or invalid if list is empty.
Since
1.0