public EulerHalfEdge Link(EulerVertex other) { //Create half edges and link them to each other var st = new EulerHalfEdge(this, other, null, null); var ts = new EulerHalfEdge(other, this, null, st); st.opposite = ts; // check whether the nodes are if (!this.AreConnected(other)) { //Move both vertices to root this.MakeRoot(); other.MakeRoot(); //Insert entries in Euler tours st.node = this.node.Insert(st); ts.node = other.node.Insert(ts); //Link tours together this.node.Concat(other.node); } //Return half edge return(st); }
public EulerHalfEdge <T> Link(EulerVertex <T> other, T value) { // Move both vertices to root MakeRoot(); other.MakeRoot(); // Create half edges and link them to each other var st = new EulerHalfEdge <T>(value, this, other); var ts = new EulerHalfEdge <T>(value, other, this); ts.opposite = st; st.opposite = ts; // Insert entries in Euler tours st.node = node.Insert(st); ts.node = other.node.Insert(ts); // Link tours together node.Merge(other.node); // Return half edge return(st); }