InterViews Reference Manual -- Transformer

NAME
Transformer - transformation matrix for Painter
SYNOPSIS
#include <InterViews/transformer.h>
DESCRIPTION
A transformer object is a transformation matrix for use in translating coordinates. Most users will not need to access a transformer directly; the Painter operations will be sufficient.
PUBLIC OPERATIONS
Transformer(Transformer* = nil)
Create a copy of the given transformer. The identity transformer is returned by default.
Transformer(float a00, float a01, float a10, float a11, float a20, float a21)
Create a matrix with the given values.
void GetEntries(float& a00, float& a01, float& a10, float& a11, float& a20, float& a21)
Get the transformer's matrix entries.
void Rotate(float angle)
Modify the matrix to rotate coordinates by angle degrees.
bool Rotated(float tolerance = 1e-6)
bool Rotated90(float tolerance = 1e-6)
Rotated returns true if coordinates would be rotated more than plus or minus arcsin(tolerance) degrees when transformed. Rotated90 returns true only if the angle of rotation is 90 plus or minus arcsine(tolerance) degrees.
void Scale(float sx, float sy)
Modify the matrix to multiply coordinates by sx and sy.
bool Scaled(float tolerance = 1e-6)
bool Stretched(float tolerance = 1e-6)
Scaled returns true if coordinates are scaled when transformed beyond 1 plus or minus the given tolerance. Stretched returns true if the scaling is not the same in both dimensions.
void Translate(float dx, float dy)
Add (dx, dy) to coordinates after multiplying by the matrix.
bool Translated(float tolerance = 1e-6)
Return true if coordinates are translated when transformed and the absolute value of the translation in either dimension is greater than the tolerance.
void Transform(Coord& x, Coord& y)
void Transform(Coord x, Coord y, Coord& tx, Coord& ty)
void Transform(float x, float y, float& tx, float& ty)
void TransformList(Coord x[], Coord y[], int n)
void TransformList(Coord x[], Coord y[], int n, Coord tx[], Coord ty[])
Transform a point or set of points using the transformer's matrix.
void TransformRect(Coord& x0, Coord& y0, Coord& x1, Coord& y1)
void TransformRect(float& x0, float& y0, float& x1, float& y1)
Transform the rectangle defined by two points and return the bounding box of the result.
void InvTransform(Coord& tx, Coord& ty)
void InvTransform(Coord tx, Coord ty, Coord& x, Coord& y)
void InvTransform(float tx, float ty, float& x, float& y)
void InvTransformList(Coord tx[], Coord ty[], int n)
void InvTransformList(Coord tx[], Coord ty[], int n, Coord x[], Coord y[])
Perform a reverse transformation on a point or set of points.
void InvTransformRect(Coord& x0, Coord& y0, Coord& x1, Coord& y1)
void InvTransformRect(float& x0, float& y0, float& x1, float& y1)
Inverse transform the rectangle defined by two points and return the bounding box of the result.
void Premultiply(Transformer*)
void Postmultiply(Transformer*)
Multiply in place the transformer's matrix by the given transformer's matrix.
SEE ALSO
Painter

Next: Tray | Prev: TextEditor | Up: index | Top: index