Blame view

src/ParamOutputImpl/Plot/TimeAxisDecorator.hh 1.63 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
 * TickMarkHandler.hh
 *
 *  Created on: Dec 17, 2013
 *      Author: amdadev
 */

#ifndef TIMEAXISDECORATOR_HH_
#define TIMEAXISDECORATOR_HH_


#include <iosfwd>

#include "XAxisDecorator.hh"
#include "PanelPlotOutput.hh"
#include "TimeAxis.hh"

namespace plot {

/**
 * @brief Time axis decorator. decorator is attached to a plot panel and is used to add decoration to the x axis.
 * This class is responsible of reserving space for what it needs to draw in the panel, configuring itself and
 * draws additional stuff it manage.
 */
class TimeAxisDecorator :public XAxisDecorator {
public:
	/**
	 * @brief Default constructor
	 */
	TimeAxisDecorator(): XAxisDecorator() {}

	/**
	 * @brief Copy constructor
	 */
	TimeAxisDecorator(const TimeAxisDecorator& ref_): XAxisDecorator(ref_),
			_PLFormat(ref_._PLFormat) {}

	/**
	 * default destructor
	 */
	virtual ~TimeAxisDecorator(){}

	/**
	 * @brief Gets the format used by plPlot for this axis values.
	 * This method should be called after TickMarkHandler::configure has been called, since it
	 * may process the format.
	 * @return
	 */
	const std::string& getPlFormat() const {
		return _PLFormat;
	}


protected:
	/**
	 * @brief Install function used to format each values when displaying tick mark informations.
	 * @param plot_ plot that is decorated
	 * @param axis_ time axis to decorate
	 * @return
	 */
	virtual void installLabelGenerator(PanelPlotOutput* pplot_,TimeAxis* axis_)  =0;

	void setPlFormat(const std::string& plFormat_) {
		_PLFormat = plFormat_;
	}


private:
	/**
	 * PLPlot format for time values.
	 */
	std::string _PLFormat;

};

} /* namespace plot */

#endif /* TIMEAXISDECORATOR_HH_ */