XYPlotNode.hh
1.98 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
* XYPlotNode.hh
*
* Created on: Dec 6, 2013
* Author: amdadev
*/
#ifndef XYPLOTNODE_HH_
#define XYPLOTNODE_HH_
#include <boost/smart_ptr/shared_ptr.hpp>
#include <libxml/tree.h>
#include "AbstractPanelPlotNode.hh"
#include "PanelPlotOutput.hh"
#include "PlotOutput.hh"
#include "Panel.hh"
#include "ParamsNode.hh"
#include "SeriesNode.hh"
namespace plot {
/**
* xml node name, this name is used in both config and request xml files.
*/
#define XYPLOT_NODENAME "xyPlot"
/**
* Reads xyplot node.
*/
class XYPlotNode: public plot::AbstractPanelPlotNode {
public:
XYPlotNode();
virtual ~XYPlotNode();
protected:
boost::shared_ptr<PanelPlotOutput> proceed(xmlNodePtr, PlotOutput*, Panel*);
private:
/**
* constant to uniquely identify this node in the registry
*/
static const std::string NODENAME;
/**
* artificial special attribute to force registering node.
*/
static std::string _key;
};
/**
* Reads xyplot/params/param node.
*/
template<class PlotType>
class XYPlotParamNode: public ParamNode<PlotType> {
public:
XYPlotParamNode() :
ParamNode<PlotType>() {
ParamNode<PlotType>::getChildList()["xserie"] =
AMDA::XMLConfigurator::NodeCfgSPtr(new XSeriesNode<PlotType>());
ParamNode<PlotType>::getChildList()["yserie"] =
AMDA::XMLConfigurator::NodeCfgSPtr(new SeriesNode<PlotType>());
ParamNode<PlotType>::getChildList()["orbitserie"] =
AMDA::XMLConfigurator::NodeCfgSPtr(new OrbitSeriesNode<PlotType>());
ParamNode<PlotType>::getChildList()["colorserie"] =
AMDA::XMLConfigurator::NodeCfgSPtr(new ColorSeriesNode<PlotType>());
}
virtual ~XYPlotParamNode() {
}
};
/**
* Reads xyplot/params node.
*/
template<class PlotType>
class XYPlotParamsNode: public AMDA::XMLConfigurator::NodeGrpCfg {
public:
XYPlotParamsNode() :
AMDA::XMLConfigurator::NodeGrpCfg() {
getChildList()["param"] = AMDA::XMLConfigurator::NodeCfgSPtr(
new XYPlotParamNode<PlotType>());
}
virtual ~XYPlotParamsNode() {
}
};
} /* namespace plot */
#endif /* XYPLOTNODE_HH_ */