NDEVR
API Documentation
DesignWidget

A widget showing key properties of a DesignObject selection, used primarily in a SelectionWidget. More...

Collaboration diagram for DesignWidget:
[legend]

Classes

struct  PropertiesStruct
 Aggregated rendering properties of the current selection, used to update UI controls. More...

Public Member Functions

 DesignWidget (QTModelManager *model_manager, QWidget *parent)
 Constructs a DesignWidget bound to the given model manager.
void clear ()
 Clears all displayed data and resets the widget.
QSize minimumSizeHint () const override
 Returns the minimum size hint for this widget.
Buffer< UUIDmodelIDs () const
 Returns the UUIDs of the currently displayed models.
Buffer< Modelmodels () const
 Returns the currently displayed models.
const PropertiesStructpropertiesStruct () const
 Returns the current aggregated properties of the selection.
void refreshFromModel (const UUID &id)
 Refreshes the displayed values for a specific model.
void refreshFromModels ()
 Refreshes all displayed values from the current set of models.
void setHorizontal (bool is_horizontal)
 Sets whether the layout is horizontal or vertical.
void setModelIDs (const Buffer< UUID > &model_ids)
 Sets the design objects to display properties for.

Protected Member Functions

void collectProperties (PropertiesStruct &properties) const
 Collects rendering properties from all current models into the given struct.
ThreadcreateCalcThread ()
 Creates a background thread for computing volume and area.
void setupMaterialSection (Model &model, uint04 duration)
 Sets up the material section of the UI for the given model.
void updateProperties ()
 Updates the aggregated properties and refreshes the UI accordingly.
void updateVolumeAndAreaWidget ()
 Updates the volume and area display widget with cached or freshly computed values.

Protected Attributes

CameraLocationCombom_camera_location_combo
 Combo box for camera location presets.
bool m_is_horizontal
 Whether the widget uses horizontal layout.
bool m_is_volume_queued
 Whether a volume computation is queued.
DesignWidgetCache m_last_data
 Cached computed values from the last update.
Buffer< UUIDm_model_ids
 The UUIDs of the currently displayed models.
QTModelManagerm_model_manager
 The model manager providing design objects.
PropertiesStruct m_properties
 The aggregated rendering properties of the current selection.
QTResourceListenerm_units_listener
 Listener for unit changes to refresh display.
Threadm_volume_thread
 The background thread for computing volume and area.
Ui::DesignWidgetUI * ui
 The generated UI form.

Detailed Description

A widget showing key properties of a DesignObject selection, used primarily in a SelectionWidget.


Definition at line 59 of file DesignWidget.h.

Constructor & Destructor Documentation

◆ DesignWidget()

DesignWidget::DesignWidget ( QTModelManager * model_manager,
QWidget * parent )

Constructs a DesignWidget bound to the given model manager.

Parameters
[in]model_managerThe QTModelManager providing design objects.
[in]parentThe parent widget.

References DesignWidget().

Referenced by DesignWidget().

Member Function Documentation

◆ collectProperties()

void DesignWidget::collectProperties ( PropertiesStruct & properties) const
protected

Collects rendering properties from all current models into the given struct.

Parameters
[in]propertiesThe struct to populate.

◆ createCalcThread()

Thread * DesignWidget::createCalcThread ( )
protected

Creates a background thread for computing volume and area.

Returns
A pointer to the created Thread.

◆ minimumSizeHint()

QSize DesignWidget::minimumSizeHint ( ) const
override

Returns the minimum size hint for this widget.

Returns
The minimum QSize.

◆ modelIDs()

Buffer< UUID > DesignWidget::modelIDs ( ) const
inline

Returns the UUIDs of the currently displayed models.

Returns
A buffer of model UUIDs.

Definition at line 145 of file DesignWidget.h.

References m_model_ids.

◆ models()

Buffer< Model > DesignWidget::models ( ) const

Returns the currently displayed models.

Returns
A buffer of Model instances.

◆ propertiesStruct()

const PropertiesStruct & DesignWidget::propertiesStruct ( ) const
inline

Returns the current aggregated properties of the selection.

Returns
A const reference to the PropertiesStruct.

Definition at line 140 of file DesignWidget.h.

References m_properties.

◆ refreshFromModel()

void DesignWidget::refreshFromModel ( const UUID & id)

Refreshes the displayed values for a specific model.

Parameters
[in]idThe UUID of the model to refresh.

◆ setHorizontal()

void DesignWidget::setHorizontal ( bool is_horizontal)

Sets whether the layout is horizontal or vertical.

Parameters
[in]is_horizontalTrue for horizontal layout.

◆ setModelIDs()

void DesignWidget::setModelIDs ( const Buffer< UUID > & model_ids)

Sets the design objects to display properties for.

Parameters
[in]model_idsThe UUIDs of the models to inspect.

◆ setupMaterialSection()

void DesignWidget::setupMaterialSection ( Model & model,
uint04 duration )
protected

Sets up the material section of the UI for the given model.

Parameters
[in]modelThe model to display material info for.
[in]durationThe animation duration in milliseconds.

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