add non-functional c1 Hatchery
[openc2e.git] / qtgui / GraphWidget.h
blobda8de68e88568b9a36df3992e8f127cda702440a
1 /*
2 This program is free software; you can redistribute it and/or modify
3 it under the terms of the GNU General Public License as published by
4 the Free Software Foundation; either version 2 of the License, or
5 (at your option) any later version.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
12 You should have received a copy of the GNU General Public License along
13 with this program; if not, write to the Free Software Foundation, Inc.,
14 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 #ifndef GRAPHWIDGET_H
18 #define GRAPHWIDGET_H 1
20 #include <QtGui>
22 struct DataSetDetails {
23 QColor colour;
24 QString name;
27 class GraphWidget : public QWidget {
28 Q_OBJECT
30 protected:
31 std::map<unsigned int, DataSetDetails> datasets;
32 std::map<unsigned int, std::vector<float> > datapoints;
34 float minvertical, maxvertical;
35 unsigned int sizehorizontal;
37 void paintEvent(QPaintEvent *);
39 public:
40 GraphWidget(QWidget *parent);
41 ~GraphWidget();
43 void resetGraph();
44 void wipeGraph();
46 void setVerticalScale(float min, float max);
47 void setHorizontalSize(unsigned int size);
49 void addDataSet(unsigned int dataset);
50 void removeDataSet(unsigned int dataset);
51 void setDataSetColour(unsigned int dataset, QColor colour);
52 void setDataSetName(unsigned int dataset, QString name);
54 void addDataPoint(unsigned int dataset, float data);
57 #endif /* GRAPHWIDGET_H */