Allows the user to select a property and range to color a Model or Scene.
More...
|
| void | drawGradient (QPainter &p, const QRect &r) const |
| | Draws the color gradient within the specified rectangle.
|
| void | drawTicksAndLabels (QPainter &p, const QRect &r) const |
| | Draws tick marks and value labels alongside the gradient.
|
| Vector< 3, fltp08 > | getUIValues (const Material &mat) const |
| | Extracts the current UI min, mid, and max values from the given material.
|
|
void | init () |
| | Initializes the widget layout and default state.
|
| bool | isHorizontal () const |
| | Returns whether the gradient is displayed horizontally.
|
| void | paintEvent (QPaintEvent *) override |
| | Paints the gradient bar and associated labels.
|
|
void | setupAsDialog () |
| | Configures this widget instance as a popup dialog.
|
| void | updateColorsFromUI (const Buffer< RGBColor > &colors) |
| | Updates the color palette from the UI controls.
|
|
void | updateFromDialog () |
| | Applies values from the popup dialog to the widget.
|
|
void | updateFromTargetMaterial () |
| | Updates the widget from the current target material state.
|
|
void | updateFromTargetModel () |
| | Updates the widget from the current target model state.
|
|
void | updatePopupLayout () |
| | Updates the popup dialog layout orientation.
|
|
void | updatePopupValues () |
| | Updates the popup dialog values from the main widget.
|
| QString | valueAtIndex (int i, int n) const |
| | Returns the formatted value string at a given tick index.
|
|
|
Buffer< Button * > | m_add_buttons |
| | Buttons for adding color stops.
|
|
Buffer< ColorChooserButton * > | m_color_buttons |
| | Buttons for choosing individual gradient colors.
|
|
Buffer< RGBColor > | m_colors |
| | The color palette for the gradient.
|
|
Buffer< Button * > | m_delete_buttons |
| | Buttons for removing color stops.
|
|
QRect | m_gradient_rect |
| | The rectangle area where the gradient is drawn.
|
|
bool | m_hover = false |
| | Whether the mouse is hovering over the widget.
|
|
bool | m_is_dialog = false |
| | Whether this widget is configured as a popup dialog.
|
|
bool | m_is_unit_flipped |
| | Whether the value axis is flipped.
|
|
DynamicPointer< QTDesignObject > | m_material |
| | The material being edited.
|
|
fltp08 | m_max |
| | The maximum value of the color range.
|
|
fltp08 | m_min |
| | The minimum value of the color range.
|
|
QCustomComboBox * | m_palette_combo = nullptr |
| | Combo box for selecting predefined palettes.
|
|
ColorByValueWidget * | m_popup = nullptr |
| | The popup dialog version of this widget.
|
|
bool | m_pressed = false |
| | Whether the mouse is pressed on the widget.
|
|
RandomColorGenerator | m_random_generator |
| | Generator for random color palettes.
|
|
DynamicPointer< QTDesignObject > | m_target_material |
| | The target material design object.
|
|
DynamicPointer< QTDesignObject > | m_target_model |
| | The target model design object.
|
|
QCustomLineEdit * | max_value_line_edit |
| | Line edit for the maximum value.
|
|
QCustomLineEdit * | mid_value_line_edit |
| | Line edit for the midpoint value.
|
|
QCustomLineEdit * | min_value_line_edit |
| | Line edit for the minimum value.
|
Allows the user to select a property and range to color a Model or Scene.
Definition at line 51 of file ColorByValueWidget.h.
◆ ColorByValueWidget() [1/2]
| ColorByValueWidget::ColorByValueWidget |
( |
QWidget * | parent = nullptr | ) |
|
Constructs a ColorByValueWidget without a material target.
- Parameters
-
| [in] | parent | The optional parent widget. |
◆ ColorByValueWidget() [2/2]
Constructs a ColorByValueWidget bound to a specific material.
- Parameters
-
| [in] | material | The material design object to color by value. |
| [in] | parent | The optional parent widget. |
References material().
◆ drawGradient()
| void ColorByValueWidget::drawGradient |
( |
QPainter & | p, |
|
|
const QRect & | r ) const |
|
protected |
Draws the color gradient within the specified rectangle.
- Parameters
-
| [in] | p | The painter to draw with. |
| [in] | r | The rectangle to draw in. |
◆ drawTicksAndLabels()
| void ColorByValueWidget::drawTicksAndLabels |
( |
QPainter & | p, |
|
|
const QRect & | r ) const |
|
protected |
Draws tick marks and value labels alongside the gradient.
- Parameters
-
| [in] | p | The painter to draw with. |
| [in] | r | The rectangle defining the gradient area. |
◆ enterEvent()
| void ColorByValueWidget::enterEvent |
( |
QEnterEvent * | | ) |
|
|
override |
Handles the mouse enter event for hover effects.
- Parameters
-
| [in] | event | The enter event (unused parameter name). |
◆ getUIValues()
Extracts the current UI min, mid, and max values from the given material.
- Parameters
-
| [in] | mat | The material to read values from. |
- Returns
- A 3D vector containing the min, mid, and max values.
◆ isHorizontal()
| bool ColorByValueWidget::isHorizontal |
( |
| ) |
const |
|
protected |
Returns whether the gradient is displayed horizontally.
- Returns
- True if horizontal, false if vertical.
◆ leaveEvent()
| void ColorByValueWidget::leaveEvent |
( |
QEvent * | | ) |
|
|
override |
Handles the mouse leave event to clear hover effects.
- Parameters
-
| [in] | event | The leave event (unused parameter name). |
◆ material()
| Material ColorByValueWidget::material |
( |
| ) |
const |
◆ minimumSizeHint()
| QSize ColorByValueWidget::minimumSizeHint |
( |
| ) |
const |
|
override |
Returns the minimum recommended size for this widget.
- Returns
- The minimum QSize.
◆ mouseMoveEvent()
| void ColorByValueWidget::mouseMoveEvent |
( |
QMouseEvent * | | ) |
|
|
override |
Handles mouse move events for interaction.
- Parameters
-
| [in] | event | The mouse move event (unused parameter name). |
◆ mousePressEvent()
| void ColorByValueWidget::mousePressEvent |
( |
QMouseEvent * | | ) |
|
|
override |
Handles mouse press events for interaction.
- Parameters
-
| [in] | event | The mouse press event (unused parameter name). |
◆ mouseReleaseEvent()
| void ColorByValueWidget::mouseReleaseEvent |
( |
QMouseEvent * | | ) |
|
|
override |
Handles mouse release events for interaction.
- Parameters
-
| [in] | event | The mouse release event (unused parameter name). |
◆ paintEvent()
| void ColorByValueWidget::paintEvent |
( |
QPaintEvent * | | ) |
|
|
overrideprotected |
Paints the gradient bar and associated labels.
- Parameters
-
| [in] | event | The paint event (unused parameter name). |
◆ setColors()
| void ColorByValueWidget::setColors |
( |
const Buffer< RGBColor > & | colors | ) |
|
Sets the color palette used for the gradient display.
- Parameters
-
| [in] | colors | The buffer of RGB colors forming the palette. |
◆ setMinAndMax()
| void ColorByValueWidget::setMinAndMax |
( |
fltp08 | min, |
|
|
fltp08 | max ) |
Sets the minimum and maximum values for the color range.
- Parameters
-
| [in] | min | The minimum value. |
| [in] | max | The maximum value. |
◆ setTarget()
Sets the target design object, automatically detecting model or material.
- Parameters
-
| [in] | target | The design object to target. |
◆ setTargetMaterial()
Sets the target material whose color-by-value properties are edited.
- Parameters
-
| [in] | target | The material design object. |
◆ setTargetModel()
Sets the target model whose color-by-value properties are edited.
- Parameters
-
| [in] | target | The model design object. |
◆ sizeHint()
| QSize ColorByValueWidget::sizeHint |
( |
| ) |
const |
|
override |
Returns the recommended size for this widget.
- Returns
- The preferred QSize.
◆ updateColorsFromUI()
| void ColorByValueWidget::updateColorsFromUI |
( |
const Buffer< RGBColor > & | colors | ) |
|
|
protected |
Updates the color palette from the UI controls.
- Parameters
-
| [in] | colors | The new color palette from the UI. |
◆ valueAtIndex()
| QString ColorByValueWidget::valueAtIndex |
( |
int | i, |
|
|
int | n ) const |
|
protected |
Returns the formatted value string at a given tick index.
- Parameters
-
| [in] | i | The tick index. |
| [in] | n | The total number of ticks. |
- Returns
- The formatted value string.
The documentation for this class was generated from the following file: