checkpoint
[anneal.git] / src / edu / berkeley / qfat / MeshViewer.java
index b4d958a..2b6ba8e 100644 (file)
@@ -354,82 +354,10 @@ public class MeshViewer implements GLEventListener, MouseListener, MouseMotionLi
         gl.glShadeModel(GL.GL_SMOOTH);
         gl.glEnable(GL.GL_LIGHTING);
         gl.glDrawBuffer(GL.GL_FRONT);
         gl.glShadeModel(GL.GL_SMOOTH);
         gl.glEnable(GL.GL_LIGHTING);
         gl.glDrawBuffer(GL.GL_FRONT);
-
-
-
-        /*
-        IntBuffer selectionBuffer =
-        ByteBuffer.allocateDirect(4*10000).order(ByteOrder.nativeOrder()).asIntBuffer();
-        gl.glSelectBuffer(selectionBuffer.capacity(), selectionBuffer);
-        gl.glInitNames();
-        gl.glRenderMode(GL.GL_SELECT);
-        draw(gl, true, safeTriangles);
-        int hits = gl.glRenderMode(GL.GL_RENDER);
-        synchronized(safeTriangles) {
-            for(Mesh.T t : safeTriangles) {
-                t.occluded = true;
-            }
-            processHits(hits, selectionBuffer);
-        }
-        */
     }
     Mesh.Vertex closest = null;
     Matrix projection = null;
 
     }
     Mesh.Vertex closest = null;
     Matrix projection = null;
 
-    // I copied this method without changes from the mentioned base class.
-    // It extracts the data in the selection buffer and writes it on the console.
-    public void processHits(int hits, IntBuffer buffer) {
-        /*
-        System.out.println("---------------------------------");
-        System.out.println(" HITS: " + hits);
-        */
-        int offset = 0;
-        int names;
-        float z1, z2;
-        for (int i = 0; i < hits; i++) {
-            /*
-            System.out.println("- - - - - - - - - - - -");
-            System.out.println(" hit: " + (i + 1));
-            */
-            names = buffer.get(offset);
-            offset++;
-            z1 = (float) buffer.get(offset) / 0x7fffffff;
-            offset++;
-            z2 = (float) buffer.get(offset) / 0x7fffffff;
-            offset++;
-            /*
-            System.out.println(" number of names: " + names);
-            System.out.println(" z1: " + z1);
-            System.out.println(" z2: " + z2);
-            System.out.println(" names: ");
-            */
-
-            for (int j = 0; j < names; j++) {
-                int who = buffer.get(offset);
-                for(Mesh.T t : safeTriangles) {
-                    if (t.serial==who) {
-                        t.occluded = false;
-                    }
-                }
-                /*
-                System.out.print("  " + who);
-                if (j == (names - 1)) {
-                    System.out.println("<-");
-                } else {
-                    System.out.println();
-                    }
-                */
-                offset++;
-            }
-            /*
-            System.out.println("- - - - - - - - - - - -");
-            */
-        }
-        /*
-        System.out.println("--------------------------------- ");
-        */
-    }
-
     protected HashSet<Mesh.T> safeTriangles = new HashSet<Mesh.T>();
 
     private void draw(GL gl, boolean triangles, Iterable<Mesh.T> tris) { draw(gl, triangles, tris, Matrix.ONE); }
     protected HashSet<Mesh.T> safeTriangles = new HashSet<Mesh.T>();
 
     private void draw(GL gl, boolean triangles, Iterable<Mesh.T> tris) { draw(gl, triangles, tris, Matrix.ONE); }
@@ -512,8 +440,6 @@ public class MeshViewer implements GLEventListener, MouseListener, MouseMotionLi
         }
     }
 
         }
     }
 
-
-    //private JTextArea ocanvas = new JTextArea();
     private JFrame f;
     private GLCanvas glcanvas;
     public MeshViewer(JFrame f) {
     private JFrame f;
     private GLCanvas glcanvas;
     public MeshViewer(JFrame f) {
@@ -532,7 +458,4 @@ public class MeshViewer implements GLEventListener, MouseListener, MouseMotionLi
     public void repaint() {
         glcanvas.repaint();
     }
     public void repaint() {
         glcanvas.repaint();
     }
-
-
-
 }
\ No newline at end of file
 }
\ No newline at end of file