[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view View.java, 1.140, 1.141
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2006-08-23 13:43:25
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17565/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Mad some changed to the naming scheme Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.140 retrieving revision 1.141 diff -C2 -d -r1.140 -r1.141 *** View.java 18 Aug 2006 08:24:16 -0000 1.140 --- View.java 23 Aug 2006 13:43:15 -0000 1.141 *************** *** 876,879 **** --- 876,881 ---- grid(cs); + drawConstructorPlanes(); + gl.glDisable(GL.GL_DEPTH_TEST); { *************** *** 1063,1066 **** --- 1065,1086 ---- /** + * Draw constructor planes. + * + */ + private void drawConstructorPlanes() { + Space active = Project.getInstance().getActiveSpace(); + while (active != null) { + Iterator iter = active.getConstructors().iterator(); + while (iter.hasNext()) { + Constructor current = (Constructor) iter.next(); + if (current instanceof CoordinateSystem) { + drawConstructorPlane((CoordinateSystem) current); + } + } + active = active.getOwner(); + } + } + + /** * Draw all constructors in this level and all above */ *************** *** 1132,1135 **** --- 1152,1185 ---- /** + * + * @param cs CoordinateSystem + */ + private void drawConstructorPlane(CoordinateSystem cs) { + if (cs.isActive() && cs.onlyPlane()) { + Vertex i = cs.getI(); + Vertex j = cs.getJ(); + Vertex origin = cs.getOrigin(); + Vertex v = i.copy(); + Vertex u = j.copy(); + v.scale(5); + u.scale(5); + Vertex a = origin.add(u).minus(v); + Vertex b = origin.add(u).add(v); + Vertex c = origin.minus(u).add(v); + Vertex d = origin.minus(u).minus(v); + gl.glColor4fv(CLIP_PLANE_INTERIOR_COLOR); + gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); + gl.glPolygonOffset(1f, 1f); + gl.glBegin(GL.GL_QUADS); + gl.glVertex3d(a.getX(), a.getY(), a.getZ()); + gl.glVertex3d(b.getX(), b.getY(), b.getZ()); + gl.glVertex3d(c.getX(), c.getY(), c.getZ()); + gl.glVertex3d(d.getX(), d.getY(), d.getZ()); + gl.glEnd(); + gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); + } + } + + /** * draw the coordinatesystem * @param cs The coordinatesystem *************** *** 1159,1162 **** --- 1209,1213 ---- drawConstructorLine(cs.getOrigin(), j, dist); } + active = false; if (cs.isActive() && active) { Vertex origin = cs.getOrigin(); |