Class EllipseIterator

Description

Implements interfaces:

  • Iterator (internal interface)
  • ArrayAccess (internal interface)

Elipszis iterátor

Ez az osztály segítséget nyújt az elipszis formában történő iterációhoz.
Csupán a kezdő és befejező szögelfordulás fokát kell megadni, valamint hol legyen az elipszis centruma, mi legyen a szélessége és magassága, végül hogy hány fokonként iteráljon. Ezek után az iterátor kiszámolja az X és Y koordinátákat minden ciklusban, és visszaadja azt.

  1. <?php
  2.  
  3.  require_once('../Graph.class.php');
  4.  //Az Ă¶sszes grafikus elem importálása
  5. Graph::importIterator('EllipseIterator');
  6.  
  7.  
  8.  
  9.  $graph new Graph(400,400);
  10.  $graph->type "gif";
  11.  $graph->transparent=true;
  12.  
  13.         
  14. //ellipszis iterátor lĂ©trehozása
  15. $iterator new EllipseIterator(150,150,200,150);
  16. $iterator->add 10;
  17. $iterator->start = -180;
  18. $iterator->end = -540;
  19.  
  20. $isize 10;
  21. //Ellipszis vonalán vĂ©gig csillagok kirajzolása
  22. foreach($iterator as $pos{
  23.     $obj new Star((abs($isize)+44);
  24.     $obj->numPoint 8;
  25.     $obj->lenPoint 70;
  26.     $obj->transparent true;
  27.     $obj->$pos['x'];
  28.     $obj->$pos['y'];
  29.     $obj->type 'gif';
  30.     $obj->angle 30;
  31.     $obj->quality 100;
  32.     $obj->color $graph->createColor(255,255,0);
  33.     $obj->borderColor $graph->createColor(200,0,0);
  34.  
  35.     $graph->add($obj);
  36.     $isize+=10;
  37.         
  38.         
  39. $graph->flush();
  40. ?>

  • author: Takács Ákos (Rimelek), programmer [at] rimelek [dot] hu
  • version: 1.0
  • copyright: Copyright (C) 2009, Takács Ákos

Located in /iterators/EllipseIterator.class.php (line 24)


	
			
Direct descendents
Class Description
 class MultiEllipseIterator MultiEllipseIterator
Variable Summary
 int $add
 int $cx
 int $cy
 int $end
 int $height
 mixed $key
 int $start
 mixed $valid
 int $width
 int $_i
Method Summary
 EllipseIterator __construct (int $cx, int $cy, int $width, int $height)
 array current ()
 int key ()
 void next ()
 boolean offsetExists (int $offset)
 array offsetGet (int $offset)
 void offsetSet (int $offset, mixed $value)
 void offsetUnset (mixed $offset)
 void rewind ()
 boolean valid ()
 mixed __get (string $var)
 void __set (string $var, mixed $value)
Variables
int $add = 1 (line 70)

Iteráció lépésköze fok-ban számítva

  • access: protected
int $cx = 0 (line 31)

Iterátor centrumának X koordinátája

  • access: protected

Redefined in descendants as:
int $cy = 0 (line 37)

Iterátor centrumának Y koordinátája

  • access: protected

Redefined in descendants as:
int $end = 360 (line 65)

Befejező szög

  • access: protected
int $height = 100 (line 50)

Elipszis magassága

  • access: protected

Redefined in descendants as:
mixed $key = 0 (line 72)
  • access: protected
int $start = 0 (line 60)

Kezdő szög

  • access: protected
mixed $valid = true (line 73)
  • access: protected
int $width = 100 (line 55)

Elipszis szélessége

  • access: protected

Redefined in descendants as:
int $_i = 1 (line 45)

Az iteráció aktuális szöge

CSak olvasható (readonly)

  • access: protected
Methods
Constructor __construct (line 119)

EllipseIterator konstruktor

Csak értékeket állít be, amit majd az iterációkor hazsnál

EllipseIterator __construct (int $cx, int $cy, int $width, int $height)
  • int $cx: Elipszis centrumának X koordinátája
  • int $cy: Elipszis centrumának Y koordinátája
  • int $width: Elipszis szélessége
  • int $height: Elipszis magassága

Redefined in descendants as:
current (line 145)

Aktuális elemek visszaadása

  • access: public
array current ()

Implementation of:
Iterator::current

Redefined in descendants as:
key (line 183)

Aktuális index visszaadása

  • access: public
int key ()

Implementation of:
Iterator::key
next (line 156)

Következő elem előállítása

  • access: public
void next ()

Implementation of:
Iterator::next
offsetExists (line 204)

Létezik-e egy $offset indexű elem

  • access: public
boolean offsetExists (int $offset)
  • int $offset

Implementation of:
ArrayAccess::offsetExists
offsetGet (line 215)

Konkrét elem elérése index alapján

  • access: public
array offsetGet (int $offset)
  • int $offset

Implementation of:
ArrayAccess::offsetGet

Redefined in descendants as:
offsetSet (line 236)

$offset indexű elem beállítása

A beállítás nem lehetséges! Csak az adott indexű elem x és y koordinátájának megváltoztatása

  • access: public
void offsetSet (int $offset, mixed $value)
  • int $offset
  • mixed $value

Implementation of:
ArrayAccess::offsetSet
offsetUnset (line 248)

Elem megszüntetése

Nem lehetséges!

  • access: public
void offsetUnset (mixed $offset)
  • mixed $offset

Implementation of:
ArrayAccess::offsetUnset
rewind (line 133)

Iteráció alaphelyzetbe állítása

  • access: public
void rewind ()

Implementation of:
Iterator::rewind
valid (line 193)

Van-e még több elem

  • access: public
boolean valid ()

Implementation of:
Iterator::valid
__get (line 80)

Tulajdonságok értékeinek lekérdezésekor lefutó metódus

mixed __get (string $var)
  • string $var

Redefined in descendants as:
__set (line 91)

Tulajdonságok értékeinek beállításakor lefutó metódus

void __set (string $var, mixed $value)
  • string $var
  • mixed $value

Redefined in descendants as:

Documentation generated on Tue, 09 Feb 2010 01:17:47 +0100 by phpDocumentor 1.4.1