[geos-commits] r2429 - in trunk/source: geomgraph headers/geos/geomgraph

svn_geos at osgeo.org svn_geos at osgeo.org
Thu Apr 30 06:43:17 EDT 2009


Author: strk
Date: 2009-04-30 06:43:16 -0400 (Thu, 30 Apr 2009)
New Revision: 2429

Modified:
   trunk/source/geomgraph/EdgeIntersection.cpp
   trunk/source/headers/geos/geomgraph/EdgeIntersection.h
Log:
Sync to revision 1.5 (JTS-1.10) : add accessors


Modified: trunk/source/geomgraph/EdgeIntersection.cpp
===================================================================
--- trunk/source/geomgraph/EdgeIntersection.cpp	2009-04-30 09:54:09 UTC (rev 2428)
+++ trunk/source/geomgraph/EdgeIntersection.cpp	2009-04-30 10:43:16 UTC (rev 2429)
@@ -4,6 +4,7 @@
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
  *
+ * Copyright (C) 2009      Sandro Santilli <strk at keybit.net>
  * Copyright (C) 2001-2002 Vivid Solutions Inc.
  *
  * This is free software; you can redistribute and/or modify it under
@@ -11,6 +12,10 @@
  * by the Free Software Foundation. 
  * See the COPYING file for more information.
  *
+ **********************************************************************
+ *
+ * Last port: geomgraph/EdgeIntersection.java rev. 1.5 (JTS-1.10)
+ *
  **********************************************************************/
 
 #include <sstream>
@@ -26,7 +31,8 @@
 namespace geomgraph { // geos.geomgraph
 
 EdgeIntersection::EdgeIntersection(const Coordinate& newCoord,
-		int newSegmentIndex, double newDist):
+		int newSegmentIndex, double newDist)
+	:
 	coord(newCoord),
 	segmentIndex(newSegmentIndex),
 	dist(newDist)
@@ -74,42 +80,3 @@
 } // namespace geos
 
 
-/**********************************************************************
- * $Log$
- * Revision 1.9  2006/03/15 17:16:29  strk
- * streamlined headers inclusion
- *
- * Revision 1.8  2006/03/03 10:46:21  strk
- * Removed 'using namespace' from headers, added missing headers in .cpp files, removed useless includes in headers (bug#46)
- *
- * Revision 1.7  2006/02/19 19:46:49  strk
- * Packages <-> namespaces mapping for most GEOS internal code (uncomplete, but working). Dir-level libs for index/ subdirs.
- *
- * Revision 1.6  2005/12/07 23:36:49  strk
- * standard indentation
- *
- * Revision 1.5  2005/11/16 22:21:45  strk
- * enforced const-correctness and use of initializer lists.
- *
- * Revision 1.4  2005/11/07 12:31:24  strk
- * Changed EdgeIntersectionList to use a set<> rathern then a vector<>, and
- * to avoid dynamic allocation of initial header.
- * Inlined short SweepLineEvent methods.
- *
- * Revision 1.3  2005/01/28 09:47:51  strk
- * Replaced sprintf uses with ostringstream.
- *
- * Revision 1.2  2004/07/02 13:28:26  strk
- * Fixed all #include lines to reflect headers layout change.
- * Added client application build tips in README.
- *
- * Revision 1.1  2004/03/19 09:48:45  ybychkov
- * "geomgraph" and "geomgraph/indexl" upgraded to JTS 1.4
- *
- * Revision 1.9  2003/11/07 01:23:42  pramsey
- * Add standard CVS headers licence notices and copyrights to all cpp and h
- * files.
- *
- *
- **********************************************************************/
-

Modified: trunk/source/headers/geos/geomgraph/EdgeIntersection.h
===================================================================
--- trunk/source/headers/geos/geomgraph/EdgeIntersection.h	2009-04-30 09:54:09 UTC (rev 2428)
+++ trunk/source/headers/geos/geomgraph/EdgeIntersection.h	2009-04-30 10:43:16 UTC (rev 2429)
@@ -4,6 +4,7 @@
  * GEOS - Geometry Engine Open Source
  * http://geos.refractions.net
  *
+ * Copyright (C) 2009      Sandro Santilli <strk at keybit.net>
  * Copyright (C) 2005-2006 Refractions Research Inc.
  * Copyright (C) 2001-2002 Vivid Solutions Inc.
  *
@@ -12,6 +13,10 @@
  * by the Free Software Foundation. 
  * See the COPYING file for more information.
  *
+ **********************************************************************
+ *
+ * Last port: geomgraph/EdgeIntersection.java rev. 1.5 (JTS-1.10)
+ *
  **********************************************************************/
 
 
@@ -28,17 +33,55 @@
 namespace geos {
 namespace geomgraph { // geos.geomgraph
 
+/**
+ * Represents a point on an
+ * edge which intersects with another edge.
+ * 
+ * The intersection may either be a single point, or a line segment
+ * (in which case this point is the start of the line segment)
+ * The intersection point must be precise.
+ *
+ */
 class EdgeIntersection {
 public:
+
+	// the point of intersection
 	geom::Coordinate coord;
+
+	// the index of the containing line segment in the parent edge
 	int segmentIndex;
+
+	// the edge distance of this point along the containing line segment
 	double dist;
-	EdgeIntersection(const geom::Coordinate& newCoord, int newSegmentIndex, double newDist);
+
+	EdgeIntersection(const geom::Coordinate& newCoord,
+	                 int newSegmentIndex, double newDist);
+
 	virtual ~EdgeIntersection();
+
+	/**
+	 * @return -1 this EdgeIntersection is located before the
+	 *                 argument location
+	 * @return 0 this EdgeIntersection is at the argument location
+	 * @return 1 this EdgeIntersection is located after the argument
+	 *                location
+	 */
 	int compare(int newSegmentIndex, double newDist) const;
+
 	bool isEndPoint(int maxSegmentIndex);
+
 	std::string print() const;
+
 	int compareTo(const EdgeIntersection *) const;
+
+	const geom::Coordinate& getCoordinate() const {
+		return coord;
+	}
+
+	int getSegmentIndex() const { return segmentIndex; }
+
+	double getDistance() { return dist; }
+
 };
 
 struct EdgeIntersectionLessThen {
@@ -62,13 +105,4 @@
 
 #endif // ifndef GEOS_GEOMGRAPH_EDGEINTERSECTION_H
 
-/**********************************************************************
- * $Log$
- * Revision 1.2  2006/03/24 09:52:41  strk
- * USE_INLINE => GEOS_INLINE
- *
- * Revision 1.1  2006/03/09 16:46:49  strk
- * geos::geom namespace definition, first pass at headers split
- *
- **********************************************************************/
 



More information about the geos-commits mailing list