Methods:
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(); Leap::PointableList onHand = hand.pointables();Public Functions
- Since
- 1.0
PointableList & append(const PointableList & other)Appends the members of the specified PointableList to this PointableList.
- Since
- 1.0
- Parameters
- other -
A PointableList object containing Pointable objects to append to the end of this PointableList.
PointableList & append(const FingerList & other)Appends the members of the specified FingerList to this PointableList.
- Since
- 1.0
- Parameters
- other -
A FingerList object containing Finger objects to append to the end of this PointableList.
PointableList & append(const ToolList & other)Appends the members of the specified ToolList to this PointableList.
- Parameters
- other -
A ToolList object containing Tool objects to append to the end of this PointableList.
const_iterator begin()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()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; }
- Return
- The number of pointable entities in this list.
- Since
- 1.0
const_iterator end()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()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.
- Return
- The list of tools and extended fingers from the current list.
- Since
- 2.0
Pointable frontmost()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();
- Return
- The frontmost pointable, or invalid if list is empty.
- Since
- 1.0
bool isEmpty()Reports whether the list is empty.
if(!hand.pointables().isEmpty()){ //Process this hand's pointables }
- Return
- True, if the list has no members.
- Since
- 1.0
Pointable leftmost()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();
- Return
- The leftmost pointable, or invalid if list is empty.
- Since
- 1.0
Pointable operator[](int index)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; }
- Return
- The Pointable object at the specified index.
- Since
- 1.0
- Parameters
- index -
The zero-based list position index.
PointableList()Constructs an empty list of pointable entities.
- Since
- 1.0
Pointable rightmost()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();
- Return
- The rightmost pointable, or invalid if list is empty.
- Since
- 1.0