@@ -114,22 +114,18 @@ void QgsMapToPixel::updateMatrix()
114
114
mMatrix = QTransform::fromTranslate ( cx, cy )
115
115
.rotate ( rotation )
116
116
.scale ( 1 / mMapUnitsPerPixel , -1 / mMapUnitsPerPixel )
117
- .translate ( -xCenter, -yCenter )
118
- ;
117
+ .translate ( -xCenter, -yCenter );
119
118
}
120
119
121
- QgsPoint QgsMapToPixel::toMapPoint ( double x, double y ) const
120
+ QgsPoint QgsMapToPixel::toMapPoint ( qreal x, qreal y ) const
122
121
{
123
122
bool invertible;
124
123
QTransform matrix = mMatrix .inverted ( &invertible );
125
124
assert ( invertible );
126
- double mx, my;
125
+ qreal mx, my;
127
126
matrix.map ( x, y, &mx, &my );
128
- QgsPoint ret ( mx, my );
129
-
130
127
// QgsDebugMsg(QString("XXX toMapPoint x:%1 y:%2 -> x:%3 y:%4").arg(x).arg(y).arg(mx).arg(my));
131
-
132
- return ret;
128
+ return QgsPoint ( mx, my );
133
129
}
134
130
135
131
QgsPoint QgsMapToPixel::toMapCoordinates ( QPoint p ) const
@@ -232,42 +228,34 @@ QString QgsMapToPixel::showParameters() const
232
228
<< " rotation: " << mRotation
233
229
<< " size: " << mWidth << " x" << mHeight ;
234
230
return rep;
235
-
236
231
}
237
232
238
-
239
- QgsPoint QgsMapToPixel::transform ( double x, double y ) const
233
+ QgsPoint QgsMapToPixel::transform ( qreal x, qreal y ) const
240
234
{
241
235
transformInPlace ( x, y );
242
236
return QgsPoint ( x, y );
243
237
}
244
238
245
- QgsPoint QgsMapToPixel::transform ( const QgsPoint& p ) const
239
+ QgsPoint QgsMapToPixel::transform ( const QgsPoint & p ) const
246
240
{
247
- double dx = p.x ();
248
- double dy = p.y ();
249
- transformInPlace ( dx, dy );
250
-
241
+ qreal x = p.x (), y = p.y ();
242
+ transformInPlace ( x, y );
251
243
// QgsDebugMsg(QString("Point to pixel...X : %1-->%2, Y: %3 -->%4").arg(p.x()).arg(dx).arg(p.y()).arg(dy));
252
- return QgsPoint ( dx, dy );
244
+ return QgsPoint ( x, y );
253
245
}
254
246
255
- void QgsMapToPixel::transform ( QgsPoint* p ) const
247
+ void QgsMapToPixel::transform ( QgsPoint * p ) const
256
248
{
257
- double x = p->x ();
258
- double y = p->y ();
249
+ qreal x = p->x (), y = p->y ();
259
250
transformInPlace ( x, y );
260
-
261
- #ifdef QGISDEBUG
262
251
// QgsDebugMsg(QString("Point to pixel...X : %1-->%2, Y: %3 -->%4").arg(p->x()).arg(x).arg(p->y()).arg(y));
263
- #endif
264
252
p->set ( x, y );
265
253
}
266
254
267
- void QgsMapToPixel::transformInPlace ( qreal& x, qreal& y ) const
255
+ void QgsMapToPixel::transformInPlace ( qreal & x, qreal & y ) const
268
256
{
269
257
// Map 2 Pixel
270
- double mx, my;
258
+ qreal mx, my;
271
259
mMatrix .map ( x, y, &mx, &my );
272
260
// QgsDebugMsg(QString("XXX transformInPlace X : %1-->%2, Y: %3 -->%4").arg(x).arg(mx).arg(y).arg(my));
273
261
x = mx; y = my;
0 commit comments