[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool ExtrudeTool.java,1.10,1.11 RotationToo
Status: Pre-Alpha
Brought to you by:
henryml
From: Nordholt <nor...@us...> - 2006-02-17 09:56:16
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5100/tool Modified Files: ExtrudeTool.java RotationTool.java Log Message: holding down shift is now also required to make selection in rotationtool and extrudetool Index: ExtrudeTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrudeTool.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ExtrudeTool.java 16 Feb 2006 21:11:35 -0000 1.10 --- ExtrudeTool.java 17 Feb 2006 09:56:06 -0000 1.11 *************** *** 91,107 **** prevY = e.getY(); number = new String(); ! super.pressed(e); ! if (target instanceof Surface) { ! sides = new HashSet(); ! extrudeSurface = (Surface) target; ! View view = glv.getView(); ! Transformation trans = view.transformation(); ! double x = prevX; ! double y = View.getHeight() - prevY; ! Vertex near = new Vertex(x, y, 0.0); ! Vertex far = new Vertex(x, y, 1.0); ! Edge ray = new Edge(near, far); ! ray = trans.unProject(ray); ! dragplane = extrudeSurface.plane().orthogonalPlane(ray); } } --- 91,110 ---- prevY = e.getY(); number = new String(); ! if (e.isShiftDown()) { ! super.pressed(e); ! } else if (selection != null && !selection.isEmpty()) { ! if (target instanceof Surface) { ! sides = new HashSet(); ! extrudeSurface = (Surface) target; ! View view = glv.getView(); ! Transformation trans = view.transformation(); ! double x = prevX; ! double y = View.getHeight() - prevY; ! Vertex near = new Vertex(x, y, 0.0); ! Vertex far = new Vertex(x, y, 1.0); ! Edge ray = new Edge(near, far); ! ray = trans.unProject(ray); ! dragplane = extrudeSurface.plane().orthogonalPlane(ray); ! } } } Index: RotationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RotationTool.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** RotationTool.java 11 Feb 2006 18:00:39 -0000 1.11 --- RotationTool.java 17 Feb 2006 09:56:06 -0000 1.12 *************** *** 86,123 **** */ protected void pressed(MouseEvent e) { ! super.pressed(e); ! if (target != null && target instanceof Entity) { ! // If one edge in a rotate circle are selected all should be ! if (xCircle.contains(target)) { ! axis = X_AXIS; ! clearConstructors(zCircle); ! clearConstructors(yCircle); ! } else if (yCircle.contains(target)) { ! axis = Y_AXIS; ! clearConstructors(xCircle); ! clearConstructors(zCircle); ! } else if (zCircle.contains(target)) { ! axis = Z_AXIS; ! clearConstructors(xCircle); ! clearConstructors(yCircle); ! } else { ! // ther were no rotation selection ! axis = 0; ! ! } ! if (axis != 0) { ! // do the rotation preparation and wait for drag events ! initial = findInitial(target, e); ! from = initial.copy(); ! prev = initial; ! Edge edge = new Edge(center, initial); ! edge.setConstructor(true); ! guide.clear(); ! guide.add(edge); ! displayConstructors(guide); } - } else { - clear(); } } --- 86,126 ---- */ protected void pressed(MouseEvent e) { ! if (e.isShiftDown()) { ! super.pressed(e); ! } else { ! if (target != null && target instanceof Entity) { ! // If one edge in a rotate circle are selected all should be ! if (xCircle.contains(target)) { ! axis = X_AXIS; ! clearConstructors(zCircle); ! clearConstructors(yCircle); ! } else if (yCircle.contains(target)) { ! axis = Y_AXIS; ! clearConstructors(xCircle); ! clearConstructors(zCircle); ! } else if (zCircle.contains(target)) { ! axis = Z_AXIS; ! clearConstructors(xCircle); ! clearConstructors(yCircle); ! } else { ! // ther were no rotation selection ! axis = 0; ! ! } ! if (axis != 0) { ! // do the rotation preparation and wait for drag events ! initial = findInitial(target, e); ! from = initial.copy(); ! prev = initial; ! Edge edge = new Edge(center, initial); ! edge.setConstructor(true); ! guide.clear(); ! guide.add(edge); ! displayConstructors(guide); ! } ! } else { ! clear(); } } } *************** *** 170,182 **** */ protected void dragged(MouseEvent e) { ! super.dragged(e); ! if (target != null && ! (xCircle.contains(target) || yCircle.contains(target) || zCircle.contains(target))) { ! Vertex ny = findInitial(target, e); ! initial.setX(ny.getX()); ! initial.setY(ny.getY()); ! initial.setZ(ny.getZ()); ! ! prev = initial; } } --- 173,188 ---- */ protected void dragged(MouseEvent e) { ! if (e.isShiftDown()) { ! super.dragged(e); ! } else { ! if (target != null && ! (xCircle.contains(target) || yCircle.contains(target) || zCircle.contains(target))) { ! Vertex ny = findInitial(target, e); ! initial.setX(ny.getX()); ! initial.setY(ny.getY()); ! initial.setZ(ny.getZ()); ! ! prev = initial; ! } } } |