CartoType C++ API 7.8.2, 2022-03-25
for Windows, Linux, Qt and other platforms supporting C++ development
Public Member Functions | List of all members
CartoType::TTransform Class Reference

#include <cartotype_transform.h>

Public Member Functions

 TTransform (double aA, double aB, double aC, double aD, double aTx, double aTy)
 
 TTransform (TDataInputStream &aInput)
 
void Transform (double &aX, double &aY) const
 
void Transform (TPoint &aPoint) const
 
void Transform (TPointFP &aPoint) const
 
void Transform (TRect &aRect) const
 
void Transform (TRectFP &aRect) const
 
void Concat (const TTransform &aTransform)
 
void Prefix (const TTransform &aTransform)
 
void Scale (double aXScale, double aYScale)
 
void ExtractScale (double &aXScale, double &aYScale)
 
void Invert ()
 
void Translate (double aX, double aY)
 
void Rotate (double aAngle)
 
void Rotate (double aX, double aY)
 
void ReflectY (double aY)
 
double A () const
 
double B () const
 
double C () const
 
double D () const
 
double Tx () const
 
double Ty () const
 
TPointFP CenterOfRotation () const
 
TTransformComponents Components () const
 
TTransform Interpolate (const TTransform &aOther, double aTime)
 
bool operator== (const TTransform &aTransform) const
 
bool operator!= (const TTransform &aTransform) const
 
uint32_t Type () const
 
bool IsIdentity () const
 
void Write (TDataOutputStream &aOutput) const
 

Detailed Description

A floating point affine 2D transformation.

Constructor & Destructor Documentation

◆ TTransform() [1/2]

CartoType::TTransform::TTransform ( double  aA,
double  aB,
double  aC,
double  aD,
double  aTx,
double  aTy 
)

Creates an affine 2D transform, specifying all 6 components.

◆ TTransform() [2/2]

CartoType::TTransform::TTransform ( TDataInputStream aInput)
explicit

Reads this transform in serialized form by reading the six components A, B, C, D, Tx, Ty as double-precision floating point numbers. Throws an exception on failure.

Member Function Documentation

◆ A()

double CartoType::TTransform::A ( ) const
inline

Return the A (x scale) parameter.

◆ B()

double CartoType::TTransform::B ( ) const
inline

Returns the B (y shear) parameter.

◆ C()

double CartoType::TTransform::C ( ) const
inline

Returns the C (x shear) parameter.

◆ CenterOfRotation()

TPointFP CartoType::TTransform::CenterOfRotation ( ) const

Returns the center of rotation of the projection.

◆ Components()

TTransformComponents CartoType::TTransform::Components ( ) const

Returns the components of this transform.

◆ Concat()

void CartoType::TTransform::Concat ( const TTransform aTransform)

Concatenates aTransform to this transform.

◆ D()

double CartoType::TTransform::D ( ) const
inline

Returns the D (y scale) parameter.

◆ ExtractScale()

void CartoType::TTransform::ExtractScale ( double &  aXScale,
double &  aYScale 
)

Removes the non-negative scale components from a transform and returns them in aXScale and aYScale. There is no unique way of doing this, but the method chosen here minimises shear and prefers to decompose into scale plus rotation.

◆ Interpolate()

TTransform CartoType::TTransform::Interpolate ( const TTransform aOther,
double  aTime 
)

Interpolate between two transformations, which are assumed to consist of translation, rotation and scale only; no shear.

◆ Invert()

void CartoType::TTransform::Invert ( )

Inverts a transform if it is invertible. If not, throws KErrorNoInverse.

◆ IsIdentity()

bool CartoType::TTransform::IsIdentity ( ) const
inline

Returns true if this is the identity transform.

◆ operator!=()

bool CartoType::TTransform::operator!= ( const TTransform aTransform) const
inline

The inequality operator.

◆ operator==()

bool CartoType::TTransform::operator== ( const TTransform aTransform) const

The equality operator.

◆ Prefix()

void CartoType::TTransform::Prefix ( const TTransform aTransform)

Prefixes aTransform to this transform.

◆ ReflectY()

void CartoType::TTransform::ReflectY ( double  aY)
inline

Concatenates a reflection about the line y=aY to this transform.

◆ Rotate() [1/2]

void CartoType::TTransform::Rotate ( double  aAngle)

Concatenates a rotation by aAngle radians to this transform.

◆ Rotate() [2/2]

void CartoType::TTransform::Rotate ( double  aX,
double  aY 
)
inline

Concatenates the rotation defined by Atan(aX,aY) to this transform.

◆ Scale()

void CartoType::TTransform::Scale ( double  aXScale,
double  aYScale 
)

Scales a transform by aXScale and aYScale. Does nothing if either XScale and YScale is 0, which creates a non-invertible matrix.

◆ Transform() [1/5]

void CartoType::TTransform::Transform ( double &  aX,
double &  aY 
) const
inline

Transforms the point (aX,aY).

◆ Transform() [2/5]

void CartoType::TTransform::Transform ( TPoint aPoint) const

Transforms aPoint.

◆ Transform() [3/5]

void CartoType::TTransform::Transform ( TPointFP aPoint) const

Transforms aPoint.

◆ Transform() [4/5]

void CartoType::TTransform::Transform ( TRect aRect) const

Transform a grid-aligned rectangle. The result is the grid-aligned bounds of the transformed rectangle, so the operation cannot be reversed by the inverse transform.

◆ Transform() [5/5]

void CartoType::TTransform::Transform ( TRectFP aRect) const

Transform a grid-aligned rectangle. The result is the grid-aligned bounds of the transformed rectangle, so the operation cannot be reversed by the inverse transform.

◆ Translate()

void CartoType::TTransform::Translate ( double  aX,
double  aY 
)
inline

Concatenates the translation (aX,aY) to this transform.

◆ Tx()

double CartoType::TTransform::Tx ( ) const
inline

Returns the TX (x translation) parameter.

◆ Ty()

double CartoType::TTransform::Ty ( ) const
inline

Returns the TY (y translation) parameter.

◆ Type()

uint32_t CartoType::TTransform::Type ( ) const

Returns the type of this transform as a combination of bit flags defined in TTransformType.

◆ Write()

void CartoType::TTransform::Write ( TDataOutputStream aOutput) const

Writes this transform in serialized form by writing the six components A, B, C, D, Tx, Ty as double-precision floating point numbers.


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