ColorSeriesProperties.hh 1.57 KB
/*
 * ColorSerieProperties.hh
 *
 *  Created on: 15 nov. 2014
 *      Author: AKKA
 */

#ifndef COLORSERIESPROPERTIES_HH_
#define COLORSERIESPROPERTIES_HH_

#include <string>
#include <map>
#include <algorithm>
#include <cmath>
#include <ctgmath>

namespace plot {

/**
 * Color Serie properties
 */
class ColorSeriesProperties {
public:
	ColorSeriesProperties() :
			_id(-1),
			_index(-1),
			_colorParamIds(),
			_min(nan("")),
			_max(nan("")) {
	}
	virtual ~ColorSeriesProperties() {
	}

	int getId() const {
		return _id;
	}

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

	int getIndex() const {
		return _index;
	}

	void setIndex(int index) {
		_index = index;
	}
	
	/**
	 * Adds a paramId to the paramId vector if not already in.
	 */
	void addParamId(const std::string &relatedYParamId, const std::string &colorParamId)
	{
		_colorParamIds[relatedYParamId] = colorParamId;
	}

	std::map<std::string, std::string> &getColorParamIds() {
		return _colorParamIds;
	}

	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 :

	/**
	 * Color serie id
	 */
	int _id;

	/**
	 * Component index, -1 if scalar vector
	 */
	int _index;
	
	/**
	 * Related Param Ids
	 */
	std::map<std::string, std::string> _colorParamIds;

	/*
	 * Min acceptable value
	 */
	double		_min;

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

} /* namespace plot */
#endif /* COLORSERIESPROPERTIES_HH_ */