Blame view

src/ParamOutputImpl/Plot/Label.cc 702 Bytes
fbe3c2bb   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
 * Label.cc
 *
 *  Created on: 27 nov. 2013
 *      Author: CS
 */

#include "Label.hh"
#include <sstream>
#include <algorithm>
#include <boost/regex.hpp>
#include <boost/algorithm/string/regex.hpp>

namespace plot {

const std::string Label::DELIMITER = "/breakline/";

LabelRowInfo Label::getRowNumber(Label const& pLegend) {
df45df5e   Benjamin Renard   Introduce AxisLeg...
19
	LabelRowInfo lSplittedLegend;
fbe3c2bb   Benjamin Renard   First commit
20
21

	if (!pLegend._text.empty()) {
df45df5e   Benjamin Renard   Introduce AxisLeg...
22
		boost::split_regex(lSplittedLegend, pLegend._text,
fbe3c2bb   Benjamin Renard   First commit
23
24
25
26
27
28
				boost::regex(Label::DELIMITER));
	}

	return lSplittedLegend;
}

fbe3c2bb   Benjamin Renard   First commit
29
void Label::dump(std::ostream& out, std::string& prefix) {
df45df5e   Benjamin Renard   Introduce AxisLeg...
30
31
32
33
34
	prefix += "label.";
	out << prefix << "text=" << _text;
	out << prefix << "color=" << _color;
	_font.dump(out, prefix);
}
fbe3c2bb   Benjamin Renard   First commit
35
36

}