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

Source for file PointDouble.php

Documentation is available at PointDouble.php

  1. <?php
  2.  
  3. /**
  4.  * PointDouble class
  5.  *
  6.  * Description:
  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. class PointDouble {
  16.  
  17.     public $x;
  18.     public $y;
  19.  
  20.     // Interceptors
  21.     function __get$property {
  22.       $method ="get{$property}";
  23.       if method_exists$this$method ) ) {
  24.         return $this->$method();
  25.       }
  26.     }
  27.  
  28.     function __set $property,$value {
  29.       $method ="set{$property}";
  30.       if method_exists$this$method ) ) {
  31.         return $this->$method($value);
  32.       }
  33.     }
  34.  
  35.      /**
  36.      * Constructs and initializes a point at the origin
  37.      * (0,&nbsp;0) of the coordinate space.
  38.      * @since       1.1
  39.      */
  40.     public function PointDouble($x=0$y=0{
  41.         $this->x = $x;
  42.         $this->y = $y;
  43.     }
  44.  
  45.     /**
  46.      * The X location in pixels.
  47.      *
  48.      * @return double 
  49.      */
  50.     public function getX({
  51.         return $this->x;
  52.     }
  53.  
  54.     /**
  55.      * Sets the X location in pixels.
  56.      *
  57.      * @param value double
  58.      */
  59.     public function setX($value{
  60.         $this->x = $value;
  61.     }
  62.  
  63.     /**
  64.      * The Y location in pixels.
  65.      *
  66.      * @return double 
  67.      */
  68.     public function getY({
  69.         return $this->y;
  70.     }
  71.  
  72.     /**
  73.      * Sets the Y location in pixels.
  74.      *
  75.      * @param value double
  76.      */
  77.     public function setY($value{
  78.         $this->y = $value;
  79.     }
  80.  
  81.     /*
  82.      * convert PointDouble to rounded value Point
  83.      */
  84.     public static function round($value)
  85.     {
  86.       return new TeePoint((int)MathUtils::round($value->getX())(int)MathUtils::round($value->getY()));
  87.     }
  88.  
  89.     /*
  90.      * convert PointDouble[] to rounded value Point[]
  91.      */
  92.     public static function  roundPointArray(/*PointDouble[]*/ $value)
  93.     {
  94.       $result Array()// Array of TeePoint new TeePoint[value.length];
  95.       for ($i 0$i sizeof($value)$i++)
  96.       {
  97.         $result[$iPointDouble::round($value[$i]);
  98.       }
  99.       return $result;
  100.     }
  101. }
  102.  
  103. ?>

Documentation generated on Wed, 16 Jun 2010 12:07:26 +0200 by phpDocumentor 1.4.1