From: adam Date: Mon, 26 Nov 2007 03:50:54 +0000 (-0800) Subject: checkpoint X-Git-Url: http://git.megacz.com/?p=anneal.git;a=commitdiff_plain;h=8a19e3f30ae67231e204c28d5ec93e5a6d812861 checkpoint darcs-hash:20071126035054-5007d-07a55acc220977fa3a8c23eb9e061296e1fca9e6.gz --- diff --git a/Makefile b/Makefile index a9c9949..0d6f0c7 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ all: mkdir -p build javac -d build `find src -name \*.java` - java -cp build Geom + java -cp build Main diff --git a/src/Geom.java b/src/Geom.java index fec07b5..c879bfe 100644 --- a/src/Geom.java +++ b/src/Geom.java @@ -1,80 +1,42 @@ import java.awt.*; +import java.util.*; import java.awt.event.*; import javax.swing.*; import javax.media.opengl.*; import javax.media.opengl.glu.*; -public class Geom implements GLEventListener { +public class Geom { - public static StlFile stlf = null; + private HashMap ps = new HashMap(); - /** - * Take care of initialization here. - */ - public void init(GLAutoDrawable gld) { - GL gl = gld.getGL(); - GLU glu = new GLU(); - gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f); - gl.glViewport(0, 0, 500, 300); - gl.glMatrixMode(GL.GL_PROJECTION); - gl.glLoadIdentity(); - //glu.gluOrtho2D(0.0, 500.0, 0.0, 300.0); - display(gld); + public P newP(float x, float y, float z) { + P p = new P(x, y, z); + P p2 = ps.get(p); + if (p2 != null) return p2; + ps.put(p, p); + return p; } - - /** - * Take care of drawing here. - */ - public void display(GLAutoDrawable drawable) { - float red = 0.0f; - float green = 0.0f; - float blue = 0.0f; - GL gl = drawable.getGL(); - gl.glClear(GL.GL_COLOR_BUFFER_BIT); - gl.glPointSize(5.0f); - - for(int i=0; i