The Gesture class represents a recognized movement by the user. More...
Inherits Interface.
Inherited by CircleGesture, KeyTapGesture, ScreenTapGesture, and SwipeGesture.
Public Types | |
| enum | State |
| The possible gesture states. More... | |
| enum | Type |
| The supported types of gestures. More... | |
Public Member Functions | |
| int64_t | duration () const |
| The elapsed duration of the recognized movement up to the frame containing this Gesture object, in microseconds. More... | |
| float | durationSeconds () const |
| The elapsed duration in seconds. More... | |
| Frame | frame () const |
| The Frame containing this Gesture instance. More... | |
| Gesture (GestureImplementation *) | |
| Gesture () | |
| Constructs a new Gesture object. More... | |
| Gesture (const Gesture &rhs) | |
| Constructs a new copy of an Gesture object. More... | |
| HandList | hands () const |
| The list of hands associated with this Gesture, if any. More... | |
| int32_t | id () const |
| The gesture ID. More... | |
| bool | isValid () const |
| Reports whether this Gesture instance represents a valid Gesture. More... | |
| bool | operator!= (const Gesture &rhs) const |
| Compare Gesture object inequality. More... | |
| bool | operator== (const Gesture &rhs) const |
| Compare Gesture object equality. More... | |
| PointableList | pointables () const |
| The list of fingers and tools associated with this Gesture, if any. More... | |
| State | state () const |
| The gesture state. More... | |
| std::string | toString () const |
| A string containing a brief, human-readable description of this Gesture. More... | |
| Type | type () const |
| The gesture type. More... | |
Static Public Member Functions | |
| static const Gesture & | invalid () |
| Returns an invalid Gesture object. More... | |
The Gesture class represents a recognized movement by the user.
| enum State |
The possible gesture states.
| Enumerator | |
|---|---|
| STATE_INVALID |
An invalid state.
|
| STATE_START |
The gesture is starting. Just enough has happened to recognize it.
|
| STATE_UPDATE |
The gesture is in progress. (Note: not all gestures have updates).
|
| STATE_STOP |
The gesture has completed or stopped.
|
| enum Type |
The supported types of gestures.
| Enumerator | |
|---|---|
| TYPE_INVALID |
An invalid type.
|
| TYPE_SWIPE |
A straight line movement by the hand with fingers extended.
|
| TYPE_CIRCLE |
A circular movement by a finger.
|
| TYPE_SCREEN_TAP |
A forward tapping movement by a finger.
|
| TYPE_KEY_TAP |
A downward tapping movement by a finger.
|
| Gesture | ( | GestureImplementation * | ) |
| Gesture | ( | ) |
Constructs a new copy of an Gesture object.
| int64_t duration | ( | ) | const |
The elapsed duration of the recognized movement up to the frame containing this Gesture object, in microseconds.
The duration reported for the first Gesture in the sequence (with the STATE_START state) will typically be a small positive number since the movement must progress far enough for the Leap Motion software to recognize it as an intentional gesture.
| float durationSeconds | ( | ) | const |
The elapsed duration in seconds.
| Frame frame | ( | ) | const |
The Frame containing this Gesture instance.
| HandList hands | ( | ) | const |
The list of hands associated with this Gesture, if any.
If no hands are related to this gesture, the list is empty.
| int32_t id | ( | ) | const |
The gesture ID.
All Gesture objects belonging to the same recognized movement share the same ID value. Use the ID value with the Frame::gesture() method to find updates related to this Gesture object in subsequent frames.
|
static |
Returns an invalid Gesture object.
| bool isValid | ( | ) | const |
Reports whether this Gesture instance represents a valid Gesture.
| bool operator!= | ( | const Gesture & | rhs | ) | const |
Compare Gesture object inequality.
Two Gestures are equal only if they represent the same snapshot of the same recognized movement.
| bool operator== | ( | const Gesture & | rhs | ) | const |
Compare Gesture object equality.
Two Gestures are equal if they represent the same snapshot of the same recognized movement.
| PointableList pointables | ( | ) | const |
The list of fingers and tools associated with this Gesture, if any.
If no Pointable objects are related to this gesture, the list is empty.
| State state | ( | ) | const |
The gesture state.
Recognized movements occur over time and have a beginning, a middle, and an end. The 'state()' attribute reports where in that sequence this Gesture object falls.
|
inline |
A string containing a brief, human-readable description of this Gesture.
| Type type | ( | ) | const |
The gesture type.
C++