HistoPlot.hh 2.33 KB
/*
 * HistoPlot.hh
 *
 *  Created on: 29 oct. 2013
 *      Author: CS
 */

#ifndef HISTOPLOT_HH_
#define HISTOPLOT_HH_

#include "NodeCfg.hh"
#include "HistoPlotNode.hh"
#include "PanelPlotOutput.hh"


namespace plot {

/**
 *  @brief Plot that draws f(x).
 */
class HistoPlot: public PanelPlotOutput {
public:
	HistoPlot(AMDA::Parameters::ParameterManager& manager,
			boost::shared_ptr<Panel> panel);
	virtual ~HistoPlot(){};

	/**
	 * @overload plot::PanelPlotOutput
	 */
	virtual const std::string typeName() {
		return HISTOPLOT_NODENAME;
	}

	/**
	 * @overload plot::PanelPlotOutput
	 */
	virtual const std::string subTypeName() {
		return HISTOPLOT_NODENAME;
	}

	/**
	 * @brief Configure params legend for a plot.
	 * @overload plot::PanelPlotOutput
	 */
	//virtual void configureParamsLegend(double startTime, double stopTime, int intervalIndex);


	// /**
	//  * @overload plot::PanelPlotOutput::preparePlotArea()
	//  */
	virtual void preparePlotArea(double startTime, double stopTime, int intervalIndex);


	void getUsedParameters(AMDA::Parameters::ParameterSPtr originalXParam_,AMDA::Parameters::ParameterSPtr originalYParam_,
							AMDA::Parameters::ParameterSPtr originalZParam_, ResamplingProperties &resamplingProperties_,
							int maxResolution_,AMDA::Parameters::ParameterSPtr &usedXParam_,
							AMDA::Parameters::ParameterSPtr &usedYParam_,AMDA::Parameters::ParameterSPtr &usedZParam_);
	// /**
	//  * @overload plot::PanelPlotOutput::createParameters()
	//  */
	virtual void createParameters(std::list<std::string>& usedParametersId_);

	/**
	 * @overload PanelPlotOutput::resetPlot - reset plot
	 */
	virtual void resetPlot();

protected:

	void histo1DUtils(double startDate, double stopDate, HistogramSeriesProperties &pHistogramProperties,
								std::vector<std::pair<double,double>> &grid, double &xBinSize, bool resetCache=FALSE);

	virtual void drawHistogram(double startDate, double stopDate, std::string pParamId, 
								HistogramSeriesProperties &pHistogramProperties, bool isSuperposed);


	private:
	// /**
	//  * @brief Configure series color (symbols and line) and range of axis (depending of parameters series to draw).
	//  */
	void configureSeriesAxis(double startTime, double stopTime);

	// /**
	//  * @brief Configure axis legend with paramInfo.
	//  */
	void configureAxisLegend();
};

} /* namespace plot */
#endif /* HISTOPLOT_HH_ */