ColorMapEditor.h
Go to the documentation of this file.
/***************************************************************************
File : ColorMapEditor.h
Project : QtiPlot
--------------------------------------------------------------------
Copyright : (C) 2006 by Ion Vasilief
Email (use @ for *) : ion_vasilief*yahoo.fr
Description : A QwtLinearColorMap Editor Widget
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301 USA *
* *
***************************************************************************/
#ifndef COLORMAPEDITOR_H
#define COLORMAPEDITOR_H
#include <QWidget>
#include <QLocale>
#include <LinearColorMap.h>
class QPushButton;
class QTableWidget;
class QCheckBox;
class DoubleSpinBox;
class ColorMapEditor: public QWidget
{
Q_OBJECT
public:
ColorMapEditor(const QLocale& locale = QLocale::system(), int precision = 6, QWidget* parent = 0);
LinearColorMap colorMap(){return color_map;};
void setColorMap(const LinearColorMap& map);
void setRange(double min, double max);
signals:
void scalingChanged();
protected slots:
void updateLowerRangeLimit(double);
void updateUpperRangeLimit(double);
void updateColorMap();
void enableButtons(int row);
void showColorDialog(int row, int col);
void insertLevel();
void deleteLevel();
void setScaledColors(bool scale = true);
void spinBoxActivated(DoubleSpinBox *);
bool eventFilter(QObject *object, QEvent *e);
private:
QTableWidget *table;
QPushButton *insertBtn, *deleteBtn;
QCheckBox *scaleColorsBox;
LinearColorMap color_map;
double min_val, max_val;
QLocale d_locale;
int d_precision;
};
#endif
ColorMapEditor::setRange
void setRange(double min, double max)
Use this function to initialize the values range.
Definition: ColorMapEditor.cpp:209
LinearColorMap.h
ColorMapEditor::scalingChanged
void scalingChanged()
ColorMapEditor::scaleColorsBox
QCheckBox * scaleColorsBox
Definition: ColorMapEditor.h:84
ColorMapEditor::deleteBtn
QPushButton * deleteBtn
Definition: ColorMapEditor.h:83
ColorMapEditor::color_map
LinearColorMap color_map
Color map object.
Definition: ColorMapEditor.h:87
ColorMapEditor::setColorMap
void setColorMap(const LinearColorMap &map)
Use this function to initialize the color map to be edited.
Definition: ColorMapEditor.cpp:110
ColorMapEditor::updateUpperRangeLimit
void updateUpperRangeLimit(double)
Definition: ColorMapEditor.cpp:192
ColorMapEditor::insertBtn
QPushButton * insertBtn
Definition: ColorMapEditor.h:83
ColorMapEditor::d_locale
QLocale d_locale
Locale settings used to display level values.
Definition: ColorMapEditor.h:91
ColorMapEditor::spinBoxActivated
void spinBoxActivated(DoubleSpinBox *)
Definition: ColorMapEditor.cpp:340
LinearColorMap
A customized QwtLinearColorMap.
Definition: LinearColorMap.h:39
DoubleSpinBox
A QDoubleSpinBox allowing to customize numbers display with respect to locale settings.
Definition: DoubleSpinBox.h:39
ColorMapEditor::table
QTableWidget * table
Table displaying the values ranges in the first column and their corresponding colors in the second c...
Definition: ColorMapEditor.h:82
min
#define min(a, b)
Definition: ShapiroWilkTest.cpp:36
ColorMapEditor::d_precision
int d_precision
Precision used to display level values.
Definition: ColorMapEditor.h:93
ColorMapEditor::updateColorMap
void updateColorMap()
Definition: ColorMapEditor.cpp:93
ColorMapEditor::enableButtons
void enableButtons(int row)
Definition: ColorMapEditor.cpp:314
ColorMapEditor::eventFilter
bool eventFilter(QObject *object, QEvent *e)
Definition: ColorMapEditor.cpp:289
ColorMapEditor::setScaledColors
void setScaledColors(bool scale=true)
Definition: ColorMapEditor.cpp:330
ColorMapEditor::colorMap
LinearColorMap colorMap()
Returns the customized color map.
Definition: ColorMapEditor.h:58
ColorMapEditor::max_val
double max_val
Definition: ColorMapEditor.h:89
ColorMapEditor::deleteLevel
void deleteLevel()
Definition: ColorMapEditor.cpp:263
ColorMapEditor::insertLevel
void insertLevel()
Definition: ColorMapEditor.cpp:215
ColorMapEditor::ColorMapEditor
ColorMapEditor(const QLocale &locale=QLocale::system(), int precision=6, QWidget *parent=0)
Constructor.
Definition: ColorMapEditor.cpp:42
ColorMapEditor
A complex widget allowing to customize a QwtLinearColorMap.
Definition: ColorMapEditor.h:47
ColorMapEditor::min_val
double min_val
Levels range.
Definition: ColorMapEditor.h:89
ColorMapEditor::showColorDialog
void showColorDialog(int row, int col)
Definition: ColorMapEditor.cpp:270
ColorMapEditor::updateLowerRangeLimit
void updateLowerRangeLimit(double)
Definition: ColorMapEditor.cpp:170