/// <summary> /// Add a set of edges to the graph. For each edge two DirectedEdges /// will be created. DirectedEdges are NOT linked by this method. /// </summary> public void AddEdges(EdgeCollection edgesToAdd) { // create all the nodes for the edges for (IEdgeEnumerator it = edgesToAdd.GetEnumerator(); it.MoveNext();) { Edge e = it.Current; edges.Add(e); DirectedEdge de1 = new DirectedEdge(e, true); DirectedEdge de2 = new DirectedEdge(e, false); de1.Sym = de2; de2.Sym = de1; Add(de1); Add(de2); } }
/// <summary> Creates new edges for all the edges that the intersections in this /// list split the parent edge into. /// Adds the edges to the input list (this is so a single list /// can be used to accumulate all split edges for a Geometry). /// </summary> /// <param name="edgeList">a list of EdgeIntersections /// </param> public void AddSplitEdges(EdgeCollection edgeList) { // ensure that the list has entries for the first and last point of the edge AddEndpoints(); IEnumerator it = Iterator(); // there should always be at least two entries in the list it.MoveNext(); //TODO--PAUL EdgeIntersection eiPrev = (EdgeIntersection)it.Current; while (it.MoveNext()) { EdgeIntersection ei = (EdgeIntersection)it.Current; Edge newEdge = CreateSplitEdge(eiPrev, ei); edgeList.Add(newEdge); eiPrev = ei; } }
/// <summary> Insert an edge unless it is already in the list</summary> public void Add(Edge e) { edges.Add(e); index.Insert(e.Envelope, e); }