SeExpr

Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
VectorControl Class Reference

A vector or color control (named vector because it edits a SeExpr2::Vec3d literal) More...

`#include <ExprControl.h>`

Inheritance diagram for VectorControl:

## Public Member Functions
| VectorControl (int id, VectorEditable *number)
QColor | getColor ()
| Interface for getting the color (used for linked color picking) More...
void | setColor (QColor color)
| Interface for setting the color (used for linked color picking) More...
Public Member Functions inherited from ExprControl
| ExprControl (int id, Editable *editable, bool showColorLink)
virtual | ~ExprControl ()
void | linkDisconnect (int newId)

## Private Slots
void | sliderChanged (int id, float val)
void | editChanged (int id, const QString &text)
void | swatchChanged (QColor color)

## Private Member Functions
void | setValue (int id, float value)
| set the value in the model (in response to editing from controls) More...
void | updateControl ()
| update the individual slider and eidt box controls More...

## Private Attributes
VectorEditable * | _numberEditable
| Number model. More...
ExprLineEdit * | _edits [3]
| All three line edit widgets (for each component) More...
ExprCSwatchFrame * | _swatch
ExprChannelSlider * | _sliders [3]
| All three channel sliders (for each component) More...

## Additional Inherited Members
Public Slots inherited from ExprControl
void | linkStateChange (int state)
Signals inherited from ExprControl
void | controlChanged (int id)
void | linkColorEdited (int id, QColor color)
void | linkColorLink (int id)
Protected Attributes inherited from ExprControl
int | _id
bool | _updating
QHBoxLayout * | hbox
QCheckBox * | _colorLinkCB
QLabel * | _label
Editable * | _editable

## Detailed Description

A vector or color control (named vector because it edits a SeExpr2::Vec3d literal)

Definition at line 196 of file ExprControl.h.

## Constructor & Destructor Documentation

## ◆ VectorControl()

VectorControl::VectorControl | ( | int | id,
|  | VectorEditable * | number
| ) |  |

Definition at line 273 of file ExprControl.cpp.

References _edits, _numberEditable, _sliders, _swatch, editChanged(), ExprControl::hbox, VectorEditable::isColor, ExprChannelSlider::setDisplayColor(), sliderChanged(), swatchChanged(), updateControl(), and VectorEditable::v.

## Member Function Documentation

## ◆ editChanged

void VectorControl::editChanged | ( | int | id,
|  | const QString & | text
| ) |  |
| private slot

Definition at line 335 of file ExprControl.cpp.

References ExprControl::_updating, and setValue().

Referenced by VectorControl().

## ◆ getColor()

QColor VectorControl::getColor | ( |  | ) |
| virtual

Interface for getting the color (used for linked color picking)

Reimplemented from ExprControl.

Definition at line 318 of file ExprControl.cpp.

References _numberEditable, SeExpr2::clamp(), and VectorEditable::v.

Referenced by sliderChanged().

## ◆ setColor()

void VectorControl::setColor | ( | QColor | color | ) |
| virtual

Interface for setting the color (used for linked color picking)

Reimplemented from ExprControl.

Definition at line 323 of file ExprControl.cpp.

References setValue().

## ◆ setValue()

void VectorControl::setValue | ( | int | id,
|  | float | value
| ) |  |
| private

set the value in the model (in response to editing from controls)

Definition at line 367 of file ExprControl.cpp.

References ExprControl::_id, _numberEditable, _swatch, ExprControl::controlChanged(), ExprCSwatchFrame::setValue(), updateControl(), VectorEditable::v, and value().

Referenced by editChanged(), setColor(), sliderChanged(), and swatchChanged().

## ◆ sliderChanged

void VectorControl::sliderChanged | ( | int | id,
|  | float | val
| ) |  |
| private slot

Definition at line 329 of file ExprControl.cpp.

References ExprControl::_id, _numberEditable, ExprControl::_updating, getColor(), VectorEditable::isColor, ExprControl::linkColorEdited(), VectorEditable::max, VectorEditable::min, setValue(), and value().

Referenced by VectorControl().

## ◆ swatchChanged

void VectorControl::swatchChanged | ( | QColor | color | ) |
| private slot

Definition at line 310 of file ExprControl.cpp.

References _swatch, ExprCSwatchFrame::getValue(), and setValue().

Referenced by VectorControl().

## ◆ updateControl()

void VectorControl::updateControl | ( |  | ) |
| private

update the individual slider and eidt box controls

Definition at line 343 of file ExprControl.cpp.

References _edits, ExprControl::_label, _numberEditable, _sliders, ExprControl::_updating, b, SeExpr2::clamp(), VectorEditable::isColor, SeExpr2::max(), VectorEditable::max, SeExpr2::min(), VectorEditable::min, r, ExprChannelSlider::setValue(), and VectorEditable::v.

Referenced by setValue(), and VectorControl().

## Member Data Documentation

## ◆ _edits

ExprLineEdit* VectorControl::_edits[3]
| private

All three line edit widgets (for each component)

Definition at line 202 of file ExprControl.h.

Referenced by updateControl(), and VectorControl().

## ◆ _numberEditable

VectorEditable* VectorControl::_numberEditable
| private

Number model.

Definition at line 200 of file ExprControl.h.

Referenced by getColor(), setValue(), sliderChanged(), updateControl(), and VectorControl().

## ◆ _sliders

ExprChannelSlider* VectorControl::_sliders[3]
| private

All three channel sliders (for each component)

Definition at line 204 of file ExprControl.h.

Referenced by updateControl(), and VectorControl().

## ◆ _swatch

ExprCSwatchFrame* VectorControl::_swatch
| private

Definition at line 203 of file ExprControl.h.

Referenced by setValue(), swatchChanged(), and VectorControl().

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

- /build/seexpr/src/SeExpr/src/SeExpr2/UI/ExprControl.h
- /build/seexpr/src/SeExpr/src/SeExpr2/UI/ExprControl.cpp