Blame view

src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotElementNodeClass.php 3.04 KB
22521f1c   Benjamin Renard   First commit
1
2
<?php

c958695a   Benjamin Renard   Add Params Legend...
3
require_once("RequestOutputPlotLegendsNodeClass.php");
22521f1c   Benjamin Renard   First commit
4
5
require_once("RequestOutputPlotParamsNodeClass.php");
require_once("RequestOutputPlotAxesNodeClass.php");
966bd5f8   Benjamin Renard   Add request to ge...
6
7
require_once("RequestOutputPlotAdditionalObjectsNodeClass.php");
require_once("RequestOutputPlotFillsNodeClass.php");
22521f1c   Benjamin Renard   First commit
8

c958695a   Benjamin Renard   Add Params Legend...
9
10
define ("REQUESTOUTPUTPLOTLEGENDS_NAME", "legends");

22521f1c   Benjamin Renard   First commit
11
12
13
14
15
16
17
/**
 * @class RequestOutputPlotElementNodeClass
 * @brief Definition of a plot element for a panel of a plot request
 * @details
*/
class RequestOutputPlotElementNodeClass extends NodeClass
{
17f69bd1   Benjamin Renard   Add tick plot and...
18
	public function __construct($plotElementName, $defineLegends, $defineAdditionalObjects, $defineFills, $noXAxis, $noYAxis, $noZAxis)
22521f1c   Benjamin Renard   First commit
19
20
21
22
	{
		parent::__construct($plotElementName);
		//create plot element skeleton

c958695a   Benjamin Renard   Add Params Legend...
23
24
25
26
27
		if ($defineLegends)
		{
			$node = new RequestOutputPlotLegendsNodeClass(REQUESTOUTPUTPLOTLEGENDS_NAME);
			$this->addChild($node);
		}
22521f1c   Benjamin Renard   First commit
28
29
30
31
32
33

		//params
		$node = new RequestOutputPlotParamsNodeClass();
		$this->addChild($node);

		//axes
17f69bd1   Benjamin Renard   Add tick plot and...
34
35
36
37
38
39
		if (!$noXAxis || !$noYAxis || !$noZAxis)
		{
			$node = new RequestOutputPlotAxesNodeClass($noXAxis, $noYAxis, $noZAxis);
			$this->addChild($node);
		}
			
ab13f26c   Benjamin Renard   Add text object p...
40
41
42
43
44
45
		//additional objects
		if ($defineAdditionalObjects)
		{
			$node = new RequestOutputPlotAdditionalObjectsNodeClass();
			$this->addChild($node);
		}
22521f1c   Benjamin Renard   First commit
46

bbe4d005   Benjamin Renard   Integration for f...
47
48
		//fills
		if ($defineFills)
22521f1c   Benjamin Renard   First commit
49
		 {
bbe4d005   Benjamin Renard   Integration for f...
50
51
52
			$node = new RequestOutputPlotFillsNodeClass();
			$this->addChild($node);
		}
22521f1c   Benjamin Renard   First commit
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
	}

	public function getLegends()
	{
		$node = $this->getChildInstanceByName(REQUESTOUTPUTPLOTLEGENDS_NAME);
		return $node;
	}

	public function getParams()
	{
		$node = $this->getChildInstanceByName(REQUESTOUTPUTPLOTPARAMS_NAME);
		return $node;
	}

	public function getAxes()
	{
		$node = $this->getChildInstanceByName(REQUESTOUTPUTPLOTAXES_NAME);
		return $node;
	}

	public function getAdditionalObjects()
	{
		$node = $this->getChildInstanceByName(REQUESTOUTPUTPLOTADDITIONALOBJECTS_NAME);
		return $node;
	}

	public function getFills()
	{
		$node = $this->getChildInstanceByName(REQUESTOUTPUTPLOTFILLS_NAME);
		return $node;
	}
966bd5f8   Benjamin Renard   Add request to ge...
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
	
	public function loadFromNode($xmlNode)
	{
		$legendXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTLEGENDS_NAME);
		if (isset($legendXmlNode))
			$this->getLegends()->loadFromNode($legendXmlNode);
		
		$paramsXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTPARAMS_NAME);
		if (isset($paramsXmlNode))
			$this->getParams()->loadFromNode($paramsXmlNode);
		
		$axesXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTAXES_NAME);
		if (isset($axesXmlNode))
			$this->getAxes()->loadFromNode($axesXmlNode);
		
		$additionalObjXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTADDITIONALOBJECTS_NAME);
		if (isset($additionalObjXmlNode))
			$this->getAdditionalObjects()->loadFromNode($additionalObjXmlNode);
		
		$fillsXmlNode = $this->getXmlNodeChildByTagName($xmlNode, REQUESTOUTPUTPLOTFILLS_NAME);
		if (isset($fillsXmlNode))
			$this->getFills()->loadFromNode($fillsXmlNode);
	}
22521f1c   Benjamin Renard   First commit
107
108
109
}

?>