All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::layout::WorldTransformer Class Reference

This class implements the logic for transforming from System 1 coordinate to other type of coordinate system and vice-versa. More...

#include <WorldTransformer.h>

Public Member Functions

Initializer Methods

Methods related to instantiation and destruction.

 WorldTransformer ()
 Empty constructor. More...
 
 WorldTransformer (const double &s1llx, const double &s1lly, const double &s1urx, const double &s1ury, double s2width, double s2height)
 The world coordinates system will fit with 0,0 of another coordinate system (passed as width and height). This method is indicated to create a World Transformer between a coordinate system and viewport (device, logical). More...
 
 WorldTransformer (te::gm::Envelope system1Box, te::gm::Envelope system2Box)
 The system 1 coordinates will fit with another coordinate system. This method is indicated to create a World Transformer between a coordinate system and viewport (device, logical). More...
 
 ~WorldTransformer ()
 Destructor. More...
 

Protected Attributes

bool m_mirroring
 
double m_s1Height
 Height of System 1 coordinate system. More...
 
double m_s1llx
 Lower left x-coordinate of the System 1. More...
 
double m_s1lly
 Lower left y-coordinate of the System 1. More...
 
double m_s1urx
 Upper right x-coordinate of the System 1. More...
 
double m_s1ury
 Upper right y-coordinate of the System 1. More...
 
double m_s1Width
 Width of System 1 coordinate system. More...
 
double m_s2Height
 Height of System 2 coordinate system. More...
 
double m_s2llx
 Lower left x-coordinate of the System 2. More...
 
double m_s2lly
 Lower left y-coordinate of the System 2. More...
 
double m_s2urx
 Upper right x-coordinate of the System 2. More...
 
double m_s2ury
 Upper right y-coordinate of the System 2. More...
 
double m_s2Width
 Width of System 2 coordinate system. More...
 
double m_scaleX
 Map units per unit along x-direction between Coordinate Systems. More...
 
double m_scaleY
 Map units per unit along y-direction between Coordinate Systems. More...
 
double m_translateX
 The value corresponds to the X-Axis translation of system 2. More...
 
double m_translateY
 The value corresponds to the Y-Axis translation of system 2. More...
 
bool m_valid
 

Transformation Methods

Methods used to transform coordinates from system 1 coordinate system to system 2 coordinate and vice-versa.

void setTransformationParameters (te::gm::Envelope system1Box, te::gm::Envelope system2Box)
 It adjusts a new transformation function that maps between the world coordinate system to other coordinate system. More...
 
void system1Tosystem2 (double &wx, double &wy) const
 It transforms the coordinate wx and wy from world coordinates to other(system) coordinates without using auxiliary variables. More...
 
void system1Tosystem2 (const double &wx, const double &wy, double &dx, double &dy) const
 It transforms the coordinate wx and wy from world coordinates to other(system) coordinates (dx and dy). More...
 
void system2Tosystem1 (double &dx, double &dy) const
 It transforms the coordinate dx and dy from system 2 coordinates to syste 1 coordinates without using auxiliary variables. It is supposed to be faster than the other version that has 4 parameters. More...
 
void system2Tosystem1 (double dx, double dy, double &wx, double &wy) const
 It transforms the coordinate dx and dy from system 2 coordinates to system 1 coordinates (wx and wy). More...
 
double getScaleX ()
 
double getScaleY ()
 
double getTranslateX ()
 
double getTranslateY ()
 
double getS1llx ()
 
double getS1lly ()
 
double getS1urx ()
 
double getS1ury ()
 
double getS1Width ()
 
double getS1Height ()
 
double getS2llx ()
 
double getS2lly ()
 
double getS2urx ()
 
double getS2ury ()
 
double getS2Width ()
 
double getS2Height ()
 
bool isValid ()
 
bool isMirroring ()
 
void setMirroring (bool mirror)
 
void initVariables (te::gm::Envelope system1Box, te::gm::Envelope system2Box)
 

Detailed Description

This class implements the logic for transforming from System 1 coordinate to other type of coordinate system and vice-versa.

Definition at line 44 of file WorldTransformer.h.

Constructor & Destructor Documentation

te::layout::WorldTransformer::WorldTransformer ( )
inline

Empty constructor.

Definition at line 199 of file WorldTransformer.h.

te::layout::WorldTransformer::WorldTransformer ( const double &  s1llx,
const double &  s1lly,
const double &  s1urx,
const double &  s1ury,
double  s2width,
double  s2height 
)
inline

The world coordinates system will fit with 0,0 of another coordinate system (passed as width and height). This method is indicated to create a World Transformer between a coordinate system and viewport (device, logical).

Parameters
s1llxLower left x-coordinate of the World (Spatial Coordinate System of the features).
s1llyLower left y-coordinate of the World (Spatial Coordinate System of the features).
wurxUpper right x-coordinate of the World (Spatial Coordinate System of the features).
s1uryUpper right y-coordinate of the World (Spatial Coordinate System of the features).
s2width*Can be device (canvas) width in pixels.
s2height*Can be device (canvas) height in pixels.

Definition at line 221 of file WorldTransformer.h.

References setTransformationParameters().

te::layout::WorldTransformer::WorldTransformer ( te::gm::Envelope  system1Box,
te::gm::Envelope  system2Box 
)
inline

The system 1 coordinates will fit with another coordinate system. This method is indicated to create a World Transformer between a coordinate system and viewport (device, logical).

Parameters
system1BoxBox in System 1 Coordinate System.
system2BoxBox in System 2 Coordinate System.

Definition at line 231 of file WorldTransformer.h.

References setTransformationParameters().

te::layout::WorldTransformer::~WorldTransformer ( )
inline

Destructor.

Definition at line 236 of file WorldTransformer.h.

Member Function Documentation

double te::layout::WorldTransformer::getS1Height ( )
inline

Definition at line 380 of file WorldTransformer.h.

References m_s1Height.

double te::layout::WorldTransformer::getS1llx ( )
inline

Definition at line 355 of file WorldTransformer.h.

References m_s1llx.

double te::layout::WorldTransformer::getS1lly ( )
inline

Definition at line 360 of file WorldTransformer.h.

References m_s1lly.

double te::layout::WorldTransformer::getS1urx ( )
inline

Definition at line 365 of file WorldTransformer.h.

References m_s1urx.

double te::layout::WorldTransformer::getS1ury ( )
inline

Definition at line 370 of file WorldTransformer.h.

References m_s1ury.

double te::layout::WorldTransformer::getS1Width ( )
inline

Definition at line 375 of file WorldTransformer.h.

References m_s1Width.

double te::layout::WorldTransformer::getS2Height ( )
inline

Definition at line 410 of file WorldTransformer.h.

References m_s2Height.

double te::layout::WorldTransformer::getS2llx ( )
inline

Definition at line 385 of file WorldTransformer.h.

References m_s2llx.

double te::layout::WorldTransformer::getS2lly ( )
inline

Definition at line 390 of file WorldTransformer.h.

References m_s2lly.

double te::layout::WorldTransformer::getS2urx ( )
inline

Definition at line 395 of file WorldTransformer.h.

References m_s2urx.

double te::layout::WorldTransformer::getS2ury ( )
inline

Definition at line 400 of file WorldTransformer.h.

References m_s2ury.

double te::layout::WorldTransformer::getS2Width ( )
inline

Definition at line 405 of file WorldTransformer.h.

References m_s2Width.

double te::layout::WorldTransformer::getScaleX ( )
inline

Definition at line 335 of file WorldTransformer.h.

References m_scaleX.

double te::layout::WorldTransformer::getScaleY ( )
inline

Definition at line 340 of file WorldTransformer.h.

References m_scaleY.

double te::layout::WorldTransformer::getTranslateX ( )
inline

Definition at line 345 of file WorldTransformer.h.

References m_translateX.

double te::layout::WorldTransformer::getTranslateY ( )
inline

Definition at line 350 of file WorldTransformer.h.

References m_translateY.

bool te::layout::WorldTransformer::isMirroring ( )
inline

Definition at line 423 of file WorldTransformer.h.

References m_mirroring.

bool te::layout::WorldTransformer::isValid ( )
inline

Definition at line 415 of file WorldTransformer.h.

References m_scaleX, and m_scaleY.

void te::layout::WorldTransformer::setTransformationParameters ( te::gm::Envelope  system1Box,
te::gm::Envelope  system2Box 
)
inline

It adjusts a new transformation function that maps between the world coordinate system to other coordinate system.

Parameters
system1BoxBox in System 1 Coordinate System.
system2BoxBox in System 2 Coordinate System.

Definition at line 240 of file WorldTransformer.h.

References initVariables(), te::gm::Envelope::isValid(), m_s1Height, m_s1llx, m_s1lly, m_s1Width, m_s2Height, m_s2llx, m_s2lly, m_s2Width, m_scaleX, m_scaleY, m_translateX, m_translateY, and m_valid.

Referenced by te::layout::Utils::getTransformGeo(), and WorldTransformer().

void te::layout::WorldTransformer::system1Tosystem2 ( double &  wx,
double &  wy 
) const
inline

It transforms the coordinate wx and wy from world coordinates to other(system) coordinates without using auxiliary variables.

Parameters
wxX value in system 1 coordinates.
wyY value in system 1 coordinates.

Definition at line 259 of file WorldTransformer.h.

References m_mirroring, m_s2Height, m_scaleX, m_scaleY, m_translateX, and m_translateY.

Referenced by te::layout::Utils::convertToMillimeter(), te::layout::GridPlanarModel::drawHorizontalLines(), and te::layout::GridPlanarModel::drawVerticalLines().

void te::layout::WorldTransformer::system1Tosystem2 ( const double &  wx,
const double &  wy,
double &  dx,
double &  dy 
) const
inline

It transforms the coordinate wx and wy from world coordinates to other(system) coordinates (dx and dy).

Parameters
wxX value in system 1 coordinates.
wyY value in system 1 coordinates.
dxX value in system 2 coordinates.
dyY value in system 2 coordinates.

Definition at line 271 of file WorldTransformer.h.

References m_mirroring, m_s2Height, m_scaleX, m_scaleY, m_translateX, and m_translateY.

void te::layout::WorldTransformer::system2Tosystem1 ( double &  dx,
double &  dy 
) const
inline

It transforms the coordinate dx and dy from system 2 coordinates to syste 1 coordinates without using auxiliary variables. It is supposed to be faster than the other version that has 4 parameters.

Parameters
dxX value in system 2 coordinates.
dyY value in system 2 coordinates.

Definition at line 284 of file WorldTransformer.h.

References m_mirroring, m_s2Height, m_scaleX, m_scaleY, m_translateX, and m_translateY.

Referenced by te::layout::MapModel::generateSystematic().

void te::layout::WorldTransformer::system2Tosystem1 ( double  dx,
double  dy,
double &  wx,
double &  wy 
) const
inline

It transforms the coordinate dx and dy from system 2 coordinates to system 1 coordinates (wx and wy).

Parameters
dxX value in system 2 coordinates.
dyY value in system 2 coordinates.
wxX value in system 1 coordinates.
wyY value in system 1 coordinates.

Definition at line 297 of file WorldTransformer.h.

References m_mirroring, m_s2Height, m_scaleX, m_scaleY, m_translateX, and m_translateY.

Member Data Documentation

bool te::layout::WorldTransformer::m_mirroring
protected

Definition at line 196 of file WorldTransformer.h.

Referenced by isMirroring(), setMirroring(), system1Tosystem2(), and system2Tosystem1().

double te::layout::WorldTransformer::m_s1Height
protected

Height of System 1 coordinate system.

Definition at line 185 of file WorldTransformer.h.

Referenced by getS1Height(), initVariables(), and setTransformationParameters().

double te::layout::WorldTransformer::m_s1llx
protected

Lower left x-coordinate of the System 1.

Definition at line 180 of file WorldTransformer.h.

Referenced by getS1llx(), initVariables(), and setTransformationParameters().

double te::layout::WorldTransformer::m_s1lly
protected

Lower left y-coordinate of the System 1.

Definition at line 181 of file WorldTransformer.h.

Referenced by getS1lly(), initVariables(), and setTransformationParameters().

double te::layout::WorldTransformer::m_s1urx
protected

Upper right x-coordinate of the System 1.

Definition at line 182 of file WorldTransformer.h.

Referenced by getS1urx(), and initVariables().

double te::layout::WorldTransformer::m_s1ury
protected

Upper right y-coordinate of the System 1.

Definition at line 183 of file WorldTransformer.h.

Referenced by getS1ury(), and initVariables().

double te::layout::WorldTransformer::m_s1Width
protected

Width of System 1 coordinate system.

Definition at line 184 of file WorldTransformer.h.

Referenced by getS1Width(), initVariables(), and setTransformationParameters().

double te::layout::WorldTransformer::m_s2Height
protected

Height of System 2 coordinate system.

Definition at line 192 of file WorldTransformer.h.

Referenced by getS2Height(), initVariables(), setTransformationParameters(), system1Tosystem2(), and system2Tosystem1().

double te::layout::WorldTransformer::m_s2llx
protected

Lower left x-coordinate of the System 2.

Definition at line 187 of file WorldTransformer.h.

Referenced by getS2llx(), initVariables(), and setTransformationParameters().

double te::layout::WorldTransformer::m_s2lly
protected

Lower left y-coordinate of the System 2.

Definition at line 188 of file WorldTransformer.h.

Referenced by getS2lly(), initVariables(), and setTransformationParameters().

double te::layout::WorldTransformer::m_s2urx
protected

Upper right x-coordinate of the System 2.

Definition at line 189 of file WorldTransformer.h.

Referenced by getS2urx(), and initVariables().

double te::layout::WorldTransformer::m_s2ury
protected

Upper right y-coordinate of the System 2.

Definition at line 190 of file WorldTransformer.h.

Referenced by getS2ury(), and initVariables().

double te::layout::WorldTransformer::m_s2Width
protected

Width of System 2 coordinate system.

Definition at line 191 of file WorldTransformer.h.

Referenced by getS2Width(), initVariables(), and setTransformationParameters().

double te::layout::WorldTransformer::m_scaleX
protected

Map units per unit along x-direction between Coordinate Systems.

Definition at line 174 of file WorldTransformer.h.

Referenced by getScaleX(), initVariables(), isValid(), setTransformationParameters(), system1Tosystem2(), and system2Tosystem1().

double te::layout::WorldTransformer::m_scaleY
protected

Map units per unit along y-direction between Coordinate Systems.

Definition at line 175 of file WorldTransformer.h.

Referenced by getScaleY(), initVariables(), isValid(), setTransformationParameters(), system1Tosystem2(), and system2Tosystem1().

double te::layout::WorldTransformer::m_translateX
protected

The value corresponds to the X-Axis translation of system 2.

Definition at line 177 of file WorldTransformer.h.

Referenced by getTranslateX(), initVariables(), setTransformationParameters(), system1Tosystem2(), and system2Tosystem1().

double te::layout::WorldTransformer::m_translateY
protected

The value corresponds to the Y-Axis translation of system 2.

Definition at line 178 of file WorldTransformer.h.

Referenced by getTranslateY(), initVariables(), setTransformationParameters(), system1Tosystem2(), and system2Tosystem1().

bool te::layout::WorldTransformer::m_valid
protected

Definition at line 194 of file WorldTransformer.h.

Referenced by setTransformationParameters().


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