Kig Python Scripting API Documentation

Transformation Class Reference

Class representing a transformation. More...

List of all members.

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 &center=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 &center=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 &center, 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 &center, 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

static const Transformation Transformation::affinityGI3P const std::vector< Coordinate > &  FromPoints,
const std::vector< Coordinate > &  ToPoints,
bool &  valid
[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

static const Transformation Transformation::castShadow const Coordinate ls,
const LineData d
[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 const Transformation Transformation::harmonicHomology const Coordinate center,
const LineData axis
[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 const Transformation Transformation::identity  )  [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 const Transformation Transformation::lineReflection const LineData l  )  [static]
 

Line Reflection.

Returns a reflection over a line

Note:
This equals scaling( -1, l );

static const Transformation Transformation::pointReflection const Coordinate c  )  [static]
 

Point Reflection.

Returns a reflection over a point

Note:
This equals scaling( -1, c );

static const Transformation Transformation::projectiveRotation double  alpha,
const Coordinate d,
const Coordinate t
[static]
 

Projective Rotation.

This is really only a test example of a projective non-affine transformation...

static const Transformation Transformation::projectivityGI4P const std::vector< Coordinate > &  FromPoints,
const std::vector< Coordinate > &  ToPoints,
bool &  valid
[static]
 

Projectivity given the image of 4 points.

Returns the unique projectivity that transforms 4 given points into 4 given points.

static const Transformation Transformation::rotation double  angle,
const Coordinate center = Coordinate()
[static]
 

Rotation.

Returns a Rotation by a certain angle, around a certain center.

static const Transformation Transformation::scalingOverLine double  factor,
const LineData l
[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 const Transformation Transformation::scalingOverPoint double  factor,
const Coordinate center = Coordinate()
[static]
 

Scaling over Point.

Returns a Transformation that scales points by a certain factor with relation to a center point.

static const Transformation Transformation::similitude const Coordinate center,
double  theta,
double  factor
[static]
 

Similitude.

Sequence of a rotation and a scaling with relation to a certain center.

static const Transformation Transformation::translation const Coordinate c  )  [static]
 

Translation.

Returns a Translation by a vector c.


Friends And Related Function Documentation

const Transformation operator * const Transformation a,
const Transformation b
[friend]
 

Sequence.

This creates a Transformation that executes first transformation b, and then a.

bool operator== const Transformation lhs,
const Transformation rhs
[friend]
 

Equality.

Tests two Transformation's for equality.

KDE Logo
This file is part of the documentation for kdelibs 0.10.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Mon Aug 15 23:01:22 2005 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2001