ImFusion SDK 4.3
TrackerID Class Reference

#include <ImFusion/Base/TrackingInstrument.h>

Class identifying a tracker via a unique ID. More...

Detailed Description

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.

Note
ID, Name, and Model Number cannot contain the character |, 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::stringID () const
 ID of the tracking instrument. Needs to be set uniquely by the input TrackingStream.
 
const std::stringmodelNumber () const
 Model number of the tracking instrument.
 
const std::stringname () 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.
 

Constructor & Destructor Documentation

◆ TrackerID() [1/2]

TrackerID ( const std::string & modelNumber,
const std::string & name )
explicit

Creates a TrackerID from only model number and name. Intended for backward compatibility only, as it cannot guarantee uniqueness of the ID.

Deprecated
"Should not be used, use the constructor with ID arguments instead. Only intended for backward compatibility."

◆ TrackerID() [2/2]

TrackerID ( const std::string & name)
explicit

Creates a TrackerID from instrument-name only. Intended for backward compatibility only, as it cannot guarantee uniqueness of the ID.

Deprecated
"Should not be used, use the constructor with ID arguments instead. Only intended for backward compatibility."

Member Function Documentation

◆ toIDModelNameString()

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>"

◆ string()

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.

Deprecated
"Should not be used due to missing compatibility with fromIDModelName. Use toIDModelNameString instead."

The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close