[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool AbstractTool.java,1.58,1.59 MoveTool.j
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Michael L. <he...@us...> - 2006-02-28 20:53:57
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3806/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java MoveTool.java ExtrudeTool.java TapeMeasureTool.java SelectTool.java Log Message: Minor tweaks before release. Some tools have temporarily been simplified: - Move/Extrusion: Objects are selected automatically when applying the tool - Tape-measure: The angle step have been turned off Index: TapeMeasureTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/TapeMeasureTool.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TapeMeasureTool.java 23 Feb 2006 21:30:14 -0000 1.8 --- TapeMeasureTool.java 28 Feb 2006 20:53:53 -0000 1.9 *************** *** 30,33 **** --- 30,36 ---- private static Logger log = Logger.getLogger(TapeMeasureTool.class); + /** Angle mode on/off */ + private static boolean angleMode = false; + /** The x axis */ private Edge xAxis = new Edge(new Vertex(-50, 0, 0), new Vertex(50, 0, 0)); *************** *** 188,192 **** if (target instanceof Edge) { currentEdge = (Edge)target; ! angling = true; Vertex minus = currentEdge.getDirection(); minus.scale(1 / minus.length()); --- 191,196 ---- if (target instanceof Edge) { currentEdge = (Edge)target; ! angling = false; ! measuring = true; Vertex minus = currentEdge.getDirection(); minus.scale(1 / minus.length()); Index: ExtrudeTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrudeTool.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ExtrudeTool.java 22 Feb 2006 09:02:45 -0000 1.12 --- ExtrudeTool.java 28 Feb 2006 20:53:53 -0000 1.13 *************** *** 22,25 **** --- 22,26 ---- import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 91,95 **** prevY = e.getY(); number = new String(); ! if (e.isShiftDown()) { super.pressed(e); } else if (!selection.isEmpty()) { --- 92,99 ---- prevY = e.getY(); number = new String(); ! if (directMode) { ! super.pressed(e); ! } ! if (e.isShiftDown() && !directMode) { super.pressed(e); } else if (!selection.isEmpty()) { *************** *** 161,164 **** --- 165,169 ---- top = extrudeSurface.extrude(length, sides); holeAnalysis(top); + Selection.primary().set(top); } } *************** *** 216,220 **** */ protected void moved(MouseEvent e) { ! if (e.isShiftDown()) { super.moved(e); } --- 221,225 ---- */ protected void moved(MouseEvent e) { ! if (e.isShiftDown() || directMode) { super.moved(e); } *************** *** 266,270 **** */ protected void released(MouseEvent e) { ! if (e.isShiftDown()) { super.released(e); } --- 271,275 ---- */ protected void released(MouseEvent e) { ! if (e.isShiftDown() && !directMode) { super.released(e); } *************** *** 287,290 **** --- 292,296 ---- holeAnalysis(current); } + Selection.primary().set(top); } } Index: SelectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectTool.java,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** SelectTool.java 14 Feb 2006 11:56:21 -0000 1.54 --- SelectTool.java 28 Feb 2006 20:53:53 -0000 1.55 *************** *** 89,109 **** */ protected void dragged(MouseEvent e) { ! if (!multipleSelection) { ! multipleSelection = true; ! } - Transformation t = glv.getView().transformation(); - last = t.unProject(new Vertex(e.getX(), View.getHeight() - e.getY(), 0.001)); - temp1 = t.unProject(new Vertex(e.getX(), View.getHeight() - pressPos[1], 0.001)); - temp2 = t.unProject(new Vertex(pressPos[0], View.getHeight() - e.getY(), 0.001)); - e1.setTo(temp1); - e2.setFrom(temp1); - e2.setTo(last); - e3.setFrom(last); - e3.setTo(temp2); - e4.setFrom(temp2); - displayConstructors(box); - findTarget(e); - glv.getView().makeTarget(target); } --- 89,105 ---- */ protected void dragged(MouseEvent e) { ! if (multipleSelection) { ! Transformation t = glv.getView().transformation(); ! last = t.unProject(new Vertex(e.getX(), View.getHeight() - e.getY(), 0.001)); ! temp1 = t.unProject(new Vertex(e.getX(), View.getHeight() - pressPos[1], 0.001)); ! temp2 = t.unProject(new Vertex(pressPos[0], View.getHeight() - e.getY(), 0.001)); ! e1.setTo(temp1); ! e2.setFrom(temp1); ! e2.setTo(last); ! e3.setFrom(last); ! e3.setTo(temp2); ! e4.setFrom(temp2); ! displayConstructors(box); } } *************** *** 138,141 **** --- 134,138 ---- if (target == null) { selection.clear(); + multipleSelection = true; } else if (e.isShiftDown()) { if (!selection.contains(target)) { Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** MoveTool.java 23 Feb 2006 16:04:13 -0000 1.40 --- MoveTool.java 28 Feb 2006 20:53:53 -0000 1.41 *************** *** 152,156 **** protected void pressed(MouseEvent e) { findTarget(e); ! if (e.isShiftDown()) { super.pressed(e); } else { --- 152,159 ---- protected void pressed(MouseEvent e) { findTarget(e); ! if (directMode) { ! super.pressed(e); ! } ! if (e.isShiftDown() && !directMode) { super.pressed(e); } else { *************** *** 297,300 **** --- 300,307 ---- return; } + if (e.isShiftDown()) { + super.dragged(e); + return; + } findRestrictions(e); if (dragPlane != null && restrictionVector != null) { Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** AbstractTool.java 11 Feb 2006 17:22:17 -0000 1.58 --- AbstractTool.java 28 Feb 2006 20:53:53 -0000 1.59 *************** *** 42,45 **** --- 42,48 ---- private static Logger log = Logger.getLogger(AbstractTool.class); + /** Simple selection mechanism **/ + protected boolean directMode = true; + /** The x axis */ protected Edge xAxis = new Edge(new Vertex(-50, 0, 0), new Vertex(50, 0, 0)); |