libetonyek::KEYTransformation Class Reference

Represents an affine transformation. More...

#include <KEYTransformation.h>

Public Member Functions

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

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

libetonyek::KEYTransformation::KEYTransformation ( )

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

double libetonyek::KEYTransformation::m_x0
private

Referenced by approxEqual(), operator()(), and operator*=().

double libetonyek::KEYTransformation::m_xx
private

Referenced by approxEqual(), operator()(), and operator*=().

double libetonyek::KEYTransformation::m_xy
private

Referenced by approxEqual(), operator()(), and operator*=().

double libetonyek::KEYTransformation::m_y0
private

Referenced by approxEqual(), operator()(), and operator*=().

double libetonyek::KEYTransformation::m_yx
private

Referenced by approxEqual(), operator()(), and operator*=().

double libetonyek::KEYTransformation::m_yy
private

Referenced by approxEqual(), operator()(), and operator*=().


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

Generated for libetonyek by doxygen 1.8.5