12 #include <QHBoxLayout>
13 #include <QToolButton>
21 QString defaultButtonIconPath )
24 m_comboBox(new QComboBox()),
25 m_button(new QToolButton()) {
28 setLayout(
new QHBoxLayout());
29 layout()->setContentsMargins(0, 0, 0, 0);
39 m_button->setIcon(QIcon(defaultButtonIconPath));
56 QMap<QString, QString> scales;
57 for (ccColorScalesManager::ScalesMap::const_iterator it =
60 scales.insert((*it)->getName(), (*it)->getUuid());
63 for (QMap<QString, QString>::const_iterator scale = scales.constBegin();
64 scale != scales.constEnd(); ++scale) {
65 m_comboBox->addItem(scale.key(), scale.value());
68 connect(
m_comboBox, SIGNAL(activated(
int)),
this,
74 connect(
m_button, SIGNAL(clicked()),
this,
88 QString UUID =
m_comboBox->itemData(index).toString();
void colorScaleSelected(int)
Signal emitted when a color scale is selected.
ccColorScaleSelector(ccColorScalesManager *manager, QWidget *parent, QString defaultButtonIconPath=QString())
Default constructor.
void init()
Inits selector with the Color Scales Manager.
void setSelectedScale(QString uuid)
Sets selected combo box item (scale) by UUID.
ccColorScalesManager * m_manager
Color scales manager.
QComboBox * m_comboBox
Color scales combo-box.
void colorScaleEditorSummoned()
QToolButton * m_button
Spawn color scale editor button.
ccColorScale::Shared getScale(int index) const
Returns a given color scale by index.
ccColorScale::Shared getSelectedScale() const
Returns currently selected color scale.
QSharedPointer< ccColorScale > Shared
Shared pointer type.
Color scales manager/container.
ccColorScale::Shared getScale(QString UUID) const
Returns a color scale based on its UUID.
ScalesMap & map()
Access to the internal map.
Tensor Maximum(const Tensor &input, const Tensor &other)
Computes the element-wise maximum of input and other. The tensors must have same data type and device...