RequestOutputPlotAdditionalObjectsNodeClass.php
1.24 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
<?php
require_once "RequestOutputPlotTextNodeClass.php";
require_once "RequestOutputPlotCurveObjectNodeClass.php";
define ("REQUESTOUTPUTPLOTADDITIONALOBJECTS_NAME", "additionalObjects");
/**
* @class RequestOutputPlotAdditionalObjectsNodeClass
* @brief Definition of additional objects for a plot
* @details
*/
class RequestOutputPlotAdditionalObjectsNodeClass extends NodeClass
{
public function __construct()
{
parent::__construct(REQUESTOUTPUTPLOTADDITIONALOBJECTS_NAME);
}
public function addTextObject()
{
$node = new RequestOutputPlotTextNodeClass();
$this->addChild($node);
return $node;
}
public function addCurveObject()
{
$node = new RequestOutputPlotCurveObjectNodeClass();
$this->addChild($node);
return $node;
}
public function getCurveObjects()
{
return $this->getChildrenByName(REQUESTOUTPUTPLOTCURVEOBJECT_NAME);
}
public function loadFromNode($xmlNode)
{
foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTOUTPUTPLOTTEXT_NAME) as $plotTextXmlNode) {
$this->addTextObject()->loadFromNode($plotTextXmlNode);
}
foreach ($this->getXmlNodeChildrenByTagName($xmlNode, REQUESTOUTPUTPLOTCURVEOBJECT_NAME) as $curveXmlNode) {
$this->addCurveObject()->loadFromNode($curveXmlNode);
}
}
}
?>