Skip to content
Permalink
Browse files
Merge pull request #1275 from sebastic/arm
Support building QGIS on ARM (#9917)
  • Loading branch information
jef-n committed Mar 28, 2014
2 parents a82aeb0 + 3d44c59 commit c324895cc1d58d60cf02d6d1f65ee2c4a3ec41d6
@@ -55,6 +55,11 @@ IF(NOT ANDROID)
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} ANDROID)
ENDIF(NOT ANDROID)

IF(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
ELSE(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} ARM)
ENDIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")

IF(NOT WITH_TOUCH)
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} HAVE_TOUCH)
ENDIF(NOT WITH_TOUCH)
@@ -109,7 +109,7 @@ class QgsComposerScaleBar: QgsComposerItem
of the segment
@note python bindings not available on android
*/
%If (!ANDROID)
%If (!ARM)
void segmentPositions( QList<QPair<double, double> >& posWidthList ) const;
%End

@@ -1,3 +1,5 @@
%Feature ARM

class QgsClipper
{
%TypeHeaderCode
@@ -34,7 +36,7 @@ class QgsClipper
// A handy way to refer to the four boundaries
enum Boundary {XMax, XMin, YMax, YMin};

%If (!ANDROID)
%If (!ARM)
// Trims the given feature to a rectangular box. Returns the trimmed
// feature in x and y. The shapeOpen parameter determines whether
// the function treats the points as a closed shape (polygon), or as
@@ -433,7 +433,7 @@ void QwtPolarCurve::drawLines( QPainter *painter,

if ( !clipRect.isEmpty() )
{
double off = qCeil( qMax( 1.0, painter->pen().widthF() ) );
double off = qCeil( qMax((qreal)1.0,painter->pen().widthF() ) );
clipRect = clipRect.toRect().adjusted( -off, -off, off, off );
polyline = QwtClipper::clipPolygonF( clipRect, polyline );
}
@@ -278,7 +278,7 @@ QRectF QwtPolarLayout::layoutLegend( Options options, QRectF &rect ) const
// We don't allow vertical legends to take more than
// half of the available space.

dim = qMin( hint.width(), rect.width() * d_data->legendRatio );
dim = qMin( hint.width(), (qreal)(rect.width() * d_data->legendRatio) );

if ( !( options & IgnoreScrollbars ) )
{
@@ -293,7 +293,7 @@ QRectF QwtPolarLayout::layoutLegend( Options options, QRectF &rect ) const
}
else
{
dim = qMin( hint.height(), rect.height() * d_data->legendRatio );
dim = qMin( hint.height(), (qreal)(rect.height() * d_data->legendRatio) );
dim = qMax( dim, d_data->layoutData.legend.hScrollBarHeight );
}

@@ -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
@@ -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,
@@ -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

@@ -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

0 comments on commit c324895

Please sign in to comment.