[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view AbstractView.java,1.30,1.31
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2005-09-21 07:30:00
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9225/src/net/sourceforge/bprocessor/gl/view Modified Files: AbstractView.java Log Message: Index: AbstractView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/AbstractView.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** AbstractView.java 20 Sep 2005 13:14:09 -0000 1.30 --- AbstractView.java 21 Sep 2005 07:29:51 -0000 1.31 *************** *** 8,11 **** --- 8,12 ---- import net.sourceforge.bprocessor.gl.GLView; + import net.sourceforge.bprocessor.gl.tool.SelectTool; import net.sourceforge.bprocessor.model.Plane; *************** *** 264,268 **** //drawTextBox(200, 200, "Space 1"); ! gl.glGetIntegerv(GL.GL_RENDER_MODE, mode); --- 265,271 ---- //drawTextBox(200, 200, "Space 1"); ! if (glv.getTool() instanceof SelectTool) { ! decorateSelection(); ! } gl.glGetIntegerv(GL.GL_RENDER_MODE, mode); *************** *** 340,343 **** --- 343,378 ---- } + + /** + * Decorate Surface + * @param surface The Surface to decorate + */ + void decorateSurface(Surface surface) { + Vertex from = surface.getFirtVertex(); + Vertex to = surface.normal(); + to.scale(1 / to.length()); + to.setX(from.getX() + to.getX()); + to.setY(from.getY() + to.getY()); + to.setZ(from.getZ() + to.getZ()); + Edge edge = new Edge("", from, to); + gl.glColor3d(0.0, 1.0, 0.0); + drawEdge(edge); + } + + /** + * Draw special decoration on selection + * + */ + void decorateSelection() { + List selection = glv.getTool().getSelection(); + Iterator iter = selection.iterator(); + while (iter.hasNext()) { + Object current = iter.next(); + if (current instanceof Surface) { + decorateSurface((Surface) current); + } + } + } + /** * Draw all the existing elements *************** *** 574,578 **** Vertex to = e.getTo(); Vertex from = e.getFrom(); - int name = e.getId().intValue(); if (to != null && from != null) { gl.glBegin(GL.GL_LINE_STRIP); --- 609,612 ---- |