20 #include "qgis_core.h" 50 QgsMapToPixel(
double mapUnitsPerPixel,
double centerX,
double centerY,
int widthPixels,
int heightPixels,
double rotation );
91 QgsPointXY transform( qreal x, qreal y )
const;
98 void transformInPlace(
double &x,
double &y )
const;
101 void transformInPlace(
float &x,
float &y )
const SIP_SKIP;
111 template <
class T> SIP_SKIP
114 assert( x.size() == y.size() );
115 for (
int i = 0; i < x.size(); ++i )
116 transformInPlace( x[i], y[i] );
120 QgsPointXY toMapCoordinates(
int x,
int y )
const;
123 QgsPointXY toMapCoordinatesF(
double x,
double y )
const;
130 QgsPointXY toMapCoordinates( QPoint p )
const;
132 QgsPointXY toMapPoint(
double x,
double y )
const;
138 void setMapUnitsPerPixel(
double mapUnitsPerPixel );
141 double mapUnitsPerPixel()
const;
148 int mapWidth()
const;
154 int mapHeight()
const;
163 void setMapRotation(
double degrees,
double cx,
double cy );
169 double mapRotation()
const;
181 void setParameters(
double mapUnitsPerPixel,
double centerX,
double centerY,
int widthPixels,
int heightPixels,
double rotation );
184 QString showParameters()
const;
186 QTransform transform()
const;
203 double mMapUnitsPerPixel = 1;
206 double mRotation = 0.0;
207 double mXCenter = 0.5;
208 double mYCenter = 0.5;
217 #endif // QGSMAPTOPIXEL double xCenter() const
Returns the center x-coordinate for the transform.
void transformInPlace(QVector< T > &x, QVector< T > &y) const
Transform device coordinates to map coordinates.
A class to represent a 2D point.
Perform transforms between map coordinates and device coordinates.
DistanceUnit
Units of distance.
double yCenter() const
Returns the center y-coordinate for the transform.