te::map::WorldDeviceTransformer Class Reference

This class implements the logic for transforming from device coordinate to world coordinate and vice-versa. More...

#include <WorldDeviceTransformer.h>

Public Member Functions

Initializer Methods

Methods related to instantiation and destruction.

 WorldDeviceTransformer ()
 Empty constructor. More...
 
 WorldDeviceTransformer (const double &wllx, const double &wlly, const double &wurx, const double &wury, int deviceWidth, int deviceHeight)
 Creates a new transformation functor that maps between the spatial coordinate system of a feature to device (canvas) coordinate system. More...
 
 ~WorldDeviceTransformer ()
 Destructor. More...
 
Transformation Methods

Methods used to transform coordinates from world (feature coordinate system) to device (canvas) and vice-versa.

void setTransformationParameters (const double &wllx, const double &wlly, const double &wurx, const double &wury, int deviceWidth, int deviceHeight)
 It adjusts a new transformation function that maps between the spatial coordinate system of a feature to device (canvas) coordinate system. More...
 
void world2Device (double &wx, double &wy) const
 It transforms the coordinate wx and wy from world coordinates to device (canvas) coordinates without using auxiliary variables. It is supposed to be faster than the other version that has 4 parameters. More...
 
void world2Device (double *line, unsigned int npoints, double *pts)
 It transforms the line coordinates from world coordinates to device (canvas) coordinates. More...
 
void world2Device (const double &wx, const double &wy, double &dx, double &dy) const
 It transforms the coordinate wx and wy from world coordinates to device (canvas) coordinates (dx and dy). More...
 
void device2World (double &dx, double &dy) const
 It transforms the coordinate dx and dy from device coordinates to world coordinates without using auxiliary variables. It is supposed to be faster than the other version that has 4 parameters. More...
 
void device2World (int dx, int dy, double &wx, double &wy) const
 It transforms the coordinate dx and dy from device (canvas) coordinates to world coordinates (wx and wy). More...
 

Public Attributes

double m_mapUnitsPP
 Map units per-pixel. More...
 
double m_wllx
 Lower left x-coordinate of the World (Spatial Coordinate System of the features). More...
 
double m_wlly
 Lower left y-coordinate of the World (Spatial Coordinate System of the features). More...
 
double m_wurx
 Upper right x-coordinate of the World (Spatial Coordinate System of the features). More...
 
double m_wury
 Upper right y-coordinate of the World (Spatial Coordinate System of the features). More...
 

Detailed Description

This class implements the logic for transforming from device coordinate to world coordinate and vice-versa.

See also
Canvas

Definition at line 42 of file WorldDeviceTransformer.h.

Constructor & Destructor Documentation

◆ WorldDeviceTransformer() [1/2]

te::map::WorldDeviceTransformer::WorldDeviceTransformer ( )
inline

Empty constructor.

Definition at line 156 of file WorldDeviceTransformer.h.

◆ WorldDeviceTransformer() [2/2]

te::map::WorldDeviceTransformer::WorldDeviceTransformer ( const double &  wllx,
const double &  wlly,
const double &  wurx,
const double &  wury,
int  deviceWidth,
int  deviceHeight 
)
inline

Creates a new transformation functor that maps between the spatial coordinate system of a feature to device (canvas) coordinate system.

Parameters
wllxLower left x-coordinate of the World (Spatial Coordinate System of the features).
wllyLower 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).
wuryUpper right y-coordinate of the World (Spatial Coordinate System of the features).
deviceWidthDevice (canvas) width in pixels.
deviceHeightDevice (canvas) height in pixels.

Definition at line 165 of file WorldDeviceTransformer.h.

References setTransformationParameters().

◆ ~WorldDeviceTransformer()

te::map::WorldDeviceTransformer::~WorldDeviceTransformer ( )
inline

Destructor.

Definition at line 172 of file WorldDeviceTransformer.h.

Member Function Documentation

◆ device2World() [1/2]

void te::map::WorldDeviceTransformer::device2World ( double &  dx,
double &  dy 
) const
inline

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

Parameters
dxX value in device coordinates.
dyY value in device coordinates.

Definition at line 231 of file WorldDeviceTransformer.h.

References m_mapUnitsPP, m_wllx, and m_wury.

◆ device2World() [2/2]

void te::map::WorldDeviceTransformer::device2World ( int  dx,
int  dy,
double &  wx,
double &  wy 
) const
inline

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

Parameters
dxX value in device coordinates.
dyY value in device coordinates.
wxX value in world coordinates.
wyY value in world coordinates.

Definition at line 237 of file WorldDeviceTransformer.h.

References m_mapUnitsPP, m_wllx, and m_wury.

◆ setTransformationParameters()

void te::map::WorldDeviceTransformer::setTransformationParameters ( const double &  wllx,
const double &  wlly,
const double &  wurx,
const double &  wury,
int  deviceWidth,
int  deviceHeight 
)
inline

It adjusts a new transformation function that maps between the spatial coordinate system of a feature to device (canvas) coordinate system.

Parameters
wllxLower left x-coordinate of the World (Spatial Coordinate System of the features).
wllyLower 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).
wuryUpper right y-coordinate of the World (Spatial Coordinate System of the features).
deviceWidthDevice (canvas) width in pixels.
deviceHeightDevice (canvas) height in pixels.

Definition at line 176 of file WorldDeviceTransformer.h.

References m_mapUnitsPP, m_wllx, m_wlly, m_wurx, and m_wury.

Referenced by WorldDeviceTransformer().

◆ world2Device() [1/3]

void te::map::WorldDeviceTransformer::world2Device ( double &  wx,
double &  wy 
) const
inline

It transforms the coordinate wx and wy from world coordinates to device (canvas) coordinates without using auxiliary variables. It is supposed to be faster than the other version that has 4 parameters.

Parameters
wxX value in world coordinates.
wyY value in world coordinates.

Definition at line 207 of file WorldDeviceTransformer.h.

References m_mapUnitsPP, m_wllx, and m_wury.

◆ world2Device() [2/3]

void te::map::WorldDeviceTransformer::world2Device ( double *  line,
unsigned int  npoints,
double *  pts 
)
inline

It transforms the line coordinates from world coordinates to device (canvas) coordinates.

Parameters
lineMust be a buffer of double, with npoints.
npointsThe number of points in the line.
ptsThe device coordinate buffer.
Note
We must have buffer aligned as: buffer[0] -> x0, buffer[1] -> y0, buffer[2] -> x1, buffer[3] -> y1 and so on.

Definition at line 213 of file WorldDeviceTransformer.h.

References m_mapUnitsPP, m_wllx, and m_wury.

◆ world2Device() [3/3]

void te::map::WorldDeviceTransformer::world2Device ( const double &  wx,
const double &  wy,
double &  dx,
double &  dy 
) const
inline

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

Parameters
wxX value in world coordinates.
wyY value in world coordinates.
dxX value in device coordinates.
dyY value in device coordinates.

Definition at line 224 of file WorldDeviceTransformer.h.

References m_mapUnitsPP, m_wllx, and m_wury.

Member Data Documentation

◆ m_mapUnitsPP

double te::map::WorldDeviceTransformer::m_mapUnitsPP

Map units per-pixel.

Definition at line 149 of file WorldDeviceTransformer.h.

Referenced by device2World(), setTransformationParameters(), and world2Device().

◆ m_wllx

double te::map::WorldDeviceTransformer::m_wllx

Lower left x-coordinate of the World (Spatial Coordinate System of the features).

Definition at line 150 of file WorldDeviceTransformer.h.

Referenced by device2World(), setTransformationParameters(), and world2Device().

◆ m_wlly

double te::map::WorldDeviceTransformer::m_wlly

Lower left y-coordinate of the World (Spatial Coordinate System of the features).

Definition at line 151 of file WorldDeviceTransformer.h.

Referenced by setTransformationParameters().

◆ m_wurx

double te::map::WorldDeviceTransformer::m_wurx

Upper right x-coordinate of the World (Spatial Coordinate System of the features).

Definition at line 152 of file WorldDeviceTransformer.h.

Referenced by setTransformationParameters().

◆ m_wury

double te::map::WorldDeviceTransformer::m_wury

Upper right y-coordinate of the World (Spatial Coordinate System of the features).

Definition at line 153 of file WorldDeviceTransformer.h.

Referenced by device2World(), setTransformationParameters(), and world2Device().


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