iVS3D v2.0.9
Loading...
Searching...
No Matches
MCFG::ModelSettingsWidget Class Reference

Reusable UI widget for selecting detection models and configuring class selection. More...

#include <ModelSettingsWidget.h>

Inheritance diagram for MCFG::ModelSettingsWidget:

Signals

void modelChanged (const QString &modelName, bool isValid)
 Emitted when user selects a different model.
 
void classSelectionChanged (const QVector< uint > &selectedClassIds)
 Emitted when user changes class selection.
 
void modelConfigChanged ()
 Emitted when any model configuration parameter changes This includes normalizeTo01, applyMeanStd, or inputAlignment changes.
 

Public Member Functions

 ModelSettingsWidget (ModelManager &manager, QWidget *parent=nullptr)
 Construct the settings widget.
 
 ~ModelSettingsWidget ()=default
 Destructor.
 
void refreshModelList ()
 Refresh the model list from the manager Call this after the manager's refresh() method or when models change.
 
bool setSelectedModel (const QString &modelName)
 Set the currently selected model.
 
QString selectedModel () const
 Get the currently selected model name.
 
QVector< uint > selectedClassIds () const
 Get the class selection state for the current model.
 
void setSelectedClassIds (const QVector< uint > &classIds)
 Set which classes are selected (by class ID)
 

Private Member Functions

void updateModelDisplay ()
 Update the display based on currently selected model.
 
void updateClassList ()
 Rebuild the class checkbox list.
 
void showModelError (ModelManager::ModelState state, const QString &errorMessage)
 Show error message for invalid model.
 
void setupUi ()
 Create all UI elements.
 
void setupManagerConnections ()
 Setup connections to ModelManager signals/slots.
 
QString getResolutionHint (ModelManager::ModelState state) const
 Get human-readable hint for resolving model errors.
 
QString getStateString (ModelManager::ModelState state) const
 Get human-readable string for model state.
 
void updateConfigurationSection ()
 Update configuration section with current model config.
 
void checkConfigurationChanges ()
 Check if configuration has changed from original values.
 

Detailed Description

Reusable UI widget for selecting detection models and configuring class selection.

This widget integrates with ModelManager to:

  • Display all available models (valid and invalid) in a dropdown
  • Show classes as checkboxes for valid models
  • Display error messages for invalid models with resolution hints
  • Emit signals when model or class selection changes

The widget automatically handles model state (Ready, MissingModel, InvalidConfig, etc.) and provides appropriate feedback to the user.

The underlying model-config format is documented in ModelConfig.md.

Author
Dominik Wüst (domin.nosp@m.ik.w.nosp@m.uest@.nosp@m.iosb.nosp@m..frau.nosp@m.nhof.nosp@m.er.de)
Date
March 2026

Constructor & Destructor Documentation

◆ ModelSettingsWidget()

MCFG::ModelSettingsWidget::ModelSettingsWidget ( ModelManager manager,
QWidget *  parent = nullptr 
)
explicit

Construct the settings widget.

Parameters
managerReference to the model manager (must outlive this widget)
parentParent widget

Member Function Documentation

◆ classSelectionChanged

void MCFG::ModelSettingsWidget::classSelectionChanged ( const QVector< uint > &  selectedClassIds)
signal

Emitted when user changes class selection.

Parameters
selectedClassIdsVector of class IDs that are now selected

◆ modelChanged

void MCFG::ModelSettingsWidget::modelChanged ( const QString &  modelName,
bool  isValid 
)
signal

Emitted when user selects a different model.

Parameters
modelNameName of the newly selected model
isValidtrue if the model is valid and ready, false if it has errors

◆ selectedClassIds()

QVector< uint > MCFG::ModelSettingsWidget::selectedClassIds ( ) const

Get the class selection state for the current model.

Returns
Vector of class IDs that are currently selected

◆ selectedModel()

QString MCFG::ModelSettingsWidget::selectedModel ( ) const

Get the currently selected model name.

Returns
Name of the selected model, or empty string if none selected

◆ setSelectedClassIds()

void MCFG::ModelSettingsWidget::setSelectedClassIds ( const QVector< uint > &  classIds)

Set which classes are selected (by class ID)

Parameters
classIdsVector of class IDs to select

◆ setSelectedModel()

bool MCFG::ModelSettingsWidget::setSelectedModel ( const QString &  modelName)

Set the currently selected model.

Parameters
modelNameName of the model to select
Returns
true if model was found and selected, false otherwise

The documentation for this class was generated from the following files: