WorldTransformer Class Reference

This class is used to transform coordinates in world coordinate system to the screen coordinate system. More...

Public Member Functions

bool isMirroring ()
 Returns TRUE if transformation is mirrored and FALSE otherwise. More...
 
bool isValid ()
 Returns TRUE if transformation is ok and FALSE otherwise. More...
 
void setMirroring (bool mirror)
 Updates mirroring internal attribute. More...
 
Constructor and destructor methods.

Methods related to instantiation and destruction.

 WorldTransformer ()
 Default constructor. More...
 
 WorldTransformer (const double &s1llx, const double &s1lly, const double &s1urx, const double &s1ury, double s2width, double s2height)
 Parameterized constructor. More...
 
 WorldTransformer (const te::gm::Envelope &system1Box, const te::gm::Envelope &system2Box)
 Parameterized constructor. More...
 
 WorldTransformer (const WorldTransformer &other)
 Copy constructor. More...
 
 ~WorldTransformer ()=default
 Destructor. More...
 
Transformation methods.

Methods used to change coordinates of a coordinate system to another.

void setTransformationParameters (const te::gm::Envelope &system1Box, const te::gm::Envelope &system2Box)
 Updates the matrix of transformation to be used. More...
 
void system1Tosystem2 (double &wx, double &wy) const
 Transforms the coordinate from world system to screen coordinate system. More...
 
void system1Tosystem2 (const double &wx, const double &wy, double &dx, double &dy) const
 
te::gm::Coord2D system1Tosystem2 (const te::gm::Coord2D &c1) const
 
void system2Tosystem1 (double &dx, double &dy) const
 Transforms the coordinate from screen system to world coordinate system. More...
 
void system2Tosystem1 (double dx, double dy, double &wx, double &wy) const
 
Getter methods of matrix parameters.

Methods used to retrieve informations about the matrix of transformation.

double getScaleX ()
 Returns the scale in X-axis. More...
 
double getScaleY ()
 Returns the scale in Y-axis. More...
 
double getTranslateX ()
 Returns the translation in X-axis. More...
 
double getTranslateY ()
 Returns the translation in Y-axis. More...
 
Getter parameters of the world box.

Methods used to retrieve informations about the box in world coordinate system.

double getS1llx ()
 Returns the lower left corner x value. More...
 
double getS1lly ()
 Returns the lower left corner y value. More...
 
double getS1urx ()
 Returns the upper right corner x value. More...
 
double getS1ury ()
 Returns the upper right corner y value. More...
 
double getS1Width ()
 Returns the width of the world box. More...
 
double getS1Height ()
 Returns the height of the world box. More...
 
Getter parameters of the device box.

Methods used to retrieve informations about the box in device coordinate system.

double getS2llx ()
 Returns the lower left corner x value. More...
 
double getS2lly ()
 Returns the lower left corner y value. More...
 
double getS2urx ()
 Returns the upper right corner x value. More...
 
double getS2ury ()
 Returns the upper right corner y value. More...
 
double getS2Width ()
 Returns the width of the device box. More...
 
double getS2Height ()
 Returns the height of the device box. More...
 

Protected Member Functions

void initVariables (const te::gm::Envelope &system1Box, const te::gm::Envelope &system2Box)
 Initializes the transformer using the arguments. More...
 

Protected Attributes

bool m_mirroring {true}
 Flag sinalizing the mirroring. More...
 
double m_s1Height {0.}
 Height of System 1 coordinate system. More...
 
double m_s1llx {0.}
 Lower left x-coordinate of the System 1. More...
 
double m_s1lly {0.}
 Lower left y-coordinate of the System 1. More...
 
double m_s1urx {0.}
 Upper right x-coordinate of the System 1. More...
 
double m_s1ury {0.}
 Upper right y-coordinate of the System 1. More...
 
double m_s1Width {0.}
 Width of System 1 coordinate system. More...
 
double m_s2Height {0.}
 Height of System 2 coordinate system. More...
 
double m_s2llx {0.}
 Lower left x-coordinate of the System 2. More...
 
double m_s2lly {0.}
 Lower left y-coordinate of the System 2. More...
 
double m_s2urx {0.}
 Upper right x-coordinate of the System 2. More...
 
double m_s2ury {0.}
 Upper right y-coordinate of the System 2. More...
 
double m_s2Width {0.}
 Width of System 2 coordinate system. More...
 
double m_scaleX {0.}
 Map units per unit along x-direction between Coordinate Systems. More...
 
double m_scaleY {0.}
 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 {false}
 Flag specifying the state of validation of the transformation being used. More...
 

Detailed Description

This class is used to transform coordinates in world coordinate system to the screen coordinate system.

Definition at line 48 of file qt/widgets/canvas/Grid.cpp.

Constructor & Destructor Documentation

WorldTransformer::WorldTransformer ( )
inline

Default constructor.

Definition at line 60 of file qt/widgets/canvas/Grid.cpp.

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

Parameterized constructor.

Definition at line 68 of file qt/widgets/canvas/Grid.cpp.

References setTransformationParameters().

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

Parameterized constructor.

Definition at line 82 of file qt/widgets/canvas/Grid.cpp.

References setTransformationParameters().

WorldTransformer::WorldTransformer ( const WorldTransformer other)
inline

Copy constructor.

Parameters
otherThe object to be copied.

Definition at line 93 of file qt/widgets/canvas/Grid.cpp.

References m_mirroring, 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, m_translateY, m_valid, and ~WorldTransformer().

WorldTransformer::~WorldTransformer ( )
default

Destructor.

Referenced by WorldTransformer().

Member Function Documentation

double WorldTransformer::getS1Height ( )
inline

Returns the height of the world box.

Returns
The height of the world box.

Definition at line 362 of file qt/widgets/canvas/Grid.cpp.

References m_s1Height.

double WorldTransformer::getS1llx ( )
inline

Returns the lower left corner x value.

Returns
The lower left corner x value.

Definition at line 312 of file qt/widgets/canvas/Grid.cpp.

References m_s1llx.

double WorldTransformer::getS1lly ( )
inline

Returns the lower left corner y value.

Returns
The lower left corner y value.

Definition at line 322 of file qt/widgets/canvas/Grid.cpp.

References m_s1lly.

double WorldTransformer::getS1urx ( )
inline

Returns the upper right corner x value.

Returns
The upper right corner x value.

Definition at line 332 of file qt/widgets/canvas/Grid.cpp.

References m_s1urx.

double WorldTransformer::getS1ury ( )
inline

Returns the upper right corner y value.

Returns
The upper right corner y value.

Definition at line 342 of file qt/widgets/canvas/Grid.cpp.

References m_s1ury.

double WorldTransformer::getS1Width ( )
inline

Returns the width of the world box.

Returns
The width of the world box.

Definition at line 352 of file qt/widgets/canvas/Grid.cpp.

References m_s1Width.

double WorldTransformer::getS2Height ( )
inline

Returns the height of the device box.

Returns
The height of the device box.

Definition at line 428 of file qt/widgets/canvas/Grid.cpp.

References m_s2Height.

double WorldTransformer::getS2llx ( )
inline

Returns the lower left corner x value.

Returns
The lower left corner x value.

Definition at line 378 of file qt/widgets/canvas/Grid.cpp.

References m_s2llx.

double WorldTransformer::getS2lly ( )
inline

Returns the lower left corner y value.

Returns
The lower left corner y value.

Definition at line 388 of file qt/widgets/canvas/Grid.cpp.

References m_s2lly.

double WorldTransformer::getS2urx ( )
inline

Returns the upper right corner x value.

Returns
The upper right corner x value.

Definition at line 398 of file qt/widgets/canvas/Grid.cpp.

References m_s2urx.

double WorldTransformer::getS2ury ( )
inline

Returns the upper right corner y value.

Returns
The upper right corner y value.

Definition at line 408 of file qt/widgets/canvas/Grid.cpp.

References m_s2ury.

double WorldTransformer::getS2Width ( )
inline

Returns the width of the device box.

Returns
The width of the device box.

Definition at line 418 of file qt/widgets/canvas/Grid.cpp.

References m_s2Width.

double WorldTransformer::getScaleX ( )
inline

Returns the scale in X-axis.

Returns
The scale in X-axis.

Definition at line 266 of file qt/widgets/canvas/Grid.cpp.

References m_scaleX.

double WorldTransformer::getScaleY ( )
inline

Returns the scale in Y-axis.

Returns
The scale in Y-axis.

Definition at line 276 of file qt/widgets/canvas/Grid.cpp.

References m_scaleY.

double WorldTransformer::getTranslateX ( )
inline

Returns the translation in X-axis.

Returns
The transation in X-axis.

Definition at line 286 of file qt/widgets/canvas/Grid.cpp.

References m_translateX.

double WorldTransformer::getTranslateY ( )
inline

Returns the translation in Y-axis.

Returns
The transation in Y-axis.

Definition at line 296 of file qt/widgets/canvas/Grid.cpp.

References m_translateY.

void WorldTransformer::initVariables ( const te::gm::Envelope system1Box,
const te::gm::Envelope system2Box 
)
inlineprotected
bool WorldTransformer::isMirroring ( )
inline

Returns TRUE if transformation is mirrored and FALSE otherwise.

Returns
True if the transformation is mirrored and false otherwise.

Definition at line 452 of file qt/widgets/canvas/Grid.cpp.

References m_mirroring.

bool WorldTransformer::isValid ( )
inline

Returns TRUE if transformation is ok and FALSE otherwise.

Returns
True if the transformation is valid and false otherwise.

Definition at line 439 of file qt/widgets/canvas/Grid.cpp.

References m_scaleX, and m_scaleY.

void WorldTransformer::setMirroring ( bool  mirror)
inline

Updates mirroring internal attribute.

Parameters
mirrorNew mirroring state.

Definition at line 462 of file qt/widgets/canvas/Grid.cpp.

References m_mirroring.

Referenced by CalculateHorizontalLines(), CalculateVerticalLines(), and te::qt::widgets::Grid::redraw().

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

Updates the matrix of transformation to be used.

Parameters
system1BoxBox in world coordinate system.
system2BoxBox in screen coordinate system.

Definition at line 133 of file qt/widgets/canvas/Grid.cpp.

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 GetTransformGeo(), and WorldTransformer().

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

Transforms the coordinate from world system to screen coordinate system.

Parameters
[out]wxCoordinate in X-axis.
[out]wyCoordinate in Y-axis.

Definition at line 158 of file qt/widgets/canvas/Grid.cpp.

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

Referenced by ConvertToMillimeter(), DrawLines(), GetTextsPixmap(), and system1Tosystem2().

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
wxCoordinate, in X-axis, to be transformed to screen coordinate system.
wyCoordinate, in Y-axis, to be transformed to screen coordinate system.
[out]dxCoodinate, in X-axis, transformed.
[out]dyCoodinate, in Y-axis, transformed.

Definition at line 181 of file qt/widgets/canvas/Grid.cpp.

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

void WorldTransformer::system1Tosystem2 ( const te::gm::Coord2D c1) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
c1Coordinate to be transformed.
Returns
Returns the coordinate transformed.

Definition at line 200 of file qt/widgets/canvas/Grid.cpp.

References te::gm::Coord2D::getX(), te::gm::Coord2D::getY(), and system1Tosystem2().

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

Transforms the coordinate from screen system to world coordinate system.

Parameters
[out]dxCoordinate in X-axis.
[out]dyCoordinate in Y-axis.

Definition at line 218 of file qt/widgets/canvas/Grid.cpp.

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

Referenced by GetGeographicCoordLine(), and GetTextsPixmap().

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
dxCoordinate, in X-axis, to be transformed to world coordinate system.
dyCoordinate, in Y-axis, to be transformed to world coordinate system.
[out]wxCoodinate, in X-axis, transformed.
[out]wyCoodinate, in Y-axis, transformed.

Definition at line 242 of file qt/widgets/canvas/Grid.cpp.

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

Member Data Documentation

bool WorldTransformer::m_mirroring {true}
protected

Flag sinalizing the mirroring.

Definition at line 521 of file qt/widgets/canvas/Grid.cpp.

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

double WorldTransformer::m_s1Height {0.}
protected

Height of System 1 coordinate system.

Definition at line 512 of file qt/widgets/canvas/Grid.cpp.

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

double WorldTransformer::m_s1llx {0.}
protected

Lower left x-coordinate of the System 1.

Definition at line 507 of file qt/widgets/canvas/Grid.cpp.

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

double WorldTransformer::m_s1lly {0.}
protected

Lower left y-coordinate of the System 1.

Definition at line 508 of file qt/widgets/canvas/Grid.cpp.

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

double WorldTransformer::m_s1urx {0.}
protected

Upper right x-coordinate of the System 1.

Definition at line 509 of file qt/widgets/canvas/Grid.cpp.

Referenced by getS1urx(), initVariables(), and WorldTransformer().

double WorldTransformer::m_s1ury {0.}
protected

Upper right y-coordinate of the System 1.

Definition at line 510 of file qt/widgets/canvas/Grid.cpp.

Referenced by getS1ury(), initVariables(), and WorldTransformer().

double WorldTransformer::m_s1Width {0.}
protected

Width of System 1 coordinate system.

Definition at line 511 of file qt/widgets/canvas/Grid.cpp.

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

double WorldTransformer::m_s2Height {0.}
protected

Height of System 2 coordinate system.

Definition at line 518 of file qt/widgets/canvas/Grid.cpp.

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

double WorldTransformer::m_s2llx {0.}
protected

Lower left x-coordinate of the System 2.

Definition at line 513 of file qt/widgets/canvas/Grid.cpp.

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

double WorldTransformer::m_s2lly {0.}
protected

Lower left y-coordinate of the System 2.

Definition at line 514 of file qt/widgets/canvas/Grid.cpp.

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

double WorldTransformer::m_s2urx {0.}
protected

Upper right x-coordinate of the System 2.

Definition at line 515 of file qt/widgets/canvas/Grid.cpp.

Referenced by getS2urx(), initVariables(), and WorldTransformer().

double WorldTransformer::m_s2ury {0.}
protected

Upper right y-coordinate of the System 2.

Definition at line 516 of file qt/widgets/canvas/Grid.cpp.

Referenced by getS2ury(), initVariables(), and WorldTransformer().

double WorldTransformer::m_s2Width {0.}
protected

Width of System 2 coordinate system.

Definition at line 517 of file qt/widgets/canvas/Grid.cpp.

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

double WorldTransformer::m_scaleX {0.}
protected

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

Definition at line 499 of file qt/widgets/canvas/Grid.cpp.

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

double WorldTransformer::m_scaleY {0.}
protected

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

Definition at line 501 of file qt/widgets/canvas/Grid.cpp.

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

double WorldTransformer::m_translateX
protected
Initial value:
{
0}

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

Definition at line 503 of file qt/widgets/canvas/Grid.cpp.

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

double WorldTransformer::m_translateY
protected
Initial value:
{
0}

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

Definition at line 505 of file qt/widgets/canvas/Grid.cpp.

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

bool WorldTransformer::m_valid {false}
protected

Flag specifying the state of validation of the transformation being used.

Definition at line 519 of file qt/widgets/canvas/Grid.cpp.

Referenced by setTransformationParameters(), and WorldTransformer().


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