QtiPlot  0.9.8.2
ColorMapEditor.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : ColorMapEditor.h
3  Project : QtiPlot
4 --------------------------------------------------------------------
5  Copyright : (C) 2006 by Ion Vasilief
6  Email (use @ for *) : ion_vasilief*yahoo.fr
7  Description : A QwtLinearColorMap Editor Widget
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  * This program is distributed in the hope that it will be useful, *
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
20  * GNU General Public License for more details. *
21  * *
22  * You should have received a copy of the GNU General Public License *
23  * along with this program; if not, write to the Free Software *
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
25  * Boston, MA 02110-1301 USA *
26  * *
27  ***************************************************************************/
28 #ifndef COLORMAPEDITOR_H
29 #define COLORMAPEDITOR_H
30 
31 #include <QWidget>
32 #include <QLocale>
33 #include <LinearColorMap.h>
34 
35 class QPushButton;
36 class QTableWidget;
37 class QCheckBox;
38 class DoubleSpinBox;
39 
41 
47 class ColorMapEditor: public QWidget
48 {
49  Q_OBJECT
50 
51 public:
53 
56  ColorMapEditor(const QLocale& locale = QLocale::system(), int precision = 6, QWidget* parent = 0);
60  void setColorMap(const LinearColorMap& map);
62  void setRange(double min, double max);
63 
64 signals:
65  void scalingChanged();
66 
67 protected slots:
68  void updateLowerRangeLimit(double);
69  void updateUpperRangeLimit(double);
70  void updateColorMap();
71  void enableButtons(int row);
72  void showColorDialog(int row, int col);
73  void insertLevel();
74  void deleteLevel();
75  void setScaledColors(bool scale = true);
77 
78  bool eventFilter(QObject *object, QEvent *e);
79 
80 private:
82  QTableWidget *table;
83  QPushButton *insertBtn, *deleteBtn;
84  QCheckBox *scaleColorsBox;
85 
89  double min_val, max_val;
91  QLocale d_locale;
94 };
95 
96 #endif