#include <Leap.h>
Public Member Functions | |
def | __init__ |
LEAP_EXPORT Vector | direction () const |
LEAP_EXPORT Pointable | pointable () const |
LEAP_EXPORT Vector | position () const |
LEAP_EXPORT float | speed () const |
LEAP_EXPORT Vector | startPosition () const |
LEAP_EXPORT | SwipeGesture () |
LEAP_EXPORT | SwipeGesture (const Gesture &rhs) |
Static Public Member Functions | |
static Type | classType () |
Public Attributes | |
this | |
Static Public Attributes | |
tuple | class_type = staticmethod(LeapPython.SwipeGesture_class_type) |
tuple | direction = _swig_property(LeapPython.SwipeGesture_direction_get) |
tuple | pointable = _swig_property(LeapPython.SwipeGesture_pointable_get) |
tuple | position = _swig_property(LeapPython.SwipeGesture_position_get) |
tuple | speed = _swig_property(LeapPython.SwipeGesture_speed_get) |
tuple | start_position = _swig_property(LeapPython.SwipeGesture_start_position_get) |
Static Private Attributes | |
tuple | __getattr__ = lambdaself,name:_swig_getattr(self, SwipeGesture, name) |
__repr__ = _swig_repr | |
tuple | __setattr__ = lambdaself,name,value:_swig_setattr(self, SwipeGesture, name, value) |
__swig_destroy__ = LeapPython.delete_SwipeGesture | |
dictionary | __swig_getmethods__ = {} |
dictionary | __swig_setmethods__ = {} |
The SwipeGesture class represents a swiping motion a finger or tool.
SwipeGesture objects are generated for each visible finger or tool. Swipe gestures are continuous; a gesture object with the same ID value will appear in each frame while the gesture continues.
**Important:** To use swipe gestures in your application, you must enable recognition of the swipe gesture. You can enable recognition with:
You can set the minimum length and velocity required for a movement to be recognized as a swipe using the config attribute of a connected Controller object. Use the following keys to configure swipe recognition:
==================================== ========== ============= ======= Key string Value type Default value Units ==================================== ========== ============= ======= Gesture.Swipe.MinLength float 150 mm Gesture.Swipe.MinVelocity float 1000 mm/s ==================================== ========== ============= =======
The following example demonstrates how to set the swipe configuration parameters:
The Controller object must be connected to the Leap Motion service/daemon before setting the configuration parameters.
LEAP_EXPORT Leap::SwipeGesture::SwipeGesture | ( | const Gesture & | rhs | ) |
Constructs a SwipeGesture object from an instance of the Gesture class.
rhs | The Gesture instance to specialize. This Gesture instance must be a SwipeGesture object. |
def Leap::SwipeGesture::__init__ | ( | self, | |
args | |||
) |
Reimplemented from Leap::Gesture.
static Type Leap::SwipeGesture::classType | ( | ) | [inline, static] |
LEAP_EXPORT Vector Leap::SwipeGesture::direction | ( | ) | const |
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.
LEAP_EXPORT Vector Leap::SwipeGesture::position | ( | ) | const |
LEAP_EXPORT float Leap::SwipeGesture::speed | ( | ) | const |
The swipe speed in mm/second.
tuple Leap::SwipeGesture::__getattr__ = lambdaself,name:_swig_getattr(self, SwipeGesture, name) [static, private] |
Reimplemented from Leap::Gesture.
Leap::SwipeGesture::__repr__ = _swig_repr [static, private] |
Reimplemented from Leap::Gesture.
tuple Leap::SwipeGesture::__setattr__ = lambdaself,name,value:_swig_setattr(self, SwipeGesture, name, value) [static, private] |
Reimplemented from Leap::Gesture.
Leap::SwipeGesture::__swig_destroy__ = LeapPython.delete_SwipeGesture [static, private] |
Reimplemented from Leap::Gesture.
dictionary Leap::SwipeGesture::__swig_getmethods__ = {} [static, private] |
Reimplemented from Leap::Gesture.
dictionary Leap::SwipeGesture::__swig_setmethods__ = {} [static, private] |
Reimplemented from Leap::Gesture.
tuple Leap::SwipeGesture::class_type = staticmethod(LeapPython.SwipeGesture_class_type) [static] |
tuple Leap::SwipeGesture::direction = _swig_property(LeapPython.SwipeGesture_direction_get) [static] |
tuple Leap::SwipeGesture::pointable = _swig_property(LeapPython.SwipeGesture_pointable_get) [static] |
tuple Leap::SwipeGesture::position = _swig_property(LeapPython.SwipeGesture_position_get) [static] |
tuple Leap::SwipeGesture::speed = _swig_property(LeapPython.SwipeGesture_speed_get) [static] |
tuple Leap::SwipeGesture::start_position = _swig_property(LeapPython.SwipeGesture_start_position_get) [static] |
Reimplemented from Leap::Gesture.