[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool AbstractPencil.java,1.28,1.29
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Michael L. <he...@us...> - 2006-05-05 14:08:51
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28928a/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Log Message: Plane.coordinateSystem() implemented Orthogonal Constructor implemented in first version that only works with xy plane Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** AbstractPencil.java 5 May 2006 12:14:01 -0000 1.28 --- AbstractPencil.java 5 May 2006 14:08:38 -0000 1.29 *************** *** 24,27 **** --- 24,28 ---- import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.gl.view.View; + import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometry; *************** *** 376,379 **** --- 377,405 ---- glv.getView().changeColor(parrallel, new float[] {255f / 255f, 153f / 255f, 0}); constructors.add(parrallel); + + Plane xy = new Plane(0, 0, 1, 0); + CoordinateSystem system = xy.coordinateSystem(); + Vertex direction = parrallel.getDirection(); + direction = system.translate(direction); + double x = direction.getX(); + double y = direction.getY(); + direction.setX(-y); + direction.setY(x); + system.unTranslate(direction); + direction.scale(50 / direction.length()); + Edge orthogonal = null; + if (start != null) { + orthogonal = new Edge(start.vertex().minus(direction), start.vertex().add(direction)); + } else { + if (incident != null) { + orthogonal = new Edge(incident.vertex().minus(direction), + incident.vertex().add(direction)); + } + } + if (orthogonal != null) { + orthogonal.setConstructor(true); + glv.getView().changeColor(orthogonal, new float[] {255f / 255f, 153f / 255f, 0}); + constructors.add(orthogonal); + } } } |