-
Notifications
You must be signed in to change notification settings - Fork 1
/
Graph.h
50 lines (38 loc) · 1.21 KB
/
Graph.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
#include <vector>
#include <string>
struct Point
{
float x;
float y;
};
typedef std::vector<std::string> StringVector;
typedef StringVector MultiPoint;
/*
Class which contains a graph.
Used to help us generate a graphPlot.
*/
class Graph
{
public:
Graph();
Graph(std::vector< Point > points, std::string _xLabel, std::string _yLabel, std::string _name);
Graph(std::vector< MultiPoint > points, StringVector labels, std::string _name);
bool writeGraphToFile(bool append);
bool writeMultiGraphToFile(bool);
inline void addGraphPoint(Point p){ graphPoints.push_back(p); };
inline std::vector<Point> getGraph(){ return graphPoints; };
inline std::string getName(){ return name; };
inline void setNAme(std::string n) { name = n; };
inline std::string getXLabel(){ return xLabel; };
inline void setXLabel(std::string label) { xLabel = label; };
inline std::string getYLabel(){ return yLabel; };
inline void setYLabel(std::string label) { yLabel = label; };
inline std::string getLabel(int pos){return labels[pos]; };
private:
std::vector< Point > graphPoints;
std::vector< MultiPoint> graphMultiPoints;
StringVector labels;
std::string xLabel;
std::string yLabel;
std::string name;
};