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

Source for file InternalPyramidTrunc.php

Documentation is available at InternalPyramidTrunc.php

  1. <?php
  2.  
  3. /**
  4.  * InternalPyramidTrunc Class
  5.  *
  6.  * Description:
  7.  *
  8.  * @author
  9.  * @copyright Copyright (c) 1995-2008 by Steema Software SL. All Rights Reserved. <info@steema.com>
  10.  * @version 1.0
  11.  * @package TeeChartPHP
  12.  * @subpackage drawing
  13.  * @link http://www.steema.com
  14.  */
  15.  
  16.  
  17.    // TODO review protected
  18.     public /*protected*/ $r;
  19.     protected $midX;
  20.     protected $midZ;
  21.     public /*protected*/ $truncX;
  22.     public /*protected*/ $truncZ;
  23.     public /*protected*/ $startZ;
  24.     public /*protected*/ $endZ;
  25.     protected $g;
  26.  
  27.     private function frontWall($startZ$endZ{
  28.         $p Array(new TeePoint($this->midX - $this->truncX$this->r->y),
  29.                    new TeePoint($this->midX + $this->truncX$this->r->y),
  30.                    new TeePoint($this->r->getRight()$this->r->getBottom()),
  31.                    new TeePoint($this->r->x$this->r->getBottom()));
  32.  
  33.         $this->g->planeFour3D($startZ$endZ$p);
  34.     }
  35.  
  36.     private function sideWall($horizPos1$horizPos2$startZ$endZ{
  37.         $tmp Array($this->g->calc3DPoint($horizPos2$this->r->y$this->midZ - $this->truncZ),
  38.                       $this->g->calc3DPoint($horizPos2$this->r->y$this->midZ + $this->truncZ),
  39.                       $this->g->calc3DPoint($horizPos1$this->r->getBottom()$endZ),
  40.                       $this->g->calc3DPoint($horizPos1$this->r->getBottom()$startZ)
  41.         );
  42.         $this->g->polygon($tmp);
  43.     }
  44.  
  45.     private function bottomCover({
  46.         $this->g->rectangleY($this->r->x$this->r->getBottom()$this->r->getRight()$this->startZ$this->endZ);
  47.     }
  48.  
  49.     private function topCover({
  50.         if ($this->truncX != 0{
  51.             $this->g->rectangleY($this->midX - $this->truncX$this->r->y$this->midX + $this->truncX$this->midZ - $this->truncZ,
  52.                          $this->midZ + $this->truncZ);
  53.         }
  54.     }
  55.  
  56.     public function draw($gr{
  57.         $this->g = $gr;
  58.         $this->midX = ($this->r->$this->r->getRight()) 2;
  59.         $this->midZ = ($this->startZ $this->endZ2;
  60.  
  61.         if ($this->r->getBottom($this->r->y{
  62.             $this->bottomCover();
  63.         else {
  64.             $this->topCover();
  65.         }
  66.  
  67.         $this->frontWall($this->midZ + $this->truncZ$this->endZ);
  68.         $this->sideWall($this->r->x$this->midX - $this->truncX$this->startZ$this->endZ);
  69.         $this->frontWall($this->midZ - $this->truncZ$this->startZ);
  70.         $this->sideWall($this->r->getRight()$this->midX + $this->truncX$this->startZ$this->endZ);
  71.  
  72.         if ($this->r->getBottom($this->r->y{
  73.             $this->topCover();
  74.         else {
  75.             $this->bottomCover();
  76.         }
  77.     }
  78. }
  79. ?>

Documentation generated on Wed, 16 Jun 2010 12:06:29 +0200 by phpDocumentor 1.4.1