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) |
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.
|
inline |
Empty constructor.
Definition at line 199 of file WorldTransformer.h.
|
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).
s1llx | Lower left x-coordinate of the World (Spatial Coordinate System of the features). |
s1lly | Lower left y-coordinate of the World (Spatial Coordinate System of the features). |
wurx | Upper right x-coordinate of the World (Spatial Coordinate System of the features). |
s1ury | Upper 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().
|
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).
system1Box | Box in System 1 Coordinate System. |
system2Box | Box in System 2 Coordinate System. |
Definition at line 231 of file WorldTransformer.h.
References setTransformationParameters().
|
inline |
Destructor.
Definition at line 236 of file WorldTransformer.h.
|
inline |
Definition at line 380 of file WorldTransformer.h.
References m_s1Height.
|
inline |
Definition at line 355 of file WorldTransformer.h.
References m_s1llx.
|
inline |
Definition at line 360 of file WorldTransformer.h.
References m_s1lly.
|
inline |
Definition at line 365 of file WorldTransformer.h.
References m_s1urx.
|
inline |
Definition at line 370 of file WorldTransformer.h.
References m_s1ury.
|
inline |
Definition at line 375 of file WorldTransformer.h.
References m_s1Width.
|
inline |
Definition at line 410 of file WorldTransformer.h.
References m_s2Height.
|
inline |
Definition at line 385 of file WorldTransformer.h.
References m_s2llx.
|
inline |
Definition at line 390 of file WorldTransformer.h.
References m_s2lly.
|
inline |
Definition at line 395 of file WorldTransformer.h.
References m_s2urx.
|
inline |
Definition at line 400 of file WorldTransformer.h.
References m_s2ury.
|
inline |
Definition at line 405 of file WorldTransformer.h.
References m_s2Width.
|
inline |
Definition at line 335 of file WorldTransformer.h.
References m_scaleX.
|
inline |
Definition at line 340 of file WorldTransformer.h.
References m_scaleY.
|
inline |
Definition at line 345 of file WorldTransformer.h.
References m_translateX.
|
inline |
Definition at line 350 of file WorldTransformer.h.
References m_translateY.
|
inlineprotected |
Definition at line 311 of file WorldTransformer.h.
References te::gm::Envelope::getHeight(), te::gm::Envelope::getLowerLeftX(), te::gm::Envelope::getLowerLeftY(), te::gm::Envelope::getUpperRightX(), te::gm::Envelope::getUpperRightY(), te::gm::Envelope::getWidth(), m_s1Height, m_s1llx, m_s1lly, m_s1urx, m_s1ury, m_s1Width, m_s2Height, m_s2llx, m_s2lly, m_s2urx, m_s2ury, m_s2Width, m_scaleX, m_scaleY, m_translateX, and m_translateY.
Referenced by setTransformationParameters().
|
inline |
Definition at line 423 of file WorldTransformer.h.
References m_mirroring.
|
inline |
Definition at line 415 of file WorldTransformer.h.
|
inline |
Definition at line 428 of file WorldTransformer.h.
References m_mirroring.
Referenced by te::layout::GridPlanarModel::drawHorizontalLines(), te::layout::GridGeodesicModel::drawHorizontalLines(), te::layout::GridPlanarModel::drawVerticalLines(), te::layout::GridGeodesicModel::drawVerticalLines(), and te::layout::MapModel::generateSystematic().
|
inline |
It adjusts a new transformation function that maps between the world coordinate system to other coordinate system.
system1Box | Box in System 1 Coordinate System. |
system2Box | Box 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().
|
inline |
It transforms the coordinate wx and wy from world coordinates to other(system) coordinates without using auxiliary variables.
wx | X value in system 1 coordinates. |
wy | Y 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().
|
inline |
It transforms the coordinate wx and wy from world coordinates to other(system) coordinates (dx and dy).
wx | X value in system 1 coordinates. |
wy | Y value in system 1 coordinates. |
dx | X value in system 2 coordinates. |
dy | Y 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.
|
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.
dx | X value in system 2 coordinates. |
dy | Y 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().
|
inline |
It transforms the coordinate dx and dy from system 2 coordinates to system 1 coordinates (wx and wy).
dx | X value in system 2 coordinates. |
dy | Y value in system 2 coordinates. |
wx | X value in system 1 coordinates. |
wy | Y 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.
|
protected |
Definition at line 196 of file WorldTransformer.h.
Referenced by isMirroring(), setMirroring(), system1Tosystem2(), and system2Tosystem1().
|
protected |
Height of System 1 coordinate system.
Definition at line 185 of file WorldTransformer.h.
Referenced by getS1Height(), initVariables(), and setTransformationParameters().
|
protected |
Lower left x-coordinate of the System 1.
Definition at line 180 of file WorldTransformer.h.
Referenced by getS1llx(), initVariables(), and setTransformationParameters().
|
protected |
Lower left y-coordinate of the System 1.
Definition at line 181 of file WorldTransformer.h.
Referenced by getS1lly(), initVariables(), and setTransformationParameters().
|
protected |
Upper right x-coordinate of the System 1.
Definition at line 182 of file WorldTransformer.h.
Referenced by getS1urx(), and initVariables().
|
protected |
Upper right y-coordinate of the System 1.
Definition at line 183 of file WorldTransformer.h.
Referenced by getS1ury(), and initVariables().
|
protected |
Width of System 1 coordinate system.
Definition at line 184 of file WorldTransformer.h.
Referenced by getS1Width(), initVariables(), and setTransformationParameters().
|
protected |
Height of System 2 coordinate system.
Definition at line 192 of file WorldTransformer.h.
Referenced by getS2Height(), initVariables(), setTransformationParameters(), system1Tosystem2(), and system2Tosystem1().
|
protected |
Lower left x-coordinate of the System 2.
Definition at line 187 of file WorldTransformer.h.
Referenced by getS2llx(), initVariables(), and setTransformationParameters().
|
protected |
Lower left y-coordinate of the System 2.
Definition at line 188 of file WorldTransformer.h.
Referenced by getS2lly(), initVariables(), and setTransformationParameters().
|
protected |
Upper right x-coordinate of the System 2.
Definition at line 189 of file WorldTransformer.h.
Referenced by getS2urx(), and initVariables().
|
protected |
Upper right y-coordinate of the System 2.
Definition at line 190 of file WorldTransformer.h.
Referenced by getS2ury(), and initVariables().
|
protected |
Width of System 2 coordinate system.
Definition at line 191 of file WorldTransformer.h.
Referenced by getS2Width(), initVariables(), and setTransformationParameters().
|
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().
|
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().
|
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().
|
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().
|
protected |
Definition at line 194 of file WorldTransformer.h.
Referenced by setTransformationParameters().