|
QGIS API Documentation
2.12.0-Lyon
|
Perform transforms between map coordinates and device coordinates. More...
#include <qgsmaptopixel.h>
Public Member Functions | |
| Q_DECL_DEPRECATED | QgsMapToPixel (double mapUnitsPerPixel, double height, double ymin=0, double xmin=0) |
| Constructor. More... | |
| QgsMapToPixel (double mapUnitsPerPixel, double xc, double yc, int width, int height, double rotation) | |
| Constructor. More... | |
| QgsMapToPixel (double mapUnitsPerPixel) | |
| Constructor. More... | |
| QgsMapToPixel () | |
| Constructor. More... | |
| ~QgsMapToPixel () | |
| destructor More... | |
| int | mapHeight () const |
| Return current map height in pixels. More... | |
| double | mapRotation () const |
| Return current map rotation in degrees. More... | |
| double | mapUnitsPerPixel () const |
| Return current map units per pixel. More... | |
| int | mapWidth () const |
| Return current map width in pixels The information is only known if setRotation was used. More... | |
| void | setMapRotation (double degrees, double cx, double cy) |
| Set map rotation in degrees (clockwise) More... | |
| void | setMapUnitsPerPixel (double mapUnitsPerPixel) |
| Set map units per pixel. More... | |
| Q_DECL_DEPRECATED void | setParameters (double mapUnitsPerPixel, double xmin, double ymin, double height) |
| Set parameters for use in transforming coordinates. More... | |
| void | setParameters (double mapUnitsPerPixel, double xc, double yc, int width, int height, double rotation) |
| Set parameters for use in transforming coordinates. More... | |
| Q_DECL_DEPRECATED void | setXMinimum (double xmin) |
| set minimum x value More... | |
| Q_DECL_DEPRECATED void | setYMaximum (double yMax) |
| Set maximum y value. More... | |
| Q_DECL_DEPRECATED void | setYMinimum (double ymin) |
| Set minimum y value. More... | |
| QString | showParameters () const |
| String representation of the parameters used in the transform. More... | |
| QgsPoint | toMapCoordinates (int x, int y) const |
| QgsPoint | toMapCoordinates (QPoint p) const |
| Transform device coordinates to map (world) coordinates. More... | |
| QgsPoint | toMapCoordinatesF (double x, double y) const |
| Transform device coordinates to map (world) coordinates. More... | |
| QgsPoint | toMapPoint (double x, double y) const |
| QgsPoint | transform (const QgsPoint &p) const |
| Transform the point from map (world) coordinates to device coordinates. More... | |
| void | transform (QgsPoint *p) const |
| QgsPoint | transform (qreal x, qreal y) const |
| Transform the point specified by x,y from map (world) coordinates to device coordinates. More... | |
| QTransform | transform () const |
| void | transformInPlace (double &x, double &y) const |
| Transform device coordinates to map (world) coordinates. More... | |
| void | transformInPlace (float &x, float &y) const |
| template<class T > | |
| void | transformInPlace (QVector< T > &x, QVector< T > &y) const |
| Transform device coordinates to map coordinates. More... | |
Perform transforms between map coordinates and device coordinates.
This class can convert device coordinates to map coordinates and vice versa.
Definition at line 34 of file qgsmaptopixel.h.
| QgsMapToPixel::QgsMapToPixel | ( | double | mapUnitsPerPixel, |
| double | height, | ||
| double | ymin = 0, |
||
| double | xmin = 0 |
||
| ) |
Constructor.
| mapUnitsPerPixel | Map units per pixel |
| height | Map canvas height, in pixels |
| ymin | Minimum y value of the map canvas |
| xmin | Minimum x value of the map canvas |
Definition at line 72 of file qgsmaptopixel.cpp.
| QgsMapToPixel::QgsMapToPixel | ( | double | mapUnitsPerPixel, |
| double | xc, | ||
| double | yc, | ||
| int | width, | ||
| int | height, | ||
| double | rotation | ||
| ) |
Constructor.
| mapUnitsPerPixel | Map units per pixel |
| xc | X ordinate of map center, in geographical units |
| yc | Y ordinate of map center, in geographical units |
| width | Output width, in pixels |
| height | Output height, in pixels |
| rotation | clockwise rotation in degrees |
Definition at line 26 of file qgsmaptopixel.cpp.
| QgsMapToPixel::QgsMapToPixel | ( | double | mapUnitsPerPixel | ) |
Constructor.
| mapUnitsPerPixel | Map units per pixel |
Definition at line 45 of file qgsmaptopixel.cpp.
| QgsMapToPixel::QgsMapToPixel | ( | ) |
| QgsMapToPixel::~QgsMapToPixel | ( | ) |
destructor
Definition at line 88 of file qgsmaptopixel.cpp.
| int QgsMapToPixel::mapHeight | ( | ) | const |
Return current map height in pixels.
Definition at line 92 of file qgsmaptopixel.cpp.
| double QgsMapToPixel::mapRotation | ( | ) | const |
Return current map rotation in degrees.
Definition at line 182 of file qgsmaptopixel.cpp.
| double QgsMapToPixel::mapUnitsPerPixel | ( | ) | const |
Return current map units per pixel.
Definition at line 152 of file qgsmaptopixel.cpp.
| int QgsMapToPixel::mapWidth | ( | ) | const |
Return current map width in pixels The information is only known if setRotation was used.
Definition at line 97 of file qgsmaptopixel.cpp.
| void QgsMapToPixel::setMapRotation | ( | double | degrees, |
| double | cx, | ||
| double | cy | ||
| ) |
Set map rotation in degrees (clockwise)
| degrees | clockwise rotation in degrees |
| cx | X ordinate of map center in geographical units |
| cy | Y ordinate of map center in geographical units |
Definition at line 157 of file qgsmaptopixel.cpp.
| void QgsMapToPixel::setMapUnitsPerPixel | ( | double | mapUnitsPerPixel | ) |
Set map units per pixel.
| mapUnitsPerPixel | Map units per pixel |
Definition at line 142 of file qgsmaptopixel.cpp.
| void QgsMapToPixel::setParameters | ( | double | mapUnitsPerPixel, |
| double | xmin, | ||
| double | ymin, | ||
| double | height | ||
| ) |
Set parameters for use in transforming coordinates.
| mapUnitsPerPixel | Map units per pixel |
| xmin | Minimum x value |
| ymin | Minimum y value |
| height | Map height, in pixels |
Definition at line 219 of file qgsmaptopixel.cpp.
| void QgsMapToPixel::setParameters | ( | double | mapUnitsPerPixel, |
| double | xc, | ||
| double | yc, | ||
| int | width, | ||
| int | height, | ||
| double | rotation | ||
| ) |
Set parameters for use in transforming coordinates.
| mapUnitsPerPixel | Map units per pixel |
| xc | X ordinate of map center, in geographical units |
| yc | Y ordinate of map center, in geographical units |
| width | Output width, in pixels |
| height | Output height, in pixels |
| rotation | clockwise rotation in degrees |
Definition at line 249 of file qgsmaptopixel.cpp.
| void QgsMapToPixel::setXMinimum | ( | double | xmin | ) |
set minimum x value
Definition at line 203 of file qgsmaptopixel.cpp.
|
inline |
Set maximum y value.
Definition at line 179 of file qgsmaptopixel.h.
| void QgsMapToPixel::setYMinimum | ( | double | ymin | ) |
Set minimum y value.
Definition at line 188 of file qgsmaptopixel.cpp.
| QString QgsMapToPixel::showParameters | ( | ) | const |
String representation of the parameters used in the transform.
Definition at line 287 of file qgsmaptopixel.cpp.
| QgsPoint QgsMapToPixel::toMapCoordinates | ( | int | x, |
| int | y | ||
| ) | const |
Definition at line 132 of file qgsmaptopixel.cpp.
Transform device coordinates to map (world) coordinates.
| p | Point to be converted to map cooordinates |
Definition at line 126 of file qgsmaptopixel.cpp.
| QgsPoint QgsMapToPixel::toMapCoordinatesF | ( | double | x, |
| double | y | ||
| ) | const |
Transform device coordinates to map (world) coordinates.
Definition at line 137 of file qgsmaptopixel.cpp.
| QgsPoint QgsMapToPixel::toMapPoint | ( | double | x, |
| double | y | ||
| ) | const |
Definition at line 114 of file qgsmaptopixel.cpp.
Transform the point from map (world) coordinates to device coordinates.
| p | Point to transform |
Definition at line 303 of file qgsmaptopixel.cpp.
| void QgsMapToPixel::transform | ( | QgsPoint * | p | ) | const |
Definition at line 311 of file qgsmaptopixel.cpp.
| QgsPoint QgsMapToPixel::transform | ( | qreal | x, |
| qreal | y | ||
| ) | const |
Transform the point specified by x,y from map (world) coordinates to device coordinates.
| x | x cordinate o point to transform |
| y | y coordinate of point to transform |
Definition at line 297 of file qgsmaptopixel.cpp.
| QTransform QgsMapToPixel::transform | ( | ) | const |
Definition at line 336 of file qgsmaptopixel.cpp.
| void QgsMapToPixel::transformInPlace | ( | double & | x, |
| double & | y | ||
| ) | const |
Transform device coordinates to map (world) coordinates.
| x | x coordinate of point to be converted to map cooordinates |
| y | y coordinate of point to be converted to map cooordinates |
Definition at line 319 of file qgsmaptopixel.cpp.
| void QgsMapToPixel::transformInPlace | ( | float & | x, |
| float & | y | ||
| ) | const |
Definition at line 329 of file qgsmaptopixel.cpp.
|
inline |
Transform device coordinates to map coordinates.
Modifies the given coordinates in place. Intended as a fast way to do the transform.
Definition at line 116 of file qgsmaptopixel.h.
1.8.9.1