/// <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; LocationType 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 == LocationType.Boundary) { n.SetLabelBoundary(argIndex); } else if (n.Label.IsNull(argIndex)) { n.SetLabel(argIndex, LocationType.Interior); } } } }
/// <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. /// </summary> /// <param name="argIndex"></param> private void ComputeIntersectionNodes(int argIndex) { for (IEnumerator i = _arg[argIndex].GetEdgeEnumerator(); i.MoveNext();) { Edge e = (Edge)i.Current; LocationType 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 == LocationType.Boundary) { n.SetLabelBoundary(argIndex); } else { if (n.Label.IsNull(argIndex)) { n.SetLabel(argIndex, LocationType.Interior); } } } } }