Thread: [Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view Display.java, 1.13, 1.14
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2007-09-29 13:06:36
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30594/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: drawing lonely vertices and some color adjustments Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Display.java 28 Sep 2007 13:51:03 -0000 1.13 --- Display.java 29 Sep 2007 13:06:39 -0000 1.14 *************** *** 56,60 **** --- 56,63 ---- private static float[] alice = new float[] {0.94f, 0.97f, 1}; private static float[] cornflower = new float[] {100f / 255, 149f / 255, 237f / 255}; + private static float[] babyblue = new float[] {224f / 255, 255f / 255, 255f / 255}; + private static float[] middleblue = new float[] {0.11f, 0.72f, 0.67f, 0.0f}; + private static float[] misty = new float[] {255f / 280, 228f / 280, 225f / 280}; private static byte[] highlight = new byte[128]; *************** *** 86,90 **** byte b3 = (byte) 0x00; for (int i = 0; i < highlight.length; i++) { ! int d = ((int)(i / 4)) % 4; if (d == 0) { --- 89,93 ---- byte b3 = (byte) 0x00; for (int i = 0; i < highlight.length; i++) { ! int d = (i / 4) % 4; if (d == 0) { *************** *** 224,228 **** gl.glNormal3d(n.getX(), n.getY(), n.getZ()); if (front.isVoid()) { ! gl.glColor3fv(cornflower, 0); } else if (front.isConstructionSpace()) { gl.glColor3fv(Defaults.getFrontColor(), 0); --- 227,231 ---- gl.glNormal3d(n.getX(), n.getY(), n.getZ()); if (front.isVoid()) { ! gl.glColor3fv(misty, 0); } else if (front.isConstructionSpace()) { gl.glColor3fv(Defaults.getFrontColor(), 0); *************** *** 239,243 **** gl.glNormal3d(-n.getX(), -n.getY(), -n.getZ()); if (back.isVoid()) { ! gl.glColor3fv(cornflower, 0); } else if (back.isConstructionSpace()) { gl.glColor3fv(Defaults.getFrontColor(), 0); --- 242,246 ---- gl.glNormal3d(-n.getX(), -n.getY(), -n.getZ()); if (back.isVoid()) { ! gl.glColor3fv(misty, 0); } else if (back.isConstructionSpace()) { gl.glColor3fv(Defaults.getFrontColor(), 0); *************** *** 278,281 **** --- 281,285 ---- private static void drawEdges(Collection<Edge> edges, boolean active) { + Collection<Edge> stippled = new LinkedList(); if (active) { gl.glColor3fv(black, 0); *************** *** 285,289 **** gl.glLineWidth(1.0f); for (Edge current : edges) { ! draw(current); } } --- 289,305 ---- gl.glLineWidth(1.0f); for (Edge current : edges) { ! if (current.getStrippled()) { ! stippled.add(current); ! } else { ! draw(current); ! } ! } ! if (!stippled.isEmpty()) { ! gl.glColor3fv(middleblue, 0); ! gl.glEnable(GL.GL_LINE_STIPPLE); ! for (Edge current : stippled) { ! draw(current); ! } ! gl.glDisable(GL.GL_LINE_STIPPLE); } } *************** *** 377,383 **** Collection<Edge> edges = new LinkedList(); Collection<Vertex> vertices = new LinkedList(); - Collection<Vertex> loners = new LinkedList(); - - for (Space current : space.getElements()) { --- 393,396 ---- *************** *** 427,439 **** } } { ! Set<Vertex> visible = new HashSet(); ! for (Edge current : edges) { ! visible.add(current.getFrom()); ! visible.add(current.getTo()); } ! for (Vertex current : visible) { ! if (!hidden.contains(current)) { ! vertices.add(current); } } --- 440,469 ---- } } + { ! if (selecting()) { ! Set<Vertex> visible = new HashSet(); ! for (Edge current : edges) { ! visible.add(current.getFrom()); ! visible.add(current.getTo()); ! } ! for (Vertex current : visible) { ! if (!hidden.contains(current)) { ! vertices.add(current); ! } ! } } ! ! // FIXME: The set of lonely vertices should be cached. ! Set<Vertex> mark = new HashSet(); ! for (Edge current : space.getEdges()) { ! mark.add(current.getFrom()); ! mark.add(current.getTo()); ! } ! for (Vertex current : space.getVertices()) { ! if (!mark.contains(current)) { ! if (!hidden.contains(current)) { ! vertices.add(current); ! } } } *************** *** 465,469 **** selectVertices(vertices); } else { ! drawVertices(loners); } --- 495,499 ---- selectVertices(vertices); } else { ! drawVertices(vertices); } |