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::Devices::TrackIRDevice
§ TrackIRScaffold()
SurgSim::Devices::TrackIRScaffold::TrackIRScaffold |
( |
| ) |
|
§ ~TrackIRScaffold()
SurgSim::Devices::TrackIRScaffold::~TrackIRScaffold |
( |
| ) |
|
§ buildDeviceInputData()
Builds the data layout for the application input (i.e. device output).
§ createPerDeviceThread()
bool SurgSim::Devices::TrackIRScaffold::createPerDeviceThread |
( |
DeviceData * |
data | ) |
|
|
private |
Creates a thread for the given DeviceData object.
- Parameters
-
- Returns
- true on success.
§ destroyPerDeviceThread()
bool SurgSim::Devices::TrackIRScaffold::destroyPerDeviceThread |
( |
DeviceData * |
data | ) |
|
|
private |
Destroys the thread associated with the given DeviceData object.
- Parameters
-
- Returns
- true on success.
§ finalizeSdk()
bool SurgSim::Devices::TrackIRScaffold::finalizeSdk |
( |
| ) |
|
|
private |
Finalizes (de-initializes) the OptiTrack SDK.
- Returns
- true on success.
§ getOrCreateSharedInstance()
std::shared_ptr< TrackIRScaffold > SurgSim::Devices::TrackIRScaffold::getOrCreateSharedInstance |
( |
| ) |
|
|
static |
Gets or creates the scaffold shared by all TrackIRDevice instances.
The scaffold is managed using a SharedInstance object, so it will be destroyed when all devices are released.
- Returns
- the scaffold object.
§ initializeSdk()
bool SurgSim::Devices::TrackIRScaffold::initializeSdk |
( |
| ) |
|
|
private |
Initializes the OptiTrack SDK.
- Returns
- true on success.
§ registerDevice()
bool SurgSim::Devices::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.
§ runInputFrame()
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.
§ setOrientationScale()
void SurgSim::Devices::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. |
§ setPositionScale()
void SurgSim::Devices::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. |
§ startCamera()
bool SurgSim::Devices::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.
§ stopCamera()
bool SurgSim::Devices::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.
§ unregisterDevice()
bool SurgSim::Devices::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.
§ updateDevice()
Updates the device information for a single device.
- Parameters
-
- Returns
- true on success.
§ StateData
§ TrackIRDevice
§ TrackIRThread
§ m_logger
Logger used by the scaffold and all devices.
§ m_state
std::unique_ptr<StateData> SurgSim::Devices::TrackIRScaffold::m_state |
|
private |
The documentation for this class was generated from the following files: