/// <summary> /// For all DirectedEdges in result, form them into MaximalEdgeRings. /// </summary> /// <param name="dirEdges"></param> /// <returns></returns> private IList BuildMaximalEdgeRings(IEnumerable dirEdges) { IList maxEdgeRings = new ArrayList(); for (IEnumerator it = dirEdges.GetEnumerator(); it.MoveNext(); ) { DirectedEdge de = (DirectedEdge)it.Current; if (!de.IsInResult || !de.Label.IsArea()) continue; // if this edge has not yet been processed if (de.EdgeRing != null) continue; MaximalEdgeRing er = new MaximalEdgeRing(de, _geometryFactory); maxEdgeRings.Add(er); er.SetInResult(); } return maxEdgeRings; }
/// <summary> /// Form <see cref="DirectedEdge" />s in graph into Minimal EdgeRings. /// (Minimal Edgerings must be used, because only they are guaranteed to provide /// a correct isHole computation). /// </summary> /// <param name="dirEdges"></param> /// <returns></returns> private IList BuildEdgeRings(IList dirEdges) { IList edgeRings = new ArrayList(); foreach (DirectedEdge de in dirEdges) { // if this edge has not yet been processed if (de.IsInResult && de.EdgeRing == null) { MaximalEdgeRing er = new MaximalEdgeRing(de, _geometryFactory); er.LinkDirectedEdgesForMinimalEdgeRings(); IList minEdgeRings = er.BuildMinimalRings(); foreach(object o in minEdgeRings) edgeRings.Add(o); } } return edgeRings; }