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

Source for file LineSet.php

Documentation is available at LineSet.php

  1. <?php
  2. //
  3. // +------------------------------------------------------------------------+
  4. // | PEAR :: Image :: GIS :: Line Set                                       |
  5. // +------------------------------------------------------------------------+
  6. // | Copyright (c) 2002-2005 Jan Kneschke <jan@kneschke.de> and             |
  7. // |                         Sebastian Bergmann <sb@sebastian-bergmann.de>. |
  8. // +------------------------------------------------------------------------+
  9. // | This source file is subject to version 3.00 of the PHP License,        |
  10. // | that is available at http://www.php.net/license/3_0.txt.               |
  11. // | If you did not receive a copy of the PHP license and are unable to     |
  12. // | obtain it through the world-wide-web, please send a note to            |
  13. // | license@php.net so we can mail you a copy immediately.                 |
  14. // +------------------------------------------------------------------------+
  15. //
  16. // $Id$
  17. //
  18.  
  19. /**
  20.  * A Set of Lines.
  21.  *
  22.  * @author      Sebastian Bergmann <sb@sebastian-bergmann.de>
  23.  * @copyright   Copyright &copy; 2002-2005 Jan Kneschke <jan@kneschke.de> and Sebastian Bergmann <sb@sebastian-bergmann.de>
  24.  * @license     http://www.php.net/license/3_0.txt The PHP License, Version 3.0
  25.  * @category    Image
  26.  * @package     Image_GIS2
  27.  */
  28.     /**
  29.     * @var array $color 
  30.     */
  31.     public $color = 'black';
  32.  
  33.     /**
  34.     * @var array $lines 
  35.     */
  36.     public $lines = array();
  37.  
  38.     /**
  39.     * @var array $min 
  40.     */
  41.     public $min = false;
  42.  
  43.     /**
  44.     * @var array $max 
  45.     */
  46.     public $max = false;
  47.  
  48.     /**
  49.     * Constructor.
  50.     *
  51.     * @param  string $color 
  52.     * @access public
  53.     */
  54.     public function Image_GIS2_LineSet($color 'black'{
  55.         $this->color = $color;
  56.     }
  57.  
  58.     /**
  59.     * Adds a line to the line set.
  60.     *
  61.     * @param  float $x1 
  62.     * @param  float $y1 
  63.     * @param  float $x2 
  64.     * @param  float $y2 
  65.     * @access public
  66.     */
  67.     public function addLine($x1$y1$x2$y2{
  68.         $this->lines[= array($x1$y1$x2$y2);
  69.  
  70.         if ($this->min == false{
  71.             $this->min['x'min($x1$x2);
  72.             $this->min['y'min($y1$y2);
  73.             $this->max['x'max($x1$x2);
  74.             $this->max['y'max($y1$y2);
  75.         else {
  76.             $this->min['x'min($this->min['x']$x1$x2);
  77.             $this->min['y'min($this->min['y']$y1$y2);
  78.             $this->max['x'max($this->max['x']$x1$x2);
  79.             $this->max['y'max($this->max['y']$y1$y2);
  80.         }
  81.     }
  82. }
  83. ?>

Documentation generated on Mon, 11 Mar 2019 15:48:42 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.