[geos-commits] r2051 - trunk/source/headers/geos/algorithm

svn_geos at osgeo.org svn_geos at osgeo.org
Fri Dec 21 14:52:52 EST 2007


Author: benjubb
Date: 2007-12-21 14:52:51 -0500 (Fri, 21 Dec 2007)
New Revision: 2051

Modified:
   trunk/source/headers/geos/algorithm/SimplePointInAreaLocator.h
Log:
Added a public constructor, and a method to bring in line with JTS 1.9.  Changed namespace to geos::algorithm::locate

Modified: trunk/source/headers/geos/algorithm/SimplePointInAreaLocator.h
===================================================================
--- trunk/source/headers/geos/algorithm/SimplePointInAreaLocator.h	2007-12-21 18:44:27 UTC (rev 2050)
+++ trunk/source/headers/geos/algorithm/SimplePointInAreaLocator.h	2007-12-21 19:52:51 UTC (rev 2051)
@@ -14,9 +14,10 @@
  *
  **********************************************************************/
 
-#ifndef GEOS_ALGORITHM_SIMPLEPOINTINAREALOCATOR_H
-#define GEOS_ALGORITHM_SIMPLEPOINTINAREALOCATOR_H
+#ifndef GEOS_ALGORITHM_LOCATE_SIMPLEPOINTINAREALOCATOR_H
+#define GEOS_ALGORITHM_LOCATE_SIMPLEPOINTINAREALOCATOR_H
 
+#include <geos/algorithm/locate/PointOnGeometryLocator.h> // inherited
 
 // Forward declarations
 namespace geos {
@@ -29,8 +30,10 @@
 
 namespace geos {
 namespace algorithm { // geos::algorithm
+namespace locate { // geos::algorithm::locate
 
-class SimplePointInAreaLocator {
+class SimplePointInAreaLocator : public PointOnGeometryLocator
+{
 
 public:
 
@@ -40,17 +43,30 @@
 	static bool containsPointInPolygon(const geom::Coordinate& p,
 			const geom::Polygon *poly);
 
+	SimplePointInAreaLocator( const geom::Geometry * g) 
+	:	g( g)
+	{ }
+
+	int locate( const geom::Coordinate * p) 
+	{
+		return locate( *p, g);
+	}
+
 private:
 
 	static bool containsPoint(const geom::Coordinate& p,
 			const geom::Geometry *geom);
+
+	const geom::Geometry * g;
+
 };
 
-} // namespace geos::algorithm
-} // namespace geos
+} // geos::algorithm::locate
+} // geos::algorithm
+} // geos
 
 
-#endif // GEOS_ALGORITHM_SIMPLEPOINTINAREALOCATOR_H
+#endif // GEOS_ALGORITHM_LOCATE_SIMPLEPOINTINAREALOCATOR_H
 
 /**********************************************************************
  * $Log$



More information about the geos-commits mailing list