[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool MoveTool.java,1.56,1.57 AbstractPencil
Status: Pre-Alpha
Brought to you by:
henryml
|
From: rimestad <rim...@us...> - 2006-05-15 15:23:51
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16907/src/net/sourceforge/bprocessor/gl/tool Modified Files: MoveTool.java AbstractPencil.java Log Message: refactored getaffected from movetool to abstractPencil and turned find best aligned plane off in findIntersection Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** MoveTool.java 3 May 2006 10:04:38 -0000 1.56 --- MoveTool.java 15 May 2006 14:55:41 -0000 1.57 *************** *** 254,264 **** moveConstructor = new Edge(start.vertex(), current.vertex()); moveConstructor.setConstructor(true); - constructors.add(moveConstructor); - excluded.add(moveConstructor); Set constcopy = new HashSet(); constcopy.addAll(constructors); constructors(constcopy); Set excopy = new HashSet(); excopy.addAll(excluded); excluded(excopy); } else { --- 254,264 ---- moveConstructor = new Edge(start.vertex(), current.vertex()); moveConstructor.setConstructor(true); Set constcopy = new HashSet(); constcopy.addAll(constructors); + constcopy.add(moveConstructor); constructors(constcopy); Set excopy = new HashSet(); excopy.addAll(excluded); + excopy.add(moveConstructor); excluded(excopy); } else { *************** *** 269,294 **** /** - * Gets the set of elements that can be affected by moveing a - * set of elements. - * @param moveElements the elements to move - * @return the affected elements - */ - protected Set getAffected(Collection moveElements) { - HashSet affected = new HashSet(); - HashSet affectedEdges = new HashSet(); - HashSet affectedSurfaces = new HashSet(); - affected.addAll(collect(moveElements)); - Iterator it = affected.iterator(); - while (it.hasNext()) { - Vertex v = (Vertex)it.next(); - affectedEdges.addAll(v.getEdges()); - affectedSurfaces.addAll(v.getSurfaces()); - } - affected.addAll(affectedEdges); - affected.addAll(affectedSurfaces); - return affected; - } - - /** * Clean up */ --- 269,272 ---- Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** AbstractPencil.java 8 May 2006 08:53:14 -0000 1.30 --- AbstractPencil.java 15 May 2006 14:55:41 -0000 1.31 *************** *** 107,111 **** */ protected Intersection findIntersection(MouseEvent e) { ! plane = bestAlignedPlane(); if (start != null) { Vertex planeNormal = plane.normal(); --- 107,111 ---- */ protected Intersection findIntersection(MouseEvent e) { ! //plane = bestAlignedPlane(); if (start != null) { Vertex planeNormal = plane.normal(); *************** *** 138,142 **** Vertex lockedcopy = locked.copy(); Vertex unlocked = intersection.vertex().minus(start.vertex()); ! lockedcopy.scale(locked.dot(unlocked)); lockedcopy = lockedcopy.add(start.vertex()); return new Intersection(lockedcopy, intersection.type(), intersection.object()); --- 138,142 ---- Vertex lockedcopy = locked.copy(); Vertex unlocked = intersection.vertex().minus(start.vertex()); ! lockedcopy.scale(locked.dot(unlocked) / locked.length()); lockedcopy = lockedcopy.add(start.vertex()); return new Intersection(lockedcopy, intersection.type(), intersection.object()); *************** *** 805,808 **** --- 805,830 ---- /** + * Gets the set of elements that can be affected by moveing a + * set of elements. + * @param moveElements the elements to move + * @return the affected elements + */ + protected Set getAffected(Collection moveElements) { + HashSet affected = new HashSet(); + HashSet affectedEdges = new HashSet(); + HashSet affectedSurfaces = new HashSet(); + affected.addAll(collect(moveElements)); + Iterator it = affected.iterator(); + while (it.hasNext()) { + Vertex v = (Vertex)it.next(); + affectedEdges.addAll(v.getEdges()); + affectedSurfaces.addAll(v.getSurfaces()); + } + affected.addAll(affectedEdges); + affected.addAll(affectedSurfaces); + return affected; + } + + /** * info * @param info Info |