Skip to content

Commit

Permalink
cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyBoivie authored and JimmyBoivie committed Dec 5, 2015
1 parent b2277de commit 86670ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 66 deletions.
71 changes: 6 additions & 65 deletions main/HalfEdge.pde
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,14 @@ public class HalfEdge {
private HalfEdge previous;
private HalfEdge next;
private HalfEdge twin;
private Vertex vertex;
private Point origin;
private boolean counted;
private Face incidentFace;

// MAKE SURE ALL HALF EDGES ARE INITIALIZED TO FALSE

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;
Expand Down Expand Up @@ -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;
Expand All @@ -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() {
Expand All @@ -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;
Expand All @@ -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("");
}
}
2 changes: 1 addition & 1 deletion main/main.pde
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 86670ff

Please sign in to comment.