SOFA plugin: LeapMotion  master
Open source framework for multi-physics simuation
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Leap::Finger Class Reference

#include <Leap.h>

Inheritance diagram for Leap::Finger:

Detailed Description

The Finger class represents a tracked finger.

Fingers are Pointable objects that the Leap has classified as a finger. Get valid Finger objects from a Frame or a Hand object.

Note that Finger objects can be invalid, which means that they do not contain valid tracking data and do not correspond to a physical finger. Invalid Finger objects can be the result of asking for a Finger object using an ID from an earlier frame when no Finger objects with that ID exist in the current frame. A Finger object created from the Finger constructor is also invalid. Test for validity with the Finger::isValid() function.

Public Member Functions

 Finger (FingerImplementation *)
 
LEAP_EXPORT Finger ()
 
LEAP_EXPORT Finger (const Pointable &)
 
LEAP_EXPORT std::string toString () const
 
- Public Member Functions inherited from Leap::Pointable
 Pointable (PointableImplementation *)
 
 Pointable (FingerImplementation *)
 
 Pointable (ToolImplementation *)
 
LEAP_EXPORT Pointable ()
 
LEAP_EXPORT int32_t id () const
 
LEAP_EXPORT Frame frame () const
 
LEAP_EXPORT Hand hand () const
 
LEAP_EXPORT Vector tipPosition () const
 
LEAP_EXPORT Vector tipVelocity () const
 
LEAP_EXPORT Vector direction () const
 
LEAP_EXPORT float width () const
 
LEAP_EXPORT float length () const
 
LEAP_EXPORT bool isFinger () const
 
LEAP_EXPORT bool isTool () const
 
LEAP_EXPORT bool isValid () const
 
LEAP_EXPORT bool operator== (const Pointable &) const
 
LEAP_EXPORT bool operator!= (const Pointable &) const
 
LEAP_EXPORT std::string toString () const
 

Static Public Member Functions

static LEAP_EXPORT const Fingerinvalid ()
 
- Static Public Member Functions inherited from Leap::Pointable
static LEAP_EXPORT const Pointableinvalid ()
 

Additional Inherited Members

- Protected Attributes inherited from Leap::Interface
class SharedObject * m_object
 
- Protected Member Functions inherited from Leap::Interface
LEAP_EXPORT Interface (void *owner)
 
LEAP_EXPORT Interface (Implementation *reference, void *owner)
 
LEAP_EXPORT Interface (const Interface &rhs)
 
LEAP_EXPORT Interfaceoperator= (const Interface &rhs)
 
virtual LEAP_EXPORT ~Interface ()
 
template<typename T >
T * get () const
 

Constructor details

◆ Finger() [1/3]

Leap::Finger::Finger ( FingerImplementation *  )

◆ Finger() [2/3]

LEAP_EXPORT Leap::Finger::Finger ( )

Constructs a Finger object.

An uninitialized finger is considered invalid. Get valid Finger objects from a Frame or a Hand object.

◆ Finger() [3/3]

LEAP_EXPORT Leap::Finger::Finger ( const Pointable )
explicit

If the specified Pointable object represents a finger, creates a copy of it as a Finger object; otherwise, creates an invalid Finger object.

Function details

◆ invalid()

static LEAP_EXPORT const Finger& Leap::Finger::invalid ( )
static

Returns an invalid Finger object.

You can use the instance returned by this function in comparisons testing whether a given Finger instance is valid or invalid. (You can also use the Finger::isValid() function.)

Returns
The invalid Finger instance.

◆ toString()

LEAP_EXPORT std::string Leap::Finger::toString ( ) const

A string containing a brief, human readable description of the Finger object.

Returns
A description of the Finger object as a string.