Brief description of class still missing. More...
#include <PaletteInterpole.h>
Public Member Functions | |
| int | fromIndex () const |
| PaletteInterpole (QWidget *parent=0) | |
| void | setColors (const ColorPalette &pal) |
| void | setColors (const Legend &leg) |
| void | setValues (const ColorPalette &pal) |
| int | toIndex () const |
Brief description of class still missing.
Full description of class still missing
| SciFigs::PaletteInterpole::PaletteInterpole | ( | QWidget * | parent = 0 | ) | [inline] |
: Dialog(parent) {setupUi(this);}
| int SciFigs::PaletteInterpole::fromIndex | ( | ) | const |
| void SciFigs::PaletteInterpole::setColors | ( | const ColorPalette & | pal | ) |
Populate with colors from a color palette
References QGpGuiTools::ColorPalette::color(), QGpGuiTools::ColorPalette::count(), str, QGpCoreTools::tr(), and TRACE.
{
TRACE;
setWindowTitle(tr("Interpole colors"));
int n=pal.count();
QPixmap pm(20,20);
QPainter p;
for(int i=0 ; i<n; i++) {
QColor c=pal.color(i);
p.begin(&pm);
p.fillRect(0, 0, 20, 20, c);
p.end();
QString str=QString::number(i+1);
fromList->addItem(pm,str);
fromList->setItemData(i, c, Qt::BackgroundRole);
toList->addItem(pm,str);
toList->setItemData(i, c, Qt::BackgroundRole);
}
on_lastEntry_clicked(); // Force the last value by default
}
| void SciFigs::PaletteInterpole::setColors | ( | const Legend & | leg | ) |
Populate with colors from a legend
References SciFigs::Pen::color(), SciFigs::Legend::count(), SciFigs::Legend::pen(), str, SciFigs::Legend::text(), QGpCoreTools::tr(), and TRACE.
{
TRACE;
setWindowTitle(tr("Interpole colors"));
int n=leg.count();
QPixmap pm(20,20);
QPainter p;
for(int i=0 ; i<n; i++) {
QColor c=leg.pen(i).color();
p.begin(&pm);
p.fillRect(0, 0, 20, 20, c);
p.end();
QString str=leg.text(i);
fromList->addItem(pm,str);
fromList->setItemData(i, c, Qt::BackgroundRole);
toList->addItem(pm,str);
toList->setItemData(i, c, Qt::BackgroundRole);
}
on_lastEntry_clicked(); // Force the last value by default
}
| void SciFigs::PaletteInterpole::setValues | ( | const ColorPalette & | pal | ) |
Populate with values from a color palette
References QGpGuiTools::ColorPalette::count(), str, QGpCoreTools::tr(), TRACE, and QGpGuiTools::ColorPalette::upperValue().
{
TRACE;
setWindowTitle(tr("Interpole values"));
int n=pal.count()-1;
static const QString str0("%1: %2");
for(int i=0 ; i<n; i++) {
QString str=str0.arg(i+1).arg(pal.upperValue(i));
fromList->addItem(str);
toList->addItem(str);
}
on_lastEntry_clicked(); // Force the last value by default
}
| int SciFigs::PaletteInterpole::toIndex | ( | ) | const |