[ Index ]
 

Code source de vtiger CRM 5.0.2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/Image/Graph/Marker/Pointing/ -> Angular.php (source)

   1  <?php
   2  
   3  /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
   4  
   5  /**
   6   * Image_Graph - PEAR PHP OO Graph Rendering Utility.
   7   *
   8   * PHP versions 4 and 5
   9   *
  10   * LICENSE: This library is free software; you can redistribute it and/or modify
  11   * it under the terms of the GNU Lesser General Public License as published by
  12   * the Free Software Foundation; either version 2.1 of the License, or (at your
  13   * option) any later version. This library is distributed in the hope that it
  14   * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  15   * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
  16   * General Public License for more details. You should have received a copy of
  17   * the GNU Lesser General Public License along with this library; if not, write
  18   * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  19   * 02111-1307 USA
  20   *
  21   * @category   Images
  22   * @package    Image_Graph
  23   * @subpackage Marker
  24   * @author     Jesper Veggerby <pear.nosey@veggerby.dk>
  25   * @copyright  Copyright (C) 2003, 2004 Jesper Veggerby Hansen
  26   * @license    http://www.gnu.org/copyleft/lesser.html  LGPL License 2.1
  27   * @version    CVS: $Id: Angular.php,v 1.5 2005/08/24 20:36:03 nosey Exp $
  28   * @link       http://pear.php.net/package/Image_Graph
  29   */
  30  
  31  /**
  32   * Include file Image/Graph/Marker/Pointing.php
  33   */
  34  require_once  'Image/Graph/Marker/Pointing.php';
  35  
  36  /**
  37   * Marker that points 'away' from the graph.
  38   *
  39   * Use this as a marker for displaying another marker pointing to the original
  40   * point on the graph - where the 'pointer' is calculated as line orthogonal to
  41   * a line drawn between the points neighbours to both sides (an approximate
  42   * tangent). This should make an the pointer appear to point 'straight' out from
  43   * the graph. The 'head' of the pointer is then another marker of any choice.
  44   *
  45   * @category   Images
  46   * @package    Image_Graph
  47   * @subpackage Marker
  48   * @author     Jesper Veggerby <pear.nosey@veggerby.dk>
  49   * @copyright  Copyright (C) 2003, 2004 Jesper Veggerby Hansen
  50   * @license    http://www.gnu.org/copyleft/lesser.html  LGPL License 2.1
  51   * @version    Release: 0.7.2
  52   * @link       http://pear.php.net/package/Image_Graph
  53   */
  54  class Image_Graph_Marker_Pointing_Angular extends Image_Graph_Marker_Pointing
  55  {
  56  
  57      /**
  58       * The length of the angular marker
  59       * @var int
  60       * @access private
  61       */
  62      var $_radius;
  63  
  64      /**
  65       * Image_Graph_AngularPointingMarker [Constructor]
  66       * @param int $radius The 'length' of the pointer
  67       * @param Marker $markerEnd The ending marker that represents 'the head of
  68       * the pin'
  69       */
  70      function Image_Graph_Marker_Pointing_Angular($radius, & $markerEnd)
  71      {
  72          parent::Image_Graph_Marker_Pointing(0, 0, $markerEnd);
  73          $this->_radius = $radius;
  74      }
  75  
  76      /**
  77       * Draw the marker on the canvas
  78       * @param int $x The X (horizontal) position (in pixels) of the marker on
  79       * the canvas
  80       * @param int $y The Y (vertical) position (in pixels) of the marker on the
  81       * canvas
  82       * @param array $values The values representing the data the marker 'points'
  83       * to
  84       * @access private
  85       */
  86      function _drawMarker($x, $y, $values = false)
  87      {
  88          if ((isset($values['LENGTH'])) && ($values['LENGTH'] != 0)) {
  89              $this->_deltaX = - $values['AX'] * $this->_radius / $values['LENGTH'];
  90              $this->_deltaY = - $values['AY'] * $this->_radius / $values['LENGTH'];
  91          }
  92  
  93          if ((isset($values['NPY'])) && (isset($values['APY'])) &&
  94              (isset($values['PPY'])) && ($values['NPY'] > $values['APY']) &&
  95              ($values['PPY'] > $values['APY']))
  96          {
  97              $this->_deltaX = - $this->_deltaX;
  98              $this->_deltaY = - $this->_deltaY;
  99          }
 100          parent::_drawMarker($x, $y, $values);
 101      }
 102  
 103  }
 104  
 105  ?>


Généré le : Sun Feb 25 10:22:19 2007 par Balluche grâce à PHPXref 0.7