The SwipeGesture class represents a swiping motion a finger or tool.
More...
Inherits Gesture.
The SwipeGesture class represents a swiping motion a finger or tool.
- Deprecated:
- 3.0
The possible gesture states.
- Deprecated:
- 3.0
| Enumerator |
|---|
| STATE_INVALID |
An invalid state.
- Deprecated:
- 3.0
|
| STATE_START |
The gesture is starting.
Just enough has happened to recognize it. - Deprecated:
- 3.0
|
| STATE_UPDATE |
The gesture is in progress.
(Note: not all gestures have updates). - Deprecated:
- 3.0
|
| STATE_STOP |
The gesture has completed or stopped.
- Deprecated:
- 3.0
|
The supported types of gestures.
- Deprecated:
- 3.0
| Enumerator |
|---|
| TYPE_INVALID |
An invalid type.
- Deprecated:
- 3.0
|
| TYPE_SWIPE |
A straight line movement by the hand with fingers extended.
- Deprecated:
- 3.0
|
| TYPE_CIRCLE |
A circular movement by a finger.
- Deprecated:
- 3.0
|
| TYPE_SCREEN_TAP |
A forward tapping movement by a finger.
- Deprecated:
- 3.0
|
| TYPE_KEY_TAP |
A downward tapping movement by a finger.
- Deprecated:
- 3.0
|
| static Type classType |
( |
| ) |
|
|
inlinestatic |
The swipe gesture type.
- Returns
- Type The type value designating a swipe gesture.
- Deprecated:
- 3.0
The unit direction vector parallel to the swipe motion.
You can compare the components of the vector to classify the swipe as appropriate for your application. For example, if you are using swipes for two dimensional scrolling, you can compare the x and y values to determine if the swipe is primarily horizontal or vertical.
- Returns
- Vector The unit direction vector representing the swipe motion.
- Deprecated:
- 3.0
| int64_t duration |
( |
| ) |
const |
|
inherited |
The elapsed duration of the recognized movement up to the frame containing this Gesture object, in microseconds.
float microseconds = gesture.duration();
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.
- Returns
- int64_t the elapsed duration in microseconds.
- Deprecated:
- 3.0
| float durationSeconds |
( |
| ) |
const |
|
inherited |
The elapsed duration in seconds.
float seconds = gesture.durationSeconds();
- See also
- duration()
- Returns
- float the elapsed duration in seconds.
- Deprecated:
- 3.0
The list of hands associated with this Gesture, if any.
If no hands are related to this gesture, the list is empty.
- Returns
- HandList the list of related Hand objects.
- Deprecated:
- 3.0
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.
int32_t gestureOfInterest = gesture.id();
{
if ((*gl).id() == gestureOfInterest) {
}
}
- Returns
- int32_t the ID of this Gesture.
- Deprecated:
- 3.0
Reports whether this Gesture instance represents a valid Gesture.
if (gesture.isValid()) {
}
- Returns
- bool True, if this is a valid Gesture instance; false, otherwise.
- Deprecated:
- 3.0
| bool operator!= |
( |
const Gesture & |
rhs | ) |
const |
|
inherited |
Compare Gesture object inequality.
thisGesture != thatGesture;
Two Gestures are equal only if they represent the same snapshot of the same recognized movement.
- Deprecated:
- 3.0
| bool operator== |
( |
const Gesture & |
rhs | ) |
const |
|
inherited |
Compare Gesture object equality.
thisGesture == thatGesture;
Two Gestures are equal if they represent the same snapshot of the same recognized movement.
- Deprecated:
- 3.0
The current position of the swipe.
- Returns
- Vector The current swipe position within the Leap Motion frame of reference, in mm.
- Deprecated:
- 3.0
The swipe speed in mm/second.
float currentSwipeSpeed = swipe.speed();
- Returns
- float The speed of the finger performing the swipe gesture in millimeters per second.
- Deprecated:
- 3.0
| Vector startPosition |
( |
| ) |
const |
The position where the swipe began.
- Returns
- Vector The starting position within the Leap Motion frame of reference, in mm.
- Deprecated:
- 3.0
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.
{
switch ((*gl).state()) {
break;
break;
break;
default:
break;
}
}
- Returns
- Gesture::State A value from the Gesture::State enumeration.
- Deprecated:
- 3.0
| std::string toString |
( |
| ) |
const |
|
inlineinherited |
A string containing a brief, human-readable description of this Gesture.
std::cout << (*gl).toString() << std::endl;
- Deprecated:
- 3.0