checkpoint
[anneal.git] / src / edu / berkeley / qfat / Viewer.java
index eccb6b6..92be445 100644 (file)
@@ -14,32 +14,12 @@ import edu.berkeley.qfat.geom.Point;
 public abstract class Viewer implements GLEventListener, MouseListener, MouseMotionListener, KeyListener, MouseWheelListener  {
 
     Mesh.Vertex closest = null;
+    Matrix projection = null;
 
-    public boolean force = false;
     public Mesh tile = new Mesh(false);
     public Mesh goal = new Mesh(false);
-    public Matrix[] transforms;
-    public Mesh.Vertex[] points;
-
-    public int whichNeighbor = 1;
-
-    public double temp;
-    public boolean tileon = true;
-    public boolean tilemeshon = false;
-    public boolean goalon = true;
-    public boolean anneal = false;
-    public boolean hillclimb = false;
-    public boolean neighbors = false;
-    public boolean neighborsWire = false;
-    public boolean neighborsWireOne = false;
-    public boolean errorNormals = false;
-
-    public int breaks = 0;
-    boolean alt = false;
-    boolean shift = false;
-    boolean control = false;
 
-    Matrix projection = null;
+
     JFrame f;
     GLCanvas glcanvas;
     Point clickPoint = null;
@@ -53,6 +33,10 @@ public abstract class Viewer implements GLEventListener, MouseListener, MouseMot
     float anglex = 0;
     float angley = 0;
 
+    boolean alt = false;
+    boolean shift = false;
+    boolean control = false;
+
     public abstract void _display(GLAutoDrawable drawable, GL gl);
     public void display(GLAutoDrawable drawable) {
         GL gl = drawable.getGL();
@@ -60,6 +44,7 @@ public abstract class Viewer implements GLEventListener, MouseListener, MouseMot
         this.projection = Matrix.getProjectionMatrix(gl);
     }
 
+    /** return the position of the mouse as a point in window-space */
     public Point getMouse() {
         return new Point(mousex, glcanvas.getHeight()-mousey, 0);
     }
@@ -92,12 +77,12 @@ public abstract class Viewer implements GLEventListener, MouseListener, MouseMot
         clickPoint = getMouse();
         clickClosest = closest == null ? null : closest.getPoint();
     }
+
     public void mouseReleased(MouseEvent e) {
         clickPoint = null;
         clickClosest = null;
     }
 
-
     public void mouseMoved(MouseEvent e) {
         mousex = e.getX();
         mousey = e.getY();
@@ -128,17 +113,15 @@ public abstract class Viewer implements GLEventListener, MouseListener, MouseMot
 
     public Viewer(JFrame f) {
         this.f = f;
-
-        GLCapabilities glcaps = new GLCapabilities();
         glcanvas = new GLCanvas();
         glcanvas.addGLEventListener(this);
         f.add(glcanvas, BorderLayout.CENTER);
-
         glcanvas.addMouseListener(this);
         glcanvas.addMouseMotionListener(this);
         glcanvas.addMouseWheelListener(this);
         glcanvas.addKeyListener(this);
     }
+
     public void repaint() {
         glcanvas.repaint();
     }