RequestOutputPlotElementXYNodeClass.php 1.67 KB
<?php

require_once("RequestOutputPlotElementNodeClass.php");

define ("REQUESTOUTPUTPLOTELEMENTXY_NAME", "xyPlot");
define ("REQUESTOUTPUTPLOTELEMENTXY_ISOTROPIC", "isotropic");
define ("REQUESTOUTPUTPLOTELEMENTXY_XAXISID", "xaxis_id");

/**
 * @class RequestOutputPlotElementXYNodeClass
 * @brief Definition of a XY plot element for a panel of a plot request
 * @details
*/
class RequestOutputPlotElementXYNodeClass extends RequestOutputPlotElementNodeClass
{
	public function __construct()
	{
		parent::__construct(REQUESTOUTPUTPLOTELEMENTXY_NAME,true,true,false,false,false,false);
		//create x axis
		$this->getAxes()->addDigitalAxis(RequestOutputPlotAxisTypeEnum::XAXIS,REQUESTOUTPUTPLOTELEMENTXY_XAXISID);
		//force color axis creation
		$this->getAxes()->getColorAxis();
		//default attributes
		$this->setIsIsotropic(false);
	}

	public function setIsIsotropic($isIsotropic)
	{
		if ($isIsotropic)
			$this->setAttribute(REQUESTOUTPUTPLOTELEMENTXY_ISOTROPIC, "true");
		else
			$this->setAttribute(REQUESTOUTPUTPLOTELEMENTXY_ISOTROPIC, "false");
	}

	public function getIsIsotropic()
	{
		return $this->getAttribute(REQUESTOUTPUTPLOTELEMENTXY_ISOTROPIC);
	}

	public function getXAxis()
	{
		return $this->getAxes()->getDigitalAxis(RequestOutputPlotAxisTypeEnum::XAXIS,REQUESTOUTPUTPLOTELEMENTXY_XAXISID);
	}

	public function addYAxis($id)
	{
		return $this->getAxes()->addDigitalAxis(RequestOutputPlotAxisTypeEnum::YAXIS,$id);
	}

	public function getYAxis($id)
	{
		return $this->getAxes()->getDigitalAxis(RequestOutputPlotAxisTypeEnum::YAXIS,$id);
	}

	public function getZAxis()
	{
		return $this->getAxes()->getColorAxis();
	}
}

?>