Exemple #1
0
 public static void swapEdge(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.orig = a.dest();
   e.sym().orig = b.dest();
 }
Exemple #2
0
 /**
  * Test if the Point p is at the right of the QuadEdge q.
  *
  * @param QuadEdge reference
  * @param p Point to test
  * @return true/false
  */
 public static boolean isAtRightOf(QuadEdge q, Point p) {
   return isCounterClockwise(p, q.dest(), q.orig());
 }
Exemple #3
0
 /**
  * Test if the Point p is on the line porting the edge
  *
  * @param e QuadEdge
  * @param p Point to test
  * @return true/false
  */
 public static boolean isOnLine(QuadEdge e, Point p) {
   // test if the vector product is zero
   if ((p.x - e.orig().x) * (p.y - e.dest().y) == (p.y - e.orig().y) * (p.x - e.dest().x))
     return true;
   return false;
 }
Exemple #4
0
 /**
  * Create a new QuadEdge by connecting 2 QuadEdges
  *
  * @param e1,e2 the 2 QuadEdges to connect
  * @return the new QuadEdge
  */
 public static QuadEdge connect(QuadEdge e1, QuadEdge e2) {
   QuadEdge q = makeEdge(e1.dest(), e2.orig());
   splice(q, e1.lnext());
   splice(q.sym(), e2);
   return q;
 }