Blame view

src/ParamOutputImpl/Plot/SeriesProperties.cc 2.49 KB
fbe3c2bb   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*
 * SeriesProperties.cc
 *
 *  Created on: Dec 4, 2013
 *      Author: amdadev
 */
#ifndef SERIESPROPERTIES_CC_
#define SERIESPROPERTIES_CC_

#include "SeriesProperties.hh"
#include "DrawingProperties.hh"
#include <sstream>

namespace plot {

319cf057   Benjamin Renard   Fix orbitserie in...
16
17
int SeriesProperties::AUTO_SERIES_ID = -10000;

2fc1f2f8   Benjamin Renard   Full rework for s...
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
std::vector<AMDA::Common::ParameterIndexComponent> SeriesProperties::getIndexList(std::map<std::string, ParameterData> *pParameterValues) {
	std::vector<AMDA::Common::ParameterIndexComponent> indexes;
	if (_index == AMDA::Common::ParameterIndexComponent(-1,-1))
	{
		indexes.insert(indexes.end(),
			(*pParameterValues)[getParamId()]._indexes.begin(),
			(*pParameterValues)[getParamId()]._indexes.end());
		if (indexes.empty()) {
			indexes.push_back(AMDA::Common::ParameterIndexComponent(-1,-1));
		}
	} else {
		indexes.push_back(_index);
	}

	return indexes;
}

fbe3c2bb   Benjamin Renard   First commit
35
36
37
38
39
40
41
42
43
44
45
/*
 * Dumps properties for test.
 */
void SeriesProperties::dump(std::ostream& out_, std::string& prefix_) {
	out_ << "[SERIES PROPERTIES]" << std::endl;
	out_ << prefix_ << "index=" << getIndex().getDim1Index() << "x" << getIndex().getDim2Index() << std::endl;
	out_ << prefix_ << "id=" << getId() << std::endl;
	out_ << prefix_ << "xAxisId=" << getXAxisId() << std::endl;
	out_ << prefix_ << "yAxisId=" << getYAxisId() << std::endl;;
	out_ << prefix_ << "zAxisId=" << getZAxisId() << std::endl;;
	out_ << prefix_ << "colorSerieId=" << getColorSerieId() << std::endl;
c46af5a8   Benjamin Renard   Implements multi ...
46
	out_ << prefix_ << "xId=" << getXId() << std::endl;
fbe3c2bb   Benjamin Renard   First commit
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
	out_ << prefix_ << "paramId=" << getParamId() << std::endl;;
	getColor().dump(out_, prefix_);
	getLineProperties().dump(out_, prefix_);
	getSymbolProperties().dump(out_, prefix_);
}

std::ostream& operator<<(std::ostream& out_, const SeriesProperties& prop_) {
	out_ << "[SERIES PROPERTIES]" << std::endl;
	out_ << "{" << std::endl;
	out_ << "  index=" << prop_._index.getDim1Index() << "x" << prop_._index.getDim2Index() << std::endl;
	out_ << "  id=" << prop_._id << std::endl;
	out_ << "  xAxis Id = " << prop_.getXAxisId() << std::endl;
	out_ << "  yAxis Id = " << prop_.getYAxisId() << std::endl;
	out_ << "  zAxis Id = " << prop_.getZAxisId() << std::endl;
	out_ << "  colorSerieId = " << prop_.getColorSerieId() << std::endl;
c46af5a8   Benjamin Renard   Implements multi ...
62
	out_ << "  xId = " << prop_.getXId() << std::endl;
fbe3c2bb   Benjamin Renard   First commit
63
64
65
66
67
68
69
70
71
72
	out_ << "  default color = " << prop_.getColor() << std::endl;
	out_ << "  " << prop_.getLineProperties() << std::endl;
	out_ << "  " << prop_.getSymbolProperties() << std::endl;
	out_ << "}" << std::endl;
	return out_;
}

}  // namespace plot

#endif /* SERIESPROPERTIES_CC_ */