[geos-commits] r3237 - in trunk: include/geos/noding/snapround src/noding/snapround

svn_geos at osgeo.org svn_geos at osgeo.org
Wed Feb 23 09:37:05 EST 2011


Author: strk
Date: 2011-02-23 06:37:05 -0800 (Wed, 23 Feb 2011)
New Revision: 3237

Modified:
   trunk/include/geos/noding/snapround/HotPixel.h
   trunk/include/geos/noding/snapround/HotPixel.inl
   trunk/src/noding/snapround/HotPixel.cpp
Log:
Sync HotPixel to JTS-1.12 (doxygen + privatization of a method..)

Modified: trunk/include/geos/noding/snapround/HotPixel.h
===================================================================
--- trunk/include/geos/noding/snapround/HotPixel.h	2011-02-23 11:05:03 UTC (rev 3236)
+++ trunk/include/geos/noding/snapround/HotPixel.h	2011-02-23 14:37:05 UTC (rev 3237)
@@ -13,7 +13,7 @@
  *
  **********************************************************************
  *
- * Last port: noding/snapround/HotPixel.java rev. 1.3 (JTS-1.9)
+ * Last port: noding/snapround/HotPixel.java r320 (JTS-1.12)
  *
  **********************************************************************/
 
@@ -135,6 +135,9 @@
 	 */
 	bool intersectsPixelClosure(const geom::Coordinate& p0,
 			const geom::Coordinate& p1);
+
+	bool intersectsScaled(const geom::Coordinate& p0,
+			const geom::Coordinate& p1) const;
  
     // Declare type as noncopyable
     HotPixel(const HotPixel& other);
@@ -142,6 +145,14 @@
 
 public:
 
+	/**
+	 * Creates a new hot pixel.
+	 *
+	 * @param pt the coordinate at the centre of the pixel
+	 * @param scaleFact the scaleFactor determining the pixel size
+	 * @param li the intersector to use for testing intersection with
+	 *        line segments
+	 */
 	HotPixel(const geom::Coordinate& pt,
 			double scaleFact,
 			algorithm::LineIntersector& li);
@@ -154,12 +165,19 @@
 	/** \brief
 	 * Returns a "safe" envelope that is guaranteed to contain
 	 * the hot pixel. Keeps ownership of it.
+	 *
+	 * The envelope returned will be larger than the exact envelope of the
+	 * pixel.
 	 */
 	const geom::Envelope& getSafeEnvelope() const;
 
-	bool intersectsScaled(const geom::Coordinate& p0,
-			const geom::Coordinate& p1) const;
-
+	/**
+	 * Tests whether the line segment (p0-p1) intersects this hot pixel.
+	 *
+	 * @param p0 the first coordinate of the line segment to test
+	 * @param p1 the second coordinate of the line segment to test
+	 * @return true if the line segment intersects this hot pixel
+	 */
 	bool intersects(const geom::Coordinate& p0,
 			const geom::Coordinate& p1) const;
  

Modified: trunk/include/geos/noding/snapround/HotPixel.inl
===================================================================
--- trunk/include/geos/noding/snapround/HotPixel.inl	2011-02-23 11:05:03 UTC (rev 3236)
+++ trunk/include/geos/noding/snapround/HotPixel.inl	2011-02-23 14:37:05 UTC (rev 3237)
@@ -13,7 +13,7 @@
  *
  **********************************************************************
  *
- * Last port: noding/snapround/HotPixel.java rev. 1.3 (JTS-1.9)
+ * Last port: noding/snapround/HotPixel.java r320 (JTS-1.12)
  *
  **********************************************************************/
 

Modified: trunk/src/noding/snapround/HotPixel.cpp
===================================================================
--- trunk/src/noding/snapround/HotPixel.cpp	2011-02-23 11:05:03 UTC (rev 3236)
+++ trunk/src/noding/snapround/HotPixel.cpp	2011-02-23 14:37:05 UTC (rev 3237)
@@ -13,7 +13,7 @@
  *
  **********************************************************************
  *
- * Last port: noding/snapround/HotPixel.java rev. 1.3 (JTS-1.9)
+ * Last port: noding/snapround/HotPixel.java r320 (JTS-1.12)
  *
  **********************************************************************/
 
@@ -56,8 +56,10 @@
 const Envelope&
 HotPixel::getSafeEnvelope() const
 {
+	static const double SAFE_ENV_EXPANSION_FACTOR = 0.75;
+
 	if (safeEnv.get() == NULL) {
-		double safeTolerance = .75 / scaleFactor;
+		double safeTolerance = SAFE_ENV_EXPANSION_FACTOR / scaleFactor;
 		safeEnv = auto_ptr<Envelope>(new Envelope(originalPt.x - safeTolerance,
 			originalPt.x + safeTolerance,
 			originalPt.y - safeTolerance,
@@ -96,6 +98,7 @@
 	return intersectsScaled(p0Scaled, p1Scaled);
 }
 
+/* private */
 bool
 HotPixel::intersectsScaled(const Coordinate& p0,
 		const Coordinate& p1) const



More information about the geos-commits mailing list