XSeriesProperties.hh 2.19 KB
/*
 * XSerieProperties.hh
 *
 *  Created on: 13 déc. 2013
 *      Author: CS
 */

#ifndef XSERIESPROPERTIES_HH_
#define XSERIESPROPERTIES_HH_

#include <sstream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>

#include "ParameterIndexesTool.hh"

namespace plot {

/**
 * X Serie properties for XYPlot
 */
class XSeriesProperties {
public:
	XSeriesProperties() :
			_id(-1),
			_index(-1,-1),
			_paramId(""),
			_computeExpression(""),
			_computeExpressionName(""),
			_min(nan("")),
			_max(nan(""))
	{
	}

	virtual ~XSeriesProperties() {
	}

	int getId() const {
		return _id;
	}

	void setId(int id) {
		_id = id;
	}

	AMDA::Common::ParameterIndexComponent getIndex() const {
		return _index;
	}

	void setIndex(AMDA::Common::ParameterIndexComponent index) {
		_index = index;
	}

	const std::string& getComputeExpression() const {
		return _computeExpression;
	}

	void setComputeExpression(const std::string& computeExpression) {
		_computeExpression = computeExpression;
	}

	const std::string& getComputeExpressionName() const {
		return _computeExpressionName;
	}

	void setComputeExpressionName(const std::string& computeExpressionName) {
		_computeExpressionName = computeExpressionName;
	}

	void setParamId(const std::string& xParamId)
	{
		_paramId = xParamId;
	}

	const std::string& getParamId() const {
		return _paramId;
	}

	double getMax() const {
		return _max;
	}

	void setMax(double max) {
		_max = max;
	}

	double getMin() const {
		return _min;
	}

	void setMin(double min) {
		_min = min;
	}

	/*
	 * Dumps properties for test.
	 */
	void dump(std::ostream& out_, std::string& prefix_);

private :

	/**
	 * X Serie identifier
	 */
	int _id;

	/**
	 * Component index
	 */
	AMDA::Common::ParameterIndexComponent _index;

	/**
	 * Related Param Id
	 */
	std::string _paramId;

	/**
	 * Compute expression used to set expression results as x values
	 * instead of parameter index
	 */
	std::string _computeExpression;

	/**
	 * Name of the compute expression.
	 * Used for legend axis
	 */
	std::string _computeExpressionName;

	/*
	 * Min acceptable value
	 */
	double		_min;

	/*
	 * Max acceptable value
	 */
	double		_max;
};

} /* namespace plot */
#endif /* XSERIESPROPERTIES_HH_ */