TeeChartPHP
[ class tree: TeeChartPHP ] [ index: TeeChartPHP ] [ all elements ]

Source for file Aspect.php

Documentation is available at Aspect.php

  1. <?php
  2.  
  3. /**
  4.  * Aspect class
  5.  *
  6.  * Description: Chart view characteristics to define Chart 3D appearance
  7.  *
  8.  * @author
  9.  * @copyright (c) 1995-2010 by Steema Software SL. All Rights Reserved. <info@steema.com>
  10.  * @version 1.0
  11.  * @package TeeChartPHP
  12.  * @link http://www.steema.com
  13.  */
  14.  
  15. final class Aspect extends TeeBase {
  16.  
  17.     private $applyZOrder=true;
  18.     private $chart3D=15;
  19.     private $clipPoints=true;
  20.     private $elevation=345;
  21.     private $horizOffset=0;
  22.     private $orthoAngle=45;
  23.     private $orthogonal=true;
  24.     private $perspective=100;
  25.     private $rotation=345;
  26.     private $tilt=0;
  27.     private $vertOffset=0;
  28.     private $view3D=true;
  29.     private $zoom=100;
  30.     private $zoomText=true;
  31.  
  32.     public $height3D=0;
  33.     public $width3D=0;
  34.  
  35.  
  36.     // Interceptors
  37.     function __get$property {
  38.       $method ="get{$property}";
  39.       if method_exists$this$method ) ) {
  40.         return $this->$method();
  41.       }
  42.     }
  43.  
  44.     function __set $property,$value {
  45.       $method ="set{$property}";
  46.       if method_exists$this$method ) ) {
  47.         return $this->$method($value);
  48.       }
  49.     }
  50.  
  51.     /**
  52.     * The class constructor.
  53.     */
  54.     public function Aspect($c=null{
  55.         parent::__construct($c);
  56.     }
  57.  
  58.     /**
  59.      * Determines the angle of 3D rotation in degrees.<br>
  60.      * Rotation describes front plane rotation by rotation degrees (0 - 360).
  61.      * Increasing the value positively will bring the right of the Chart
  62.      * towards the viewer and the left of the Chart away, moving around a
  63.      * vertical axis at the central horizontal point of the Chart. <br>
  64.      * <b>Important.</b> Orthogonal should be set to false for Rotation
  65.      * to act on the Chart. <br>
  66.      * Default value: 345
  67.      *
  68.      * @return integer 
  69.      */
  70.     public function getRotation({
  71.         return $this->rotation;
  72.     }
  73.  
  74.     /**
  75.      * Sets the angle of 3D rotation in degrees.
  76.      *
  77.      * @param integer $value 
  78.      */
  79.     public function setRotation($value{
  80.         $this->rotation $this->setIntegerProperty($this->rotation$value);
  81.     }
  82.  
  83.     /**
  84.      * Determines the angle of 3D elevation in degrees.<br>
  85.      * Elevation describes front plane rotation by rotation degrees (0 - 360).
  86.      * Increasing the value positively will bring the top of the Chart towards
  87.      * the viewer and the bottom of the Chart away, moving around an horizontal
  88.      * axis at the central vertical point of the Chart. <br>
  89.      * <b>Important.</b> Orthogonal should be set to false for Elevation to
  90.      * act on the Chart. <br>
  91.      * Default value: 345
  92.      *
  93.      * @return integer 
  94.      */
  95.     public function getElevation({
  96.         return $this->elevation;
  97.     }
  98.  
  99.     /**
  100.      * Sets the angle of 3D elevation in degrees.
  101.      *
  102.      * @param integer $value 
  103.      */
  104.     public function setElevation($value{
  105.         $this->elevation $this->setIntegerProperty($this->elevation$value);
  106.     }
  107.  
  108.     /**
  109.      * Determines the angle of 3D tilt in degrees.<br>
  110.      * Not supported for 2D or 3D orthogonal Charts <br>
  111.      * <b>Important.</b> Set TChart.Aspect.Orthogonal = false;<br>
  112.      * Default value: 0
  113.      *
  114.      * @return integer 
  115.      */
  116.     public function getTilt({
  117.         return $this->tilt;
  118.     }
  119.  
  120.     /**
  121.      * Sets the angle of 3D tilt in degrees.
  122.      *
  123.      * @param integer $value 
  124.      */
  125.     public function setTilt($value{
  126.         $this->tilt $this->setIntegerProperty($this->tilt$value);
  127.     }
  128.  
  129.     /**
  130.      * Displays multiple Series at different 3D "Z" (depth) positions.<br>
  131.      * Run-time only. <br> ApplyZOrder controls if several Series of the same
  132.      * TChart class are displayed in a different Z space for each one. <br>
  133.      * It's valid only when TChart.Aspect.View3D is true and when there's more
  134.      * than one Series in same chart. When false, all Series are drawn using
  135.      * the full Chart Z space. The Chart output can be confusing if Series
  136.      * overlap. <br>
  137.      * Default value: true
  138.      *
  139.      * @return boolean 
  140.      */
  141.     public function getApplyZOrder({
  142.         return $this->applyZOrder;
  143.     }
  144.  
  145.     /**
  146.      * Sets the different 3D "Z" depth positions of multiple Series.
  147.      *
  148.      * @param boolean $value 
  149.      */
  150.     public function setApplyZOrder($value{
  151.         $this->applyZOrder $this->setBooleanProperty($this->applyZOrder$value);
  152.     }
  153.  
  154.     /**
  155.      * Restricts those Series points displayed outside the Chart axes
  156.      * rectangle when true.<br>
  157.      * Chart method defines the TChart or TDBChart component to display
  158.      * on a TQRChart. TQRChart is an "interface" component. It must be
  159.      * associated to a TChart or TDBChart component. <br>
  160.      * Default value: true
  161.      *
  162.      * @return boolean 
  163.      */
  164.     public function getClipPoints({
  165.         return $this->clipPoints;
  166.     }
  167.  
  168.     /**
  169.      * Restricts those Series points displayed outside the Chart axes
  170.      * rectangle when true.
  171.      *
  172.      * @param boolean $value 
  173.      */
  174.     public function setClipPoints($value{
  175.         $this->clipPoints $this->setBooleanProperty($this->clipPoints$value);
  176.     }
  177.  
  178.     /**
  179.      * Displays the Chart in semi-3D mode when true.<br>
  180.      * Orthogonal displays the Chart in a simulated 3D fashion by drawing the
  181.      * Chart depth at an inclined angle. The bottom of the Chart is always
  182.      * horizontal. When false and the Chart is in 3D, the Chart will display
  183.      * in true 3D mode. <br>
  184.      * Default value: true
  185.      *
  186.      * @return boolean 
  187.      */
  188.     public function getOrthogonal({
  189.         return $this->orthogonal;
  190.     }
  191.  
  192.     /**
  193.      * Displays the Chart in semi-3D mode when true.
  194.      *
  195.      * @param boolean $value 
  196.      */
  197.     public function setOrthogonal($value{
  198.         $this->orthogonal $this->setBooleanProperty($this->orthogonal$value);
  199.     }
  200.  
  201.     /**
  202.      * Chooses between speed or display quality for Chart rendering. <br><br>
  203.      * for example:-<br>
  204.      * AntiAlias - Specifies antialiased rendering.  <br>
  205.      * Default - Specifies the default mode.  <br>
  206.      * HighQuality - Specifies high quality, low speed rendering.  <br>
  207.      * HighSpeed - Specifies high speed, low quality rendering.  <br>
  208.      * Invalid - Specifies an invalid mode.  <br>
  209.      * None - Specifies no antialiasing. <br>
  210.      * Default value: HighSpeed
  211.      *
  212.      * @return boolean 
  213.      */
  214.     public function getSmoothingMode({
  215.       if (($this->chart==null|| ($this->chart->getGraphics3D()==null)) {
  216.         return false;
  217.       }
  218.       else {
  219.         return $this->chart->getGraphics3D()->getSmoothingMode();
  220.       }
  221.     }
  222.  
  223.     /**
  224.      * Sets the type of rendering used to display the Chart depending on whether
  225.      * speed, display quality or antialiasing is required.
  226.      *
  227.      * @param boolean $value 
  228.      */
  229.     public function setSmoothingMode($value{
  230.       $g=$this->chart->getGraphics3D();
  231.       if (($this->chart!=null&& ($g!=null)) {
  232.            $g->setSmoothingMode($value);
  233.       }
  234.     }
  235.  
  236.     /**
  237.      * Chooses between speed or display quality for Text rendering.<br>
  238.      *
  239.      * @return boolean 
  240.      */
  241.     public function getTextSmooth({
  242.         return $this->chart->getGraphics3D()->getTextSmooth();
  243.     }
  244.  
  245.     /**
  246.      * Sets the type of rendering used to display Text.
  247.      *
  248.      * @param boolean $value 
  249.      */
  250.     public function setTextSmooth($value{
  251.         $this->chart->getGraphics3D()->setTextSmooth($value);
  252.     }
  253.  
  254.     /**
  255.      * Percent of zoom in 3D mode for the entire Chart.<br>
  256.      * Increasing the value of Zoom brings the entire Chart towards the viewer.
  257.      * 'In Chart' zoom will still function by mouse dragging within the Chart
  258.      * area and is distinct from whole Chart zooming.<br>
  259.      * Default value: 100
  260.      *
  261.      * @return integer 
  262.      */
  263.     public function getZoom({
  264.         return $this->zoom;
  265.     }
  266.  
  267.     /**
  268.      * Sets the percentage of zoom in 3D mode for the entire Chart.
  269.      *
  270.      * @param  integer $value 
  271.      */
  272.     public function setZoom($value{
  273.         $this->zoom $this->setIntegerProperty($this->zoom$value);
  274.     }
  275.  
  276.     /**
  277.      * <br>
  278.      * Perspective offers a distance adjustment for the Chart display, giving
  279.      * an appearance of perspective between the nearer and further parts of the
  280.      * Chart. <br>
  281.      * See the comparison below: <br>
  282.      * No perspective <br>
  283.      * Perspective = 50; <br>
  284.      * Default value: 15
  285.      *
  286.      * @return integer 
  287.      */
  288.     public function getPerspective({
  289.         return $this->perspective;
  290.     }
  291.  
  292.     /**
  293.      * Sets the percentage of 3D perspective.
  294.      *
  295.      * @param integer $value 
  296.      */
  297.     public function setPerspective($value{
  298.         $this->perspective $this->setIntegerProperty($this->perspective$value);
  299.     }
  300.  
  301.     /**
  302.      * Angle in degrees, from 0 to 90, when displaying in Orthogonal mode.<br>
  303.      * OrthoAngle sets the angle of inclination of the Depth axis when the
  304.      * Chart is set to Orthogonal mode, or in other words, when Orthogonal
  305.      * property is set to true. <br>
  306.      * Default value: 45
  307.      *
  308.      * @return integer 
  309.      */
  310.     public function getOrthoAngle({
  311.         return $this->orthoAngle;
  312.     }
  313.  
  314.     /**
  315.      * Sets the angle in degrees, from 0 to 90, to display the Chart when in
  316.      * Orthogonal mode.
  317.      *
  318.      * @param integer $value 
  319.      */
  320.     public function setOrthoAngle($value{
  321.         $this->orthoAngle $this->setIntegerProperty($this->orthoAngle$value);
  322.     }
  323.  
  324.     /**
  325.      * Percent from 0 to 100 of Z Depth.<br>
  326.      * Chart3DPercent indicates the size ratio between Chart dimensions and
  327.      * Chart depth when Chart.Aspect.View3D is true. You can specify a percent
  328.      * number from 1 to 100.<br>
  329.      * Default value: 15
  330.      *
  331.      * @return integer 
  332.      */
  333.     public function getChart3DPercent({
  334.         return $this->chart3D;
  335.     }
  336.  
  337.     /**
  338.      * Sets the percentage of Z Depth.<br>
  339.      *
  340.      * @param integer $value 
  341.      */
  342.     public function setChart3DPercent($value{
  343.         $this->chart3D $this->setIntegerProperty($this->chart3D$value);
  344.     }
  345.  
  346.     public function getWidth3D({
  347.         return $this->width3D;
  348.     }
  349.  
  350.     public function getHeight3D({
  351.         return $this->height3D;
  352.     }
  353.  
  354.     /**
  355.      * Amount (postive or negative) in pixels of horizontal displacement.<br>
  356.      * HorizOffset will move the Chart Rectangle horizontally across the Chart
  357.      * Panel. Positive values move the Chart to the right, negative values to
  358.      * the left. <br>
  359.      * Default value: 0
  360.      *
  361.      * @return integer 
  362.      */
  363.     public function getHorizOffset({
  364.         return $this->horizOffset;
  365.     }
  366.  
  367.     /**
  368.      * Sets the amount (postive or negative) in pixels of horizontal
  369.      * displacement.<br>
  370.      *
  371.      * @param integer $value 
  372.      */
  373.     public function setHorizOffset($value{
  374.         $this->horizOffset $this->setIntegerProperty($this->horizOffset$value);
  375.     }
  376.  
  377.     /**
  378.      * Amount (postive or negative) in pixels of vertical displacement.<br>
  379.      * Moves the entire Chart on a vertical plane. Not Active for 2D or 3D
  380.      * orthogonal Charts. <br>
  381.      * Default value: 0
  382.      *
  383.      * @return integer 
  384.      */
  385.     public function getVertOffset({
  386.         return $this->vertOffset;
  387.     }
  388.  
  389.     /**
  390.      * Sets the amount (postive or negative) in pixels of vertical
  391.      * displacement.<br>
  392.      *
  393.      * @param integer $value 
  394.      */
  395.     public function setVertOffset($value{
  396.         $this->vertOffset $this->setIntegerProperty($this->vertOffset$value);
  397.     }
  398.  
  399.     /**
  400.      * Draws each Series with a 3D effect.<br>
  401.      * You can control the 3D proportion by using Chart.Aspect.Chart3DPercent.
  402.      * Chart.Walls.Visible depends on View3D. <br>
  403.      * Default value: true
  404.      *
  405.      * @return boolean 
  406.      * @see Aspect#getOrthoAngle
  407.      */
  408.     public function getView3D({
  409.         return $this->view3D;
  410.     }
  411.  
  412.     /**
  413.      * Draws each Series with a 3D effect when true.
  414.      *
  415.      * @param boolean $value 
  416.      */
  417.     public function setView3D($value{
  418.       if ($value==0$value=false}
  419.       else
  420.         if ($value==1$value=true}
  421.  
  422.         $this->view3D $this->setBooleanProperty($this->view3D$value);
  423.     }
  424.  
  425.     /**
  426.      * Resizes all texts according to Zoom property when true.<br>
  427.      * When false, Text size will remain constant regardless of the zoom factor
  428.      * obtained with Aspect.Zoom <br>
  429.      * Default value: true
  430.      *
  431.      * @return boolean 
  432.      */
  433.     public function getZoomText({
  434.         return $this->zoomText;
  435.     }
  436.  
  437.     /**
  438.      * Resizes all texts according to Zoom property when true.
  439.      *
  440.      * @param boolean $value 
  441.      */
  442.     public function setZoomText($value{
  443.         $this->zoomText $this->setBooleanProperty($this->zoomText$value);
  444.     }
  445.  
  446.     /**
  447.      * Copies all properties from a Series component to another.<br>
  448.      * Only the common properties shared by both source and destination Series
  449.      * are copied. <br>
  450.      * The following code copies all properties from Series2 into Series1: <br>
  451.      * tChart1.Series[0].Assign(tChart1.Series[1]);<br><br>
  452.      * Some Series types restore values after assigning them. For example,
  453.      * Points Series restores Pointer.Visible to True after being assigned
  454.      * to a Line Series, which has Pointers invisible by default. <br>
  455.      * <b>Note:</b> Series events are not assigned.  Series DataSource and
  456.      * FunctionType are assigned.  Assign is used by CloneChartSeries and
  457.      * ChangeSeriesType methods for example.
  458.      *
  459.      * @param Aspect $a 
  460.      */
  461.     public function assign($a{
  462.         $this->applyZOrder $a->applyZOrder;
  463.         $this->chart3D $a->chart3D;
  464.         $this->clipPoints $a->clipPoints;
  465.         $this->elevation $a->elevation;
  466.         $this->horizOffset $a->horizOffset;
  467.         $this->orthoAngle $a->orthoAngle;
  468.         $this->orthogonal $a->orthogonal;
  469.         $this->perspective $a->perspective;
  470.         $this->rotation $a->rotation;
  471.         $this->tilt $a->tilt;
  472.         $this->vertOffset $a->vertOffset;
  473.         $this->view3D $a->view3D;
  474.         $this->zoom $a->zoom;
  475.         $this->zoomText $a->zoomText;
  476.     }
  477. }
  478. ?>

Documentation generated on Wed, 16 Jun 2010 12:02:45 +0200 by phpDocumentor 1.4.1