Index: src/Common/NetTopologySuite/Noding/SegmentString.cs
===================================================================
diff -u -r8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9 -r5fc71a385897af92ccb092f2f969b5709afab85a
--- src/Common/NetTopologySuite/Noding/SegmentString.cs (.../SegmentString.cs) (revision 8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9)
+++ src/Common/NetTopologySuite/Noding/SegmentString.cs (.../SegmentString.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a)
@@ -17,32 +17,6 @@
///
public class SegmentString
{
- ///
- ///
- ///
- ///
- ///
- public static IList GetNodedSubstrings(IList segStrings)
- {
- IList resultEdgelist = new ArrayList();
- GetNodedSubstrings(segStrings, resultEdgelist);
- return resultEdgelist;
- }
-
- ///
- ///
- ///
- ///
- ///
- public static void GetNodedSubstrings(IList segStrings, IList resultEdgelist)
- {
- foreach (var obj in segStrings)
- {
- var ss = (SegmentString) obj;
- ss.NodeList.AddSplitEdges(resultEdgelist);
- }
- }
-
private readonly SegmentNodeList nodeList;
private readonly ICoordinate[] pts;
@@ -69,7 +43,10 @@
///
public SegmentNodeList NodeList
{
- get { return nodeList; }
+ get
+ {
+ return nodeList;
+ }
}
///
@@ -78,33 +55,68 @@
///
public int Count
{
- get { return pts.Length; }
+ get
+ {
+ return pts.Length;
+ }
}
///
///
///
- ///
+ public ICoordinate[] Coordinates
+ {
+ get
+ {
+ return pts;
+ }
+ }
+
+ ///
+ ///
+ ///
+ public bool IsClosed
+ {
+ get
+ {
+ return pts[0].Equals(pts[pts.Length - 1]);
+ }
+ }
+
+ ///
+ ///
+ ///
+ ///
///
- public ICoordinate GetCoordinate(int i)
- {
- return pts[i];
+ public static IList GetNodedSubstrings(IList segStrings)
+ {
+ IList resultEdgelist = new ArrayList();
+ GetNodedSubstrings(segStrings, resultEdgelist);
+ return resultEdgelist;
}
///
///
///
- public ICoordinate[] Coordinates
+ ///
+ ///
+ public static void GetNodedSubstrings(IList segStrings, IList resultEdgelist)
{
- get { return pts; }
+ foreach (var obj in segStrings)
+ {
+ var ss = (SegmentString) obj;
+ ss.NodeList.AddSplitEdges(resultEdgelist);
+ }
}
///
///
///
- public bool IsClosed
+ ///
+ ///
+ public ICoordinate GetCoordinate(int i)
{
- get { return pts[0].Equals(pts[pts.Length - 1]); }
+ return pts[i];
}
///
@@ -117,9 +129,9 @@
/// The octant of the segment at the vertex
public Octants GetSegmentOctant(int index)
{
- return index == pts.Length - 1 ?
- Octants.Null :
- Octant.GetOctant(GetCoordinate(index), GetCoordinate(index + 1));
+ return index == pts.Length - 1 ?
+ Octants.Null :
+ Octant.GetOctant(GetCoordinate(index), GetCoordinate(index + 1));
}
///
@@ -132,7 +144,9 @@
public void AddIntersections(LineIntersector li, int segmentIndex, int geomIndex)
{
for (var i = 0; i < li.IntersectionNum; i++)
- AddIntersection(li, segmentIndex, geomIndex, i);
+ {
+ AddIntersection(li, segmentIndex, geomIndex, i);
+ }
}
///
@@ -161,18 +175,20 @@
var normalizedSegmentIndex = segmentIndex;
// normalize the intersection point location
var nextSegIndex = normalizedSegmentIndex + 1;
- if(nextSegIndex < pts.Length)
+ if (nextSegIndex < pts.Length)
{
var nextPt = pts[nextSegIndex];
-
+
// Normalize segment index if intPt falls on vertex
// The check for point equality is 2D only - Z values are ignored
if (intPt.Equals2D(nextPt))
- normalizedSegmentIndex = nextSegIndex;
+ {
+ normalizedSegmentIndex = nextSegIndex;
+ }
}
// Add the intersection point to edge intersection list.
var ei = nodeList.Add(intPt, normalizedSegmentIndex);
}
}
-}
+}
\ No newline at end of file