Blame view

src/ParamOutputImpl/Plot/Scatter/XYPlot.hh 4.02 KB
fbe3c2bb   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * XYPlot.hh
 *
 *  Created on: 29 oct. 2013
 *      Author: CS
 */

#ifndef XYPLOT_HH_
#define XYPLOT_HH_

#include "PanelPlotOutput.hh"
#include "NodeCfg.hh"
#include "XYPlotNode.hh"

namespace plot {

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

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

	/**
1d1a3b8a   Erdogan Furkan   Done for tickPlot...
34
35
36
37
38
39
40
	 * @overload plot::PanelPlotOutput
	 */
	virtual const std::string subTypeName() {
		return XYPLOT_NODENAME;
	}

	/**
fbe3c2bb   Benjamin Renard   First commit
41
42
43
44
	 * @overload plot::PanelPlotOutput::preparePlotArea()
	 */
	virtual void preparePlotArea(double startTime, double stopTime, int intervalIndex);

34c311b3   Erdogan Furkan   Smooting works
45
46
47
48
49

	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_);
fbe3c2bb   Benjamin Renard   First commit
50
51
52
53
54
55
	/**
	 * @overload plot::PanelPlotOutput::createParameters()
	 */
	virtual void createParameters(std::list<std::string>& usedParametersId_);

	/**
fbe3c2bb   Benjamin Renard   First commit
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
	 * @overload PanelPlotOutput::getLayoutConstraint (void)
	 * @brief Defines the layout constraint to be used for the panel when used within a layout
	 */
	virtual PanelConstraint getLayoutConstraint (void) {
		return PanelConstraint::Square;
	}

	/**
	 * @brief Flag to make x axis and y axis have the same length
	 */
	bool _isIsotropic;

protected:
	/**
	 * @overload PanelPlotOutput::calculatePlotArea(Bounds const& pPanelBounds)
	 * @brief Calculate and draw plot area.
	 */
8c860e4f   Benjamin Renard   Rework for tickpl...
73
	virtual void calculatePlotArea(const Bounds& panelBounds_, Bounds& bounds_);
97f9b74e   Erdogan Furkan   #10776 - Density ...
74
	std::pair<double,double> getIsotropicGaps(std::string xAxisId,std::string yAxisId );
fbe3c2bb   Benjamin Renard   First commit
75
76
77
78
79
80
81
82
83
84
85

	/**
	 * @brief Format a date / time according to a given format.
	 */
	virtual std::string formatDateTime (double dateTime, const std::string &format);
	/**
	 * @brief Draw time ticks for a serie on plot.
	 */
	virtual void drawTimeTicks(SeriesProperties& pSeries, AMDA::Common::ParameterIndexComponent pParamIndex,
			double* timeValues, int nbTimeValues);

5953671a   Erdogan Furkan   For now
86
87
88

	virtual void drawHistogram2D(double startDate, double stopDate, std::string pParamId, Histogram2DSeriesProperties &pHistogram2DProperties);

fbe3c2bb   Benjamin Renard   First commit
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
	/**
	 * @overload PanelPlotOutput::drawSeries(double startDate, double stopDate, std::string pParamId, SeriesProperties const& pSerie)
	 * @brief Draw series of parameter on plot.
	 */
	virtual void drawSeries(double startDate, double stopDate, int intervalIndex, std::string pParamId,
			SeriesProperties& pSerie,
			AMDA::Common::ParameterIndexComponent pParamIndex, ParameterAxes& param,
			bool moreThanOneSerieForAxis);

	/**
	 * @overload PanelPlotOutput::drawCurvePlot(CurvePlot &curvePlot)
	 * @brief Draw curvePlot for a panel.
	 */
	virtual void drawCurvePlot(CurvePlot &curvePlot);

	/*
	 * Dumps properties for test.
	 */
	virtual void dump(std::ostream& fileName_);

	/*
	 * @brief Get computed X values (in relation with the x axis definition) for a serie and a time interval
	 * Do not forget to delete computedValues !!
	 * Don't delete timeValues !!
	 */
	bool getXComputedValuesFromSerieAndInterval(double startDate, double stopDate, SeriesProperties &rSeriesProperties,
			double** computedValues, double** timeValues, int& nbValues);

	/*
	 * @overload PanelPlotOutput::getSerieParamsLegendString Return the associated params legend to a xy serie
	 */
	virtual std::string getSerieParamsLegendString(SeriesProperties &rSeriesProperties,
			AMDA::Common::ParameterIndexComponent& index, std::string originalParamId);

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

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

} /* namespace plot */
#endif /* XYPLOT_HH_ */