[geos-commits] r3063 - in trunk: include/geos/geom src/geom

svn_geos at osgeo.org svn_geos at osgeo.org
Wed Jun 23 05:47:02 EDT 2010


Author: strk
Date: 2010-06-23 09:47:02 +0000 (Wed, 23 Jun 2010)
New Revision: 3063

Modified:
   trunk/include/geos/geom/Geometry.h
   trunk/src/geom/Geometry.cpp
Log:
Const-correct Geometry::isWithinDistance. Thanks to Yabo,  see ticket #349


Modified: trunk/include/geos/geom/Geometry.h
===================================================================
--- trunk/include/geos/geom/Geometry.h	2010-06-23 09:31:32 UTC (rev 3062)
+++ trunk/include/geos/geom/Geometry.h	2010-06-23 09:47:02 UTC (rev 3063)
@@ -691,8 +691,16 @@
 	/** \brief
 	 * Tests whether the distance from this Geometry  to another
 	 * is less than or equal to a specified value.
+	 *
+	 * @param geom the Geometry to check the distance to
+	 * @param cDistance the distance value to compare
+	 * @return <code>true</code> if the geometries are less than
+	 *  <code>distance</code> apart.
+	 *
+	 * @todo doesn't seem to need being virtual, make it concrete
 	 */
-	virtual bool isWithinDistance(const Geometry *geom,double cDistance);
+	virtual bool isWithinDistance(const Geometry *geom,
+			double cDistance) const;
 
 	/** \brief
 	 * Computes the centroid of this <code>Geometry</code>.

Modified: trunk/src/geom/Geometry.cpp
===================================================================
--- trunk/src/geom/Geometry.cpp	2010-06-23 09:31:32 UTC (rev 3062)
+++ trunk/src/geom/Geometry.cpp	2010-06-23 09:47:02 UTC (rev 3063)
@@ -168,17 +168,9 @@
 	return false;
 }
 	
-/**
- * Tests whether the distance from this <code>Geometry</code>
- * to another is less than or equal to a specified value.
- *
- * @param geom the Geometry to check the distance to
- * @param cDistance the distance value to compare
- * @return <code>true</code> if the geometries are less than
- *  <code>distance</code> apart.
- */
+/* public */
 bool
-Geometry::isWithinDistance(const Geometry *geom,double cDistance)
+Geometry::isWithinDistance(const Geometry *geom,double cDistance) const
 {
 	const Envelope *env0=getEnvelopeInternal();
 	const Envelope *env1=geom->getEnvelopeInternal();



More information about the geos-commits mailing list