LeapSwipeGestureΒΆ

LeapSwipeGesture Class Reference

The LeapSwipeGesture class represents a swiping motion of fingers and tools. More...

Inherits LeapGesture.

Instance Methods

(BOOL) - equals:
 Compare LeapGesture object equality. More...
 
(LeapPointable *) - pointable
 The finger or tool performing the swipe gesture. More...
 

Class Methods

(LeapGesture *) + invalid
 Returns an invalid LeapGesture object. More...
 

Properties

LeapVector * direction
 The unit direction vector parallel to the swipe motion. More...
 
int64_t duration
 The elapsed duration of the recognized movement up to the frame containing this LeapGesture object, in microseconds. More...
 
float durationSeconds
 The elapsed duration in seconds. More...
 
LeapFrame * frame
 The LeapFrame containing this LeapGesture instance. More...
 
NSArray * hands
 The list of hands associated with this LeapGesture, if any. More...
 
int32_t id
 The gesture ID. More...
 
BOOL isValid
 Reports whether this LeapGesture instance represents a valid gesture. More...
 
NSArray * pointables
 The list of fingers and tools associated with this LeapGesture, if any. More...
 
LeapVector * position
 The current position of the swipe. More...
 
float speed
 The swipe speed in mm/second. More...
 
LeapVector * startPosition
 The position where the swipe began. More...
 
LeapGestureState state
 The gesture state. More...
 
LeapGestureType type
 The gesture type. More...
 

Detailed Description

The LeapSwipeGesture class represents a swiping motion of fingers and tools.

[controller.config setFloat:@"Gesture.Swipe.MinLength" value:200.0];
[controller.config setFloat:@"Gesture.Swipe.MinVelocity" value:750];
[controller.config save];

Method Documentation

- (BOOL) equals: (const LeapGesture *)  other

Compare LeapGesture object equality.

[thisGesture equals:thatGesture];
Parameters
otherThe LeapGesture object to compare.
+ (LeapGesture *) invalid

Returns an invalid LeapGesture object.

Returns
The invalid LeapGesture instance.
- (LeapPointable *) pointable

The finger or tool performing the swipe gesture.

LeapPointable *gesturer = swipe.pointable;
Returns
A LeapPointable object representing the swiping finger or tool.

Property Documentation

- (LeapVector*) direction
readnonatomicassign

The unit direction vector parallel to the swipe motion.

LeapVector *direction = swipe.direction;
Returns
LeapVector The unit direction vector representing the swipe motion.
- (int64_t) duration
readnonatomicassigninherited

The elapsed duration of the recognized movement up to the frame containing this LeapGesture object, in microseconds.

int64_t microseconds = gesture.duration;
Returns
int64_t the elapsed duration in microseconds.
- (float) durationSeconds
readnonatomicassigninherited

The elapsed duration in seconds.

float seconds = gesture.duration;
See also
duration
Returns
float the elapsed duration in seconds.
- (LeapFrame*) frame
readnonatomicstronginherited

The LeapFrame containing this LeapGesture instance.

LeapFrame *owningFrame = gesture.frame;
Returns
The parent LeapFrame object.
- (NSArray*) hands
readnonatomicstronginherited

The list of hands associated with this LeapGesture, if any.

NSArray *handList = gesture.hands;
//Only one hand for current gestures
LeapHand *gesturingHand = [handList objectAtIndex:0];
Returns
NSArray the list of related LeapHand objects.
- (int32_t) id
readnonatomicassigninherited

The gesture ID.

int gestureID = gesture.id;
Returns
int32_t the ID of this LeapGesture.
- (BOOL) isValid
readnonatomicassigninherited

Reports whether this LeapGesture instance represents a valid gesture.

LeapFrame *frame = [controller frame:0];
LeapGesture *trackedGesture = [frame gesture:trackedGestureID];
if(trackedGesture.isValid)
{
//Use the data...
}
Returns
bool Yes, if this is a valid LeapGesture instance; NO, otherwise.
- (NSArray*) pointables
readnonatomicstronginherited

The list of fingers and tools associated with this LeapGesture, if any.

NSArray *pointableList = gesture.pointables;
//Only one pointable for current gestures
LeapHand *gesturingPointable = [pointableList objectAtIndex:0];
Returns
NSArray the list of related LeapPointable objects.
- (LeapVector*) position
readnonatomicassign

The current position of the swipe.

LeapVector *current = swipe.position;
Returns
LeapVector The current swipe position within the Leap frame of reference, in mm.
- (float) speed
readnonatomicassign

The swipe speed in mm/second.

float velocity = swipe.speed;
Returns
float The speed of the finger performing the swipe gesture in millimeters per second.
- (LeapVector*) startPosition
readnonatomicassign

The position where the swipe began.

LeapVector *start = swipe.startPosition;
Returns
LeapVector The starting position within the Leap frame of reference, in mm.
- (LeapGestureState) state
readnonatomicassigninherited

The gesture state.

Returns
LeapGestureState A value from the LeapGestureState enumeration.
- (LeapGestureType) type
readnonatomicassigninherited

The gesture type.

LeapGestureType type = gesture.type;
Returns
LeapGestureType A value from the LeapGestureType enumeration.