Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Static Private Attributes | Friends
Leap::Bone Class Reference

#include <Leap.h>

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

List of all members.

Public Types

enum  Type { TYPE_METACARPAL = 0, TYPE_PROXIMAL = 1, TYPE_INTERMEDIATE = 2, TYPE_DISTAL = 3 }

Public Member Functions

def __eq__
def __init__
def __ne__
def __str__
LEAP_EXPORT Matrix basis () const
 Bone (BoneImplementation *)
LEAP_EXPORT Bone ()
LEAP_EXPORT Vector center () const
LEAP_EXPORT Vector direction () const
LEAP_EXPORT bool isValid () const
LEAP_EXPORT float length () const
LEAP_EXPORT Vector nextJoint () const
LEAP_EXPORT bool operator!= (const Bone &) const
LEAP_EXPORT bool operator== (const Bone &) const
LEAP_EXPORT Vector prevJoint () const
std::string toString () const
LEAP_EXPORT Type type () const
LEAP_EXPORT float width () const

Static Public Member Functions

static LEAP_EXPORT const Boneinvalid ()

Public Attributes

 this

Static Public Attributes

tuple basis = _swig_property(LeapPython.Bone_basis_get)
tuple center = _swig_property(LeapPython.Bone_center_get)
tuple direction = _swig_property(LeapPython.Bone_direction_get)
tuple is_valid = _swig_property(LeapPython.Bone_is_valid_get)
tuple length = _swig_property(LeapPython.Bone_length_get)
tuple next_joint = _swig_property(LeapPython.Bone_next_joint_get)
tuple prev_joint = _swig_property(LeapPython.Bone_prev_joint_get)
tuple type = _swig_property(LeapPython.Bone_type_get)
 TYPE_DISTAL = LeapPython.Bone_TYPE_DISTAL
 TYPE_INTERMEDIATE = LeapPython.Bone_TYPE_INTERMEDIATE
 TYPE_METACARPAL = LeapPython.Bone_TYPE_METACARPAL
 TYPE_PROXIMAL = LeapPython.Bone_TYPE_PROXIMAL
tuple width = _swig_property(LeapPython.Bone_width_get)

Private Member Functions

LEAP_EXPORT const char * toCString () const

Static Private Attributes

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

Friends

LEAP_EXPORT friend std::ostream & operator<< (std::ostream &, const Bone &)

Detailed Description

The Bone class represents a tracked bone.

All fingers contain 4 bones that make up the anatomy of the finger. Get valid Bone objects from a Finger object.

Bones are ordered from base to tip, indexed from 0 to 3. Additionally, the bone's Type enum may be used to index a specific bone anatomically.

The thumb does not have a base metacarpal bone and therefore contains a valid, zero length bone at that location.

Note that Bone objects can be invalid, which means that they do not contain valid tracking data and do not correspond to a physical bone. Invalid Bone objects can be the result of asking for a Bone object from an invalid finger, indexing a bone out of range, or constructing a new bone. Test for validity with the Bone::isValid() function.

Since:
2.0

Definition at line 662 of file Leap.h.


Member Enumeration Documentation

Enumerates the names of the bones.

Members of this enumeration are returned by Bone::type() to identify a Bone object.

Since:
2.0
Enumerator:
TYPE_METACARPAL 

Bone connected to the wrist inside the palm

TYPE_PROXIMAL 

Bone connecting to the palm

TYPE_INTERMEDIATE 

Bone between the tip and the base

TYPE_DISTAL 

Bone at the tip of the finger

Definition at line 671 of file Leap.h.


Constructor & Destructor Documentation

Leap::Bone::Bone ( BoneImplementation *  )

Constructs an invalid Bone object.

Get valid Bone objects from a Finger object.

Since:
2.0
def Leap::Bone::__init__ (   self)

Definition at line 590 of file Leap.py.


Member Function Documentation

def Leap::Bone::__eq__ (   self,
  arg2 
)

Definition at line 597 of file Leap.py.

def Leap::Bone::__ne__ (   self,
  arg2 
)

Definition at line 600 of file Leap.py.

def Leap::Bone::__str__ (   self)

Definition at line 603 of file Leap.py.

The orthonormal basis vectors for this Bone as a Matrix.

Basis vectors specify the orientation of a bone.

**xBasis** Perpendicular to the longitudinal axis of the bone; exits the sides of the finger.

**yBasis or up vector** Perpendicular to the longitudinal axis of the bone; exits the top and bottom of the finger. More positive in the upward direction.

**zBasis** Aligned with the longitudinal axis of the bone. More positive toward the base of the finger.

The bases provided for the right hand use the right-hand rule; those for the left hand use the left-hand rule. Thus, the positive direction of the x-basis is to the right for the right hand and to the left for the left hand. You can change from right-hand to left-hand rule by multiplying the z basis vector by -1.

You can use the basis vectors for such purposes as measuring complex finger poses and skeletal animation.

Note that converting the basis vectors directly into a quaternion representation is not mathematically valid. If you use quaternions, create them from the derived rotation matrix not directly from the bases.

Returns:
The basis of the bone as a matrix.
Since:
2.0

The midpoint of the bone.

Returns:
The midpoint in the center of the bone.
Since:
2.0

The normalized direction of the bone from base to tip.

Returns:
The normalized direction of the bone from base to tip.
Since:
2.0
static LEAP_EXPORT const Bone& Leap::Bone::invalid ( ) [static]

Returns an invalid Bone object.

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

Returns:
The invalid Bone instance.
Since:
2.0

Reports whether this is a valid Bone object.

Returns:
True, if this Bone object contains valid tracking data.
Since:
2.0

The estimated length of the bone in millimeters.

Returns:
The length of the bone in millimeters.
Since:
2.0

The end of the bone, closest to the finger tip.

In anatomical terms, this is the distal end of the bone.

Returns:
The Vector containing the coordinates of the next joint position.
Since:
2.0
LEAP_EXPORT bool Leap::Bone::operator!= ( const Bone ) const

Compare Bone object inequality.

Two Bone objects are equal if and only if both Bone objects represent the exact same physical bone in the same frame and both Bone objects are valid.

Since:
2.0
LEAP_EXPORT bool Leap::Bone::operator== ( const Bone ) const

Compare Bone object equality.

Two Bone objects are equal if and only if both Bone objects represent the exact same physical bone in the same frame and both Bone objects are valid.

Since:
2.0

The base of the bone, closest to the wrist.

In anatomical terms, this is the proximal end of the bone.

Returns:
The Vector containing the coordinates of the previous joint position.
Since:
2.0
LEAP_EXPORT const char* Leap::Bone::toCString ( ) const [private]
std::string Leap::Bone::toString ( ) const [inline]

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

Returns:
A description of the Bone object as a string.
Since:
2.0

Definition at line 859 of file Leap.h.

The name of this bone.

Returns:
The anatomical type of this bone as a member of the Bone::Type enumeration.
Since:
2.0
LEAP_EXPORT float Leap::Bone::width ( ) const

The average width of the flesh around the bone in millimeters.

Returns:
The width of the flesh around the bone in millimeters.
Since:
2.0

Friends And Related Function Documentation

LEAP_EXPORT friend std::ostream& operator<< ( std::ostream &  ,
const Bone  
) [friend]

Writes a brief, human readable description of the Bone object to an output stream.

Since:
2.0

Member Data Documentation

tuple Leap::Bone::__getattr__ = lambdaself,name:_swig_getattr(self, Bone, name) [static, private]

Reimplemented from Leap::Interface.

Definition at line 583 of file Leap.py.

Leap::Bone::__repr__ = _swig_repr [static, private]

Definition at line 584 of file Leap.py.

tuple Leap::Bone::__setattr__ = lambdaself,name,value:_swig_setattr(self, Bone, name, value) [static, private]

Reimplemented from Leap::Interface.

Definition at line 579 of file Leap.py.

Leap::Bone::__swig_destroy__ = LeapPython.delete_Bone [static, private]

Definition at line 632 of file Leap.py.

dictionary Leap::Bone::__swig_getmethods__ = {} [static, private]

Reimplemented from Leap::Interface.

Definition at line 580 of file Leap.py.

dictionary Leap::Bone::__swig_setmethods__ = {} [static, private]

Reimplemented from Leap::Interface.

Definition at line 576 of file Leap.py.

tuple Leap::Bone::basis = _swig_property(LeapPython.Bone_basis_get) [static]

Definition at line 628 of file Leap.py.

tuple Leap::Bone::center = _swig_property(LeapPython.Bone_center_get) [static]

Definition at line 613 of file Leap.py.

tuple Leap::Bone::direction = _swig_property(LeapPython.Bone_direction_get) [static]

Definition at line 616 of file Leap.py.

tuple Leap::Bone::is_valid = _swig_property(LeapPython.Bone_is_valid_get) [static]

Definition at line 631 of file Leap.py.

tuple Leap::Bone::length = _swig_property(LeapPython.Bone_length_get) [static]

Definition at line 619 of file Leap.py.

tuple Leap::Bone::next_joint = _swig_property(LeapPython.Bone_next_joint_get) [static]

Definition at line 610 of file Leap.py.

tuple Leap::Bone::prev_joint = _swig_property(LeapPython.Bone_prev_joint_get) [static]

Definition at line 607 of file Leap.py.

Definition at line 590 of file Leap.py.

tuple Leap::Bone::type = _swig_property(LeapPython.Bone_type_get) [static]

Definition at line 625 of file Leap.py.

Leap::Bone::TYPE_DISTAL = LeapPython.Bone_TYPE_DISTAL [static]

Definition at line 588 of file Leap.py.

Leap::Bone::TYPE_INTERMEDIATE = LeapPython.Bone_TYPE_INTERMEDIATE [static]

Definition at line 587 of file Leap.py.

Leap::Bone::TYPE_METACARPAL = LeapPython.Bone_TYPE_METACARPAL [static]

Definition at line 585 of file Leap.py.

Leap::Bone::TYPE_PROXIMAL = LeapPython.Bone_TYPE_PROXIMAL [static]

Definition at line 586 of file Leap.py.

tuple Leap::Bone::width = _swig_property(LeapPython.Bone_width_get) [static]

Definition at line 622 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 Sat Jun 8 2019 18:47:25