![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Base/TrackingInstrument.h>
Class identifying a tracker via a unique ID. More...
Class identifying a tracker via a unique ID.
This ID can be set via the constructor and should uniquely identify this tracking instrument. Model number and name of the tracking instrument shall also be set via the same constructor. For legacy reasons two deprecated constructor are provided.
|
, since this is used as separator in the member functions TrackerID::fromIDModelNameString
and TrackerID::string
. Public Member Functions | |
TrackerID (const std::string &ID, const std::string &modelNumber, const std::string &name) | |
Creates a TrackerID from a unique ID (cannot be empty), a model-number, and a name. | |
TrackerID (const std::string &modelNumber, const std::string &name) | |
Creates a TrackerID from only model number and name. Intended for backward compatibility only, as it cannot guarantee uniqueness of the ID. | |
TrackerID (const std::string &name) | |
Creates a TrackerID from instrument-name only. Intended for backward compatibility only, as it cannot guarantee uniqueness of the ID. | |
TrackerID () | |
Default Ctor. | |
void | setID (const std::string &id) |
Sets the ID string. | |
void | setName (const std::string &name) |
Sets the tracker name string. | |
void | setModelNumber (const std::string &modelNumber) |
Sets the model number string. | |
const std::string & | ID () const |
ID of the tracking instrument. Needs to be set uniquely by the input TrackingStream. | |
const std::string & | modelNumber () const |
Model number of the tracking instrument. | |
const std::string & | name () const |
Name of the tracking instrument, used for display purposes. | |
std::string | toIDModelNameString (bool skipEmptyFields=false) const |
Converts the TrackerID to a string of the form "id|modelNumber|name". | |
std::string | string () const |
Converts the TrackerID to a string of the form "id|modelNumber|name", "id|name" (if model number is empty), "id|modelNumber" (if name is empty), or "id" (if both are empty) Note: This method is not fully compatible with fromIDModelNameString when "mode number" or "name" is empty. | |
bool | empty () const |
Return true if ID, model-number and name are all empty. | |
Static Public Member Functions | |
static TrackerID | fromIDModelNameString (const std::string &id_ModelNumber_Name_String) |
Creates a TrackerID from a string of the form "id|modelNumber|name". Strings of different kind are rejected. | |
|
explicit |
Creates a TrackerID from only model number and name. Intended for backward compatibility only, as it cannot guarantee uniqueness of the ID.
|
explicit |
Creates a TrackerID from instrument-name only. Intended for backward compatibility only, as it cannot guarantee uniqueness of the ID.
std::string toIDModelNameString | ( | bool | skipEmptyFields = false | ) | const |
Converts the TrackerID to a string of the form "id|modelNumber|name".
If skipEmptyFields is true, preceding separators of empty fields are omitted: "id|name" (if model number is empty), "id|modelNumber" (if name is empty), or "id" (if both are empty). Otherwise, the empty field is filled with a placeholder "<empty>"
std::string string | ( | ) | const |
Converts the TrackerID to a string of the form "id|modelNumber|name", "id|name" (if model number is empty), "id|modelNumber" (if name is empty), or "id" (if both are empty) Note: This method is not fully compatible with fromIDModelNameString when "mode number" or "name" is empty.
Use toIDModelNameString instead.