[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool PencilTool.java,1.42,1.43
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Nordholt <nor...@us...> - 2005-12-05 17:25:31
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26621 Modified Files: PencilTool.java Log Message: added construction lines when drawing Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** PencilTool.java 5 Dec 2005 07:56:50 -0000 1.42 --- PencilTool.java 5 Dec 2005 17:25:20 -0000 1.43 *************** *** 37,40 **** --- 37,58 ---- private static Logger log = Logger.getLogger(PencilTool.class); + /** The x axis */ + private Edge xAxis = new Edge("x", new Vertex("", -50, 0, 0), new Vertex("", 50, 0, 0)); + + /** The y axis */ + private Edge yAxis = new Edge("y", new Vertex("", 0, -50, 0), new Vertex("", 0, 50, 0)); + + /**The z axis */ + private Edge zAxis = new Edge("z", new Vertex("", 0, 0, -50), new Vertex("", 0, 0, 50)); + + /**The x axis constructor*/ + private Edge xConstructor; + + /**The y axis constructor*/ + private Edge yConstructor; + + /**The z axis constructor*/ + private Edge zConstructor; + /** The active */ protected Edge active = null; *************** *** 53,57 **** /** The snap vertex */ - protected Vertex snapVertex = null; --- 71,74 ---- *************** *** 173,176 **** --- 190,225 ---- } } + + /** + * Makes constructors parralel to the x y and z-axis, originating + * from a vertex. + * @param v the vertex + */ + private void makeXYZConstructors(Vertex v) { + xConstructor = new Edge("xconst", + xAxis.getFrom().add(v), + xAxis.getTo().add(v)); + xConstructor.setConstructor(true); + yConstructor = new Edge("yconst", + yAxis.getFrom().add(v), + yAxis.getTo().add(v)); + yConstructor.setConstructor(true); + zConstructor = new Edge("zconst", + zAxis.getFrom().add(v), + zAxis.getTo().add(v)); + zConstructor.setConstructor(true); + glv.getView().addTempEdge(xConstructor); + glv.getView().addTempEdge(yConstructor); + glv.getView().addTempEdge(zConstructor); + } + + /** + * Removes constructors parralel to the x y and z-axis. + */ + private void clearXYZConstructors() { + glv.getView().removeTempEdge(xConstructor); + glv.getView().removeTempEdge(yConstructor); + glv.getView().removeTempEdge(zConstructor); + } /** *************** *** 186,190 **** setSnapVertex(null); number = ""; ! { Set vertices = Project.getInstance().findByLocation --- 235,241 ---- setSnapVertex(null); number = ""; ! clearXYZConstructors(); ! makeXYZConstructors(vertex); ! { Set vertices = Project.getInstance().findByLocation *************** *** 466,474 **** Vertex n = new Vertex("", 0, 0, 1); system = new CoordinateSystem(i, j, n, origin); ! snapInSystem(system, current); } else { if (legal) { if (system != null) { ! snapInSystem(system, current); } } --- 517,525 ---- Vertex n = new Vertex("", 0, 0, 1); system = new CoordinateSystem(i, j, n, origin); ! //snapInSystem(system, current); } else { if (legal) { if (system != null) { ! //snapInSystem(system, current); } } |