Kig Python Scripting API Documentation

Public Member Functions | Static Public Member Functions | Friends | List of all members
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. More...
 
bool isHomothetic () const
 Returns whether this is a homothetic (affine) transformation.
 
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 &center=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 &center=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 &center, 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 &center, 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...
 

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

◆ affinityGI3P()

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.

◆ apply()

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

◆ castShadow()

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.

◆ harmonicHomology()

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.

◆ identity()

static const Transformation Transformation::identity ( )
static

Identity.

Returns the Identity Transformation, i.e. a Transformation that doesn't do anything.

◆ inverse()

const Transformation Transformation::inverse ( bool &  valid) const

The inverse Transformation.

Returns the inverse Transformation of this Transformation.

◆ lineReflection()

static const Transformation Transformation::lineReflection ( const LineData l)
static

Line Reflection.

Returns a reflection over a line

Note
This equals scaling( -1, l );

◆ pointReflection()

static const Transformation Transformation::pointReflection ( const Coordinate c)
static

Point Reflection.

Returns a reflection over a point

Note
This equals scaling( -1, c );

◆ projectiveRotation()

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...

◆ projectivityGI4P()

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.

◆ rotation()

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

Rotation.

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

◆ scalingOverLine()

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.

◆ scalingOverPoint()

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.

◆ similitude()

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.

◆ translation()

static const Transformation Transformation::translation ( const Coordinate c)
static

Translation.

Returns a Translation by a vector c.

Friends And Related Function Documentation

◆ operator*

const Transformation operator* ( const Transformation a,
const Transformation b 
)
friend

Sequence.

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

◆ operator==

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 tdelibs .
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed May 15 2024 03:39:42 by doxygen 1.9.1 written by Dimitri van Heesch, © 1997-2001