All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions
SciFigs::PaletteInterpole Class Reference

Brief description of class still missing. More...

#include <PaletteInterpole.h>

Inheritance diagram for SciFigs::PaletteInterpole:
QGpGuiTools::Dialog QGpGuiTools::FrameGrabber

List of all members.

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

Detailed Description

Brief description of class still missing.

Full description of class still missing


Constructor & Destructor Documentation

SciFigs::PaletteInterpole::PaletteInterpole ( QWidget *  parent = 0) [inline]
: Dialog(parent) {setupUi(this);}

Member Function Documentation

References TRACE.

{
  TRACE;
  return fromList->currentIndex();
}

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
}

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
}

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
}

References TRACE.

{
  TRACE;
  return toList->currentIndex();
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines