Transformation Class Reference
Class representing a transformation. More...Public Member Functions | |
const Coordinate | apply (const double x0, const double x1, const double x2) const |
Apply this Tranformation. | |
bool | isHomothetic () const |
Returns whether this is a homothetic (affine) transformation. | |
const Transformation | inverse (bool &valid) const |
The inverse Transformation. | |
Static Public Member Functions | |
static const Transformation | identity () |
Identity. | |
static const Transformation | scalingOverPoint (double factor, const Coordinate ¢er=Coordinate()) |
Scaling over Point. | |
static const Transformation | scalingOverLine (double factor, const LineData &l) |
Scaling over Line. | |
static const Transformation | translation (const Coordinate &c) |
Translation. | |
static const Transformation | rotation (double angle, const Coordinate ¢er=Coordinate()) |
Rotation. | |
static const Transformation | pointReflection (const Coordinate &c) |
Point Reflection. | |
static const Transformation | lineReflection (const LineData &l) |
Line Reflection. | |
static const Transformation | harmonicHomology (const Coordinate ¢er, const LineData &axis) |
Harmonic Homology. | |
static const Transformation | affinityGI3P (const std::vector< Coordinate > &FromPoints, const std::vector< Coordinate > &ToPoints, bool &valid) |
Affinity given the image of 3 points. | |
static const Transformation | projectivityGI4P (const std::vector< Coordinate > &FromPoints, const std::vector< Coordinate > &ToPoints, bool &valid) |
Projectivity given the image of 4 points. | |
static const Transformation | castShadow (const Coordinate &ls, const LineData &d) |
Cast Shadow. | |
static const Transformation | projectiveRotation (double alpha, const Coordinate &d, const Coordinate &t) |
Projective Rotation. | |
static const Transformation | similitude (const Coordinate ¢er, double theta, double factor) |
Similitude. | |
Friends | |
const Transformation | operator * (const Transformation &a, const Transformation &b) |
Sequence. | |
bool | operator== (const Transformation &lhs, const Transformation &rhs) |
Equality. |
Detailed Description
Class representing a transformation.More specifically, this class represents a pretty generic 2-dimensional transformation. Various common transformations can be used. Construct a Transformation by using one of its static members, and use it either with its Transformation::apply method, or the Object::transform method.
Member Function Documentation
|
Affinity given the image of 3 points. Returns the unique affinity that transforms 3 given points into 3 given points. |
|
Apply this Tranformation. Apply this transformation to the Coordinate c. Can return an invalid Coordinate. apply0 assumes that c indicates a point at infinity, having [0, c.x, c.y] as homogeneous coordinates |
|
Cast Shadow. Returns a Transformation that transforms points in such a way that it appears to cast a shadow, given a certain light source, and a line indicating a plane. |
|
Harmonic Homology. Returns a Transformation that transforms points in such a way that it appears to cast a shadow, given a certain light source (center), and a line (axis) indicating a plane. |
|
Identity. Returns the Identity Transformation, i.e. a Transformation that doesn't do anything. |
|
The inverse Transformation. Returns the inverse Transformation of this Transformation. |
|
Line Reflection. Returns a reflection over a line
|
|
Point Reflection. Returns a reflection over a point
|
|
Projective Rotation. This is really only a test example of a projective non-affine transformation... |
|
Projectivity given the image of 4 points. Returns the unique projectivity that transforms 4 given points into 4 given points. |
|
Rotation. Returns a Rotation by a certain angle, around a certain center. |
|
Scaling over Line. Returns a Transformation that scales points by a certain factor with relation to a line. Note: This is not a homothetic transformation. |
|
Scaling over Point. Returns a Transformation that scales points by a certain factor with relation to a center point. |
|
Similitude. Sequence of a rotation and a scaling with relation to a certain center. |
|
Translation. Returns a Translation by a vector c. |
Friends And Related Function Documentation
|
Sequence. This creates a Transformation that executes first transformation b, and then a. |
|
Equality. Tests two Transformation's for equality. |