26 #ifndef __TERRALIB_MAPTOOLS_INTERNAL_WORLDDEVICETRANSFORMER_H
27 #define __TERRALIB_MAPTOOLS_INTERNAL_WORLDDEVICETRANSFORMER_H
66 const double& wurx,
const double& wury,
67 int deviceWidth,
int deviceHeight);
91 const double& wurx,
const double& wury,
92 int deviceWidth,
int deviceHeight);
113 void world2Device(
double* line,
unsigned int npoints,
double* pts);
123 void world2Device(
const double& wx,
const double& wy,
double& dx,
double& dy)
const;
143 void device2World(
int dx,
int dy,
double& wx,
double& wy)
const;
166 const double& wurx,
const double& wury,
167 int deviceWidth,
int deviceHeight)
177 const double& wurx,
const double& wury,
178 int deviceWidth,
int deviceHeight)
180 double worldWidth = wurx - wllx;
181 double worldHeight = wury - wlly;
183 double muppX = worldWidth /
static_cast<double>(deviceWidth);
184 double muppY = worldHeight /
static_cast<double>(deviceHeight);
191 double whitespace = ((
static_cast<double>(deviceWidth) *
mapUnitsPP_) - worldWidth) * 0.5;
192 wllx_ = wllx - whitespace;
193 wurx_ = wurx + whitespace;
200 double whitespace = ((
static_cast<double>(deviceHeight) *
mapUnitsPP_) - worldHeight) * 0.5;
201 wlly_ = wlly - whitespace;
202 wury_ = wury + whitespace;
215 const unsigned int nstep = 2 * npoints;
217 for(
register unsigned int i = 0; i != nstep; i+=2)
225 double& dx,
double& dy)
const
238 double& wx,
double& wy)
const
247 #endif // __TERRALIB_MAPTOOLS_INTERNAL_WORLDDEVICETRANSFORMER_H
~WorldDeviceTransformer()
Destructor.
double wury_
Upper right y-coordinate of the World (Spatial Coordinate System of the features).
double wlly_
Lower left y-coordinate of the World (Spatial Coordinate System of the features). ...
This class implements the logic for transforming from device coordinate to world coordinate and vice-...
WorldDeviceTransformer()
Empty constructor.
double wurx_
Upper right x-coordinate of the World (Spatial Coordinate System of the features).
void device2World(double &dx, double &dy) const
It transforms the coordinate dx and dy from device coordinates to world coordinates without using aux...
void world2Device(double &wx, double &wy) const
It transforms the coordinate wx and wy from world coordinates to device (canvas) coordinates without ...
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...
double mapUnitsPP_
Map units per-pixel.
double wllx_
Lower left x-coordinate of the World (Spatial Coordinate System of the features). ...