checkpoint
[anneal.git] / src / edu / berkeley / qfat / Main.java
index 3ce1d88..5dbba74 100644 (file)
@@ -52,6 +52,7 @@ import edu.berkeley.qfat.geom.Polygon;
 
 public class Main extends InteractiveMeshViewer {
 
+    public Matrix[] transforms;
 
     public static int verts = 1;
 
@@ -108,7 +109,7 @@ public class Main extends InteractiveMeshViewer {
             StlFile stlf = new StlFile();
             InputStream res = this.getClass().getClassLoader().getResourceAsStream(file);
             stlf.readBinaryFile(file, res);
-            goal = new Mesh(false);
+            setGoal(new Mesh(false));
             for(int i=0; i<stlf.coordArray.length; i+=3) {
                 Point p0 = new Point(stlf.coordArray[i+0].x * MAG, stlf.coordArray[i+0].y * MAG, stlf.coordArray[i+0].z * MAG);
                 Point p1 = new Point(stlf.coordArray[i+1].x * MAG, stlf.coordArray[i+1].y * MAG, stlf.coordArray[i+1].z * MAG);
@@ -347,6 +348,7 @@ public class Main extends InteractiveMeshViewer {
 
     public static void main(String[] s) throws Exception {
         JFrame f = new JFrame();
+        f.setLayout(new BorderLayout());
         Main main = new Main(f);
         f.setJMenuBar(main.new MyMenuBar());
         f.pack();
@@ -370,7 +372,7 @@ public class Main extends InteractiveMeshViewer {
     }
 
     public void hexBrick(boolean offset, boolean rotated) {
-                tile = new Mesh(false);
+        setTile(new Mesh(false));
                 float width  = (float)0.8;
                 float depth  = (float)0.08;
                 float height = (float)0.4;
@@ -603,7 +605,7 @@ public class Main extends InteractiveMeshViewer {
                 hexBrick(false, true);
             }});
             tileMenu.add(new MyMenuItem("Temp (do not use)") { public void hit() {
-                tile = new Mesh(false);
+                setTile(new Mesh(false));
                 float width  = (float)0.8;
                 float depth  = (float)0.08;
                 float height = (float)0.4;
@@ -664,7 +666,7 @@ public class Main extends InteractiveMeshViewer {
                 fixupTile();
             } });
             tileMenu.add(new MyMenuItem("Dense Packing (hex)") { public void hit() {
-                tile = new Mesh(false);
+                setTile(new Mesh(false));
                 float width  = (float)3.2;
                 float depth  = (float)0.32;
                 float height = (float)1.6;
@@ -706,7 +708,7 @@ public class Main extends InteractiveMeshViewer {
                 fixupTile();
             } });
             tileMenu.add(new MyMenuItem("Slim Dense Packing (Cubic)") { public void hit() {
-                tile = new Mesh(false);
+                setTile(new Mesh(false));
                 float unit = 0.4f;
                 float r = unit/2;
                 float sin = (float)(unit * Math.sin(Math.PI/3));
@@ -762,7 +764,7 @@ public class Main extends InteractiveMeshViewer {
             } });
             tileMenu.add(new MyMenuItem("Genus-1") { public void hit() {
                 synchronized(this) {
-                    tile = new Mesh(false);
+                    setTile(new Mesh(false));
                     Matrix mm = Matrix.scale(0.1f);
                     float height = 4;
                     float width  = 4;
@@ -894,7 +896,7 @@ public class Main extends InteractiveMeshViewer {
                 }}});
             tileMenu.add(new MyMenuItem("Hammerhead") { public void hit() {
                 synchronized(this) {
-                    tile = new Mesh(false);
+                    setTile(new Mesh(false));
                     Matrix mm = Matrix.ONE;
                     float height1 = .1f;
                     float height2 = .1f;