NDEVR
API Documentation
MaterialPropertySlider

Can adjust the properties of a material using a QCustomSlider widget. More...

Inheritance diagram for MaterialPropertySlider:
[legend]
Collaboration diagram for MaterialPropertySlider:
[legend]

Public Member Functions

 MaterialPropertySlider (const DynamicPointer< QTDesignObject > &object, NDPM property, QWidget *parent=nullptr)
 Constructs a slider bound to a specific material property of a design object.
 MaterialPropertySlider (NDPM property, QWidget *parent=nullptr)
 Constructs an unbound slider for a specific material property.
void addTarget (const DynamicPointer< QTDesignObject > &object) override
 Adds a design object as an additional editing target.
void onObjectDeletedSlot ()
 Slot called when the target object is deleted, clearing the current target.
void onTargetUpdated (UUID id) override
 Called when the target design object is updated, refreshes the slider value.
void refreshFromMaterial (const Material &mat)
 Updates the slider value from the given material's property.
void removeTarget (const DynamicPointer< QTDesignObject > &object) override
 Removes a design object from the editing targets.
Public Member Functions inherited from QCustomSlider
 QCustomSlider (Qt::Orientation orientation, QWidget *parent=nullptr)
 Constructs a slider with the specified orientation.
 QCustomSlider (QWidget *parent=nullptr)
 Constructs a slider with default orientation.
void edited (fltp08 percent)
 Signal emitted when the slider value changes.
void editingFinished ()
 Signal emitted when the user finishes editing the slider value.
fltp08 getValue () const
 Returns the current slider value as a floating-point percent.
void setMaximum (fltp08 value)
 Sets the maximum slider value from a floating-point value.
void setMinimum (fltp08 value)
 Sets the minimum slider value from a floating-point value.
void setRange (fltp08 min, fltp08 max)
 Sets the minimum and maximum range of the slider.
void setValue (fltp08 value)
 Sets the slider value from a floating-point percent.
void setVertical (bool is_vertical)
 Sets the slider orientation to vertical or horizontal.
Public Member Functions inherited from DesignObjectWidgetInterface
virtual Bounds< 3, fltp08bounds () const
 Returns the combined 3D bounding box of all target design objects.
void clearTargets ()
 Removes all target design objects from this widget.
QTModelManagermanager () const
 Returns the current model manager.
Buffer< Modelmodels () const
 Returns all target objects as Models.
virtual void removeTarget (const UUID &object)
 Removes a specific target by UUID.
void setManager (QTModelManager *manager)
 Sets the model manager used for UUID-based lookups.
void setTarget (const DynamicPointer< QTDesignObject > &object)
 Sets a single target design object, replacing any existing targets.
void setTargetID (const UUID &object)
 Sets a single target by UUID, replacing any existing targets.
void setTargetIDs (const Buffer< UUID > &objects)
 Sets multiple targets by UUID, replacing any existing targets.
void setTargets (const Buffer< DynamicPointer< QTDesignObject > > &objects)
 Sets multiple target design objects, replacing any existing targets.
Buffer< UUIDtargetIDs () const
 Returns the UUIDs of all current target design objects.

Protected Member Functions

void init ()
 Initializes slider range and connections based on the material property.
Protected Member Functions inherited from QCustomSlider
void init ()
 Initializes the slider with default settings and signal connections.
void onEditedSlot ()
 Slot called when the slider value is edited by the user.
fltp08 sliderScale () const
 Returns the internal scale factor used to convert between floating-point values and the integer-based QSlider range.
Protected Member Functions inherited from DesignObjectWidgetInterface
const Dictionary< UUID, DynamicPointer< QTDesignObject > > & targets () const
 Returns a const reference to the dictionary of all targets.

Protected Attributes

NDPM m_property
 The material property controlled by this slider.
Protected Attributes inherited from DesignObjectWidgetInterface
DesignObjectInterfacem_interface
 The internal QObject-based implementation handling signals and target storage.

Detailed Description

Can adjust the properties of a material using a QCustomSlider widget.


Definition at line 11 of file MaterialPropertySlider.h.

Constructor & Destructor Documentation

◆ MaterialPropertySlider() [1/2]

MaterialPropertySlider::MaterialPropertySlider ( const DynamicPointer< QTDesignObject > & object,
NDPM property,
QWidget * parent = nullptr )

Constructs a slider bound to a specific material property of a design object.

Parameters
[in]objectThe design object whose material property is being edited.
[in]propertyThe material property to control.
[in]parentThe optional parent widget.

Referenced by DepthBiasSlider::DepthBiasSlider(), DepthBiasSlider::DepthBiasSlider(), OpacitySlider::OpacitySlider(), OpacitySlider::OpacitySlider(), PixelThicknessSlider::PixelThicknessSlider(), and PixelThicknessSlider::PixelThicknessSlider().

◆ MaterialPropertySlider() [2/2]

MaterialPropertySlider::MaterialPropertySlider ( NDPM property,
QWidget * parent = nullptr )

Constructs an unbound slider for a specific material property.

Parameters
[in]propertyThe material property to control.
[in]parentThe optional parent widget.

Member Function Documentation

◆ addTarget()

void MaterialPropertySlider::addTarget ( const DynamicPointer< QTDesignObject > & object)
inlineoverridevirtual

Adds a design object as an additional editing target.

Parameters
[in]objectThe design object to add.

Reimplemented from DesignObjectWidgetInterface.

Definition at line 32 of file MaterialPropertySlider.h.

References DesignObjectWidgetInterface::addTarget().

◆ onTargetUpdated()

void MaterialPropertySlider::onTargetUpdated ( UUID id)
overridevirtual

Called when the target design object is updated, refreshes the slider value.

Parameters
[in]idThe UUID of the updated object.

Reimplemented from DesignObjectWidgetInterface.

◆ refreshFromMaterial()

void MaterialPropertySlider::refreshFromMaterial ( const Material & mat)
inline

Updates the slider value from the given material's property.

Parameters
[in]matThe material to read the property value from.

Definition at line 49 of file MaterialPropertySlider.h.

References DesignObject::get(), DesignObject::isValid(), m_property, QCustomSlider::setValue(), and thickness.

◆ removeTarget()

void MaterialPropertySlider::removeTarget ( const DynamicPointer< QTDesignObject > & object)
inlineoverridevirtual

Removes a design object from the editing targets.

Parameters
[in]objectThe design object to remove.

Reimplemented from DesignObjectWidgetInterface.

Definition at line 40 of file MaterialPropertySlider.h.

References DesignObjectWidgetInterface::removeTarget().


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