Transformation Class Reference (Kig Python Scripting API)

| # Kig Python Scripting API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members

Public Member Functions | Static Public Member Functions | Friends | List of all members
Transformation Class Reference

Class representing a transformation. More...

`#include <kigtransform.h>`

## 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.
double | apply (double length) const
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

## ◆ affinityGI3P()

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()

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()

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()

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()

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

Line Reflection.

Returns a reflection over a line

Note
  This equals scaling( -1, l );

## ◆ pointReflection()

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

Point Reflection.

Returns a reflection over a point

Note
  This equals scaling( -1, c );

## ◆ projectiveRotation()

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()

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()

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

Rotation.

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

## ◆ scalingOverLine()

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()

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()

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()

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

Translation.

Returns a Translation by a vector c.

## Friends And Related Symbol 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.

This file is part of the documentation for tdelibs .
Documentation copyright © 1996-2002 the KDE developers.
Generated on by doxygen 1.16.1 written by Dimitri van Heesch, © 1997-2001