#include <Leap.h>
Public Types | |
enum | Zone { ZONE_NONE = 0, ZONE_HOVERING = 1, ZONE_TOUCHING = 2 } |
Public Member Functions | |
def | __eq__ (self, arg2) |
def | __init__ (self) |
def | __ne__ (self, arg2) |
def | __str__ (self) |
LEAP_EXPORT Vector | direction () const |
LEAP_EXPORT Frame | frame () const |
LEAP_EXPORT Hand | hand () const |
LEAP_EXPORT int32_t | id () const |
LEAP_EXPORT bool | isExtended () const |
LEAP_EXPORT bool | isFinger () const |
LEAP_EXPORT bool | isTool () const |
LEAP_EXPORT bool | isValid () const |
LEAP_EXPORT float | length () const |
LEAP_EXPORT bool | operator!= (const Pointable &) const |
LEAP_EXPORT bool | operator== (const Pointable &) const |
Pointable (PointableImplementation *) | |
Pointable (FingerImplementation *) | |
Pointable (ToolImplementation *) | |
LEAP_EXPORT | Pointable () |
LEAP_EXPORT Vector | stabilizedTipPosition () const |
LEAP_EXPORT float | timeVisible () const |
LEAP_EXPORT Vector | tipPosition () const |
LEAP_EXPORT Vector | tipVelocity () const |
std::string | toString () const |
LEAP_EXPORT float | touchDistance () const |
LEAP_EXPORT Zone | touchZone () const |
LEAP_EXPORT float | width () const |
Public Member Functions inherited from Leap::Interface | |
def | __init__ (self, args, kwargs) |
Static Public Member Functions | |
static LEAP_EXPORT const Pointable & | invalid () |
Public Attributes | |
this | |
Static Public Attributes | |
direction = _swig_property(LeapPython.Pointable_direction_get) | |
frame = _swig_property(LeapPython.Pointable_frame_get) | |
hand = _swig_property(LeapPython.Pointable_hand_get) | |
id = _swig_property(LeapPython.Pointable_id_get) | |
is_extended = _swig_property(LeapPython.Pointable_is_extended_get) | |
is_finger = _swig_property(LeapPython.Pointable_is_finger_get) | |
is_tool = _swig_property(LeapPython.Pointable_is_tool_get) | |
is_valid = _swig_property(LeapPython.Pointable_is_valid_get) | |
length = _swig_property(LeapPython.Pointable_length_get) | |
stabilized_tip_position = _swig_property(LeapPython.Pointable_stabilized_tip_position_get) | |
time_visible = _swig_property(LeapPython.Pointable_time_visible_get) | |
tip_position = _swig_property(LeapPython.Pointable_tip_position_get) | |
tip_velocity = _swig_property(LeapPython.Pointable_tip_velocity_get) | |
touch_distance = _swig_property(LeapPython.Pointable_touch_distance_get) | |
touch_zone = _swig_property(LeapPython.Pointable_touch_zone_get) | |
width = _swig_property(LeapPython.Pointable_width_get) | |
ZONE_HOVERING = LeapPython.Pointable_ZONE_HOVERING | |
ZONE_NONE = LeapPython.Pointable_ZONE_NONE | |
ZONE_TOUCHING = LeapPython.Pointable_ZONE_TOUCHING | |
Private Member Functions | |
LEAP_EXPORT const char * | toCString () const |
Static Private Attributes | |
__getattr__ = lambdaself,name:_swig_getattr(self, Pointable, name) | |
__repr__ = _swig_repr | |
__setattr__ = lambdaself,name,value:_swig_setattr(self, Pointable, name, value) | |
__swig_destroy__ = LeapPython.delete_Pointable | |
dictionary | __swig_getmethods__ = {} |
dictionary | __swig_setmethods__ = {} |
Friends | |
LEAP_EXPORT friend std::ostream & | operator<< (std::ostream &, const Pointable &) |
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 Interface & | operator= (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 |
The Pointable class reports the physical characteristics of a detected finger or tool.
Both fingers and tools are classified as Pointable objects. Use the Pointable::isFinger() function to determine whether a Pointable object represents a finger. Use the Pointable::isTool() function to determine whether a Pointable object represents a tool. The Leap Motion software classifies a detected entity as a tool when it is thinner, straighter, and longer than a typical finger.
To provide touch emulation, the Leap Motion software associates a floating touch plane that adapts to the user's finger movement and hand posture. The Leap Motion interprets purposeful movements toward this plane as potential touch points. The Pointable class reports touch state with the touchZone and touchDistance values.
Note that Pointable objects can be invalid, which means that they do not contain valid tracking data and do not correspond to a physical entity. Invalid Pointable objects can be the result of asking for a Pointable object using an ID from an earlier frame when no Pointable objects with that ID exist in the current frame. A Pointable object created from the Pointable constructor is also invalid. Test for validity with the Pointable::isValid() function.
Defines the values for reporting the state of a Pointable object in relation to an adaptive touch plane.
Enumerator | |
---|---|
ZONE_NONE |
The Pointable object is too far from the plane to be considered hovering or touching.
|
ZONE_HOVERING |
The Pointable object is close to, but not touching the plane.
|
ZONE_TOUCHING |
The Pointable has penetrated the plane.
|
Leap::Pointable::Pointable | ( | PointableImplementation * | ) |
Leap::Pointable::Pointable | ( | FingerImplementation * | ) |
Leap::Pointable::Pointable | ( | ToolImplementation * | ) |
LEAP_EXPORT Leap::Pointable::Pointable | ( | ) |
LEAP_EXPORT Vector Leap::Pointable::direction | ( | ) | const |
LEAP_EXPORT Frame Leap::Pointable::frame | ( | ) | const |
LEAP_EXPORT Hand Leap::Pointable::hand | ( | ) | const |
LEAP_EXPORT int32_t Leap::Pointable::id | ( | ) | const |
A unique ID assigned to this Pointable object, whose value remains the same across consecutive frames while the tracked finger or tool remains visible. If tracking is lost (for example, when a finger is occluded by another finger or when it is withdrawn from the Leap Motion Controller field of view), the Leap Motion software may assign a new ID when it detects the entity in a future frame.
Use the ID value with the Frame::pointable() function to find this Pointable object in future frames.
IDs should be from 1 to 100 (inclusive). If more than 100 objects are tracked an IDs of -1 will be used until an ID in the defined range is available.
|
static |
Returns an invalid Pointable object.
You can use the instance returned by this function in comparisons testing whether a given Pointable instance is valid or invalid. (You can also use the Pointable::isValid() function.)
LEAP_EXPORT bool Leap::Pointable::isExtended | ( | ) | const |
Whether or not this Pointable is in an extended posture.
A finger is considered extended if it is extended straight from the hand as if pointing. A finger is not extended when it is bent down and curled towards the palm. Tools are always extended.
LEAP_EXPORT bool Leap::Pointable::isFinger | ( | ) | const |
LEAP_EXPORT bool Leap::Pointable::isTool | ( | ) | const |
LEAP_EXPORT bool Leap::Pointable::isValid | ( | ) | const |
LEAP_EXPORT float Leap::Pointable::length | ( | ) | const |
The estimated length of the finger or tool in millimeters.
LEAP_EXPORT bool Leap::Pointable::operator!= | ( | const Pointable & | ) | const |
LEAP_EXPORT bool Leap::Pointable::operator== | ( | const Pointable & | ) | const |
LEAP_EXPORT Vector Leap::Pointable::stabilizedTipPosition | ( | ) | const |
The stabilized tip position of this Pointable.
Smoothing and stabilization is performed in order to make this value more suitable for interaction with 2D content. The stabilized position lags behind the tip position by a variable amount, depending primarily on the speed of movement.
LEAP_EXPORT float Leap::Pointable::timeVisible | ( | ) | const |
The duration of time this Pointable has been visible to the Leap Motion Controller.
LEAP_EXPORT Vector Leap::Pointable::tipPosition | ( | ) | const |
LEAP_EXPORT Vector Leap::Pointable::tipVelocity | ( | ) | const |
The rate of change of the tip position in millimeters/second.
|
private |
|
inline |
LEAP_EXPORT float Leap::Pointable::touchDistance | ( | ) | const |
A value proportional to the distance between this Pointable object and the adaptive touch plane.
The touch distance is a value in the range [-1, 1]. The value 1.0 indicates the Pointable is at the far edge of the hovering zone. The value 0 indicates the Pointable is just entering the touching zone. A value of -1.0 indicates the Pointable is firmly within the touching zone. Values in between are proportional to the distance from the plane. Thus, the touchDistance of 0.5 indicates that the Pointable is halfway into the hovering zone.
You can use the touchDistance value to modulate visual feedback given to the user as their fingers close in on a touch target, such as a button.
LEAP_EXPORT Zone Leap::Pointable::touchZone | ( | ) | const |
The current touch zone of this Pointable object.
The Leap Motion software computes the touch zone based on a floating touch plane that adapts to the user's finger movement and hand posture. The Leap Motion software interprets purposeful movements toward this plane as potential touch points. When a Pointable moves close to the adaptive touch plane, it enters the "hovering" zone. When a Pointable reaches or passes through the plane, it enters the "touching" zone.
The possible states are present in the Zone enum of this class:
Zone.NONE – The Pointable is outside the hovering zone.
Zone.HOVERING – The Pointable is close to, but not touching the touch plane.
Zone.TOUCHING – The Pointable has penetrated the touch plane.
The touchDistance value provides a normalized indication of the distance to the touch plane when the Pointable is in the hovering or touching zones.
LEAP_EXPORT float Leap::Pointable::width | ( | ) | const |
The estimated width of the finger or tool in millimeters.
|
friend |
Writes a brief, human readable description of the Pointable object to an output stream.
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |