![]() |
Kig Python Scripting API Documentation |
||||
|
Class representing a transformation. More...
Public Member Functions | |
const Coordinate | apply (const double x0, const double x1, const double x2) const |
Apply this Tranformation. More... | |
bool | isHomothetic () const |
Returns whether this is a homothetic (affine) transformation. | |
double | apply (double length) const |
a homothetic transformation maintains the ratio's of lengths. More... | |
const Transformation | inverse (bool &valid) const |
The inverse Transformation. More... | |
Static Public Member Functions | |
static const Transformation | identity () |
Identity. More... | |
static const Transformation | scalingOverPoint (double factor, const Coordinate ¢er=Coordinate()) |
Scaling over Point. More... | |
static const Transformation | scalingOverLine (double factor, const LineData &l) |
Scaling over Line. More... | |
static const Transformation | translation (const Coordinate &c) |
Translation. More... | |
static const Transformation | rotation (double angle, const Coordinate ¢er=Coordinate()) |
Rotation. More... | |
static const Transformation | pointReflection (const Coordinate &c) |
Point Reflection. More... | |
static const Transformation | lineReflection (const LineData &l) |
Line Reflection. More... | |
static const Transformation | harmonicHomology (const Coordinate ¢er, const LineData &axis) |
Harmonic Homology. More... | |
static const Transformation | affinityGI3P (const std::vector< Coordinate > &FromPoints, const std::vector< Coordinate > &ToPoints, bool &valid) |
Affinity given the image of 3 points. More... | |
static const Transformation | projectivityGI4P (const std::vector< Coordinate > &FromPoints, const std::vector< Coordinate > &ToPoints, bool &valid) |
Projectivity given the image of 4 points. More... | |
static const Transformation | castShadow (const Coordinate &ls, const LineData &d) |
Cast Shadow. More... | |
static const Transformation | projectiveRotation (double alpha, const Coordinate &d, const Coordinate &t) |
Projective Rotation. More... | |
static const Transformation | similitude (const Coordinate ¢er, double theta, double factor) |
Similitude. More... | |
Friends | |
const Transformation | operator* (const Transformation &a, const Transformation &b) |
Sequence. More... | |
bool | operator== (const Transformation &lhs, const Transformation &rhs) |
Equality. More... | |
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.
|
static |
Affinity given the image of 3 points.
Returns the unique affinity that transforms 3 given points into 3 given points.
const Coordinate Transformation::apply | ( | const double | x0, |
const double | x1, | ||
const double | x2 | ||
) | const |
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
double Transformation::apply | ( | double | length | ) | const |
a homothetic transformation maintains the ratio's of lengths.
This means that every length is multiplied by a fixed number when it is projected... This function does that calculation for you..
|
static |
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.
|
static |
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.
|
static |
Identity.
Returns the Identity Transformation, i.e. a Transformation that doesn't do anything.
const Transformation Transformation::inverse | ( | bool & | valid | ) | const |
The inverse Transformation.
Returns the inverse Transformation of this Transformation.
|
static |
|
static |
|
static |
Projective Rotation.
This is really only a test example of a projective non-affine transformation...
|
static |
Projectivity given the image of 4 points.
Returns the unique projectivity that transforms 4 given points into 4 given points.
|
static |
Rotation.
Returns a Rotation by a certain angle, around a certain center.
|
static |
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.
|
static |
Scaling over Point.
Returns a Transformation that scales points by a certain factor with relation to a center point.
|
static |
Similitude.
Sequence of a rotation and a scaling with relation to a certain center.
|
static |
Translation.
Returns a Translation by a vector c.
|
friend |
Sequence.
This creates a Transformation that executes first transformation b, and then a.
|
friend |
Equality.
Tests two Transformation's for equality.