HistogramSeriesProperties.hh 4.11 KB
/*
 * HistogramSeriesProperties.hh
 *
 *  Created on: Jan 27, 2023
 *      Author: AKKODIS
 */

#ifndef HISTOGRAMSERIESPROPERTIES_HH_
#define HISTOGRAMSERIESPROPERTIES_HH_

#include <iostream>
#include <cmath>
#include <string>

#include "DrawingProperties.hh"
#include "ParameterIndexesTool.hh"
#include "BinsProperties.hh"
#include "HistotypeProperties.hh"
#include "ParameterData.hh"
#include "XSeriesProperties.hh"

namespace plot {

/**
 * Drawing properties for a parameter histogram1Dseries.
 */


class HistogramSeriesProperties: public DrawingProperties {
public:
	HistogramSeriesProperties(std::string histogramType) :
			DrawingProperties(),
			_histogramType(histogramType),
			_index(-1,-1),
			_paramId(""),
			_hasXAxis(true),
			_hasYAxis(true),
			_hasZAxis(false),
			_xId(-1),
			_id(-1)
	{
	}

	HistogramSeriesProperties(const DrawingProperties& ref_, std::string histogramType) :
			DrawingProperties(ref_),
			_histogramType(histogramType),
			_index(-1,-1),
			_paramId(""),
			_hasXAxis(true),
			_hasYAxis(true),
			_hasZAxis(false),
			_xId(-1),
			_id(-1)
			
	{
	}

	HistogramSeriesProperties(const HistogramSeriesProperties& pParamDrawingProperties_) :
			DrawingProperties(pParamDrawingProperties_),
			_histogramType(pParamDrawingProperties_._histogramType),
			_index(pParamDrawingProperties_._index),
			_paramId(pParamDrawingProperties_._paramId),
			_hasXAxis(pParamDrawingProperties_._hasXAxis),
			_hasYAxis(pParamDrawingProperties_._hasYAxis),
			_hasZAxis(pParamDrawingProperties_._hasZAxis),
			_xId(pParamDrawingProperties_._xId),
			_id(pParamDrawingProperties_._id)
	{
	}

	HistogramSeriesProperties& operator=(const HistogramSeriesProperties& ref_) {
		DrawingProperties::operator=(ref_);
		_histogramType = ref_._histogramType;
		_index = ref_._index;
		_paramId  = ref_._paramId;
		_hasYAxis = ref_._hasYAxis;
		_hasXAxis = ref_._hasXAxis;
		_hasZAxis = ref_._hasZAxis;
		_xId = ref_._xId;
		_id		  = ref_._id;
		return *this;
	}

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

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

	std::vector<AMDA::Common::ParameterIndexComponent> 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;
	}

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

	void setParamId(std::string paramId_) {_paramId = paramId_;}

	bool hasXAxis() const {return _hasXAxis;}

	void setXAxis(bool hasXAxis) {
		_hasXAxis = hasXAxis;
	}

	bool hasYAxis() const {
		return _hasYAxis;
	}

	void setYAxis(bool hasYAxis) {
		_hasYAxis = hasYAxis;
	}

	bool hasZAxis() const {
		return _hasZAxis;
	}

	void setZAxis(bool hasZAxis) {
		_hasZAxis = hasZAxis;
	}

	int getXId() const {
		return _xId;
	}

	void setXId(int xId) {
		_xId = xId;
	}

	int getId() const {
		return _id;
	}

	void setId(int id) {
		_id = id;
	}
	
	virtual ~HistogramSeriesProperties() {
	}

	ManualProperties& getManualProperties(){return _manualProperties;}
	void setManualProperties(const ManualProperties& pManualProperties_){_manualProperties = pManualProperties_;}

	HistotypeProperties& getHistotypeProperties(){return _histotypeProperties;}
	void setHistotypeProperties(const HistotypeProperties& pHistotypeProperties){_histotypeProperties = pHistotypeProperties;}

	std::string getHistogramType(){return _histogramType;}
	void setHistogramType(std::string histogramType){_histogramType = histogramType;}

	private:
		std::string _histogramType;
		AMDA::Common::ParameterIndexComponent _index;
		std::string _paramId;
		bool _hasXAxis;
		bool _hasYAxis;
		bool _hasZAxis;
		int _xId;
		int _id;
		ManualProperties _manualProperties;
		HistotypeProperties _histotypeProperties;
		
};


} /* namespace plot */

#endif /* HISTOGRAMSERIESPROPERTIES_HH_ */