/// <summary> /// Insert nodes for all intersections on the edges of a Geometry. /// Label the created nodes the same as the edge label if they do not already have a label. /// This allows nodes created by either self-intersections or /// mutual intersections to be labelled. /// Endpoint nodes will already be labelled from when they were inserted. /// Precondition: edge intersections have been computed. /// </summary> /// <param name="geomGraph"></param> /// <param name="argIndex"></param> public void ComputeIntersectionNodes(GeometryGraph geomGraph, int argIndex) { foreach (Edge e in geomGraph.Edges) { Location eLoc = e.Label.GetLocation(argIndex); foreach (EdgeIntersection ei in e.EdgeIntersectionList) { RelateNode n = (RelateNode)_nodes.AddNode(ei.Coordinate); if (eLoc == Location.Boundary) { n.SetLabelBoundary(argIndex); } else if (n.Label.IsNull(argIndex)) { n.SetLabel(argIndex, Location.Interior); } } } }
/// <summary> /// For all intersections on the edges of a Geometry, /// label the corresponding node IF it doesn't already have a label. /// This allows nodes created by either self-intersections or /// mutual intersections to be labelled. /// Endpoint nodes will already be labelled from when they were inserted. /// </summary> /// <param name="argIndex"></param> private void LabelIntersectionNodes(int argIndex) { foreach (Edge e in _arg[argIndex].Edges) { Location eLoc = e.Label.GetLocation(argIndex); foreach (EdgeIntersection ei in e.EdgeIntersectionList) { RelateNode n = (RelateNode)_nodes.Find(ei.Coordinate); if (n.Label.IsNull(argIndex)) { if (eLoc == Location.Boundary) { n.SetLabelBoundary(argIndex); } else { n.SetLabel(argIndex, Location.Interior); } } } } }