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);
76 m_ui->m_catalogComboBox->clear();
80 while(cscPairIt.first != cscPairIt.second)
84 m_ui->m_catalogComboBox->addItem(csc->
getName().c_str());
89 if(m_ui->m_catalogComboBox->count() != 0)
90 onCatalogComboBoxActivated(0);
95 std::string name = m_ui->m_catalogComboBox->itemText(index).toStdString();
102 m_ui->m_groupComboBox->clear();
106 for(std::size_t t = 0; t < csgVec.size(); ++t)
110 m_ui->m_groupComboBox->addItem(csg->
getName().c_str());
113 if(m_ui->m_groupComboBox->count() != 0)
114 onGroupComboBoxActivated(0);
119 std::string catalog = m_ui->m_catalogComboBox->currentText().toStdString();
121 std::string group = m_ui->m_groupComboBox->itemText(index).toStdString();
125 m_ui->m_schemaComboBox->clear();
131 for(std::size_t t = 0; t < csgVec.size(); ++t)
139 for(std::size_t p = 0; p < csVec.size(); ++p)
143 m_ui->m_schemaComboBox->addItem(cs->
getName().c_str());
149 if(m_ui->m_schemaComboBox->count() != 0)
150 onSchemaComboBoxActivated(0);
155 std::string catalog = m_ui->m_catalogComboBox->currentText().toStdString();
157 std::string group = m_ui->m_groupComboBox->currentText().toStdString();
159 std::string schema = m_ui->m_schemaComboBox->itemText(index).toStdString();
167 for(std::size_t t = 0; t < csgVec.size(); ++t)
175 for(std::size_t p = 0; p < csVec.size(); ++p)
181 std::vector<te::color::RGBAColor>* colors = cs->
getColors()[0];
183 std::vector<te::color::RGBAColor>::iterator it = colors->begin();
191 while(it != colors->end())
193 if(count != 0 && count != colors->size() - 1)
195 double pos = (1. / (colors->size() - 1)) * count;
205 m_colorBar->setColorBar(cb);
216 loadDefaultColorCatalog();
220 m_colorBar->setColorBar(cb);
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.
void addColor(const RGBAColor &color, const double &pos)
It adds a color in the color bar.
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.
const std::string & getName() const
It returns the color schema name.
This class represents a group of color schemes.
The concept of color bar.
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.