Skip to content
Permalink
Browse files

Replace use of qt methods with std equivalents

  • Loading branch information
nyalldawson committed Oct 25, 2017
1 parent 1d01d4b commit 00e869039bfb6dee3f2aaf2937cb9a277ae5ab48
@@ -19,8 +19,8 @@
#include "qgsfeaturepool.h"

QgsGeometryCheckerContext::QgsGeometryCheckerContext( int _precision, const QString &_mapCrs, const QMap<QString, QgsFeaturePool *> &_featurePools )
: tolerance( qPow( 10, -_precision ) )
, reducedTolerance( qPow( 10, -_precision / 2 ) )
: tolerance( std::pow( 10, -_precision ) )
, reducedTolerance( std::pow( 10, -_precision / 2 ) )
, mapCrs( _mapCrs )
, featurePools( _featurePools )
{
@@ -110,7 +110,7 @@ void QgsGeometryOverlapCheck::fixError( QgsGeometryCheckError *error, int method
for ( int iPart = 0, nParts = interGeom->partCount(); iPart < nParts; ++iPart )
{
QgsAbstractGeometry *part = QgsGeometryCheckerUtils::getGeomPart( interGeom, iPart );
if ( qAbs( part->area() - overlapError->value().toDouble() ) < mContext->reducedTolerance &&
if ( std::fabs( part->area() - overlapError->value().toDouble() ) < mContext->reducedTolerance &&
QgsGeometryCheckerUtils::pointsFuzzyEqual( part->centroid(), overlapError->location(), mContext->reducedTolerance ) )
{
interPart = part;
@@ -42,7 +42,7 @@ class ANALYSIS_EXPORT QgsGeometryOverlapCheckError : public QgsGeometryCheckErro
other->featureId() == featureId() &&
err->overlappedFeature() == overlappedFeature() &&
QgsGeometryCheckerUtils::pointsFuzzyEqual( location(), other->location(), mCheck->getContext()->reducedTolerance ) &&
qAbs( value().toDouble() - other->value().toDouble() ) < mCheck->getContext()->reducedTolerance;
std::fabs( value().toDouble() - other->value().toDouble() ) < mCheck->getContext()->reducedTolerance;
}

bool closeMatch( QgsGeometryCheckError *other ) const override
@@ -20,7 +20,7 @@ bool QgsGeometrySliverPolygonCheck::checkThreshold( double layerToMapUnits, cons
{
double maxArea = mMaxAreaMapUnits / ( layerToMapUnits * layerToMapUnits );
QgsRectangle bb = geom->boundingBox();
double maxDim = qMax( bb.width(), bb.height() );
double maxDim = std::max( bb.width(), bb.height() );
double area = geom->area();
value = ( maxDim * maxDim ) / area;
if ( maxArea > 0. && area > maxArea )
@@ -1855,7 +1855,7 @@ namespace QgsWms
QList<QColor> bufferColors = toColorList( toStringList( ParameterName::HIGHLIGHT_LABELBUFFERCOLOR, mapId, ';' ), ParameterName::HIGHLIGHT_LABELBUFFERCOLOR, mapId );
QList<float> bufferSizes = toFloatList( toStringList( ParameterName::HIGHLIGHT_LABELBUFFERSIZE, mapId, ';' ), ParameterName::HIGHLIGHT_LABELBUFFERSIZE, mapId );

int nHLayers = qMin( geoms.size(), slds.size() );
int nHLayers = std::min( geoms.size(), slds.size() );
for ( int i = 0; i < nHLayers; i++ )
{
QgsWmsParametersHighlightLayer hParam;
@@ -347,7 +347,7 @@ void TestQgsWcsPublicServers::test()
myVersionLog << QStringLiteral( "totalCoverages:%1" ).arg( myCoverages.size() );

int myCoverageCount = 0;
int myStep = myCoverages.size() / qMin( mMaxCoverages, myCoverages.size() );
int myStep = myCoverages.size() / std::min( mMaxCoverages, myCoverages.size() );
int myStepCount = -1;
bool myCoverageFound = false;
Q_FOREACH ( QgsWcsCoverageSummary myCoverage, myCoverages )

0 comments on commit 00e8690

Please sign in to comment.
You can’t perform that action at this time.