XAxisDecorator.hh
1.83 KB
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
/*
* XAxisDecorator.hh
*
* Created on: Dec 21, 2013
* Author: amdadev
*/
#ifndef XAXISDECORATOR_HH_
#define XAXISDECORATOR_HH_
#include <memory>
#include "Bounds.hh"
#include "plplot/plstream.h"
#include "PanelPlotOutput.hh"
namespace plot{
/**
* x 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 XAxisDecorator {
public:
/**
* @brief Constructor
*/
XAxisDecorator() : _pParameterValues(NULL) {}
/**
* @brief Copy constructor
*/
XAxisDecorator(const XAxisDecorator& ref_):
_pParameterValues(ref_._pParameterValues) {}
virtual ~XAxisDecorator(){}
/**
* update plot area according to space needed by this decorator to display item it manages.
* @param pplot_ related plot
* @param axis_ axis to decorate
* @param bounds_ plot area to update.
*/
virtual void updatePlotArea(PanelPlotOutput* pplot_, Axis* axis_, Bounds& bounds_)=0;
/**
* configure the decorator according to axis range.
* @param pplot_ related plot
* @param axis_ axis to configure
* @param start_ axis range start.
* @param end_ axis range end.
* @param pParameterValues pointer to a map of ParameterData
*/
virtual void configure(PanelPlotOutput* pplot_, Axis* axis_, double start_, double end_,
std::map<std::string, ParameterData> *pParameterValues) = 0;
/**
* draw decorator stuff.
* @param pplot_ related plot
* @param axis_ axis to decorate
* @param pls_ plot stream executing plot directives.
*/
virtual void draw(PanelPlotOutput* pplot_, Axis* axis_, std::shared_ptr<plstream> pls_)=0;
protected:
std::map<std::string, ParameterData> *_pParameterValues;
};
} // namespace plot
#endif /* XAXISDECORATOR_HH_ */