diff --git a/main/HalfEdge.pde b/main/HalfEdge.pde index 98e35f1..c383e26 100644 --- a/main/HalfEdge.pde +++ b/main/HalfEdge.pde @@ -2,7 +2,7 @@ public class HalfEdge { private HalfEdge previous; private HalfEdge next; private HalfEdge twin; - private Vertex vertex; + private Point origin; private boolean counted; private Face incidentFace; @@ -10,55 +10,6 @@ public class HalfEdge { public HalfEdge(){} - public HalfEdge(Vertex v1, Vertex v2) { - // Set Twins - twin = new HalfEdge(); - twin.settwin(this); - - // Set Counted - counted = false; - twin.setCounted(false); - - // Set Vertice - vertex = v1; - twin.setOrigin(v2); - - - HalfEdge[] try1 = v1.getEdgesToUpdate(v2); - if (try1 == null) { - twin.setnext(this); - previous = twin; - v1.setIncidentEdge(this); - } else { - twin.setnext(try1[1]); - try1[1].setprevious(twin); - previous = try1[0]; - try1[0].setnext(this); - } - - HalfEdge[] try2 = v2.getEdgesToUpdate(v1); - if (try2 == null) { - twin.setprevious(this); - next = twin; - v2.setIncidentEdge(twin); - } else { - twin.setprevious(try2[0]); - try2[0].setnext(twin); - next = try2[1]; - try2[1].setprevious(this); - } - if ((try1 == null) || ( try2 == null)) { System.out.println("HEY BOTH NULL"); } - //System.out.println(this); - // Set Nexts - - // Set Prevs - - // Set Faces - - - - } - public int count() { if (counted == false) { counted = true; @@ -112,8 +63,8 @@ public class HalfEdge { public void settwin(HalfEdge t) { twin = t; } - public void setOrigin(Vertex v) { - vertex = v; + public void setOrigin(Point v) { + origin = v; } public void setCounted(boolean b) { counted = b; @@ -123,7 +74,7 @@ public class HalfEdge { } public String toString() { - return "Origin: " + vertex.toString() + "\nDestination: " + twin.getOrigin().toString(); + return "Origin: " + origin.toString() + "\nDestination: " + twin.getOrigin().toString(); } public HalfEdge gettwin() { @@ -135,8 +86,8 @@ public class HalfEdge { public HalfEdge getprevious(){ return previous; } - public Vertex getOrigin() { - return vertex; + public Point getOrigin() { + return origin; } public Face getIncidentFace() { return incidentFace; @@ -145,14 +96,4 @@ public class HalfEdge { incidentFace = f; } - public void facePrint() { - System.out.println("Face Print: "); - HalfEdge e = next; - System.out.println(this); - while (e != this) { - System.out.println(e); - e = e.getnext(); - } - System.out.println(""); - } } \ No newline at end of file diff --git a/main/main.pde b/main/main.pde index e6b2dc5..0d3c7ce 100644 --- a/main/main.pde +++ b/main/main.pde @@ -5,7 +5,7 @@ public void setup() { background(255); fill(0,0); translate(width/2, height/2); - VertexList list = new VertexList(); + //VertexList list = new VertexList(); //Vertex v = new Vertex(0,0); //Vertex v1 = new Vertex(0,200); //Vertex v2 = new Vertex(80,100);