[geos-commits] r2779 - trunk/source/headers/geos/operation/buffer

svn_geos at osgeo.org svn_geos at osgeo.org
Thu Dec 3 14:45:54 EST 2009


Author: mloskot
Date: 2009-12-03 14:45:53 -0500 (Thu, 03 Dec 2009)
New Revision: 2779

Modified:
   trunk/source/headers/geos/operation/buffer/BufferBuilder.h
   trunk/source/headers/geos/operation/buffer/OffsetCurveBuilder.h
   trunk/source/headers/geos/operation/buffer/OffsetCurveSetBuilder.h
Log:
Part 18of larger changeset - source/headers/geos/operation/buffer:
* Declare noncopyable types as such explicitly (Ticket #304).
* Tidy up.
* Unified EOL and style.

Modified: trunk/source/headers/geos/operation/buffer/BufferBuilder.h
===================================================================
--- trunk/source/headers/geos/operation/buffer/BufferBuilder.h	2009-12-03 19:44:00 UTC (rev 2778)
+++ trunk/source/headers/geos/operation/buffer/BufferBuilder.h	2009-12-03 19:45:53 UTC (rev 2779)
@@ -83,6 +83,61 @@
  */
 class GEOS_DLL BufferBuilder {
 
+public:
+	/**
+	 * Creates a new BufferBuilder
+	 *
+	 * @param nBufParams buffer parameters, this object will
+	 *                   keep a reference to the passed parameters
+	 *                   so caller must make sure the object is
+	 *                   kept alive for the whole lifetime of
+	 *                   the buffer builder.
+	 */
+	BufferBuilder(const BufferParameters& nBufParams)
+		:
+		bufParams(nBufParams),
+		workingPrecisionModel(NULL),
+		li(NULL),
+		intersectionAdder(NULL),
+		workingNoder(NULL),
+		geomFact(NULL),
+		edgeList()
+	{}
+
+	~BufferBuilder();
+
+
+	/**
+	 * Sets the precision model to use during the curve computation
+	 * and noding,
+	 * if it is different to the precision model of the Geometry.
+	 * If the precision model is less than the precision of the
+	 * Geometry precision model,
+	 * the Geometry must have previously been rounded to that precision.
+	 *
+	 * @param pm the precision model to use
+	 */
+	void setWorkingPrecisionModel(const geom::PrecisionModel *pm) {
+		workingPrecisionModel=pm;
+	}
+
+	/**
+	 * Sets the {@link noding::Noder} to use during noding.
+	 * This allows choosing fast but non-robust noding, or slower
+	 * but robust noding.
+	 *
+	 * @param noder the noder to use
+	 */
+	void setNoder(noding::Noder* newNoder) { workingNoder = newNoder; }
+
+	geom::Geometry* buffer(const geom::Geometry *g, double distance);
+		// throw (GEOSException);
+
+	/// Not in JTS: this is a GEOS extension
+	geom::Geometry* bufferLineSingleSided( const geom::Geometry* g,
+	                                double distance, bool leftSide ) ;
+		// throw (GEOSException);
+
 private:
 	/**
 	 * Compute the change in depth as an edge is crossed from R to L
@@ -155,62 +210,10 @@
 	 * @return the empty result geometry, transferring ownership to caller.
 	 */
 	geom::Geometry* createEmptyResultGeometry() const;
-
-public:
-	/**
-	 * Creates a new BufferBuilder
-	 *
-	 * @param nBufParams buffer parameters, this object will
-	 *                   keep a reference to the passed parameters
-	 *                   so caller must make sure the object is
-	 *                   kept alive for the whole lifetime of
-	 *                   the buffer builder.
-	 */
-	BufferBuilder(const BufferParameters& nBufParams)
-		:
-		bufParams(nBufParams),
-		workingPrecisionModel(NULL),
-		li(NULL),
-		intersectionAdder(NULL),
-		workingNoder(NULL),
-		geomFact(NULL),
-		edgeList()
-	{}
-
-	~BufferBuilder();
-
-
-	/**
-	 * Sets the precision model to use during the curve computation
-	 * and noding,
-	 * if it is different to the precision model of the Geometry.
-	 * If the precision model is less than the precision of the
-	 * Geometry precision model,
-	 * the Geometry must have previously been rounded to that precision.
-	 *
-	 * @param pm the precision model to use
-	 */
-	void setWorkingPrecisionModel(const geom::PrecisionModel *pm) {
-		workingPrecisionModel=pm;
-	}
-
-	/**
-	 * Sets the {@link noding::Noder} to use during noding.
-	 * This allows choosing fast but non-robust noding, or slower
-	 * but robust noding.
-	 *
-	 * @param noder the noder to use
-	 */
-	void setNoder(noding::Noder* newNoder) { workingNoder = newNoder; }
-
-	geom::Geometry* buffer(const geom::Geometry *g, double distance);
-		// throw (GEOSException);
-
-	/// Not in JTS: this is a GEOS extension
-	geom::Geometry* bufferLineSingleSided( const geom::Geometry* g,
-	                                double distance, bool leftSide ) ;
-		// throw (GEOSException);
-
+    
+    // Declare type as noncopyable
+    BufferBuilder(const BufferBuilder& other);
+    BufferBuilder& operator=(const BufferBuilder& rhs);
 };
 
 } // namespace geos::operation::buffer

Modified: trunk/source/headers/geos/operation/buffer/OffsetCurveBuilder.h
===================================================================
--- trunk/source/headers/geos/operation/buffer/OffsetCurveBuilder.h	2009-12-03 19:44:00 UTC (rev 2778)
+++ trunk/source/headers/geos/operation/buffer/OffsetCurveBuilder.h	2009-12-03 19:45:53 UTC (rev 2779)
@@ -357,7 +357,11 @@
 	/// Adds a CW square around a point
 	void addSquare(const geom::Coordinate &p, double distance);
 
-	std::vector<OffsetCurveVertexList*> vertexLists;
+    std::vector<OffsetCurveVertexList*> vertexLists;
+
+    // Declare type as noncopyable
+    OffsetCurveBuilder(const OffsetCurveBuilder& other);
+    OffsetCurveBuilder& operator=(const OffsetCurveBuilder& rhs);
 };
 
 } // namespace geos::operation::buffer

Modified: trunk/source/headers/geos/operation/buffer/OffsetCurveSetBuilder.h
===================================================================
--- trunk/source/headers/geos/operation/buffer/OffsetCurveSetBuilder.h	2009-12-03 19:44:00 UTC (rev 2778)
+++ trunk/source/headers/geos/operation/buffer/OffsetCurveSetBuilder.h	2009-12-03 19:45:53 UTC (rev 2779)
@@ -163,6 +163,10 @@
 	bool isTriangleErodedCompletely(geom::CoordinateSequence *triangleCoord,
 			double bufferDistance);
 
+    // Declare type as noncopyable
+    OffsetCurveSetBuilder(const OffsetCurveSetBuilder& other);
+    OffsetCurveSetBuilder& operator=(const OffsetCurveSetBuilder& rhs);
+
 public:
 
 	/// Constructor



More information about the geos-commits mailing list