checkpoint
authoradam <adam@megacz.com>
Wed, 5 Dec 2007 09:57:41 +0000 (01:57 -0800)
committeradam <adam@megacz.com>
Wed, 5 Dec 2007 09:57:41 +0000 (01:57 -0800)
darcs-hash:20071205095741-5007d-c654ab59616e5d157e639784f0aaae2d1b0094a9.gz

src/edu/berkeley/qfat/Mesh.java
src/edu/berkeley/qfat/MeshViewer.java

index 2441057..747599c 100644 (file)
@@ -240,7 +240,16 @@ public class Mesh implements Iterable<Mesh.T> {
             } while(e != this.e);
 
             // FIXME: intersection test needed?
-            return true;
+            boolean good = true;
+            for(T t : Mesh.this) {
+                if (!good) break;
+                e = this.e;
+                do {
+                    if (!t.has(e.p1) && !t.has(e.p2) && e.t != null && e.intersects(t)) { good = false; break; }
+                    e = e.pair.next;
+                } while(e != this.e);
+            }
+            return good;
         }
 
         public boolean move(Vec v) {
index 3192c83..7dc5b0a 100644 (file)
@@ -89,6 +89,7 @@ public class MeshViewer implements GLEventListener, MouseListener, MouseMotionLi
     public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
     public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) { }
     public synchronized void display(GLAutoDrawable drawable) {
+        if (translations==null) return;
         GL gl = drawable.getGL();
         GLU glu = new GLU();
         gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);