Cost function notes for DEM optimization
[tecorrec.git] / tcColourMapWidget.h
blob0a55cd8f64a05d832e751c1581fedc95c0cc9036
1 /***************************************************************************
2 * This file is part of Tecorrec. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
4 * *
5 * Tecorrec is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * Tecorrec is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with Tecorrec. If not, write to the Free Software Foundation, *
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
20 #ifndef _tcColourMapWidget_h_
21 #define _tcColourMapWidget_h_
23 /**
24 * @file tcColourMapWidget.h
25 * @brief Colour mapping widget.
28 #include <QScrollArea>
29 #include <QList>
31 class QSignalMapper;
32 class QGridLayout;
33 class QButtonGroup;
35 /// Colour mapping widget.
36 class tcColourMapWidget : public QScrollArea
38 Q_OBJECT
40 public:
43 * Constructors + destructor
46 /// Construct with colour information.
47 tcColourMapWidget(const QStringList& outputBands, QWidget* parent);
49 /// Destructor.
50 virtual ~tcColourMapWidget();
53 * Main interface
56 /// Clear bands.
57 void clearInputBands();
59 /// Add an input band.
60 void addInputBand(const QString& name, const QString& description);
63 * Accessors
66 /// Get the index of the input band assigned to an output band.
67 int inputBand(int outputBand) const;
69 public slots:
72 * Public slots
75 /// Set the input band assigned to an output.
76 void setInputBand(int output, int input);
78 signals:
81 * Signals
84 /// Emitted when an input band is clicked.
85 void inputBandClicked(int input);
87 /// Emitted when the input band assigned to an output is changed.
88 void inputBandChanged(int output, int input);
90 private slots:
93 * Private slots
96 /// Indicates that the input band assigned to an output has changed.
97 void inputBandChangedSlot(int output);
99 private:
102 * GUI objects
105 /// Main layout of the widget.
106 QGridLayout* m_layout;
108 /// Input label signal mapper.
109 QSignalMapper* m_inputSignalMapper;
111 /// Group signal mapper.
112 QSignalMapper* m_groupSignalMapper;
115 * Variables
118 /// Radio button groups for each output band.
119 QList<QButtonGroup*> m_outputBandButtonGroups;
121 /// Number of input colour bands.
122 int m_numInputBands;
125 #endif