/** * Sets the vertex for this edge's destination * * @param d the destination vertex */ void setDest(Vertex d) { sym().setOrig(d); }
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); } } }
/** * Creates a new QuadEdge quartet from {@link Vertex} o to {@link Vertex} d. * * @param o * the origin Vertex * @param d * the destination Vertex * @return the new QuadEdge quartet */ public static QuadEdge makeEdge(Vertex o, Vertex d) { QuadEdge q0 = new QuadEdge(); QuadEdge q1 = new QuadEdge(); QuadEdge q2 = new QuadEdge(); QuadEdge q3 = new QuadEdge(); q0.rot = q1; q1.rot = q2; q2.rot = q3; q3.rot = q0; q0.setNext(q0); q1.setNext(q3); q2.setNext(q2); q3.setNext(q1); QuadEdge base = q0; base.setOrig(o); base.setDest(d); return base; }
/** * Turns an edge counterclockwise inside its enclosing quadrilateral. * * @param e the quadedge to turn */ public static void swap(QuadEdge e) { QuadEdge a = e.oPrev(); QuadEdge b = e.sym().oPrev(); splice(e, a); splice(e.sym(), b); splice(e, a.lNext()); splice(e.sym(), b.lNext()); e.setOrig(a.dest()); e.setDest(b.dest()); }
/** * Sets the vertex for this edge's destination * * @param d the destination vertex */ void setDest(Vertex d) { sym().setOrig(d); }
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); } } }
/** * Creates a new QuadEdge quartet from {@link Vertex} o to {@link Vertex} d. * * @param o * the origin Vertex * @param d * the destination Vertex * @return the new QuadEdge quartet */ public static QuadEdge makeEdge(Vertex o, Vertex d) { QuadEdge q0 = new QuadEdge(); QuadEdge q1 = new QuadEdge(); QuadEdge q2 = new QuadEdge(); QuadEdge q3 = new QuadEdge(); q0.rot = q1; q1.rot = q2; q2.rot = q3; q3.rot = q0; q0.setNext(q0); q1.setNext(q3); q2.setNext(q2); q3.setNext(q1); QuadEdge base = q0; base.setOrig(o); base.setDest(d); return base; }
/** * Turns an edge counterclockwise inside its enclosing quadrilateral. * * @param e the quadedge to turn */ public static void swap(QuadEdge e) { QuadEdge a = e.oPrev(); QuadEdge b = e.sym().oPrev(); splice(e, a); splice(e.sym(), b); splice(e, a.lNext()); splice(e.sym(), b.lNext()); e.setOrig(a.dest()); e.setDest(b.dest()); }