Skip to content

Commit a85c1a5

Browse files
author
timlinux
committed
Use 'combine' instead of 'Union' in order to preserve coding style rules (methods should be lower case). Union cant be used in lower case since it is a reserved c++ word
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9521 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent daba244 commit a85c1a5

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

python/core/qgsgeometry.sip

+4-2
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,10 @@ not disjoint with existing polygons of the feature*/
230230
/** Returns a geometry representing the points shared by this geometry and other. */
231231
QgsGeometry* intersection(QgsGeometry* geometry) /Factory/;
232232

233-
/** Returns a geometry representing all the points in this geometry and other. */
234-
QgsGeometry* Union(QgsGeometry* geometry) /Factory/;
233+
/** Returns a geometry representing all the points in this geometry and other (a
234+
* union geometry operation).
235+
* @note this operation is not called union since its a reserved word in C++.*/
236+
QgsGeometry* combine( QgsGeometry* geometry );
235237

236238
/** Returns a geometry representing the points making up this geometry that do not make up other. */
237239
QgsGeometry* difference(QgsGeometry* geometry) /Factory/;

src/core/qgsgeometry.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5347,7 +5347,7 @@ QgsGeometry* QgsGeometry::intersection( QgsGeometry* geometry )
53475347
CATCH_GEOS( 0 )
53485348
}
53495349

5350-
QgsGeometry* QgsGeometry::Union( QgsGeometry* geometry )
5350+
QgsGeometry* QgsGeometry::combine( QgsGeometry* geometry )
53515351
{
53525352
if ( geometry == NULL )
53535353
{

src/core/qgsgeometry.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,10 @@ class CORE_EXPORT QgsGeometry
276276
/** Returns a geometry representing the points shared by this geometry and other. */
277277
QgsGeometry* intersection( QgsGeometry* geometry );
278278

279-
/** Returns a geometry representing all the points in this geometry and other. */
280-
QgsGeometry* Union( QgsGeometry* geometry );
279+
/** Returns a geometry representing all the points in this geometry and other (a
280+
* union geometry operation).
281+
* @note this operation is not called union since its a reserved word in C++.*/
282+
QgsGeometry* combine( QgsGeometry* geometry );
281283

282284
/** Returns a geometry representing the points making up this geometry that do not make up other. */
283285
QgsGeometry* difference( QgsGeometry* geometry );

tests/src/core/testqgsgeometry.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ void TestQgsGeometry::intersectionCheck2()
227227
void TestQgsGeometry::unionCheck1()
228228
{
229229
// should be a multipolygon with 2 parts as A does not intersect C
230-
QgsGeometry * mypUnionGeometry = mpPolygonGeometryA->Union( mpPolygonGeometryC );
230+
QgsGeometry * mypUnionGeometry = mpPolygonGeometryA->combine( mpPolygonGeometryC );
231231
qDebug( "Geometry Type: " + wkbTypeAsString( mypUnionGeometry->wkbType() ).toLocal8Bit() );
232232
QVERIFY( mypUnionGeometry->wkbType() == QGis::WKBMultiPolygon );
233233
QgsMultiPolygon myMultiPolygon = mypUnionGeometry->asMultiPolygon();
@@ -240,7 +240,7 @@ void TestQgsGeometry::unionCheck1()
240240
void TestQgsGeometry::unionCheck2()
241241
{
242242
// should be a single polygon as A intersect B
243-
QgsGeometry * mypUnionGeometry = mpPolygonGeometryA->Union( mpPolygonGeometryB );
243+
QgsGeometry * mypUnionGeometry = mpPolygonGeometryA->combine( mpPolygonGeometryB );
244244
qDebug( "Geometry Type: " + wkbTypeAsString( mypUnionGeometry->wkbType() ).toLocal8Bit() );
245245
QVERIFY( mypUnionGeometry->wkbType() == QGis::WKBPolygon );
246246
QgsPolygon myPolygon = mypUnionGeometry->asPolygon();

0 commit comments

Comments
 (0)