phpDocumentor Painter
[ class tree: Painter ] [ index: Painter ] [ all elements ]

Class: Transform

Source Location: /painter.php

Class Transform

Class Overview

Encapsulates transformations for Polygon objects.

Located in /painter.php [line 498]



		
		
		
		

Methods

[ Top ]
Method Summary
Transform   Transform()   Creates a new Transform object.
void   Clear()   Restores the transformation matrix to the identity matrix.
void   CustomTransform()   Adds a custom transformation.
void   Rotate()   Adds a rotation operation.
void   Scale()   Adds a scaling operation.
void   Sheer()   Adds a sheering operation.
Polygon   Trans()   Performs the stored transformation on $poly. $cx = $y = -1 will set the centre of the Polygon as origin.
void   Translate()   Adds a translation operation.

[ Top ]
Methods
Constructor Transform  [line 508]

  Transform Transform( )

Creates a new Transform object.



[ Top ]
Clear  [line 516]

  void Clear( )

Restores the transformation matrix to the identity matrix.



[ Top ]
CustomTransform  [line 595]

  void CustomTransform( array $trans  )

Adds a custom transformation.

Parameters:
array   $trans:  A 3x3 transformation matrix to include.


[ Top ]
Rotate  [line 544]

  void Rotate( number $theta  )

Adds a rotation operation.

Parameters:
number   $theta:  The angle of rotation.


[ Top ]
Scale  [line 579]

  void Scale( [number $x = 1], [number $y = 1]  )

Adds a scaling operation.

Parameters:
number   $x:  The value to scale in along the X axis.
number   $y:  The value to scale in along the Y axis.


[ Top ]
Sheer  [line 562]

  void Sheer( [number $x = 0], [number $y = 0]  )

Adds a sheering operation.

Parameters:
number   $x:  The sheering value along the X axis.
number   $y:  The sheering value along the Y axis.


[ Top ]
Trans  [line 615]

  Polygon Trans( Polygon $poly, [int $cx = -1], [int $cy = -1]  )

Performs the stored transformation on $poly. $cx = $y = -1 will set the centre of the Polygon as origin.

Parameters:
Polygon   $poly:  The Polygon to transform.
int   $cx:  The X co-ordinate to act as origin.
int   $cy:  The Y co-ordinate to act as origin.


[ Top ]
Translate  [line 528]

  void Translate( number $x, number $y  )

Adds a translation operation.

Parameters:
number   $x:  Translation along X axis.
number   $y:  Translation along Y axis.


[ Top ]

Documentation generated on Mon, 31 Mar 2008 18:35:26 +0100 by phpDocumentor 1.4.1