HandListΒΆ

The HandList class represents a list of Hand objects. More...

Inherits Interface.

Public Types

typedef ConstListIterator< HandList, Handconst_iterator
 A C++ iterator type for this HandList objects. More...
 

Public Member Functions

HandListappend (const HandList &other)
 Appends the members of the specified HandList to this HandList. More...
 
const_iterator begin () const
 The C++ iterator set to the beginning of this HandList. More...
 
int count () const
 Returns the number of hands in this list. More...
 
const_iterator end () const
 The C++ iterator set to the end of this HandList. More...
 
Hand 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...
 
 HandList (const ListBaseImplementation< Hand > &)
 
 HandList ()
 Constructs an empty list of hands. More...
 
bool isEmpty () const
 Reports whether the list is empty. More...
 
Hand 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...
 
Hand operator[] (int index) const
 Access a list member by its position in the list. More...
 
Hand 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 HandList class represents a list of Hand objects.

Get a HandList object by calling Frame::hands().

Leap::HandList allHands = frame.hands();
Since
1.0

Member Typedef Documentation

typedef ConstListIterator<HandList, Hand> const_iterator

A C++ iterator type for this HandList objects.

Leap::HandList hands = frame.hands();
for(Leap::HandList::const_iterator hl = hands.begin(); hl != hands.end(); hl++)
std::cout << *hl << std::endl;
Since
1.0

Constructor & Destructor Documentation

HandList ( const ListBaseImplementation< Hand > &  )
HandList ( )

Constructs an empty list of hands.

Since
1.0

Member Function Documentation

HandList& append ( const HandList other)

Appends the members of the specified HandList to this HandList.

Parameters
otherA HandList object containing Hand objects to append to the end of this HandList.
const_iterator begin ( ) const

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

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

Returns the number of hands in this list.

if (frame.hands().count() > 0) {
//Process hand data...
}
Returns
The number of hands in this list.
Since
1.0
const_iterator end ( ) const

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

Leap::HandList hands = frame.hands();
for(Leap::HandList::const_iterator hl = hands.begin(); hl != hands.end(); hl++)
std::cout << *hl << std::endl;
Since
1.0
Hand 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::Hand frontHand = frame.hands().frontmost();
Returns
The frontmost hand, or invalid if list is empty.
Since
1.0
bool isEmpty ( ) const

Reports whether the list is empty.

if (!frame.hands().isEmpty()) {
//Process hands...
}
Returns
True, if the list has no members.
Since
1.0
Hand 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).

Note: to determine whether a hand is the left hand, use the Hand::isLeft() function.

Leap::Hand furthestLeft = frame.hands().leftmost();
Returns
The leftmost hand, or invalid if list is empty.
Since
1.0
Hand operator[] ( int  index) const

Access a list member by its position in the list.

Leap::Hand firstInList = frame.hands()[0];
Parameters
indexThe zero-based list position index.
Returns
The Hand object at the specified index.
Since
1.0
Hand 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).

Note: to determine whether a hand is the right hand, use the Hand::isRight() function.

Leap::Hand furthestRight = frame.hands().rightmost();
Returns
The rightmost hand, or invalid if list is empty.
Since
1.0