ToolListΒΆ

The ToolList class represents a list of Tool objects. More...

Inherits Interface.

Public Types

typedef ConstListIterator< ToolList, Toolconst_iterator
 A C++ iterator type for ToolList objects. More...
 

Public Member Functions

ToolListappend (const ToolList &other)
 Appends the members of the specified ToolList to this ToolList. More...
 
const_iterator begin () const
 The C++ iterator set to the beginning of this ToolList. More...
 
int count () const
 Returns the number of tools in this list. More...
 
const_iterator end () const
 The C++ iterator set to the end of this ToolList. More...
 
Tool 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...
 
Tool 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...
 
Tool operator[] (int index) const
 Access a list member by its position in the list. More...
 
Tool 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...
 
 ToolList (const ListBaseImplementation< Tool > &)
 
 ToolList ()
 Constructs an empty list of tools. More...
 

Detailed Description

The ToolList class represents a list of Tool objects.

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

Member Typedef Documentation

typedef ConstListIterator<ToolList, Tool> const_iterator

A C++ iterator type for ToolList objects.

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

Constructor & Destructor Documentation

ToolList ( const ListBaseImplementation< Tool > &  )
ToolList ( )

Constructs an empty list of tools.

Deprecated:
3.0

Member Function Documentation

ToolList& append ( const ToolList other)

Appends the members of the specified ToolList to this ToolList.

Parameters
otherA ToolList object containing Tool objects to append to the end of this ToolList.
Deprecated:
3.0
const_iterator begin ( ) const

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;
Deprecated:
3.0
int count ( ) const

Returns the number of tools in this list.

if (frame.tools().count() > 0) {
//Process tools
}
Returns
The number of tools in this list.
Deprecated:
3.0
const_iterator end ( ) const

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;
Deprecated:
3.0
Tool 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::Tool frontmostTool = frame.tools().frontmost();
Returns
The frontmost tool, or invalid if list is empty.
Deprecated:
3.0
bool isEmpty ( ) const

Reports whether the list is empty.

if(!frame.tools().isEmpty()){
//Process this hand's pointables
}
Returns
True, if the list has no members.
Deprecated:
3.0
Tool 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::Tool leftmostTool = frame.tools().leftmost();
Returns
The leftmost tool, or invalid if list is empty.
Deprecated:
3.0
Tool operator[] ( int  index) const

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;
}
Parameters
indexThe zero-based list position index.
Returns
The Tool object at the specified index.
Deprecated:
3.0
Tool 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::Tool rightmostTool = frame.tools().rightmost();
Returns
The rightmost tool, or invalid if list is empty.
Deprecated:
3.0