From e988b80804087c3b96fad38d21c1d700c0c19814 Mon Sep 17 00:00:00 2001 From: Connor Riley Date: Thu, 3 Dec 2015 15:57:57 -0500 Subject: [PATCH] minor testing changes --- main/DrawHalfEdge.pde | 7 +++---- main/HalfEdge.pde | 1 - main/Vertex.pde | 2 +- main/main.pde | 6 ++++++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/main/DrawHalfEdge.pde b/main/DrawHalfEdge.pde index 1011e3e..6b1acc0 100644 --- a/main/DrawHalfEdge.pde +++ b/main/DrawHalfEdge.pde @@ -17,10 +17,11 @@ public class DrawHalfEdge { public void drawConnectedGraph(Vertex vertex) { ArrayList edges = vertex.getAllLeavingEdges(); drawpoint(vertex); + System.out.println(vertex); if(edges != null) { - System.out.println("edges are not null"); for(HalfEdge edge: edges) { - drawConnection(edge, vertex); + System.out.println(edge); + drawConnection(edge.gettwin(), vertex); } } } @@ -28,8 +29,6 @@ public class DrawHalfEdge { public void drawConnection(HalfEdge edge, Vertex v1) { System.out.println("drawing connection"); Vertex v2 = edge.getOrigin(); - System.out.println(v1); - System.out.println(v2); drawpoint(v2); drawline(v1, v2); } diff --git a/main/HalfEdge.pde b/main/HalfEdge.pde index a077589..1d1f5a4 100644 --- a/main/HalfEdge.pde +++ b/main/HalfEdge.pde @@ -53,7 +53,6 @@ public class HalfEdge { } - public int count() { if (counted == false) { counted = true; diff --git a/main/Vertex.pde b/main/Vertex.pde index a215301..92a3974 100644 --- a/main/Vertex.pde +++ b/main/Vertex.pde @@ -43,7 +43,7 @@ public class Vertex { HalfEdge[] prevNext = new HalfEdge[2]; if (leaving.size() == 1) { prevNext[1] = leaving.get(0); - prevNext[0] = prevNext[0].gettwin(); + prevNext[0] = prevNext[1].gettwin(); return prevNext; } Vertex v1 = this; diff --git a/main/main.pde b/main/main.pde index db10ee7..6f588b7 100644 --- a/main/main.pde +++ b/main/main.pde @@ -10,12 +10,18 @@ public void setup() { Vertex v1 = new Vertex(0,200); Vertex v2 = new Vertex(100,100); Vertex v3 = new Vertex(200,0); + Vertex v4 = new Vertex(-100,-100); list.addVertex(v); list.addVertex(v1); list.addVertex(v2); list.addVertex(v3); + list.addVertex(v4); DrawHalfEdge draw = new DrawHalfEdge(); HalfEdge h1 = new HalfEdge(v, v1); + HalfEdge h2 = new HalfEdge(v, v3); + HalfEdge h3 = new HalfEdge(v, v2); + HalfEdge h4 = new HalfEdge(v,v4); + HalfEdge h5 = new HalfEdge(v1,v2); draw.drawGraph(list.getVertexList()); } /*public void draw() {