-
Notifications
You must be signed in to change notification settings - Fork 1
/
graphwidget.h
58 lines (49 loc) · 1.44 KB
/
graphwidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*!
* \file graphwidget.h
* \author Simon Coakley
* \date 2012
* \copyright Copyright (c) 2012 University of Sheffield
* \brief Header file for graph widget
*/
#ifndef GRAPHWIDGET_H_
#define GRAPHWIDGET_H_
#include <QWidget>
#include "./agent.h"
#include "./graphsettingsitem.h"
#include "./timescale.h"
class GraphWidget: public QWidget {
Q_OBJECT
public:
GraphWidget(QList<Agent*> *a = 0, int * gs = 0,
TimeScale * ts = 0, QWidget *parent = 0);
void paintEvent(QPaintEvent *event);
void updateData(int it);
void addPlot(GraphSettingsItem * gsi);
int removePlot(GraphSettingsItem * gsi);
void setGraph(QString g) { graphName = g; }
QString getGraph() { return graphName; }
signals:
void increase_iteration();
void decrease_iteration();
void signal_toggleAnimation();
void graph_window_closed(QString graphName);
protected:
void keyPressEvent(QKeyEvent *event);
void closeEvent(QCloseEvent *);
private slots:
private:
void drawStylePoint(int type, int size, int x1, int y1, QPainter *painter);
bool plotsContainTimeScale();
QList<Agent*> *agents;
// GraphSettingsModel * gsmodel;
QList<GraphSettingsItem*> plots;
QList<QList<int> > data;
/*! Flag for each iteration to say data exists */
QList<bool> dataExists;
int topValue;
int topIteration;
QString graphName;
int * style;
TimeScale * timeScale;
};
#endif // GRAPHWIDGET_H_