Example #1
0
  /**
   * Create a new edge (i.e. a segment)
   *
   * @param orig origin of the segment
   * @param dest end of the segment
   * @return the QuadEdge of the origin point
   */
  public static QuadEdge makeEdge(Point orig, Point dest) {
    QuadEdge q0 = new QuadEdge(null, null, orig);
    QuadEdge q1 = new QuadEdge(null, null, null);
    QuadEdge q2 = new QuadEdge(null, null, dest);
    QuadEdge q3 = new QuadEdge(null, null, null);

    // create the segment
    q0.onext = q0;
    q2.onext = q2; // lonely segment: no "next" quadedge
    q1.onext = q3;
    q3.onext = q1; // in the dual: 2 communicating facets

    // dual switch
    q0.rot = q1;
    q1.rot = q2;
    q2.rot = q3;
    q3.rot = q0;

    return q0;
  }
Example #2
0
 /** @return the symetric (reverse) QuadEdge */
 public QuadEdge sym() {
   return rot.rot();
 }