GestureListΒΆ

Notice Gestures are deprecated in version 3.0 and may not behave the same as they did in earlier versions.

Methods:

class Leap::GestureList

The GestureList class represents a list of Gesture objects.

Get a GestureList object from a Frame object.

Since
1.0

Public Type

typedef ConstListIterator< GestureList , Gesture > const_iterator

A C++ iterator type for GestureList objects.

Leap::GestureList gestures = frame.gestures();
for(Leap::GestureList::const_iterator gl = gestures.begin(); gl != gestures.end(); gl++)
    std::cout << (*gl).toString() << std::endl;
Since
1.0

Public Functions

GestureList & append(const GestureList & other)

Appends the members of the specified GestureList to this GestureList.

Since
1.0
Parameters

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

Leap::GestureList gestures = frame.gestures();
for(Leap::GestureList::const_iterator gl = gestures.begin(); gl != gestures.end(); gl++)
{
    std::cout << (*gl).toString() << std::endl;
}

Since
1.0

int count()

The length of this list.

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

Return
The number of gestures in this list.
Since
1.0

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

Leap::GestureList gestures = frame.gestures();
for(Leap::GestureList::const_iterator gl = gestures.begin(); gl != gestures.end(); gl++)
    std::cout << (*gl).toString() << std::endl;

Since
1.0

GestureList()

Constructs an empty gesture list.

Since
1.0

bool isEmpty()

Reports whether the list is empty.

if (!frame.gestures().isEmpty()) {
    //Handle this frame's gesture objects
}

Return
True, if the list has no members.
Since
1.0

Gesture operator[](int index)

Access a list member by its position in the list.

Leap::GestureList allGestures = frame.gestures();
Leap::Gesture firstGesture = allGestures[0];

Return
The Gesture object at the specified index.
Since
1.0
Parameters
  • index -

    The zero-based list position index.