A class that manages Natural Point TRACKIR devices.
More...
#include <SurgSim/Devices/TrackIR/TrackIRScaffold.h>
A class that manages Natural Point TRACKIR devices.
- See also
- SurgSim::Device::TrackIRDevice
Constructor.
- Parameters
-
logger | (optional) The logger to be used for the scaffold object and the devices it manages. If unspecified or empty, a console logger will be created and used. |
SurgSim::Device::TrackIRScaffold::~TrackIRScaffold |
( |
| ) |
|
Builds the data layout for the application input (i.e. device output).
bool SurgSim::Device::TrackIRScaffold::createPerDeviceThread |
( |
DeviceData * |
data | ) |
|
|
private |
Creates a thread for the given DeviceData object.
- Parameters
-
- Returns
- true on success.
bool SurgSim::Device::TrackIRScaffold::destroyPerDeviceThread |
( |
DeviceData * |
data | ) |
|
|
private |
Destroys the thread associated with the given DeviceData object.
- Parameters
-
- Returns
- true on success.
bool SurgSim::Device::TrackIRScaffold::finalizeSdk |
( |
| ) |
|
|
private |
Finalizes (de-initializes) the OptiTrack SDK.
- Returns
- true on success.
Gets the logger used by this object and the devices it manages.
- Returns
- The logger used by this scaffold.
std::shared_ptr< TrackIRScaffold > SurgSim::Device::TrackIRScaffold::getOrCreateSharedInstance |
( |
| ) |
|
|
static |
Gets or creates the scaffold shared by all TrackIRDevice instances.
The scaffold is managed using a SingleInstance object, so it will be destroyed when all devices are released.
- Returns
- the scaffold object.
bool SurgSim::Device::TrackIRScaffold::initializeSdk |
( |
| ) |
|
|
private |
Initializes the OptiTrack SDK.
- Returns
- true on success.
bool SurgSim::Device::TrackIRScaffold::registerDevice |
( |
TrackIRDevice * |
device | ) |
|
|
private |
Registers the specified device object.
If successful, the device object will become connected to an unused controller.
- Parameters
-
device | The device object to be used, which should have a unique name. |
- Returns
- True if the initialization succeeds, false if it fails.
Executes the operations for a single input frame for a single device.
Should only be called from the context of the input loop thread.
- Parameters
-
info | The internal device data. |
- Returns
- true on success.
Sets the default log level.
Has no effect unless called before a scaffold is created (i.e. before the first device).
- Parameters
-
void SurgSim::Device::TrackIRScaffold::setOrientationScale |
( |
const TrackIRDevice * |
device, |
|
|
double |
scale |
|
) |
| |
|
private |
Sets the orientation scale for the device.
- Parameters
-
device | The device whose orientation scale will be set. |
scale | Scale of the orientation. |
void SurgSim::Device::TrackIRScaffold::setPositionScale |
( |
const TrackIRDevice * |
device, |
|
|
double |
scale |
|
) |
| |
|
private |
Sets the position scale for the device.
- Parameters
-
device | The device whose position scale will be set. |
scale | Scale of the position. |
bool SurgSim::Device::TrackIRScaffold::startCamera |
( |
DeviceData * |
info | ) |
|
|
private |
Start the camera, it will start sending frames.
- Parameters
-
info | DeviceData object which contains the camera to be started. |
- Returns
- true on success.
bool SurgSim::Device::TrackIRScaffold::stopCamera |
( |
DeviceData * |
info | ) |
|
|
private |
Stop the camera, it will stop sending frames.
- Parameters
-
info | DeviceData object which contains the camera to be stopped. |
- Returns
- true on success.
bool SurgSim::Device::TrackIRScaffold::unregisterDevice |
( |
const TrackIRDevice * |
device | ) |
|
|
private |
Unregisters the specified device object.
The corresponding controller will become unused, and can be re-registered later.
- Parameters
-
- Returns
- true on success, false on failure.
Updates the device information for a single device.
- Parameters
-
- Returns
- true on success.
The default logging level.
Logger used by the scaffold and all devices.
std::unique_ptr<StateData> SurgSim::Device::TrackIRScaffold::m_state |
|
private |
The documentation for this class was generated from the following files: