libetonyek::KEYTransformation Class Reference

Represents an affine transformation. More...

#include <KEYTransformation.h>

List of all members.

Public Member Functions

 KEYTransformation ()
 Construct a unit transformation.
 KEYTransformation (double xx, double yx, double xy, double yy, double x0, double y0)
 Construct a transformation from matrix components.
KEYTransformationoperator*= (const KEYTransformation &tr)
 Apply a transformation on top of this one.
void operator() (double &x, double &y, bool distance=false) const
 Apply transformation to a point or distance.
bool approxEqual (const KEYTransformation &other, double eps=KEY_EPSILON) const
 Tests for approximate equality of transformations.

Private Attributes

double m_xx
double m_yx
double m_xy
double m_yy
double m_x0
double m_y0

Detailed Description

Represents an affine transformation.

The transformation matrix looks like:

 xx yx 0
 xy yy 0
 x0 y0 1
 

Constructor & Destructor Documentation

Construct a unit transformation.

libetonyek::KEYTransformation::KEYTransformation ( double  xx,
double  yx,
double  xy,
double  yy,
double  x0,
double  y0 
)

Construct a transformation from matrix components.


Member Function Documentation

bool libetonyek::KEYTransformation::approxEqual ( const KEYTransformation other,
double  eps = KEY_EPSILON 
) const

Tests for approximate equality of transformations.

  • [in] other the transformation for equality comparison
  • [in] eps precision
    Returns:
    true if this transformation and other are equal, false otherwise

Referenced by approxEqual(), and libetonyek::operator==().

void libetonyek::KEYTransformation::operator() ( double &  x,
double &  y,
bool  distance = false 
) const

Apply transformation to a point or distance.

  • [inout] x x coordinate of the point or distance.
  • [inout] y y coordinate of the point or distance.
  • [in] distance if true, the transformed entity is a distance (in that case translation is ignored).
KEYTransformation & libetonyek::KEYTransformation::operator*= ( const KEYTransformation tr)

Apply a transformation on top of this one.

The effect is as if transformation was applied after this.

  • [in] tr the transformation to apply after this one
    Returns:
    this transformation

Member Data Documentation


The documentation for this class was generated from the following files: