From 33c8b619de261233fe6a62e01e8b81958cc3d022 Mon Sep 17 00:00:00 2001 From: JimmyBoivie Date: Fri, 4 Dec 2015 23:26:47 -0500 Subject: [PATCH] about to change a lot --- main/CompGeo.pde | 5 ++++- main/Point.pde | 22 ++++++++++++++++++++++ main/main.pde | 16 ++++++++-------- 3 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 main/Point.pde diff --git a/main/CompGeo.pde b/main/CompGeo.pde index ff8fb22..0c3dd2f 100644 --- a/main/CompGeo.pde +++ b/main/CompGeo.pde @@ -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); } -} \ No newline at end of file +} diff --git a/main/Point.pde b/main/Point.pde new file mode 100644 index 0000000..d24a22a --- /dev/null +++ b/main/Point.pde @@ -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)); + } +} \ No newline at end of file diff --git a/main/main.pde b/main/main.pde index 12cbc62..8f275fa 100644 --- a/main/main.pde +++ b/main/main.pde @@ -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());