Skip to content

Commit

Permalink
about to change a lot
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyBoivie authored and JimmyBoivie committed Dec 5, 2015
1 parent 4b2b3a4 commit 33c8b61
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 9 deletions.
5 changes: 4 additions & 1 deletion main/CompGeo.pde
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ public static class CompGeo {
}

public int immediateCCW(Vertex parent, Vertex child, Vertex v1, Vertex v2) {
// returns 1 if v1 is more immediate CCW of parent, child than v2
// returns -1 if v2 is more immediate CCW of parent, child than v1
if (CCW(parent, child, v1) > CCW(parent, child, v2)) { return 1; }
if (CCW(parent, child, v1) < CCW(parent, child, v2)) { return -1; }
return CCW(parent, v1, v2);
}

}
}
22 changes: 22 additions & 0 deletions main/Point.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
public class Point {
private float x,y;
private HalfEdge ref;

public Point(float a, float b) {
x = a;
y = b;
ref = null;
}

public float getX() {
return x;
}

public float getY() {
return y;
}

public boolean equals(float a, float b) {
return ((a == x) && (b == y));
}
}
16 changes: 8 additions & 8 deletions main/main.pde
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ public void setup() {
list.addVertex(v3);
list.addVertex(v4);
DrawHalfEdge draw = new DrawHalfEdge();
HalfEdge h1 = new HalfEdge(v, v1);
h1.facePrint();
HalfEdge h2 = new HalfEdge(v, v3);
h1.facePrint();
HalfEdge h3 = new HalfEdge(v, v2);
h1.facePrint();
HalfEdge h4 = new HalfEdge(v,v4);
h1.facePrint();
//HalfEdge h1 = new HalfEdge(v, v1);
//h1.facePrint();
//HalfEdge h2 = new HalfEdge(v, v3);
//h1.facePrint();
//HalfEdge h3 = new HalfEdge(v, v2);
//h1.facePrint();
//HalfEdge h4 = new HalfEdge(v,v4);
//h1.facePrint();
//HalfEdge h5 = new HalfEdge(v1,v2);
//h1.facePrint();
draw.drawGraph(list.getVertexList());
Expand Down

0 comments on commit 33c8b61

Please sign in to comment.