/** * Gets the CCW edge around the left face following this edge. * * @return the next left face edge. */ public final QuadEdge lNext() { return this.invRot().oNext().rot(); }
/** * Deletes a quadedge from the subdivision. Linked quadedges are updated to * reflect the deletion. * * @param e * the quadedge to delete */ public void delete(QuadEdge e) { QuadEdge.splice(e, e.oPrev()); QuadEdge.splice(e.sym(), e.sym().oPrev()); QuadEdge eSym = e.sym(); QuadEdge eRot = e.rot(); QuadEdge eRotSym = e.rot().sym(); // this is inefficient on an ArrayList, but this method should be called infrequently quadEdges.remove(e); quadEdges.remove(eSym); quadEdges.remove(eRot); quadEdges.remove(eRotSym); e.delete(); eSym.delete(); eRot.delete(); eRotSym.delete(); }
/** * Splices two edges together or apart. * Splice affects the two edge rings around the origins of a and b, and, independently, the two * edge rings around the left faces of <tt>a</tt> and <tt>b</tt>. * In each case, (i) if the two rings are distinct, * Splice will combine them into one, or (ii) if the two are the same ring, Splice will break it * into two separate pieces. Thus, Splice can be used both to attach the two edges together, and * to break them apart. * * @param a an edge to splice * @param b an edge to splice * */ public static void splice(QuadEdge a, QuadEdge b) { QuadEdge alpha = a.oNext().rot(); QuadEdge beta = b.oNext().rot(); QuadEdge t1 = b.oNext(); QuadEdge t2 = a.oNext(); QuadEdge t3 = beta.oNext(); QuadEdge t4 = alpha.oNext(); a.setNext(t1); b.setNext(t2); alpha.setNext(t3); beta.setNext(t4); }
public void visit(QuadEdge[] triEdges) { Coordinate a = triEdges[0].orig().getCoordinate(); Coordinate b = triEdges[1].orig().getCoordinate(); Coordinate c = triEdges[2].orig().getCoordinate(); // TODO: choose the most accurate circumcentre based on the edges Coordinate cc = Triangle.circumcentre(a, b, c); Vertex ccVertex = new Vertex(cc); // save the circumcentre as the origin for the dual edges originating in this triangle for (int i = 0; i < 3; i++) { triEdges[i].rot().setOrig(ccVertex); } } }
Coordinate cc = qe.rot().orig().getCoordinate(); cellPts.add(cc);