Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Static Private Attributes | List of all members
Leap::SwipeGesture Class Reference

#include <Leap.h>

Inheritance diagram for Leap::SwipeGesture:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, args)
 
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)
 
- Public Member Functions inherited from Leap::Gesture
def __eq__ (self, rhs)
 
def __init__ (self, args)
 
def __ne__ (self, rhs)
 
def __str__ (self)
 
LEAP_EXPORT int64_t duration () const
 
LEAP_EXPORT float durationSeconds () const
 
LEAP_EXPORT Frame frame () const
 
 Gesture (GestureImplementation *)
 
LEAP_EXPORT Gesture ()
 
LEAP_EXPORT Gesture (const Gesture &rhs)
 
LEAP_EXPORT HandList hands () const
 
LEAP_EXPORT int32_t id () const
 
LEAP_EXPORT bool isValid () const
 
LEAP_EXPORT bool operator!= (const Gesture &rhs) const
 
LEAP_EXPORT bool operator== (const Gesture &rhs) const
 
LEAP_EXPORT PointableList pointables () const
 
LEAP_EXPORT State state () const
 
std::string toString () const
 
LEAP_EXPORT Type type () const
 
- Public Member Functions inherited from Leap::Interface
def __init__ (self, args, kwargs)
 

Static Public Member Functions

static Type classType ()
 
- Static Public Member Functions inherited from Leap::Gesture
static LEAP_EXPORT const Gestureinvalid ()
 

Public Attributes

 this
 
- Public Attributes inherited from Leap::Gesture
 this
 

Static Public Attributes

 class_type = staticmethod(LeapPython.SwipeGesture_class_type)
 
 direction = _swig_property(LeapPython.SwipeGesture_direction_get)
 
 pointable = _swig_property(LeapPython.SwipeGesture_pointable_get)
 
 position = _swig_property(LeapPython.SwipeGesture_position_get)
 
 speed = _swig_property(LeapPython.SwipeGesture_speed_get)
 
 start_position = _swig_property(LeapPython.SwipeGesture_start_position_get)
 
- Static Public Attributes inherited from Leap::Gesture
 duration = _swig_property(LeapPython.Gesture_duration_get)
 
 duration_seconds = _swig_property(LeapPython.Gesture_duration_seconds_get)
 
 frame = _swig_property(LeapPython.Gesture_frame_get)
 
 hands = _swig_property(LeapPython.Gesture_hands_get)
 
 id = _swig_property(LeapPython.Gesture_id_get)
 
 is_valid = _swig_property(LeapPython.Gesture_is_valid_get)
 
 pointables = _swig_property(LeapPython.Gesture_pointables_get)
 
 state = _swig_property(LeapPython.Gesture_state_get)
 
 STATE_INVALID = LeapPython.Gesture_STATE_INVALID
 
 STATE_START = LeapPython.Gesture_STATE_START
 
 STATE_STOP = LeapPython.Gesture_STATE_STOP
 
 STATE_UPDATE = LeapPython.Gesture_STATE_UPDATE
 
 type = _swig_property(LeapPython.Gesture_type_get)
 
 TYPE_CIRCLE = LeapPython.Gesture_TYPE_CIRCLE
 
 TYPE_INVALID = LeapPython.Gesture_TYPE_INVALID
 
 TYPE_KEY_TAP = LeapPython.Gesture_TYPE_KEY_TAP
 
 TYPE_SCREEN_TAP = LeapPython.Gesture_TYPE_SCREEN_TAP
 
 TYPE_SWIPE = LeapPython.Gesture_TYPE_SWIPE
 

Static Private Attributes

 __getattr__ = lambdaself,name:_swig_getattr(self, SwipeGesture, name)
 
 __repr__ = _swig_repr
 
 __setattr__ = lambdaself,name,value:_swig_setattr(self, SwipeGesture, name, value)
 
 __swig_destroy__ = LeapPython.delete_SwipeGesture
 
dictionary __swig_getmethods__ = {}
 
dictionary __swig_setmethods__ = {}
 

Additional Inherited Members

- Public Types inherited from Leap::Gesture
enum  State { STATE_INVALID = -1, STATE_START = 1, STATE_UPDATE = 2, STATE_STOP = 3 }
 
enum  Type {
  TYPE_INVALID = -1, TYPE_SWIPE = 1, TYPE_CIRCLE = 4, TYPE_SCREEN_TAP = 5,
  TYPE_KEY_TAP = 6
}
 
- Protected Member Functions inherited from Leap::Interface
template<typename T >
T * get () const
 
LEAP_EXPORT Interface (void *owner)
 
LEAP_EXPORT Interface (Implementation *reference, void *owner)
 
LEAP_EXPORT Interface (const Interface &rhs)
 
 Interface (class SharedObject *object)
 
LEAP_EXPORT Interfaceoperator= (const Interface &rhs)
 
virtual LEAP_EXPORT ~Interface ()
 
- Static Protected Member Functions inherited from Leap::Interface
static LEAP_EXPORT void deleteCString (const char *cstr)
 
- Protected Attributes inherited from Leap::Interface
class SharedObject * m_object
 

Detailed Description

The SwipeGesture class represents a swiping motion a finger or tool.

Leap_Gesture_Swipe.png

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.

Since
1.0

Definition at line 2119 of file Leap.h.

Constructor & Destructor Documentation

LEAP_EXPORT Leap::SwipeGesture::SwipeGesture ( )
LEAP_EXPORT Leap::SwipeGesture::SwipeGesture ( const Gesture rhs)

Constructs a SwipeGesture object from an instance of the Gesture class.

Parameters
rhsThe Gesture instance to specialize. This Gesture instance must be a SwipeGesture object.
Since
1.0
def Leap.SwipeGesture.__init__ (   self,
  args 
)

Definition at line 924 of file Leap.py.

Member Function Documentation

static Type Leap::SwipeGesture::classType ( )
inlinestatic

The swipe gesture type.

Returns
Type The type value designating a swipe gesture.
Since
1.0

Definition at line 2130 of file Leap.h.

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.

Returns
Vector The unit direction vector representing the swipe motion.
Since
1.0
LEAP_EXPORT Pointable Leap::SwipeGesture::pointable ( ) const

The finger performing the swipe gesture.

Returns
Pointable A Pointable object representing the swiping finger.
Since
1.0
LEAP_EXPORT Vector Leap::SwipeGesture::position ( ) const

The current position of the swipe.

Returns
Vector The current swipe position within the Leap Motion frame of reference, in mm.
Since
1.0
LEAP_EXPORT float Leap::SwipeGesture::speed ( ) const

The swipe speed in mm/second.

Returns
float The speed of the finger performing the swipe gesture in millimeters per second.
Since
1.0
LEAP_EXPORT Vector Leap::SwipeGesture::startPosition ( ) const

The position where the swipe began.

Returns
Vector The starting position within the Leap Motion frame of reference, in mm.
Since
1.0

Member Data Documentation

Leap.SwipeGesture.__getattr__ = lambdaself,name:_swig_getattr(self, SwipeGesture, name)
staticprivate

Definition at line 918 of file Leap.py.

Leap.SwipeGesture.__repr__ = _swig_repr
staticprivate

Definition at line 919 of file Leap.py.

Leap.SwipeGesture.__setattr__ = lambdaself,name,value:_swig_setattr(self, SwipeGesture, name, value)
staticprivate

Definition at line 914 of file Leap.py.

Leap.SwipeGesture.__swig_destroy__ = LeapPython.delete_SwipeGesture
staticprivate

Definition at line 945 of file Leap.py.

dictionary Leap.SwipeGesture.__swig_getmethods__ = {}
staticprivate

Definition at line 915 of file Leap.py.

dictionary Leap.SwipeGesture.__swig_setmethods__ = {}
staticprivate

Definition at line 911 of file Leap.py.

Leap.SwipeGesture.class_type = staticmethod(LeapPython.SwipeGesture_class_type)
static

Definition at line 922 of file Leap.py.

Leap.SwipeGesture.direction = _swig_property(LeapPython.SwipeGesture_direction_get)
static

Definition at line 938 of file Leap.py.

Leap.SwipeGesture.pointable = _swig_property(LeapPython.SwipeGesture_pointable_get)
static

Definition at line 944 of file Leap.py.

Leap.SwipeGesture.position = _swig_property(LeapPython.SwipeGesture_position_get)
static

Definition at line 935 of file Leap.py.

Leap.SwipeGesture.speed = _swig_property(LeapPython.SwipeGesture_speed_get)
static

Definition at line 941 of file Leap.py.

Leap.SwipeGesture.start_position = _swig_property(LeapPython.SwipeGesture_start_position_get)
static

Definition at line 932 of file Leap.py.

Leap.SwipeGesture.this

Definition at line 929 of file Leap.py.


The documentation for this class was generated from the following files:


leap_motion
Author(s): Florian Lier , Mirza Shah , Isaac IY Saito
autogenerated on Tue Jun 2 2020 03:58:01