[geos-commits] r2320 - in trunk: source/headers/geos/noding source/noding tests/unit/noding

svn_geos at osgeo.org svn_geos at osgeo.org
Wed Apr 8 05:42:56 EDT 2009


Author: strk
Date: 2009-04-08 05:42:55 -0400 (Wed, 08 Apr 2009)
New Revision: 2320

Modified:
   trunk/source/headers/geos/noding/NodableSegmentString.h
   trunk/source/headers/geos/noding/NodedSegmentString.h
   trunk/source/headers/geos/noding/SegmentNode.h
   trunk/source/headers/geos/noding/SegmentNodeList.h
   trunk/source/noding/SegmentNode.cpp
   trunk/source/noding/SegmentNodeList.cpp
   trunk/tests/unit/noding/SegmentNodeTest.cpp
   trunk/tests/unit/noding/SegmentPointComparatorTest.cpp
Log:
Port SegmentNode to JTS-1.9


Modified: trunk/source/headers/geos/noding/NodableSegmentString.h
===================================================================
--- trunk/source/headers/geos/noding/NodableSegmentString.h	2009-04-07 19:00:36 UTC (rev 2319)
+++ trunk/source/headers/geos/noding/NodableSegmentString.h	2009-04-08 09:42:55 UTC (rev 2320)
@@ -17,7 +17,7 @@
 #ifndef GEOS_NODING_NODABLESEGMENTSTRING_H
 #define GEOS_NODING_NODABLESEGMENTSTRING_H
 
-#include <geos/noding/SegmentString.h>
+#include <geos/noding/SegmentString.h> // for inheritance
 
 namespace geos {
 	namespace geom {

Modified: trunk/source/headers/geos/noding/NodedSegmentString.h
===================================================================
--- trunk/source/headers/geos/noding/NodedSegmentString.h	2009-04-07 19:00:36 UTC (rev 2319)
+++ trunk/source/headers/geos/noding/NodedSegmentString.h	2009-04-08 09:42:55 UTC (rev 2320)
@@ -21,9 +21,9 @@
 #ifndef GEOS_NODING_NODEDSEGMENTSTRING_H
 #define GEOS_NODING_NODEDSEGMENTSTRING_H
 
+#include <geos/noding/NodableSegmentString.h> // for inheritance
 #include <geos/geom/CoordinateSequence.h> // for inlines
 #include <geos/algorithm/LineIntersector.h>
-#include <geos/noding/NodableSegmentString.h>
 #include <geos/noding/SegmentNode.h>
 #include <geos/noding/SegmentNodeList.h>
 #include <geos/noding/SegmentString.h>

Modified: trunk/source/headers/geos/noding/SegmentNode.h
===================================================================
--- trunk/source/headers/geos/noding/SegmentNode.h	2009-04-07 19:00:36 UTC (rev 2319)
+++ trunk/source/headers/geos/noding/SegmentNode.h	2009-04-08 09:42:55 UTC (rev 2320)
@@ -11,6 +11,10 @@
  * by the Free Software Foundation. 
  * See the COPYING file for more information.
  *
+ **********************************************************************
+ *
+ *  Last port: noding/SegmentNode.java rev. 1.6 (JTS-1.9)
+ *
  **********************************************************************/
 
 #ifndef GEOS_NODING_SEGMENTNODE_H
@@ -26,22 +30,20 @@
 // Forward declarations
 namespace geos {
 	namespace noding {
-		class SegmentString;
+		class NodedSegmentString;
 	}
 }
 
 namespace geos {
 namespace noding { // geos.noding
 
-/// Represents an intersection point between two SegmentString.
+/// Represents an intersection point between two NodedSegmentString.
 //
 /// Final class.
 ///
-/// Last port: noding/SegmentNode.java rev. 1.5 (JTS-1.7)
-///
 class SegmentNode {
 private:
-	const SegmentString& segString;
+	const NodedSegmentString& segString;
 
 	int segmentOctant;
 
@@ -56,18 +58,20 @@
 	/// the index of the containing line segment in the parent edge
 	unsigned int segmentIndex;  
 
-	/// Construct a node on the given SegmentString
+	/// Construct a node on the given NodedSegmentString
 	//
-	/// @param ss the parent SegmentString 
+	/// @param ss the parent NodedSegmentString 
 	///
 	/// @param coord the coordinate of the intersection, will be copied
 	///
-	/// @param nSegmentIndex the index of the segment on parent SegmentString
+	/// @param nSegmentIndex the index of the segment on parent
+	///                      NodedSegmentString
 	///        where the Node is located.
 	///
 	/// @param nSegmentOctant
 	///
-	SegmentNode(const SegmentString& ss, const geom::Coordinate& nCoord,
+	SegmentNode(const NodedSegmentString& ss,
+		    const geom::Coordinate& nCoord,
 			unsigned int nSegmentIndex, int nSegmentOctant);
 
 	~SegmentNode() {}

Modified: trunk/source/headers/geos/noding/SegmentNodeList.h
===================================================================
--- trunk/source/headers/geos/noding/SegmentNodeList.h	2009-04-07 19:00:36 UTC (rev 2319)
+++ trunk/source/headers/geos/noding/SegmentNodeList.h	2009-04-08 09:42:55 UTC (rev 2320)
@@ -35,6 +35,7 @@
 		class CoordinateSequence;
 	}
 	namespace noding {
+		class SegmentString;
 		class NodedSegmentString;
 	}
 }
@@ -44,7 +45,7 @@
 
 /** \brief
  * A list of the SegmentNode present along a
- * noded SegmentString.
+ * NodedSegmentString.
  */
 class SegmentNodeList {
 private:
@@ -53,9 +54,6 @@
 	// the parent edge
 	const NodedSegmentString& edge; 
 
-	// UNUSED
-	//std::vector<SegmentNode*> *sortedNodes;
-
 	// This vector is here to keep track of created splitEdges
 	std::vector<SegmentString*> splitEdges;
 

Modified: trunk/source/noding/SegmentNode.cpp
===================================================================
--- trunk/source/noding/SegmentNode.cpp	2009-04-07 19:00:36 UTC (rev 2319)
+++ trunk/source/noding/SegmentNode.cpp	2009-04-08 09:42:55 UTC (rev 2320)
@@ -14,7 +14,7 @@
  *
  **********************************************************************
  *
- * Last port: noding/SegmentNode.java rev. 1.5 (JTS-1.7)
+ * Last port: noding/SegmentNode.java rev. 1.6 (JTS-1.9)
  *
  **********************************************************************/
 
@@ -27,7 +27,7 @@
 #include <iomanip>
 
 #include <geos/noding/SegmentNode.h>
-#include <geos/noding/SegmentString.h>
+#include <geos/noding/NodedSegmentString.h>
 #include <geos/geom/Coordinate.h>
 
 using namespace std;
@@ -103,7 +103,7 @@
 };
 
 /*public*/
-SegmentNode::SegmentNode(const SegmentString& ss, const Coordinate& nCoord,
+SegmentNode::SegmentNode(const NodedSegmentString& ss, const Coordinate& nCoord,
 		unsigned int nSegmentIndex, int nSegmentOctant)
 	:
 	segString(ss),
@@ -111,7 +111,7 @@
 	coord(nCoord),
 	segmentIndex(nSegmentIndex)
 {
-	// Number of points in SegmentString is one-more number of segments
+	// Number of points in NodedSegmentString is one-more number of segments
 	assert(segmentIndex < segString.size() );
 
 	isInteriorVar = \

Modified: trunk/source/noding/SegmentNodeList.cpp
===================================================================
--- trunk/source/noding/SegmentNodeList.cpp	2009-04-07 19:00:36 UTC (rev 2319)
+++ trunk/source/noding/SegmentNodeList.cpp	2009-04-08 09:42:55 UTC (rev 2320)
@@ -25,6 +25,7 @@
 #include <geos/util/GEOSException.h>
 #include <geos/noding/SegmentNodeList.h>
 #include <geos/noding/NodedSegmentString.h>
+#include <geos/noding/SegmentString.h> // for use
 #include <geos/geom/Coordinate.h>
 #include <geos/geom/CoordinateSequence.h>
 #include <geos/geom/CoordinateArraySequence.h> // FIXME: should we really be using this ?

Modified: trunk/tests/unit/noding/SegmentNodeTest.cpp
===================================================================
--- trunk/tests/unit/noding/SegmentNodeTest.cpp	2009-04-07 19:00:36 UTC (rev 2319)
+++ trunk/tests/unit/noding/SegmentNodeTest.cpp	2009-04-08 09:42:55 UTC (rev 2320)
@@ -6,7 +6,7 @@
 #include <tut.h>
 // GEOS
 #include <geos/noding/SegmentNode.h>
-#include <geos/noding/BasicSegmentString.h>
+#include <geos/noding/NodedSegmentString.h>
 #include <geos/geom/Coordinate.h>
 #include <geos/geom/CoordinateSequence.h>
 #include <geos/geom/CoordinateArraySequenceFactory.h>
@@ -50,7 +50,7 @@
     void object::test<1>()
     {
         using geos::geom::Coordinate;
-        using geos::noding::BasicSegmentString;
+        using geos::noding::NodedSegmentString;
         using geos::noding::SegmentNode;
 
         // Create coordinates sequence
@@ -68,11 +68,11 @@
 
         // Create SegmentString instance
         
-        BasicSegmentString segment(cs.get(), 0);
+        NodedSegmentString segment(cs.get(), 0);
 
         ensure_equals( segment.size(), coords_size );
 
-        // Construct a node on the given SegmentString
+        // Construct a node on the given NodedSegmentString
         {
             const size_t segment_index = 0;
             Coordinate cint(3, 3);

Modified: trunk/tests/unit/noding/SegmentPointComparatorTest.cpp
===================================================================
--- trunk/tests/unit/noding/SegmentPointComparatorTest.cpp	2009-04-07 19:00:36 UTC (rev 2319)
+++ trunk/tests/unit/noding/SegmentPointComparatorTest.cpp	2009-04-08 09:42:55 UTC (rev 2320)
@@ -6,6 +6,7 @@
 #include <tut.h>
 // GEOS
 #include <geos/noding/SegmentNode.h>
+#include <geos/noding/SegmentString.h>
 #include <geos/geom/Coordinate.h>
 #include <geos/geom/CoordinateSequence.h>
 #include <geos/geom/CoordinateArraySequenceFactory.h>



More information about the geos-commits mailing list