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

#include <Leap.h>

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

Public Types

enum  ValueType {
  TYPE_UNKNOWN = 0, TYPE_BOOLEAN = 1, TYPE_INT32 = 2, TYPE_FLOAT = 6,
  TYPE_STRING = 8
}
 

Public Member Functions

def __init__ (self)
 
LEAP_EXPORT Config ()
 
def get (self, args)
 
bool getBool (const std::string &key) const
 
float getFloat (const std::string &key) const
 
int32_t getInt32 (const std::string &key) const
 
std::string getString (const std::string &key) const
 
def save (self)
 
LEAP_EXPORT bool save ()
 
def set (self, args)
 
bool setBool (const std::string &key, bool value)
 
bool setFloat (const std::string &key, float value)
 
bool setInt32 (const std::string &key, int32_t value)
 
bool setString (const std::string &key, const std::string &value)
 
ValueType type (const std::string &key) const
 
- Public Member Functions inherited from Leap::Interface
def __init__ (self, args, kwargs)
 

Public Attributes

 this
 

Static Public Attributes

 TYPE_BOOLEAN = LeapPython.Config_TYPE_BOOLEAN
 
 TYPE_FLOAT = LeapPython.Config_TYPE_FLOAT
 
 TYPE_INT32 = LeapPython.Config_TYPE_INT32
 
 TYPE_STRING = LeapPython.Config_TYPE_STRING
 
 TYPE_UNKNOWN = LeapPython.Config_TYPE_UNKNOWN
 

Private Member Functions

LEAP_EXPORT bool getBoolCString (const char *key) const
 
LEAP_EXPORT float getFloatCString (const char *key) const
 
LEAP_EXPORT int32_t getInt32CString (const char *key) const
 
LEAP_EXPORT const char * getStringCString (const char *key) const
 
LEAP_EXPORT bool setBoolCString (const char *key, bool value)
 
LEAP_EXPORT bool setFloatCString (const char *key, float value)
 
LEAP_EXPORT bool setInt32CString (const char *key, int32_t value)
 
LEAP_EXPORT bool setStringCString (const char *key, const char *value)
 
LEAP_EXPORT ValueType typeCString (const char *key) const
 

Static Private Attributes

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

Additional Inherited Members

- 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 Config class provides access to Leap Motion system configuration information.

You can get and set gesture configuration parameters using the Config object obtained from a connected Controller object. The key strings required to identify a configuration parameter include:

==================================== ========== ============= ======= Key string Value type Default value Units ==================================== ========== ============= ======= Gesture.Circle.MinRadius float 5.0 mm Gesture.Circle.MinArc float 1.5 * pi radians Gesture.Swipe.MinLength float 150 mm Gesture.Swipe.MinVelocity float 1000 mm/s Gesture.KeyTap.MinDownVelocity float 50 mm/s Gesture.KeyTap.HistorySeconds float 0.1 s Gesture.KeyTap.MinDistance float 3.0 mm Gesture.ScreenTap.MinForwardVelocity float 50 mm/s Gesture.ScreenTap.HistorySeconds float 0.1 s Gesture.ScreenTap.MinDistance float 5.0 mm ==================================== ========== ============= =======

After setting a configuration value, you must call the Config::save() method to commit the changes. You can save after the Controller has connected to the Leap Motion service/daemon. In other words, after the Controller has dispatched the serviceConnected or connected events or Controller::isConnected is true. The configuration value changes are not persistent; your application needs to set the values every time it runs.

See also
CircleGesture
KeyTapGesture
ScreenTapGesture
SwipeGesture
Since
1.0

Definition at line 5326 of file Leap.h.

Member Enumeration Documentation

Enumerates the possible data types for configuration values.

The Config::type() function returns an item from the ValueType enumeration.

Since
1.0
Enumerator
TYPE_UNKNOWN 

The data type is unknown.

Since
1.0
TYPE_BOOLEAN 

A boolean value.

Since
1.0
TYPE_INT32 

A 32-bit integer.

Since
1.0
TYPE_FLOAT 

A floating-point number.

Since
1.0
TYPE_STRING 

A string of characters.

Since
1.0

Definition at line 5345 of file Leap.h.

Constructor & Destructor Documentation

LEAP_EXPORT Leap::Config::Config ( )

Constructs a Config object. Do not create your own Config objects. Get a Config object using the Controller::config() function.

Since
1.0
def Leap.Config.__init__ (   self)

Definition at line 2094 of file Leap.py.

Member Function Documentation

def Leap.Config.get (   self,
  args 
)

Definition at line 2117 of file Leap.py.

bool Leap::Config::getBool ( const std::string &  key) const
inline

Gets the boolean representation for the specified key.

Since
1.0

Definition at line 5402 of file Leap.h.

LEAP_EXPORT bool Leap::Config::getBoolCString ( const char *  key) const
private
float Leap::Config::getFloat ( const std::string &  key) const
inline

Gets the floating point representation for the specified key.

Since
1.0

Definition at line 5446 of file Leap.h.

LEAP_EXPORT float Leap::Config::getFloatCString ( const char *  key) const
private
int32_t Leap::Config::getInt32 ( const std::string &  key) const
inline

Gets the 32-bit integer representation for the specified key.

Since
1.0

Definition at line 5424 of file Leap.h.

LEAP_EXPORT int32_t Leap::Config::getInt32CString ( const char *  key) const
private
std::string Leap::Config::getString ( const std::string &  key) const
inline

Gets the string representation for the specified key.

Since
1.0

Definition at line 5468 of file Leap.h.

LEAP_EXPORT const char* Leap::Config::getStringCString ( const char *  key) const
private
def Leap.Config.save (   self)

Definition at line 2115 of file Leap.py.

LEAP_EXPORT bool Leap::Config::save ( )

Saves the current state of the config.

Call save() after making a set of configuration changes. The save() function transfers the configuration changes to the Leap Motion service. You can save after the Controller has connected to the Leap Motion service/daemon. In other words, after the Controller has dispatched the serviceConnected or connected events or Controller::isConnected is true. The configuration value changes are not persistent; your application must set the values every time it runs.

Returns
true on success, false on failure.
Since
1.0
def Leap.Config.set (   self,
  args 
)

Definition at line 2128 of file Leap.py.

bool Leap::Config::setBool ( const std::string &  key,
bool  value 
)
inline

Sets the boolean representation for the specified key.

Returns
true on success, false on failure.
Since
1.0

Definition at line 5413 of file Leap.h.

LEAP_EXPORT bool Leap::Config::setBoolCString ( const char *  key,
bool  value 
)
private
bool Leap::Config::setFloat ( const std::string &  key,
float  value 
)
inline

Sets the floating point representation for the specified key.

Returns
true on success, false on failure.
Since
1.0

Definition at line 5457 of file Leap.h.

LEAP_EXPORT bool Leap::Config::setFloatCString ( const char *  key,
float  value 
)
private
bool Leap::Config::setInt32 ( const std::string &  key,
int32_t  value 
)
inline

Sets the 32-bit integer representation for the specified key.

Returns
true on success, false on failure.
Since
1.0

Definition at line 5435 of file Leap.h.

LEAP_EXPORT bool Leap::Config::setInt32CString ( const char *  key,
int32_t  value 
)
private
bool Leap::Config::setString ( const std::string &  key,
const std::string &  value 
)
inline

Sets the string representation for the specified key.

Returns
true on success, false on failure.
Since
1.0

Definition at line 5482 of file Leap.h.

LEAP_EXPORT bool Leap::Config::setStringCString ( const char *  key,
const char *  value 
)
private
ValueType Leap::Config::type ( const std::string &  key) const
inline

Reports the natural data type for the value related to the specified key.

Parameters
keyThe key for the looking up the value in the configuration dictionary.
Returns
The native data type of the value, that is, the type that does not require a data conversion.
Since
1.0

Definition at line 5391 of file Leap.h.

LEAP_EXPORT ValueType Leap::Config::typeCString ( const char *  key) const
private

Member Data Documentation

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

Definition at line 2091 of file Leap.py.

Leap.Config.__repr__ = _swig_repr
staticprivate

Definition at line 2092 of file Leap.py.

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

Definition at line 2087 of file Leap.py.

Leap.Config.__swig_destroy__ = LeapPython.delete_Config
staticprivate

Definition at line 2140 of file Leap.py.

dictionary Leap.Config.__swig_getmethods__ = {}
staticprivate

Definition at line 2088 of file Leap.py.

dictionary Leap.Config.__swig_setmethods__ = {}
staticprivate

Definition at line 2084 of file Leap.py.

Leap.Config.this

Definition at line 2099 of file Leap.py.

Leap.Config.TYPE_BOOLEAN = LeapPython.Config_TYPE_BOOLEAN
static

Definition at line 2101 of file Leap.py.

Leap.Config.TYPE_FLOAT = LeapPython.Config_TYPE_FLOAT
static

Definition at line 2103 of file Leap.py.

Leap.Config.TYPE_INT32 = LeapPython.Config_TYPE_INT32
static

Definition at line 2102 of file Leap.py.

Leap.Config.TYPE_STRING = LeapPython.Config_TYPE_STRING
static

Definition at line 2104 of file Leap.py.

Leap.Config.TYPE_UNKNOWN = LeapPython.Config_TYPE_UNKNOWN
static

Definition at line 2100 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