Blame view

src/ParamOutputImpl/Plot/LineProperties.cc 1.18 KB
fbe3c2bb   Benjamin Renard   First commit
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
/*
 * LineProperties.cc
 *
 *  Created on: Dec 9, 2013
 *      Author: amdadev
 */

#include "LineProperties.hh"



namespace plot {

std::ostream& operator<<(std::ostream& out_, const LineProperties& lprop_){

	out_ << "[LINE PROPERTIES]" << std::endl;
	out_ << "{"<<std::endl;
	out_ << "  type  =" << static_cast<int>(lprop_._type) << std::endl;
	out_ << "  style =" << static_cast<int>(lprop_._style) << std::endl;
	out_ << "  width =" << lprop_._width << std::endl;
	out_ << "  " << lprop_._color << std::endl;
	out_ << "}" << std::endl;
	return out_;
}

/*
 * Dumps properties for test.
 */
void LineProperties::dump(std::ostream& out_, std::string& prefix_){
	out_ << "[LINE PROPERTIES]" << std::endl;
	out_ << prefix_ << "line.type=" << static_cast<int>(_type) << std::endl;
	out_ << prefix_ << "line.style=" << static_cast<int>(_style) << std::endl;
	out_ << prefix_ << "line.width=" << _width << std::endl;
	std::string subPrefix=prefix_+"line.";
	_color.dump(out_, subPrefix);
}



/**
 * @return Returns line style used by plplot.
 */
int getPlLineStyle (LineStyle pLineStyle) {
	// First line style in plplot is 1 and not 0.
	return static_cast<int>(pLineStyle) + 1;
}

} /* namespace plot */