NDEVR
API Documentation
MaterialWidget

A simple widget showing some visual properties of a Material or Model. More...

Collaboration diagram for MaterialWidget:
[legend]

Public Member Functions

 MaterialWidget (const DynamicPointer< QTDesignObject > &material, QWidget *parent=nullptr)
 Constructs a MaterialWidget bound to the given design object.
 MaterialWidget (QWidget *parent=nullptr)
 Constructs a MaterialWidget with no initial target.
void colorChannelChosenSignal ()
 Emitted when a color channel mode is selected.
void computedColorChosenSignal ()
 Emitted when a computed color mode is selected.
void setTarget (const DynamicPointer< QTDesignObject > &target)
 Sets the design object target for this widget.
void solidColorChosenSignal ()
 Emitted when a solid color mode is selected.

Protected Member Functions

void setup ()
 Sets up the internal UI layout and child widgets.
void updateFromColor ()
 Updates the widget state based on the current color selection.
void updateFromMaterial (const Model &model, const Material &mat)
 Updates the widget state from the given model and material.

Protected Attributes

TimeSpan m_animation_time
 The animation time used for color transitions.
ColorChannelCombom_color_channel_combo
 Combo box for selecting a vertex color channel.
ColorChooserButtonm_color_chooser_button
 Button for choosing a solid color.
QCustomComboBoxm_color_combo
 Combo box for selecting the color mode (solid, channel, computed).
PropertiesButtonm_properties_button
 Button to open the full material properties editor.
DynamicPointer< QTDesignObjectm_target
 The currently targeted design object.

Detailed Description

A simple widget showing some visual properties of a Material or Model.


Definition at line 46 of file MaterialWidget.h.

Constructor & Destructor Documentation

◆ MaterialWidget() [1/2]

MaterialWidget::MaterialWidget ( QWidget * parent = nullptr)

Constructs a MaterialWidget with no initial target.

Parameters
[in]parentThe optional parent widget.

◆ MaterialWidget() [2/2]

MaterialWidget::MaterialWidget ( const DynamicPointer< QTDesignObject > & material,
QWidget * parent = nullptr )

Constructs a MaterialWidget bound to the given design object.

Parameters
[in]materialThe design object whose material properties are displayed.
[in]parentThe optional parent widget.

Member Function Documentation

◆ setTarget()

void MaterialWidget::setTarget ( const DynamicPointer< QTDesignObject > & target)

Sets the design object target for this widget.

Parameters
[in]targetThe design object to display material properties for.

◆ updateFromMaterial()

void MaterialWidget::updateFromMaterial ( const Model & model,
const Material & mat )
protected

Updates the widget state from the given model and material.

Parameters
[in]modelThe model that owns the material.
[in]matThe material to read properties from.

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