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

#include <MyListener.h>

Inheritance diagram for MyListener:

Protected Attributes

Frame frame
 
float currentFramesPerSecond
 
InteractionBox interactionBox
 
Hand hand
 
Hand secondHand
 
Quat palmOrientation
 
GestureList gestures
 
Vector translation
 

Public Member Functions

virtual void onInit (const Controller &)
 
virtual void onConnect (const Controller &)
 
virtual void onDisconnect (const Controller &)
 
virtual void onExit (const Controller &)
 
virtual void onFrame (const Controller &)
 
virtual void onFocusGained (const Controller &)
 
virtual void onFocusLost (const Controller &)
 
void update (Leap::Frame frame)
 
int64_t getFrameID ()
 
Vector getPalmPosition ()
 
Vector getStabilizedPalmPosition ()
 
Vector getPalmNormal ()
 
Quat getPalmRotation ()
 
FingerList getFingers ()
 
FingerList getSecondHandFingers ()
 
Hand getHand ()
 
Hand getSecondHand ()
 
Vector getHandSphereCenter ()
 
float getHandSphereRadius ()
 
GestureList getGestures ()
 
Vector getTranslation ()
 
InteractionBox getInteractionBox ()
 
float getFPS ()
 
float getCurrentFramesPerSecond ()
 
- Public Member Functions inherited from Leap::Listener
LEAP_EXPORT Listener ()
 
virtual LEAP_EXPORT ~Listener ()
 

Attribute details

◆ currentFramesPerSecond

float MyListener::currentFramesPerSecond
protected

◆ frame

Frame MyListener::frame
protected

◆ gestures

GestureList MyListener::gestures
protected

◆ hand

Hand MyListener::hand
protected

◆ interactionBox

InteractionBox MyListener::interactionBox
protected

◆ palmOrientation

Quat MyListener::palmOrientation
protected

◆ secondHand

Hand MyListener::secondHand
protected

◆ translation

Vector MyListener::translation
protected

Function details

◆ getCurrentFramesPerSecond()

float MyListener::getCurrentFramesPerSecond ( )
inline

◆ getFingers()

FingerList MyListener::getFingers ( )
inline

◆ getFPS()

float MyListener::getFPS ( )
inline

◆ getFrameID()

int64_t MyListener::getFrameID ( )
inline

◆ getGestures()

GestureList MyListener::getGestures ( )
inline

◆ getHand()

Hand MyListener::getHand ( )
inline

◆ getHandSphereCenter()

Vector MyListener::getHandSphereCenter ( )
inline

◆ getHandSphereRadius()

float MyListener::getHandSphereRadius ( )
inline

◆ getInteractionBox()

InteractionBox MyListener::getInteractionBox ( )
inline

◆ getPalmNormal()

Vector MyListener::getPalmNormal ( )
inline

◆ getPalmPosition()

Vector MyListener::getPalmPosition ( )
inline

◆ getPalmRotation()

Quat MyListener::getPalmRotation ( )
inline

◆ getSecondHand()

Hand MyListener::getSecondHand ( )
inline

◆ getSecondHandFingers()

FingerList MyListener::getSecondHandFingers ( )
inline

◆ getStabilizedPalmPosition()

Vector MyListener::getStabilizedPalmPosition ( )
inline

◆ getTranslation()

Vector MyListener::getTranslation ( )
inline

◆ onConnect()

void MyListener::onConnect ( const Controller )
virtual

Called when the Controller object connects to the Leap software, or when this Listener object is added to a Controller that is already connected.

Parameters
controllerThe Controller object invoking this callback function.

Reimplemented from Leap::Listener.

◆ onDisconnect()

void MyListener::onDisconnect ( const Controller )
virtual

Called when the Controller object disconnects from the Leap software. The controller can disconnect when the Leap device is unplugged, the user shuts the Leap software down, or the Leap software encounters an unrecoverable error.

Note: When you launch a Leap-enabled application in a debugger, the Leap library does not disconnect from the application. This is to allow you to step through code without losing the connection because of time outs.

Parameters
controllerThe Controller object invoking this callback function.

Reimplemented from Leap::Listener.

◆ onExit()

void MyListener::onExit ( const Controller )
virtual

Called when this Listener object is removed from the Controller or the Controller instance is destroyed.

Parameters
controllerThe Controller object invoking this callback function.

Reimplemented from Leap::Listener.

◆ onFocusGained()

void MyListener::onFocusGained ( const Controller )
virtual

Called when this application becomes the foreground application.

Only the foreground application receives tracking data from the Leap Motion Controller. This function is only called when the controller object is in a connected state.

Parameters
controllerThe Controller object invoking this callback function.

Reimplemented from Leap::Listener.

◆ onFocusLost()

void MyListener::onFocusLost ( const Controller )
virtual

Called when this application loses the foreground focus.

Only the foreground application receives tracking data from the Leap Motion Controller. This function is only called when the controller object is in a connected state.

Parameters
controllerThe Controller object invoking this callback function.

Reimplemented from Leap::Listener.

◆ onFrame()

void MyListener::onFrame ( const Controller )
virtual

Called when a new frame of hand and finger tracking data is available. Access the new frame data using the Controller::frame() function.

Note, the Controller skips any pending onFrame events while your onFrame handler executes. If your implementation takes too long to return, one or more frames can be skipped. The Controller still inserts the skipped frames into the frame history. You can access recent frames by setting the history parameter when calling the Controller::frame() function. You can determine if any pending onFrame events were skipped by comparing the ID of the most recent frame with the ID of the last received frame.

Parameters
controllerThe Controller object invoking this callback function.

Reimplemented from Leap::Listener.

◆ onInit()

void MyListener::onInit ( const Controller )
virtual

Called once, when this Listener object is newly added to a Controller.

Parameters
controllerThe Controller object invoking this callback function.

Reimplemented from Leap::Listener.

◆ update()

void MyListener::update ( Leap::Frame  frame)