Mapper  0.9.0
API documentation
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
OpenOrienteering::TemplateTransform Struct Reference

Transformation parameters for non-georeferenced templates, transforming template coordinates to map coordinates. More...

#include <template.h>

Public Member Functions

 TemplateTransform (qint32 x, qint32 y, double rotation, double scale_x, double scale_y, double shear=0.0) noexcept
 Explicit implementation of aggregate initialization. More...
 
 TemplateTransform () noexcept=default
 Explicitly defaulted default constructor. More...
 
void save (QXmlStreamWriter &xml, const QString &role) const
 
void load (QXmlStreamReader &xml)
 

Static Public Member Functions

static TemplateTransform fromQTransform (const QTransform &qt) noexcept
 

Public Attributes

qint32 template_x = 0
 x position in 1/1000 mm More...
 
qint32 template_y = 0
 x position in 1/1000 mm More...
 
double template_rotation = 0.0
 Rotation in radians, a positive rotation is counter-clockwise. More...
 
double template_scale_x = 1.0
 Scaling in x direction, smaller than 1 shrinks. More...
 
double template_scale_y = 1.0
 Scaling in y direction, smaller than 1 shrinks. More...
 
double template_shear = 0.0
 Adjustment to scaling if anisotropy is askew. More...
 

Detailed Description

Transformation parameters for non-georeferenced templates, transforming template coordinates to map coordinates.

The parameters are applied to painter in the order

  1. translate
  2. rotate
  3. scale.

So this order is also chosen for the member variables, and thus used in list initialization.

See also
Template::applyTemplateTransform()

Coordinate transformations use the opposite order for the same effect.

Constructor & Destructor Documentation

◆ TemplateTransform() [1/2]

OpenOrienteering::TemplateTransform::TemplateTransform ( qint32  x,
qint32  y,
double  rotation,
double  scale_x,
double  scale_y,
double  shear = 0.0 
)
inlinenoexcept

Explicit implementation of aggregate initialization.

In C++11, there is no aggregate initialization when default initalizers are present.

Todo:
Remove when we can use C++14 everywhere.

◆ TemplateTransform() [2/2]

OpenOrienteering::TemplateTransform::TemplateTransform ( )
defaultnoexcept

Explicitly defaulted default constructor.

This is needed because of the other explicit constructor.

Todo:
Remove when we can use C++14 everywhere.

Member Function Documentation

◆ fromQTransform()

TemplateTransform OpenOrienteering::TemplateTransform::fromQTransform ( const QTransform qt)
staticnoexcept

◆ load()

void OpenOrienteering::TemplateTransform::load ( QXmlStreamReader xml)

◆ save()

void OpenOrienteering::TemplateTransform::save ( QXmlStreamWriter xml,
const QString role 
) const

Member Data Documentation

◆ template_rotation

double OpenOrienteering::TemplateTransform::template_rotation = 0.0

Rotation in radians, a positive rotation is counter-clockwise.

◆ template_scale_x

double OpenOrienteering::TemplateTransform::template_scale_x = 1.0

Scaling in x direction, smaller than 1 shrinks.

◆ template_scale_y

double OpenOrienteering::TemplateTransform::template_scale_y = 1.0

Scaling in y direction, smaller than 1 shrinks.

◆ template_shear

double OpenOrienteering::TemplateTransform::template_shear = 0.0

Adjustment to scaling if anisotropy is askew.

◆ template_x

qint32 OpenOrienteering::TemplateTransform::template_x = 0

x position in 1/1000 mm

◆ template_y

qint32 OpenOrienteering::TemplateTransform::template_y = 0

x position in 1/1000 mm


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