/// <summary> /// /// </summary> private void LabelNodeEdges() { for (IEnumerator ni = nodes.GetEnumerator(); ni.MoveNext();) { RelateNode node = (RelateNode)ni.Current; node.Edges.ComputeLabelling(arg); } }
/// <summary> /// Update the IM with the sum of the IMs for each component. /// </summary> /// <param name="im"></param> private void UpdateIM(IntersectionMatrix im) { for (IEnumerator ei = isolatedEdges.GetEnumerator(); ei.MoveNext();) { Edge e = (Edge)ei.Current; e.UpdateIM(im); } for (IEnumerator ni = nodes.GetEnumerator(); ni.MoveNext();) { RelateNode node = (RelateNode)ni.Current; node.UpdateIM(im); node.UpdateIMFromEdges(im); } }
/// <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 virtual void ComputeIntersectionNodes(GeometryGraph geomGraph, int argIndex) { for (IEnumerator edgeIt = geomGraph.GetEdgeEnumerator(); edgeIt.MoveNext();) { Edge e = (Edge)edgeIt.Current; Locations eLoc = e.Label.GetLocation(argIndex); for (IEnumerator eiIt = e.EdgeIntersectionList.GetEnumerator(); eiIt.MoveNext();) { EdgeIntersection ei = (EdgeIntersection)eiIt.Current; RelateNode n = (RelateNode)nodes.AddNode(ei.Coordinate); if (eLoc == Locations.Boundary) { n.SetLabelBoundary(argIndex); } else if (n.Label.IsNull(argIndex)) { n.SetLabel(argIndex, Locations.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) { for (IEnumerator i = arg[argIndex].GetEdgeEnumerator(); i.MoveNext();) { Edge e = (Edge)i.Current; Locations eLoc = e.Label.GetLocation(argIndex); for (IEnumerator eiIt = e.EdgeIntersectionList.GetEnumerator(); eiIt.MoveNext();) { EdgeIntersection ei = (EdgeIntersection)eiIt.Current; RelateNode n = (RelateNode)nodes.Find(ei.Coordinate); if (n.Label.IsNull(argIndex)) { if (eLoc == Locations.Boundary) { n.SetLabelBoundary(argIndex); } else { n.SetLabel(argIndex, Locations.Interior); } } } } }