CurvePlot.hh
1.64 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
* CurvePlot.hh
*
* Created on: 19/09/2014
* Author: AKKA
*/
#ifndef CURVEPLOT_HH_
#define CURVEPLOT_HH_
#include <iostream>
#include <string>
#include <memory>
#include "LineProperties.hh"
#include "CurveFunction/CurveFunctionWriter.hh"
namespace plot {
/**
* CurvePlot. Defines attributes of each curve drawn on a view port.
*/
class CurvePlot {
public:
friend std::ostream& operator<<(std::ostream& out_, const CurvePlot& lprop_);
/*
* Dumps properties for test.
*/
void dump(std::ostream& out_, std::string& prefix_);
CurvePlot() :
_serieId(-1), _width(1), _color(0,0,0), _style(LineStyle::PLAIN), _drawn(false) {
}
CurvePlot(const CurvePlot& pCurvePlot_) :
_serieId(pCurvePlot_._serieId),
_width(pCurvePlot_._width),
_color(pCurvePlot_._color),
_style(pCurvePlot_._style),
_drawn(pCurvePlot_._drawn),
_curveFunction(pCurvePlot_._curveFunction),
_pointList()
{
}
CurvePlot& operator=(const CurvePlot& pCurvePlot_) {
_serieId = pCurvePlot_._serieId;
_width = pCurvePlot_._width;
_color = pCurvePlot_._color;
_style = pCurvePlot_._style;
_drawn = pCurvePlot_._drawn;
_curveFunction = pCurvePlot_._curveFunction;
_pointList.clear();
return *this;
}
virtual ~CurvePlot() {
}
void resetPlot(void);
CurveFunctionWriter::CurvePointList& getPointList(int resolution);
bool isDrawn(void);
void setDrawn(bool drawn);
public:
int _serieId;
int _width;
Color _color;
LineStyle _style;
bool _drawn;
std::shared_ptr<CurveFunctionWriter> _curveFunction;
private:
CurveFunctionWriter::CurvePointList _pointList;
};
} /* namespace plot */
#endif /* CURVEPLOT_HH_ */