-public class MeshViewer implements GLEventListener, MouseListener, MouseMotionListener, KeyListener, MouseWheelListener {
+public class MeshViewer extends JPanel implements GLEventListener, MouseListener, MouseMotionListener, KeyListener, MouseWheelListener {
- private int mousex;
- private int mousey;
- private Matrix projection = null;
- private Point clickPoint = null;
- private GLCanvas glcanvas;
- private boolean updateVisibilities = false;
+ private Mesh.Vertex closest = null;
+ private int mousex;
+ private int mousey;
+ private Matrix projection = null;
+ private Point clickPoint = null;
+ private GLCanvas glcanvas;
+ private boolean updateVisibilities = false;
private HashSet<Mesh> meshes = new HashSet<Mesh>();
public synchronized void addMesh(Mesh m) { meshes.add(m); }
public synchronized void removeMesh(Mesh m) { meshes.remove(m); }
private HashSet<Mesh> meshes = new HashSet<Mesh>();
public synchronized void addMesh(Mesh m) { meshes.add(m); }
public synchronized void removeMesh(Mesh m) { meshes.remove(m); }
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) { }
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) { }
glcanvas.addMouseListener(this);
glcanvas.addMouseMotionListener(this);
glcanvas.addMouseWheelListener(this);
glcanvas.addMouseListener(this);
glcanvas.addMouseMotionListener(this);
glcanvas.addMouseWheelListener(this);