On armel/armhf qreal is typedef'ed to float not double.

This patch adds qreal versions of some functions on arm. It was originally
writen by Konstantinos Margaritis and later fixed by Peter Michael Green.

Bug-Debian: http://bugs.debian.org/691333
This commit is contained in:
Bas Couwenberg 2014-03-28 10:37:13 +01:00
parent 984fe0e8f5
commit 03b028dbf7
4 changed files with 26 additions and 0 deletions

View File

@ -434,6 +434,17 @@ void QgsCoordinateTransform::transformInPlace(
}
}
#ifdef QT_ARCH_ARM
void QgsCoordinateTransform::transformInPlace( qreal& x, qreal& y, double& z,
TransformDirection direction ) const
{
double xd = (double) x, yd = (double) y;
transformInPlace(xd, yd, z, direction);
x=xd;
y=yd;
}
#endif
#ifdef ANDROID
void QgsCoordinateTransform::transformInPlace( float& x, float& y, float& z,
TransformDirection direction ) const

View File

@ -156,6 +156,9 @@ class CORE_EXPORT QgsCoordinateTransform : public QObject
// and y variables in place. The second one works with good old-fashioned
// C style arrays.
void transformInPlace( double& x, double& y, double &z, TransformDirection direction = ForwardTransform ) const;
#ifdef QT_ARCH_ARM
void transformInPlace( qreal& x, qreal& y, double &z, TransformDirection direction = ForwardTransform ) const;
#endif
//! @note not available in python bindings
void transformInPlace( QVector<double>& x, QVector<double>& y, QVector<double>& z,

View File

@ -138,6 +138,14 @@ void QgsMapToPixel::transformInPlace( double& x, double& y ) const
y = yMax - ( y - yMin ) / mMapUnitsPerPixel;
}
#ifdef QT_ARCH_ARM
void QgsMapToPixel::transformInPlace( qreal& x, qreal& y ) const
{
x = ( x - xMin ) / mMapUnitsPerPixel;
y = yMax - ( y - yMin ) / mMapUnitsPerPixel;
}
#endif
void QgsMapToPixel::transformInPlace( QVector<double>& x,
QVector<double>& y ) const
{
@ -161,3 +169,4 @@ void QgsMapToPixel::transformInPlace( QVector<float>& x,
transformInPlace( x[i], y[i] );
}
#endif

View File

@ -66,6 +66,9 @@ class CORE_EXPORT QgsMapToPixel
given coordinates in place. Intended as a fast way to do the
transform. */
void transformInPlace( double& x, double& y ) const;
#ifdef QT_ARCH_ARM
void transformInPlace( qreal& x, qreal& y ) const;
#endif
/* Transform device coordinates to map coordinates. Modifies the
given coordinates in place. Intended as a fast way to do the