Image_GIS
[ class tree: Image_GIS ] [ index: Image_GIS ] [ 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: LineSet.php 299207 2010-05-10 10:21:58Z clockwerx $
  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_GIS
  27.  */
  28.     /**
  29.     * @var array $color 
  30.     */
  31.     var $color = 'black';
  32.  
  33.     /**
  34.     * @var array $lines 
  35.     */
  36.     var $lines = array();
  37.  
  38.     /**
  39.     * @var array $min 
  40.     */
  41.     var $min = false;
  42.     /**
  43.     * @var array $max 
  44.     */
  45.     var $max = false;
  46.  
  47.     /**
  48.     * Constructor.
  49.     *
  50.     * @param  string $color 
  51.     * @access public
  52.     */
  53.     function Image_GIS_LineSet($color 'black'{
  54.         $this->color = $color;
  55.     }
  56.  
  57.     /**
  58.     * Adds a line to the line set.
  59.     *
  60.     * @param  float $x1 
  61.     * @param  float $y1 
  62.     * @param  float $x2 
  63.     * @param  float $y2 
  64.     * @access public
  65.     */
  66.     function addLine($x1$y1$x2$y2{
  67.         $this->lines[= array($x1$y1$x2$y2);
  68.  
  69.         if ($this->min == false{
  70.             $this->min['x'min($x1$x2);
  71.             $this->min['y'min($y1$y2);
  72.             $this->max['x'max($x1$x2);
  73.             $this->max['y'max($y1$y2);
  74.         else {
  75.             $this->min['x'min($this->min['x']$x1$x2);
  76.             $this->min['y'min($this->min['y']$y1$y2);
  77.             $this->max['x'max($this->max['x']$x1$x2);
  78.             $this->max['y'max($this->max['y']$y1$y2);
  79.         }
  80.     }
  81. }
  82. ?>

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