Skip to content

Commit

Permalink
fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jun 13, 2014
1 parent 5d1eb4e commit b6d8331
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 26 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -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)
Expand Down
15 changes: 6 additions & 9 deletions python/core/qgsgeometry.sip
Expand Up @@ -440,14 +440,11 @@ class QgsGeometry
* @note python binding added in 1.6
**/
void validateGeometry( QList<QgsGeometry::Error> &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<QgsGeometry*>& 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<QgsGeometry*>& geometryList );
};
7 changes: 1 addition & 6 deletions src/core/qgsgeometry.cpp
Expand Up @@ -6397,10 +6397,7 @@ QgsGeometry* QgsGeometry::convertToPolygon( bool destMultipart )
}
}

namespace QgsGeometryAlgorithms
{

QgsGeometry* unaryUnion( const QList<QgsGeometry*>& geometryList )
QgsGeometry *QgsGeometry::unaryUnion( const QList<QgsGeometry*> &geometryList )
{
QList<GEOSGeometry*> geoms;
foreach( QgsGeometry* g, geometryList )
Expand All @@ -6414,5 +6411,3 @@ QgsGeometry* unaryUnion( const QList<QgsGeometry*>& geometryList )
ret->fromGeos( unioned );
return ret;
}

}// QgsGeometryAlgorithms
16 changes: 6 additions & 10 deletions src/core/qgsgeometry.h
Expand Up @@ -486,6 +486,12 @@ class CORE_EXPORT QgsGeometry
**/
void validateGeometry( QList<Error> &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<QgsGeometry*>& geometryList );

private:
// Private variables

Expand Down Expand Up @@ -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<QgsGeometry*>& geometryList );
}

#endif
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgsinvertedpolygonrenderer.cpp
Expand Up @@ -224,7 +224,7 @@ void QgsInvertedPolygonRenderer::stopRender( QgsRenderContext& context )
if ( mPreprocessingEnabled )
{
// compute the unary union on the polygons
QScopedPointer<QgsGeometry> unioned( QgsGeometryAlgorithms::unaryUnion( cit->geometries ) );
QScopedPointer<QgsGeometry> unioned( QgsGeometry::unaryUnion( cit->geometries ) );
// compute the difference with the extent
QScopedPointer<QgsGeometry> rect( QgsGeometry::fromPolygon( mExtentPolygon ) );
QgsGeometry *final = rect->difference( const_cast<QgsGeometry*>(unioned.data()) );
Expand Down

0 comments on commit b6d8331

Please sign in to comment.