[QGIS Commit] r9521 - in trunk/qgis: python/core src/core tests/src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Oct 23 02:54:12 EDT 2008


Author: timlinux
Date: 2008-10-23 02:54:12 -0400 (Thu, 23 Oct 2008)
New Revision: 9521

Modified:
   trunk/qgis/python/core/qgsgeometry.sip
   trunk/qgis/src/core/qgsgeometry.cpp
   trunk/qgis/src/core/qgsgeometry.h
   trunk/qgis/tests/src/core/testqgsgeometry.cpp
Log:
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

Modified: trunk/qgis/python/core/qgsgeometry.sip
===================================================================
--- trunk/qgis/python/core/qgsgeometry.sip	2008-10-23 03:54:07 UTC (rev 9520)
+++ trunk/qgis/python/core/qgsgeometry.sip	2008-10-23 06:54:12 UTC (rev 9521)
@@ -230,8 +230,10 @@
     /** Returns a geometry representing the points shared by this geometry and other. */
     QgsGeometry* intersection(QgsGeometry* geometry) /Factory/;
     
-    /** Returns a geometry representing all the points in this geometry and other. */
-    QgsGeometry* Union(QgsGeometry* geometry) /Factory/;
+    /** Returns a geometry representing all the points in this geometry and other (a 
+     * union geometry operation). 
+     * @note this operation is not called union since its a reserved word in C++.*/
+    QgsGeometry* combine( QgsGeometry* geometry );
     
     /** Returns a geometry representing the points making up this geometry that do not make up other. */
     QgsGeometry* difference(QgsGeometry* geometry) /Factory/;

Modified: trunk/qgis/src/core/qgsgeometry.cpp
===================================================================
--- trunk/qgis/src/core/qgsgeometry.cpp	2008-10-23 03:54:07 UTC (rev 9520)
+++ trunk/qgis/src/core/qgsgeometry.cpp	2008-10-23 06:54:12 UTC (rev 9521)
@@ -5347,7 +5347,7 @@
   CATCH_GEOS( 0 )
 }
 
-QgsGeometry* QgsGeometry::Union( QgsGeometry* geometry )
+QgsGeometry* QgsGeometry::combine( QgsGeometry* geometry )
 {
   if ( geometry == NULL )
   {

Modified: trunk/qgis/src/core/qgsgeometry.h
===================================================================
--- trunk/qgis/src/core/qgsgeometry.h	2008-10-23 03:54:07 UTC (rev 9520)
+++ trunk/qgis/src/core/qgsgeometry.h	2008-10-23 06:54:12 UTC (rev 9521)
@@ -276,8 +276,10 @@
     /** Returns a geometry representing the points shared by this geometry and other. */
     QgsGeometry* intersection( QgsGeometry* geometry );
 
-    /** Returns a geometry representing all the points in this geometry and other. */
-    QgsGeometry* Union( QgsGeometry* geometry );
+    /** Returns a geometry representing all the points in this geometry and other (a 
+     * union geometry operation). 
+     * @note this operation is not called union since its a reserved word in C++.*/
+    QgsGeometry* combine( QgsGeometry* geometry );
 
     /** Returns a geometry representing the points making up this geometry that do not make up other. */
     QgsGeometry* difference( QgsGeometry* geometry );

Modified: trunk/qgis/tests/src/core/testqgsgeometry.cpp
===================================================================
--- trunk/qgis/tests/src/core/testqgsgeometry.cpp	2008-10-23 03:54:07 UTC (rev 9520)
+++ trunk/qgis/tests/src/core/testqgsgeometry.cpp	2008-10-23 06:54:12 UTC (rev 9521)
@@ -227,7 +227,7 @@
 void TestQgsGeometry::unionCheck1()
 {
   // should be a multipolygon with 2 parts as A does not intersect C
-  QgsGeometry * mypUnionGeometry  =  mpPolygonGeometryA->Union( mpPolygonGeometryC );
+  QgsGeometry * mypUnionGeometry  =  mpPolygonGeometryA->combine( mpPolygonGeometryC );
   qDebug( "Geometry Type: " + wkbTypeAsString( mypUnionGeometry->wkbType() ).toLocal8Bit() );
   QVERIFY( mypUnionGeometry->wkbType() == QGis::WKBMultiPolygon );
   QgsMultiPolygon myMultiPolygon = mypUnionGeometry->asMultiPolygon();
@@ -240,7 +240,7 @@
 void TestQgsGeometry::unionCheck2()
 {
   // should be a single polygon as A intersect B
-  QgsGeometry * mypUnionGeometry  =  mpPolygonGeometryA->Union( mpPolygonGeometryB );
+  QgsGeometry * mypUnionGeometry  =  mpPolygonGeometryA->combine( mpPolygonGeometryB );
   qDebug( "Geometry Type: " + wkbTypeAsString( mypUnionGeometry->wkbType() ).toLocal8Bit() );
   QVERIFY( mypUnionGeometry->wkbType() == QGis::WKBPolygon );
   QgsPolygon myPolygon = mypUnionGeometry->asPolygon();



More information about the QGIS-commit mailing list