diff --git a/CMakeLists.txt b/CMakeLists.txt index 418ca173bfa..c39fa6a88ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -311,6 +311,7 @@ IF (PEDANTIC) ADD_DEFINITIONS( /wd4100 ) # unused formal parameters ADD_DEFINITIONS( /wd4127 ) # constant conditional expressions (used in Qt template classes) ADD_DEFINITIONS( /wd4231 ) # nonstandard extension used : 'identifier' before template explicit instantiation (used in Qt template classes) + ADD_DEFINITIONS( /wd4244 ) # conversion from '...' to '...' possible loss of data ADD_DEFINITIONS( /wd4251 ) # needs to have dll-interface to be used by clients of class (occurs in Qt template classes) ADD_DEFINITIONS( /wd4275 ) # non dll-interface class '...' used as base for dll-interface class '...' ADD_DEFINITIONS( /wd4505 ) # unreferenced local function has been removed (QgsRasterDataProvider::extent) diff --git a/python/core/qgsgeometry.sip b/python/core/qgsgeometry.sip index e22f9ba3562..3ef3895118a 100644 --- a/python/core/qgsgeometry.sip +++ b/python/core/qgsgeometry.sip @@ -440,14 +440,11 @@ class QgsGeometry * @note python binding added in 1.6 **/ void validateGeometry( QList &errors /Out/ ); + + /** compute the unary union on a list of geometries. May be faster than an iterative union on a set of geometries. + @param geometryList a list of QgsGeometry* as input + @returns the new computed QgsGeometry, or null + */ + static QgsGeometry *unaryUnion( const QList& geometryList ) /Factory/; }; // class QgsGeometry -/** namespace where QgsGeometry-based algorithms lie */ -namespace QgsGeometryAlgorithms -{ - /** compute the unary union on a list of geometries. May be faster than an iterative union on a set of geometries. - @param geometryList a list of QgsGeometry* as input - @returns the new computed QgsGeometry, or null - */ - QgsGeometry* unaryUnion( const QList& geometryList ); -}; diff --git a/src/core/qgsgeometry.cpp b/src/core/qgsgeometry.cpp index 8b8e53e3bd6..f54b85c86a1 100644 --- a/src/core/qgsgeometry.cpp +++ b/src/core/qgsgeometry.cpp @@ -6397,10 +6397,7 @@ QgsGeometry* QgsGeometry::convertToPolygon( bool destMultipart ) } } -namespace QgsGeometryAlgorithms -{ - -QgsGeometry* unaryUnion( const QList& geometryList ) +QgsGeometry *QgsGeometry::unaryUnion( const QList &geometryList ) { QList geoms; foreach( QgsGeometry* g, geometryList ) @@ -6414,5 +6411,3 @@ QgsGeometry* unaryUnion( const QList& geometryList ) ret->fromGeos( unioned ); return ret; } - -}// QgsGeometryAlgorithms diff --git a/src/core/qgsgeometry.h b/src/core/qgsgeometry.h index 79ad7f871fc..90f6ed7ae8c 100644 --- a/src/core/qgsgeometry.h +++ b/src/core/qgsgeometry.h @@ -486,6 +486,12 @@ class CORE_EXPORT QgsGeometry **/ void validateGeometry( QList &errors ); + /** compute the unary union on a list of geometries. May be faster than an iterative union on a set of geometries. + @param geometryList a list of QgsGeometry* as input + @returns the new computed QgsGeometry, or null + */ + static QgsGeometry *unaryUnion( const QList& geometryList ); + private: // Private variables @@ -679,14 +685,4 @@ class CORE_EXPORT QgsConstWkbPtr inline operator const unsigned char *() const { return mP; } }; -/** namespace where QgsGeometry-based algorithms lie */ -namespace QgsGeometryAlgorithms -{ - /** compute the unary union on a list of geometries. May be faster than an iterative union on a set of geometries. - @param geometryList a list of QgsGeometry* as input - @returns the new computed QgsGeometry, or null - */ - QgsGeometry* unaryUnion( const QList& geometryList ); -} - #endif diff --git a/src/core/symbology-ng/qgsinvertedpolygonrenderer.cpp b/src/core/symbology-ng/qgsinvertedpolygonrenderer.cpp index 71ee1b8bef3..e0514da8abb 100644 --- a/src/core/symbology-ng/qgsinvertedpolygonrenderer.cpp +++ b/src/core/symbology-ng/qgsinvertedpolygonrenderer.cpp @@ -224,7 +224,7 @@ void QgsInvertedPolygonRenderer::stopRender( QgsRenderContext& context ) if ( mPreprocessingEnabled ) { // compute the unary union on the polygons - QScopedPointer unioned( QgsGeometryAlgorithms::unaryUnion( cit->geometries ) ); + QScopedPointer unioned( QgsGeometry::unaryUnion( cit->geometries ) ); // compute the difference with the extent QScopedPointer rect( QgsGeometry::fromPolygon( mExtentPolygon ) ); QgsGeometry *final = rect->difference( const_cast(unioned.data()) );