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] );
121 QgsPointXY toMapCoordinates(
int x,
int y )
const;
131 QgsPointXY toMapCoordinates( QPoint p )
const;
143 void setMapUnitsPerPixel(
double mapUnitsPerPixel );
146 double mapUnitsPerPixel()
const;
153 int mapWidth()
const;
159 int mapHeight()
const;
168 void setMapRotation(
double degrees,
double cx,
double cy );
174 double mapRotation()
const;
186 void setParameters(
double mapUnitsPerPixel,
double centerX,
double centerY,
int widthPixels,
int heightPixels,
double rotation );
189 QString showParameters()
const;
191 QTransform transform()
const;
208 double mMapUnitsPerPixel = 1;
211 double mRotation = 0.0;
212 double mXCenter = 0.5;
213 double mYCenter = 0.5;
222 #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.
double yCenter() const
Returns the center y-coordinate for the transform.
A class to represent a 2D point.
Perform transforms between map coordinates and device coordinates.
DistanceUnit
Units of distance.