ToolListΒΆ

Methods:

class Leap::ToolList

The ToolList class represents a list of Tool objects.

Leap::ToolList allToolsInFrame = frame.tools();

Public Functions

ToolList & append(const ToolList & other)

Appends the members of the specified ToolList to this ToolList.

Parameters

const_iterator begin()

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

Leap::ToolList tools = frame.tools();
for(Leap::ToolList::const_iterator tl = tools.begin(); tl != tools.end(); tl++)
    std::cout << *tl << std::endl;

int count()

Returns the number of tools in this list.

if (frame.tools().count() > 0) {
    //Process tools
}

Return
The number of tools in this list.

const_iterator end()

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

Leap::ToolList tools = frame.tools();
for(Leap::ToolList::const_iterator tl = tools.begin(); tl != tools.end(); tl++)
    std::cout << *tl << std::endl;

Tool 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::Tool frontmostTool = frame.tools().frontmost();

Return
The frontmost tool, or invalid if list is empty.

bool isEmpty()

Reports whether the list is empty.

if(!frame.tools().isEmpty()){
    //Process this hand's pointables
}

Return
True, if the list has no members.

Tool 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::Tool leftmostTool = frame.tools().leftmost();

Return
The leftmost tool, or invalid if list is empty.

Tool operator[](int index)

Access a list member by its position in the list.

Leap::ToolList allTools = frame.tools();
for (int index = 0; index < allTools.count(); index++) {
    std::cout << allTools[index] << std::endl;
}

Return
The Tool object at the specified index.
Parameters
  • index -

    The zero-based list position index.

Tool 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::Tool rightmostTool = frame.tools().rightmost();

Return
The rightmost tool, or invalid if list is empty.

ToolList()

Constructs an empty list of tools.