Skip to content

Commit

Permalink
minor testing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cor11004 committed Dec 3, 2015
1 parent d4a77b2 commit e988b80
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
7 changes: 3 additions & 4 deletions main/DrawHalfEdge.pde
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,18 @@ public class DrawHalfEdge {
public void drawConnectedGraph(Vertex vertex) {
ArrayList<HalfEdge> 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);
}
}
}

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);
}
Expand Down
1 change: 0 additions & 1 deletion main/HalfEdge.pde
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public class HalfEdge {

}


public int count() {
if (counted == false) {
counted = true;
Expand Down
2 changes: 1 addition & 1 deletion main/Vertex.pde
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions main/main.pde
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit e988b80

Please sign in to comment.