SurgSim::Devices::LeapScaffold Class Reference

A class that manages Leap devices. More...

`#include <SurgSim/Devices/Leap/LeapScaffold.h>`

## Classes

struct | DeviceData
class | Listener
struct | StateData

## Public Member Functions

virtual | ~LeapScaffold ()
| Destructor. More...

## Private Member Functions

| LeapScaffold ()
| Constructor. More...
bool | registerDevice (LeapDevice *device)
| Registers the specified device object. More...
bool | unregisterDevice (const LeapDevice *device)
| Unregisters the specified device object. More...
bool | doRegisterDevice (DeviceData *info)
| Do the Leap specific registration. More...
void | handleFrame ()
| Handle a new frame of data. More...
void | handleConnect ()
| Handle initial connection to SDK. More...
void | updateHandData ()
| Update the hand data. More...
void | updateImageData ()
| Update the image data. More...
void | setUseHmdTrackingMode (bool useHmdTrackingMode)
| Set using HMD Tracking Mode. More...
bool | isUsingHmdTrackingMode () const
| Is Using HMD Tracking Mode. More...

## Static Private Member Functions

static std::shared_ptr< LeapScaffold > | getOrCreateSharedInstance ()
| Gets or creates the scaffold shared by all LeapDevice instances. More...
static DataStructures::DataGroup | buildDeviceInputData ()
| Builds the data layout for the application input (i.e. device output). More...

## Private Attributes

std::unique_ptr< StateData > | m_state
| Internal scaffold state. More...
std::shared_ptr< Framework::Logger > | m_logger
| Logger used by the scaffold. More...

## Friends

class | LeapDevice

## Detailed Description

A class that manages Leap devices.

See also
  SurgSim::Devices::LeapDevice

## Constructor & Destructor Documentation

## ~LeapScaffold()

SurgSim::Devices::LeapScaffold::~LeapScaffold | ( |  | ) |

virtual

Destructor.

## LeapScaffold()

SurgSim::Devices::LeapScaffold::LeapScaffold | ( |  | ) |

private

Constructor.

## Member Function Documentation

## buildDeviceInputData()

DataStructures::DataGroup SurgSim::Devices::LeapScaffold::buildDeviceInputData | ( |  | ) |

static private

Builds the data layout for the application input (i.e. device output).

## doRegisterDevice()

bool SurgSim::Devices::LeapScaffold::doRegisterDevice | ( | DeviceData * | info | ) |

private

Do the Leap specific registration.

Parameters

  info | The device data

Returns
  true on success, false on failure.

## getOrCreateSharedInstance()

std::shared_ptr< LeapScaffold > SurgSim::Devices::LeapScaffold::getOrCreateSharedInstance | ( |  | ) |

static private

Gets or creates the scaffold shared by all LeapDevice instances.

The scaffold is managed using a SharedInstance object, so it will be destroyed when all devices are released.

Returns
  the scaffold object.

## handleConnect()

void SurgSim::Devices::LeapScaffold::handleConnect | ( |  | ) |

private

Handle initial connection to SDK.

## handleFrame()

void SurgSim::Devices::LeapScaffold::handleFrame | ( |  | ) |

private

Handle a new frame of data.

## isUsingHmdTrackingMode()

bool SurgSim::Devices::LeapScaffold::isUsingHmdTrackingMode | ( |  | ) | const

private

Is Using HMD Tracking Mode.

Returns
  True if using HMD Tracking Mode

## registerDevice()

bool SurgSim::Devices::LeapScaffold::registerDevice | ( | LeapDevice * | device | ) |

private

Registers the specified device object.

Parameters

  device | The device object to be used

Returns
  True if the initialization succeeds, false if it fails.

## setUseHmdTrackingMode()

void SurgSim::Devices::LeapScaffold::setUseHmdTrackingMode | ( | bool | useHmdTrackingMode | ) |

private

Set using HMD Tracking Mode.

Parameters

  useHmdTrackingMode | True if using HMD Tracking Mode

## unregisterDevice()

bool SurgSim::Devices::LeapScaffold::unregisterDevice | ( | const LeapDevice * | device | ) |

private

Unregisters the specified device object.

Parameters

  device | The device object.

Returns
  true on success, false on failure.

## updateHandData()

void SurgSim::Devices::LeapScaffold::updateHandData | ( |  | ) |

private

Update the hand data.

## updateImageData()

void SurgSim::Devices::LeapScaffold::updateImageData | ( |  | ) |

private

Update the image data.

## Friends And Related Function Documentation

## LeapDevice

friend class LeapDevice

friend

## Member Data Documentation

## m_logger

std::shared_ptr<Framework::Logger> SurgSim::Devices::LeapScaffold::m_logger

private

Logger used by the scaffold.

## m_state

std::unique_ptr<StateData> SurgSim::Devices::LeapScaffold::m_state

private

Internal scaffold state.

The documentation for this class was generated from the following files:

- SurgSim/Devices/Leap/LeapScaffold.h
- SurgSim/Devices/Leap/LeapScaffold.cpp