FingerListΒΆ

The FingerList class represents a list of Finger objects. More...

Inherits Interface.

Public Types

typedef ConstListIterator< FingerList, Fingerconst_iterator
 A C++ iterator type for FingerList objects. More...
 

Public Member Functions

FingerListappend (const FingerList &other)
 Appends the members of the specified FingerList to this FingerList. More...
 
const_iterator begin () const
 The C++ iterator set to the beginning of this FingerList. More...
 
int count () const
 Returns the number of fingers in this list. More...
 
const_iterator end () const
 The C++ iterator set to the end of this FingerList. More...
 
FingerList extended () const
 Returns a new list containing those fingers in the current list that are extended. More...
 
 FingerList (const ListBaseImplementation< Finger > &)
 
 FingerList ()
 Constructs an empty list of fingers. More...
 
FingerList fingerType (Finger::Type type) const
 Returns a list containing fingers from the current list of a given finger type by modifying the existing list. More...
 
Finger 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...
 
Finger 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...
 
Finger operator[] (int index) const
 Access a list member by its position in the list. More...
 
Finger 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 FingerList class represents a list of Finger objects.

Get a FingerList object by calling Frame::fingers().

Leap::FingerList allFingers = frame.fingers();
Since
1.0

Member Typedef Documentation

typedef ConstListIterator<FingerList, Finger> const_iterator

A C++ iterator type for FingerList objects.

Leap::FingerList theFingers = frame.fingers();
for(Leap::FingerList::const_iterator fl = theFingers.begin(); fl != theFingers.end(); fl++)
std::cout << *fl << std::endl;
Since
1.0

Constructor & Destructor Documentation

FingerList ( const ListBaseImplementation< Finger > &  )

Constructs an empty list of fingers.

Since
1.0

Member Function Documentation

FingerList& append ( const FingerList other)

Appends the members of the specified FingerList to this FingerList.

Parameters
otherA FingerList object containing Finger objects to append to the end of this FingerList.
Since
1.0
const_iterator begin ( ) const

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

Leap::FingerList allTheFingers = frame.fingers();
for(Leap::FingerList::const_iterator fl = allTheFingers.begin(); fl != allTheFingers.end(); fl++)
std::cout << "Finger ID: " << (*fl).id() << std::endl;
Since
1.0
int count ( ) const

Returns the number of fingers in this list.

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

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

Leap::FingerList fingersInFrame = frame.fingers();
for(Leap::FingerList::const_iterator fl = fingersInFrame.begin(); fl != fingersInFrame.end(); fl++)
std::cout << *fl << std::endl;
Since
1.0
FingerList extended ( ) const

Returns a new list containing those fingers in the current list that are extended.

Leap::FingerList extendedFingerList = hand.fingers().extended();
Returns
The list of extended fingers from the current list.
Since
2.0
FingerList fingerType ( Finger::Type  type) const

Returns a list containing fingers from the current list of a given finger type by modifying the existing list.

Leap::Finger indexFinger = indexFingerList[0]; //since there is only one per hand
Returns
The list of matching fingers from the current list.
Since
2.0
Finger 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::Finger mostForwardFinger = frame.fingers().frontmost();
Returns
The frontmost finger, or invalid if list is empty.
Since
1.0
bool isEmpty ( ) const

Reports whether the list is empty.

if (!frame.fingers().isEmpty()) {
//Use the fingers
}
Returns
True, if the list has no members.
Since
1.0
Finger 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::Finger fingerWithSmallestX = frame.fingers().leftmost();
Returns
The leftmost finger, or invalid if list is empty.
Since
1.0
Finger operator[] ( int  index) const

Access a list member by its position in the list.

Leap::Finger firstFingerInList = frame.fingers()[0];
Parameters
indexThe zero-based list position index.
Returns
The Finger object at the specified index.
Since
1.0
Finger 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::Finger fingerWithLargestX = frame.fingers().rightmost();
Returns
The rightmost finger, or invalid if list is empty.
Since
1.0