[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool OffsetTool.java, 1.16, 1.17 Extrusion
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2007-09-20 07:45:07
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11863/src/net/sourceforge/bprocessor/gl/tool Modified Files: OffsetTool.java ExtrusionTool.java AbstractPencil.java Log Message: Selection clearance Index: OffsetTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OffsetTool.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** OffsetTool.java 3 Sep 2007 16:00:13 -0000 1.16 --- OffsetTool.java 20 Sep 2007 07:45:06 -0000 1.17 *************** *** 232,235 **** --- 232,244 ---- } + + /** + * {@inheritDoc} + */ + public void prepare() { + super.prepare(); + cleanSelection(); + } + /** * {@inheritDoc} Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** ExtrusionTool.java 7 Sep 2007 13:21:10 -0000 1.67 --- ExtrusionTool.java 20 Sep 2007 07:45:06 -0000 1.68 *************** *** 330,334 **** if (start == null) { - if (!Selection.primary().isEmpty()) { extrudeEdges = new ArrayList<Edge>(); --- 330,333 ---- *************** *** 477,480 **** --- 476,486 ---- * {@inheritDoc} */ + public void prepare() { + cleanSelection(); + } + + /** + * {@inheritDoc} + */ public void cleanUp() { glv.getView().removeTempVertex(to); Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** AbstractPencil.java 5 Sep 2007 11:18:50 -0000 1.95 --- AbstractPencil.java 20 Sep 2007 07:45:06 -0000 1.96 *************** *** 36,39 **** --- 36,40 ---- import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; *************** *** 428,431 **** --- 429,455 ---- /** + * See if selection is a connected contour of edges + * otherwise clear. + * + */ + protected void cleanSelection() { + Selection selection = Selection.primary(); + clean: + if (selection.size() > 1) { + List<Edge> edges = new LinkedList(); + for (Geometric current : selection) { + if (current instanceof Edge) { + edges.add((Edge) current); + } else { + selection.clear(); + break clean; + } + } + } else { + selection.clear(); + } + } + + /** * Update constructors based on start, current and incident. * @return Constructors |