CurvePlot.cc
1.66 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
/*
* CurvePlot.cc
*
* Created on: 19/09/2014
* Author: AKKA
*/
#include "CurvePlot.hh"
namespace plot {
std::ostream& operator<<(std::ostream& out_, const CurvePlot& lprop_){
out_ << "[CurvePlot]" << std::endl;
out_ << "{"<<std::endl;
out_ << " serie id = " << lprop_._serieId << std::endl;
if (lprop_._curveFunction == nullptr)
out_ << " function name = no function defined!" << std::endl;
else
out_ << " function name = " << lprop_._curveFunction->getFunctionName() << std::endl;
out_ << " width = " << lprop_._width << std::endl;
out_ << " color = " << lprop_._color << std::endl;
//out_ << " style = " << lprop_._style << std::endl;
out_ << "}" << std::endl;
return out_;
}
/*
* Dumps properties for test.
*/
void CurvePlot::dump(std::ostream& out_, std::string& prefix_){
out_ << prefix_ << "curvePlot.serieId=" << _serieId << std::endl;
if (_curveFunction == nullptr)
out_ << prefix_ << "curvePlot.functioName= no function defined!" << std::endl;
else
out_ << prefix_ << "curvePlot.functioName=" << _curveFunction->getFunctionName() << std::endl;
out_ << prefix_ << "curvePlot.width =" << _width << std::endl;
std::string subPrefix=prefix_+"curvePlot.";
_color.dump(out_, subPrefix);
//out_ << prefix_ << "curvePlot.style =" << _style << std::endl;
}
void CurvePlot::resetPlot(void)
{
_drawn = false;
}
CurveFunctionWriter::CurvePointList& CurvePlot::getPointList(int resolution)
{
_pointList.clear();
if (_curveFunction != nullptr)
_curveFunction->call(resolution,_pointList);
return _pointList;
}
bool CurvePlot::isDrawn(void)
{
return _drawn;
}
void CurvePlot::setDrawn(bool drawn)
{
_drawn = drawn;
}
} /* namespace plot */