X-Git-Url: http://git.megacz.com/?p=anneal.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fqfat%2FMesh.java;h=b518b14f29b979cf478e2b01ec737022ebc59c85;hp=c85de26f550f4c50daa8109f87284807030a5fff;hb=37516ec826e2017925130f192176632240f67b17;hpb=94a51f6ee148dbc5dc4fddcd6e3bd13fee12f4fa diff --git a/src/edu/berkeley/qfat/Mesh.java b/src/edu/berkeley/qfat/Mesh.java index c85de26..b518b14 100644 --- a/src/edu/berkeley/qfat/Mesh.java +++ b/src/edu/berkeley/qfat/Mesh.java @@ -17,6 +17,8 @@ public class Mesh implements Iterable { private RTree tris = new RTree(); private PointSet vertices = new PointSet(); + public boolean tilemesh = false; + public boolean ignorecollision = false; public Mesh score_against = null; public double score = 0; public float score() { return (float)score; } @@ -709,27 +711,6 @@ public class Mesh implements Iterable { } - public class FaceIterator implements Iterator { - private HashSet visited = new HashSet(); - private LinkedList next = new LinkedList(); - public FaceIterator() { } - public FaceIterator(Vert v) { next.addFirst(v.e.t); } - public boolean hasNext() { return next.peek()!=null; } - public void remove() { throw new Error(); } - public T next() { - T ret = next.removeFirst(); - if (ret == null) return null; - visited.add(ret); - T t1 = ret.e1().pair.t; - T t2 = ret.e2().pair.t; - T t3 = ret.e3().pair.t; - if (t1 != null && !visited.contains(t1)) next.addFirst(t1); - if (t2 != null && !visited.contains(t2)) next.addFirst(t2); - if (t3 != null && !visited.contains(t3)) next.addFirst(t3); - return ret; - } - } - /** [UNIQUE] a triangle (face) */ public final class T extends Triangle { public final E e1; @@ -778,20 +759,12 @@ public class Mesh implements Iterable { public boolean hasE(E e) { return e1==e || e1.next==e || e1.prev==e; } public boolean has(Vert v) { return v1()==v || v2()==v || v3()==v; } - public void glVertices(GL gl) { - - /* - if (e1().bind_to.set.size() == 0) return; - if (e2().bind_to.set.size() == 0) return; - if (e3().bind_to.set.size() == 0) return; - */ - - norm().glNormal(gl); - p1().glVertex(gl); - p2().glVertex(gl); - p3().glVertex(gl); + public boolean shouldBeDrawn() { + if (e1().bind_to.set.size() == 0) return false; + if (e2().bind_to.set.size() == 0) return false; + if (e3().bind_to.set.size() == 0) return false; + return true; } + } - public boolean tilemesh = false; - public boolean ignorecollision = false; }