Blame view

src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotAdditionalObjectsNodeClass.php 1.24 KB
ab13f26c   Benjamin Renard   Add text object p...
1
2
<?php

966bd5f8   Benjamin Renard   Add request to ge...
3
4
5
require_once "RequestOutputPlotTextNodeClass.php";
require_once "RequestOutputPlotCurveObjectNodeClass.php";

ab13f26c   Benjamin Renard   Add text object p...
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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;
	}
d7f73bcb   Benjamin Renard   Integration for c...
26
27
28
29
30
31
32
	
	public function addCurveObject()
	{
		$node = new RequestOutputPlotCurveObjectNodeClass();
		$this->addChild($node);
		return $node;
	}
966bd5f8   Benjamin Renard   Add request to ge...
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
	
	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);
		}
	}
ab13f26c   Benjamin Renard   Add text object p...
49
50
51
}

?>