[geos-commits] r3120 - in trunk: include/geos/operation include/geos/operation/sharedpaths src/operation src/operation/sharedpaths

svn_geos at osgeo.org svn_geos at osgeo.org
Mon Nov 29 04:32:34 EST 2010


Author: strk
Date: 2010-11-29 01:32:34 -0800 (Mon, 29 Nov 2010)
New Revision: 3120

Added:
   trunk/include/geos/operation/sharedpaths/
   trunk/include/geos/operation/sharedpaths/SharedPathsOp.h
   trunk/src/operation/sharedpaths/
   trunk/src/operation/sharedpaths/SharedPathsOp.cpp
Log:
Stub SharedPathsOp

Added: trunk/include/geos/operation/sharedpaths/SharedPathsOp.h
===================================================================
--- trunk/include/geos/operation/sharedpaths/SharedPathsOp.h	                        (rev 0)
+++ trunk/include/geos/operation/sharedpaths/SharedPathsOp.h	2010-11-29 09:32:34 UTC (rev 3120)
@@ -0,0 +1,84 @@
+/**********************************************************************
+ * $Id$
+ *
+ * GEOS - Geometry Engine Open Source
+ * http://geos.refractions.net
+ *
+ * Copyright (C) 2010      Sandro Santilli <strk at keybit.net>
+ *
+ * This is free software; you can redistribute and/or modify it under
+ * the terms of the GNU Lesser General Public Licence as published
+ * by the Free Software Foundation. 
+ * See the COPYING file for more information.
+ *
+ **********************************************************************
+ *
+ * Last port: original work
+ *
+ **********************************************************************/
+
+#ifndef GEOS_OPERATION_SHAREDPATHSOP_H
+#define GEOS_OPERATION_SHAREDPATHSOP_H
+
+
+#include <vector> 
+
+// Forward declarations
+namespace geos {
+	namespace geom {
+		//class LineString;
+		class Geometry;
+	}
+}
+
+
+namespace geos {
+namespace operation { // geos.operation
+namespace sharedpaths { // geos.operation.sharedpaths
+
+/** \brief
+ * Find shared paths among two linear Geometry objects
+ *
+ * For each shared path report if it direction is the same
+ * or opposite.
+ *
+ */
+class GEOS_DLL SharedPathsOp
+{
+public:
+
+	/// Find paths shared between two linear geometries
+	//
+	/// @param g1
+	///	First geometry. Must be linear.
+	///
+	/// @param g2
+	///	Second geometry. Must be linear.
+	///
+	/// @param tol
+	///	Tolerance by which very close paths are considered shared.
+	///	TODO: specify more about the semantic, check SnapOp 
+	///
+	/// @param sameDir
+	///	Shared edges having the same direction are pushed
+	///     onto this vector. They'll be of type LineString.
+	///	Ownership of the edges is tranferred.
+	///
+	/// @param oppositeDir
+	///	Shared edges having the opposite direction are pushed
+	///     onto this vector. They'll be of type LineString.
+	///	Ownership of the edges is tranferred.
+	///
+	static void SharedPathsOp(const Geometry& g1, const Geometry& g2,
+		double tol,
+		std::vector<Geometry*>& sameDirection,
+		std::vector<Geometry*>& oppositeDirection);
+
+};
+
+} // namespace geos.operation.sharedpaths
+} // namespace geos.operation
+} // namespace geos
+
+#endif
+

Added: trunk/src/operation/sharedpaths/SharedPathsOp.cpp
===================================================================
--- trunk/src/operation/sharedpaths/SharedPathsOp.cpp	                        (rev 0)
+++ trunk/src/operation/sharedpaths/SharedPathsOp.cpp	2010-11-29 09:32:34 UTC (rev 3120)
@@ -0,0 +1,40 @@
+/**********************************************************************
+ * $Id$
+ *
+ * GEOS - Geometry Engine Open Source
+ * http://geos.refractions.net
+ *
+ * Copyright (C) 2010      Sandro Santilli <strk at keybit.net>
+ *
+ * This is free software; you can redistribute and/or modify it under
+ * the terms of the GNU Lesser General Public Licence as published
+ * by the Free Software Foundation. 
+ * See the COPYING file for more information.
+ *
+ **********************************************************************
+ *
+ * Last port: original work
+ *
+ **********************************************************************/
+
+#include <geos/operation/sharedpahts/SharedPathsOp.h>
+#include <geos/util/IllegalArgumentException.h>
+
+namespace geos {
+namespace operation { // geos.operation
+namespace sharedpaths { // geos.operation.sharedpaths
+
+/* public static */
+void
+SharedPathsOp::SharedPathsOp(const Geometry& g1, const Geometry& g2,
+		double tol,
+		std::vector<Geometry*>& sameDirection,
+		std::vector<Geometry*>& oppositeDirection)
+{
+	throw geos::util::IllegalArgumentException("Not implemented yet");
+}
+
+} // namespace geos.operation.sharedpaths
+} // namespace geos::operation
+} // namespace geos
+



More information about the geos-commits mailing list