[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view View.java,1.64,1.65
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2006-02-23 14:59:46
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1183/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Small changes Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** View.java 22 Feb 2006 15:05:31 -0000 1.64 --- View.java 23 Feb 2006 14:59:41 -0000 1.65 *************** *** 762,766 **** if (e.getConstructor()) { gl.glColor3fv(constructorColor); ! drawEdge(e); gl.glColor3fv(lineColor); } else { --- 762,766 ---- if (e.getConstructor()) { gl.glColor3fv(constructorColor); ! drawConstructor(e); gl.glColor3fv(lineColor); } else { *************** *** 774,778 **** if (e.getConstructor()) { gl.glColor3fv(constructorColor); ! drawEdge(e); gl.glColor3fv(lineColor); } else { --- 774,778 ---- if (e.getConstructor()) { gl.glColor3fv(constructorColor); ! drawConstructor(e); gl.glColor3fv(lineColor); } else { *************** *** 813,822 **** gl.glColor3fv(lineColor); } - gl.glBegin(GL.GL_LINES); gl.glLineWidth(1.0f); ! gl.glVertex3d(from.getX(), from.getY(), from.getZ()); ! gl.glVertex3d(to.getX(), to.getY(), to.getZ()); ! gl.glEnd(); ! } --- 813,818 ---- gl.glColor3fv(lineColor); } gl.glLineWidth(1.0f); ! drawEdge(activeEdge); } *************** *** 837,842 **** if (doDraw) { gl.glEnable(GL.GL_LINE_STIPPLE); - gl.glBegin(GL.GL_LINES); gl.glLineWidth(1.0f); gl.glVertex3d(snapVertex.getX(), snapVertex.getY(), snapVertex.getZ()); gl.glVertex3d(to.getX(), to.getY(), to.getZ()); --- 833,838 ---- if (doDraw) { gl.glEnable(GL.GL_LINE_STIPPLE); gl.glLineWidth(1.0f); + gl.glBegin(GL.GL_LINES); gl.glVertex3d(snapVertex.getX(), snapVertex.getY(), snapVertex.getZ()); gl.glVertex3d(to.getX(), to.getY(), to.getZ()); *************** *** 879,888 **** gl.glDisable(GL.GL_DEPTH_TEST); Edge e = (Edge) o; ! Vertex to = e.getTo(); ! Vertex from = e.getFrom(); ! gl.glBegin(GL.GL_LINES); ! gl.glVertex3d(to.getX(), to.getY(), to.getZ()); ! gl.glVertex3d(from.getX(), from.getY(), from.getZ()); ! gl.glEnd(); gl.glEnable(GL.GL_DEPTH_TEST); } else if (o instanceof Surface) { --- 875,879 ---- gl.glDisable(GL.GL_DEPTH_TEST); Edge e = (Edge) o; ! drawEdge(e); gl.glEnable(GL.GL_DEPTH_TEST); } else if (o instanceof Surface) { *************** *** 1416,1419 **** --- 1407,1419 ---- + /** + * Draw a constructor edge + * @param e Edge + */ + private void drawConstructor(Edge e) { + gl.glEnable(GL.GL_LINE_STIPPLE); + drawEdge(e); + gl.glDisable(GL.GL_LINE_STIPPLE); + } /** *************** *** 1422,1446 **** */ private void drawEdge(Edge e) { - Vertex to = e.getTo(); Vertex from = e.getFrom(); if (to != null && from != null) { ! if (e.getConstructor()) { ! gl.glEnable(GL.GL_LINE_STIPPLE); ! gl.glBegin(GL.GL_LINE_STRIP); ! gl.glVertex3d(to.getX(), ! to.getY(), ! to.getZ()); ! gl.glVertex3d(from.getX(), ! from.getY(), ! from.getZ()); ! gl.glEnd(); ! gl.glDisable(GL.GL_LINE_STIPPLE); ! } else { ! gl.glBegin(GL.GL_LINE_STRIP); ! gl.glVertex3d(to.getX(), to.getY(), to.getZ()); ! gl.glVertex3d(from.getX(), from.getY(), from.getZ()); ! gl.glEnd(); ! } } } --- 1422,1432 ---- */ private void drawEdge(Edge e) { Vertex to = e.getTo(); Vertex from = e.getFrom(); if (to != null && from != null) { ! gl.glBegin(GL.GL_LINE_STRIP); ! gl.glVertex3d(to.getX(), to.getY(), to.getZ()); ! gl.glVertex3d(from.getX(), from.getY(), from.getZ()); ! gl.glEnd(); } } *************** *** 1475,1482 **** private void drawEdges(GLDrawable gld, Collection edges) { GL gl = gld.getGL(); - GLU glu = gld.getGLU(); - - Iterator it = edges.iterator(); gl.glColor3fv(lineColor); while (it.hasNext()) { Edge e = (Edge)it.next(); --- 1461,1466 ---- private void drawEdges(GLDrawable gld, Collection edges) { GL gl = gld.getGL(); gl.glColor3fv(lineColor); + Iterator it = edges.iterator(); while (it.hasNext()) { Edge e = (Edge)it.next(); |