[geos-commits] r3300 - in trunk: include/geos/operation/buffer src/operation/buffer

svn_geos at osgeo.org svn_geos at osgeo.org
Wed Apr 27 05:42:13 EDT 2011


Author: strk
Date: 2011-04-27 02:42:13 -0700 (Wed, 27 Apr 2011)
New Revision: 3300

Modified:
   trunk/include/geos/operation/buffer/BufferParameters.h
   trunk/src/operation/buffer/BufferParameters.cpp
Log:
Sync BufferParameters class to JTS r378 (isSingleSided property)

Modified: trunk/include/geos/operation/buffer/BufferParameters.h
===================================================================
--- trunk/include/geos/operation/buffer/BufferParameters.h	2011-04-27 09:42:02 UTC (rev 3299)
+++ trunk/include/geos/operation/buffer/BufferParameters.h	2011-04-27 09:42:13 UTC (rev 3300)
@@ -13,7 +13,7 @@
  *
  **********************************************************************
  *
- * Last port: operation/buffer/BufferParameters.java r262 (JTS-1.11+)
+ * Last port: operation/buffer/BufferParameters.java r378 (JTS-1.12)
  *
  **********************************************************************/
 
@@ -243,7 +243,38 @@
 		mitreLimit = limit;
 	}
 
+	/**
+	 * Sets whether the computed buffer should be single-sided.
+	 * A single-sided buffer is constructed on only one side of each input line.
+	 * 
+	 * The side used is determined by the sign of the buffer distance:
+	 * - a positive distance indicates the left-hand side
+	 * - a negative distance indicates the right-hand side
+	 * 
+	 * The single-sided buffer of point geometries is
+	 * the same as the regular buffer.
+	 *
+	 * The End Cap Style for single-sided buffers is
+	 * always ignored,
+	 * and forced to the equivalent of <tt>CAP_FLAT</tt>.
+	 *
+	 * @param isSingleSided true if a single-sided buffer should be constructed
+	 */
+	void setSingleSided(bool isSingleSided)
+	{
+	  _isSingleSided = isSingleSided;
+	}
 
+	/**
+	 * Tests whether the buffer is to be generated on a single side only.
+	 *
+	 * @return true if the generated buffer is to be single-sided
+	 */
+	bool isSingleSided() const {
+	  return _isSingleSided;
+	}
+
+
 private:
 
 	/// Defaults to DEFAULT_QUADRANT_SEGMENTS;
@@ -252,11 +283,13 @@
 	/// Defaults to CAP_ROUND;
 	EndCapStyle endCapStyle;
 
-	// Defaults to JOIN_ROUND;
+	/// Defaults to JOIN_ROUND;
 	JoinStyle joinStyle;
 
-	// Defaults to DEFAULT_MITRE_LIMIT;
+	/// Defaults to DEFAULT_MITRE_LIMIT;
 	double mitreLimit;
+
+	bool _isSingleSided;
 };
 
 } // namespace geos::operation::buffer

Modified: trunk/src/operation/buffer/BufferParameters.cpp
===================================================================
--- trunk/src/operation/buffer/BufferParameters.cpp	2011-04-27 09:42:02 UTC (rev 3299)
+++ trunk/src/operation/buffer/BufferParameters.cpp	2011-04-27 09:42:13 UTC (rev 3300)
@@ -13,7 +13,7 @@
  *
  **********************************************************************
  *
- * Last port: operation/buffer/BufferParameters.java r262 (JTS-1.11+)
+ * Last port: operation/buffer/BufferParameters.java r278 (JTS-1.12)
  *
  **********************************************************************/
 
@@ -40,7 +40,8 @@
     quadrantSegments(DEFAULT_QUADRANT_SEGMENTS),
     endCapStyle(CAP_ROUND),
     joinStyle(JOIN_ROUND),
-    mitreLimit(DEFAULT_MITRE_LIMIT)
+    mitreLimit(DEFAULT_MITRE_LIMIT),
+    _isSingleSided(false)
 {}
 
 // public
@@ -49,7 +50,8 @@
 	quadrantSegments(DEFAULT_QUADRANT_SEGMENTS),
 	endCapStyle(CAP_ROUND),
 	joinStyle(JOIN_ROUND),
-	mitreLimit(DEFAULT_MITRE_LIMIT)
+	mitreLimit(DEFAULT_MITRE_LIMIT),
+	_isSingleSided(false)
 {
 	setQuadrantSegments(quadrantSegments);
 }
@@ -61,7 +63,8 @@
 	quadrantSegments(DEFAULT_QUADRANT_SEGMENTS),
 	endCapStyle(CAP_ROUND),
 	joinStyle(JOIN_ROUND),
-	mitreLimit(DEFAULT_MITRE_LIMIT)
+	mitreLimit(DEFAULT_MITRE_LIMIT),
+	_isSingleSided(false)
 {
 	setQuadrantSegments(quadrantSegments);
 	setEndCapStyle(endCapStyle);
@@ -76,7 +79,8 @@
 	quadrantSegments(DEFAULT_QUADRANT_SEGMENTS),
 	endCapStyle(CAP_ROUND),
 	joinStyle(JOIN_ROUND),
-	mitreLimit(DEFAULT_MITRE_LIMIT)
+	mitreLimit(DEFAULT_MITRE_LIMIT),
+	_isSingleSided(false)
 {
 	setQuadrantSegments(quadrantSegments);
 	setEndCapStyle(endCapStyle);



More information about the geos-commits mailing list