27 #include "../../../color/ColorBar.h" 28 #include "../../../color/ColorScheme.h" 29 #include "../../../color/ColorSchemeCatalog.h" 30 #include "../../../color/ColorSchemeCatalogManager.h" 31 #include "../../../color/ColorSchemeGroup.h" 32 #include "../../../color/RGBAColor.h" 35 #include "ui_ColorCatalogWidgetForm.h" 38 #include <QGridLayout> 43 m_ui(new
Ui::ColorCatalogWidgetForm)
48 QGridLayout* l =
new QGridLayout(
m_ui->m_widget);
49 l->setContentsMargins(0,0,0,0);
74 return m_ui->m_catalogComboBox->currentText().toUtf8().data();
79 return m_ui->m_groupComboBox->currentText().toUtf8().data();
84 return m_ui->m_schemaComboBox->currentText().toUtf8().data();
89 int index =
m_ui->m_catalogComboBox->findText(catalog.c_str());
96 int index =
m_ui->m_groupComboBox->findText(group.c_str());
103 int index =
m_ui->m_schemaComboBox->findText(schema.c_str());
110 m_ui->m_catalogComboBox->clear();
114 while(cscPairIt.first != cscPairIt.second)
118 m_ui->m_catalogComboBox->addItem(csc->
getName().c_str());
123 if(
m_ui->m_catalogComboBox->count() != 0)
129 std::string name =
m_ui->m_catalogComboBox->itemText(index).toUtf8().data();
131 m_ui->m_catalogComboBox->setCurrentIndex(index);
138 m_ui->m_groupComboBox->clear();
142 for(std::size_t t = 0; t < csgVec.size(); ++t)
146 m_ui->m_groupComboBox->addItem(csg->
getName().c_str());
149 if(
m_ui->m_groupComboBox->count() != 0)
155 std::string catalog =
m_ui->m_catalogComboBox->currentText().toUtf8().data();
157 m_ui->m_groupComboBox->setCurrentIndex(index);
159 std::string group =
m_ui->m_groupComboBox->itemText(index).toUtf8().data();
163 m_ui->m_schemaComboBox->clear();
169 for(std::size_t t = 0; t < csgVec.size(); ++t)
177 for(std::size_t
p = 0;
p < csVec.size(); ++
p)
181 m_ui->m_schemaComboBox->addItem(cs->
getName().c_str());
187 if(
m_ui->m_schemaComboBox->count() != 0)
193 std::string catalog =
m_ui->m_catalogComboBox->currentText().toUtf8().data();
195 std::string group =
m_ui->m_groupComboBox->currentText().toUtf8().data();
197 m_ui->m_schemaComboBox->setCurrentIndex(index);
199 std::string schema =
m_ui->m_schemaComboBox->itemText(index).toUtf8().data();
207 for(std::size_t t = 0; t < csgVec.size(); ++t)
215 for(std::size_t
p = 0;
p < csVec.size(); ++
p)
221 std::vector<te::color::RGBAColor>* colors = cs->
getColors()[0];
223 std::vector<te::color::RGBAColor>::iterator it = colors->begin();
231 while(it != colors->end())
233 if(count != 0 && count != static_cast<int>(colors->size()) - 1)
235 double pos = (1. / (colors->size() - 1)) * count;
const std::vector< ColorScheme * > & getColorSchemes() const
It returns a reference to the list of color schemes belonging to this group.
const std::vector< ColorSchemeGroup * > & getColorSchemeGroups() const
It returns the list of color scheme groups in the catalog.
const std::string & getName() const
It returns the group name.
It models the concept of color scheme.
const std::vector< std::vector< RGBAColor > * > & getColors() const
It returns all color lists.
static T & getInstance()
It returns a reference to the singleton instance.
const std::string & getName() const
It returns the catalog name.
The concept of color bar.
const std::string & getName() const
It returns the color schema name.
void addColor(const RGBAColor &color, const double &pos)
It adds a color in the color bar.
This class represents a group of color schemes.
A catalog for color schemes.
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
It models the concept of color bar.