ImFusion SDK 4.3
TrackingInstrumentComboBox Class Reference

#include <ImFusion/Stream/StreamGUIHelpers.h>

Helper class to set a list of TrackingInstruments to a QComboBox for instrument selection. More...

+ Inheritance diagram for TrackingInstrumentComboBox:

Detailed Description

Helper class to set a list of TrackingInstruments to a QComboBox for instrument selection.

The class internally stores the TrackerID of the instrument and supports different display options.

Public Types

enum  FormattingOptions { ID = 1 << 0 , ModelNumber = 1 << 1 , Name = 1 << 2 , All = 0xFF }
 

Public Member Functions

 TrackingInstrumentComboBox (QWidget *parent=nullptr, bool supportsPreInitializationSelection=true)
 
void initFromTrackingStream (TrackingStream *trackingStream, Flags< FormattingOptions > idFormatting=FormattingOptions::All, bool supportsNoSelection=false)
 Convenience initialization method for the instruments of a tracking stream.
 
void initFromInstruments (const std::vector< TrackerID > &trackingInstrumentIDs, Flags< FormattingOptions > idFormatting=FormattingOptions::All, bool supportsNoSelection=false)
 Initialization method for the combo box for the selection of a tracking instrument.
 
bool selectInstrument (const std::string &trackerId)
 Selects the instrument by id if trackerId is found, otherwise selection is not changed.
 
std::string selectedInstrument () const
 Returns the id of the currently selected tracking instrument.
 
void setSeparator (const std::string &separator)
 Sets the separator for the the fields and replaces the default |.
 
- Public Member Functions inherited from SignalReceiver
 SignalReceiver ()=default
 Default constructor.
 
 SignalReceiver (const SignalReceiver &other)
 Copy constructor, does not copy any existing signal connections from other.
 
SignalReceiveroperator= (SignalReceiver rhs)
 Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs.
 
virtual ~SignalReceiver ()
 Virtual destructor disconnects from all connected signals.
 

Public Attributes

ProtectedSignal< const std::string & > signalSelectedInstrumentChanged
 Signal emits the tracker ID when the selection changed.
 

Additional Inherited Members

- Protected Member Functions inherited from SignalReceiver
void disconnectAll ()
 Disconnects all existing connections.
 

Member Enumeration Documentation

◆ FormattingOptions

Enumerator
ID 

Show unique id.

ModelNumber 

Show model number.

Name 

Show name.

All 

Show all fields in the form "id|modelNumber|name" (equivalent to TrackerID::toIDModelNameString)

Member Function Documentation

◆ initFromTrackingStream()

void initFromTrackingStream ( TrackingStream * trackingStream,
Flags< FormattingOptions > idFormatting = FormattingOptions::All,
bool supportsNoSelection = false )

Convenience initialization method for the instruments of a tracking stream.

The combo box is automatically updated when the tracking stream changes its instrument list.

◆ selectInstrument()

bool selectInstrument ( const std::string & trackerId)

Selects the instrument by id if trackerId is found, otherwise selection is not changed.

If supportsNoSelection is true, the selection is reset when trackerId is empty. Returns true if the specified instrument could be selected, false otherwise.


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