Thread: [Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view AbstractView.java,1.70,1.71 View.java,
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Nordholt <nor...@us...> - 2005-12-06 16:54:03
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5259 Modified Files: AbstractView.java View.java Log Message: made the color of construction lines seperate from other lines, had to rearrange drawAll a bit because it got to long (damn checkstyle) Index: AbstractView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/AbstractView.java,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** AbstractView.java 5 Dec 2005 17:37:53 -0000 1.70 --- AbstractView.java 6 Dec 2005 16:53:54 -0000 1.71 *************** *** 74,79 **** private static final int BACK = 2; - - /** The width of the window */ protected static double width; --- 74,77 ---- *************** *** 106,109 **** --- 104,110 ---- protected static float[] gridColor; + /** The current constructor color */ + protected static float[] constructorColor; + /** Front color for surfaces */ protected static float[] frontCcolor = new float[] {0.96f, 0.87f, 0.70f}; *************** *** 265,268 **** --- 266,270 ---- lineColor = STD_LINE_COLOR; gridColor = GRID_COLOR; + constructorColor = CONSTRUCTOR_COLOR; tempEdges = new HashSet(); tempSurfaces = new HashSet(); *************** *** 770,774 **** } } ! // Draw edges if (doDrawEdges) { gl.glLineWidth(1.0f); --- 772,776 ---- } } ! //Draw edges if (doDrawEdges) { gl.glLineWidth(1.0f); *************** *** 778,782 **** while (eit.hasNext()) { Edge e = (Edge)eit.next(); ! drawEdge(e); } //draw all temporary edges. --- 780,790 ---- while (eit.hasNext()) { Edge e = (Edge)eit.next(); ! if (e.getConstructor()) { ! gl.glColor3fv(constructorColor); ! drawEdge(e); ! gl.glColor3fv(lineColor); ! } else { ! drawEdge(e); ! } } //draw all temporary edges. *************** *** 784,788 **** while (tempEdgeIt.hasNext()) { Edge e = (Edge)tempEdgeIt.next(); ! drawEdge(e); } } --- 792,802 ---- while (tempEdgeIt.hasNext()) { Edge e = (Edge)tempEdgeIt.next(); ! if (e.getConstructor()) { ! gl.glColor3fv(constructorColor); ! drawEdge(e); ! gl.glColor3fv(lineColor); ! } else { ! drawEdge(e); ! } } } *************** *** 864,932 **** } } else { ! // HERE STARTS SELECTION MODE DRAWING ! if (selectMode == VERTICES || selectMode == ALL) { ! Iterator it = vertices.iterator(); ! gl.glColor3fv(lineColor); ! while (it.hasNext()) { ! Vertex v = (Vertex)it.next(); ! pushName(gl, v); ! drawVertexHit(v); ! popName(gl); ! } ! Iterator tempVerticesIt = tempVertices.iterator(); ! while (tempVerticesIt.hasNext()) { ! Vertex v = (Vertex)tempVerticesIt.next(); ! pushName(gl, v); ! drawVertexHit(v); ! popName(gl); ! } } ! if (selectMode == EDGES || selectMode == ALL) { ! Iterator it = edges.iterator(); ! gl.glColor3fv(lineColor); ! while (it.hasNext()) { ! Edge e = (Edge)it.next(); ! pushName(gl, e); ! drawEdge(e); ! popName(gl); ! } ! Iterator tempEdgeIt = tempEdges.iterator(); ! while (tempEdgeIt.hasNext()) { ! Edge e = (Edge)tempEdgeIt.next(); ! pushName(gl, e); ! drawEdge(e); ! popName(gl); ! } } ! if (selectMode == SURFACES || selectMode == ALL) { ! Iterator it = surfaces.iterator(); ! gl.glColor3fv(SURFACE_COLOR); ! while (it.hasNext()) { ! Surface s = (Surface)it.next(); ! pushName(gl, s); ! drawSurface(s, false); ! popName(gl); ! } ! Iterator tempSurfaceIt = tempSurfaces.iterator(); ! while (tempSurfaceIt.hasNext()) { ! Surface s = (Surface)tempSurfaceIt.next(); ! pushName(gl, s); ! drawSurface(s, false); ! popName(gl); ! } } ! if (selectMode == CLIPPLANES || selectMode == ALL) { ! Iterator it = clippingPlanes.iterator(); ! while (it.hasNext()) { ! ClippingPlane cp = (ClippingPlane)it.next(); ! gl.glDisable(GL.GL_CLIP_PLANE0 + cp.getNumber()); ! pushName(gl, cp); ! drawClipplaneFrame(cp); ! popName(gl); ! } } } } ! /** * Draw the frame of a clippingplane --- 878,956 ---- } } else { ! drawSelectionMode(vertices, edges, surfaces); ! } ! } ! ! /** ! * Draws the objects for selection ! * @param vertices the set of vertices that should be selectable ! * @param edges the set of edges that should be selectable ! * @param surfaces the set of surfaces that should be selectable ! */ ! private void drawSelectionMode(Set vertices, Set edges, Set surfaces) { ! // HERE STARTS SELECTION MODE DRAWING ! if (selectMode == VERTICES || selectMode == ALL) { ! Iterator it = vertices.iterator(); ! gl.glColor3fv(lineColor); ! while (it.hasNext()) { ! Vertex v = (Vertex)it.next(); ! pushName(gl, v); ! drawVertexHit(v); ! popName(gl); } ! Iterator tempVerticesIt = tempVertices.iterator(); ! while (tempVerticesIt.hasNext()) { ! Vertex v = (Vertex)tempVerticesIt.next(); ! pushName(gl, v); ! drawVertexHit(v); ! popName(gl); } ! } ! if (selectMode == EDGES || selectMode == ALL) { ! Iterator it = edges.iterator(); ! gl.glColor3fv(lineColor); ! while (it.hasNext()) { ! Edge e = (Edge)it.next(); ! pushName(gl, e); ! drawEdge(e); ! popName(gl); } ! Iterator tempEdgeIt = tempEdges.iterator(); ! while (tempEdgeIt.hasNext()) { ! Edge e = (Edge)tempEdgeIt.next(); ! pushName(gl, e); ! drawEdge(e); ! popName(gl); ! } ! } ! if (selectMode == SURFACES || selectMode == ALL) { ! Iterator it = surfaces.iterator(); ! gl.glColor3fv(SURFACE_COLOR); ! while (it.hasNext()) { ! Surface s = (Surface)it.next(); ! pushName(gl, s); ! drawSurface(s, false); ! popName(gl); ! } ! Iterator tempSurfaceIt = tempSurfaces.iterator(); ! while (tempSurfaceIt.hasNext()) { ! Surface s = (Surface)tempSurfaceIt.next(); ! pushName(gl, s); ! drawSurface(s, false); ! popName(gl); ! } ! } ! if (selectMode == CLIPPLANES || selectMode == ALL) { ! Iterator it = clippingPlanes.iterator(); ! while (it.hasNext()) { ! ClippingPlane cp = (ClippingPlane)it.next(); ! gl.glDisable(GL.GL_CLIP_PLANE0 + cp.getNumber()); ! pushName(gl, cp); ! drawClipplaneFrame(cp); ! popName(gl); } } } ! /** * Draw the frame of a clippingplane *************** *** 1902,1905 **** --- 1926,1937 ---- noneColor = color; } + + /** + * Sets the color of constructors. + * @param color the color + */ + public void setConstructorColor(float[] color) { + constructorColor = color; + } /** Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** View.java 3 Dec 2005 12:27:21 -0000 1.26 --- View.java 6 Dec 2005 16:53:54 -0000 1.27 *************** *** 66,69 **** --- 66,72 ---- /** Used for target objects */ public static final float[] TARGET_COLOR = new float[] {0.8f, 0.8f, 0.1f}; + + /** Used for constructor objects */ + public static final float [] CONSTRUCTOR_COLOR = new float[] {0.8f, 0.7f, 0.6f, 0.50f}; /** Can be used for setting wireframe mode */ *************** *** 298,301 **** --- 301,310 ---- /** + * Sets the color of constructors. + * @param color the color + */ + public void setConstructorColor(float[] color); + + /** * Adds a temporary surface to be drawn. * @param s the surface |