PointableListΒΆ

PointableList Class Reference

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

Inherits Interface, and Iterable< Pointable >.

Public Member Functions

PointableList append (PointableList other)
 Appends the members of the specified PointableList to this PointableList. More...
 
PointableList append (FingerList other)
 Appends the members of the specified FingerList to this PointableList. More...
 
PointableList append (ToolList other)
 Appends the members of the specified ToolList to this PointableList. More...
 
int count ()
 Returns the number of pointable entities in this list. More...
 
PointableList extended ()
 Returns a new list containing those members of the current list that are extended. More...
 
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). More...
 
Pointable get (int index)
 Access a list member by its position in the list. More...
 
boolean isEmpty ()
 Reports whether the list is empty. More...
 
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). More...
 
 PointableList ()
 Constructs an empty list of pointable entities. More...
 
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). 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().

PointableList inFrame = frame.pointables();
PointableList onHand = hand.pointables();
Since
1.0

Constructor & Destructor Documentation

Constructs an empty list of pointable entities.

Since
1.0

Member Function Documentation

PointableList append ( 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 ( 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 ( 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
int count ( )

Returns the number of pointable entities in this list.

for (int p = 0; p < frame.pointables().count(); p++) {
System.out.println(frame.pointables().get(p));
}
Returns
The number of pointable entities in this list.
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.

Returns
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).

Pointable furthestFront = frame.pointables().frontmost();
Returns
The frontmost pointable, or invalid if list is empty.
Since
1.0
Pointable get ( int  index)

Access a list member by its position in the list.

PointableList pointablesOfHand = hand.pointables();
for (int index = 0; index < pointablesOfHand.count(); index++) {
System.out.println(pointablesOfHand.get(index));
}
Parameters
indexThe zero-based list position index.
Returns
The Pointable object at the specified index.
Since
1.0
boolean isEmpty ( )

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 ( )

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).

Pointable leftmostInFrame = frame.pointables().leftmost();
Returns
The leftmost pointable, or invalid if list is empty.
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).

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