[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool MoveTool.java,1.45,1.46 MultiExtrudeTo
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2006-03-12 21:10:40
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10095/src/net/sourceforge/bprocessor/gl/tool Modified Files: MoveTool.java MultiExtrudeTool.java Log Message: Some changes MoveTool and MultiExtrudeTool to move target without selection Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** MoveTool.java 12 Mar 2006 12:33:00 -0000 1.45 --- MoveTool.java 12 Mar 2006 21:10:29 -0000 1.46 *************** *** 131,135 **** */ protected void update() { ! Iterator iter = selection.iterator(); while (iter.hasNext()) { Object o = iter.next(); --- 131,135 ---- */ protected void update() { ! Iterator iter = moveEntities.iterator(); while (iter.hasNext()) { Object o = iter.next(); *************** *** 154,158 **** { clearConstructors(moveConstructors); ! if (target != null) { if (moveMode != THREE_CLICK) { initial = findInitial(target, e); --- 154,159 ---- { clearConstructors(moveConstructors); ! if (target != null) { ! moveEntities = new HashSet(); if (moveMode != THREE_CLICK) { initial = findInitial(target, e); *************** *** 164,177 **** vertices = new HashSet(); ! moveEntities = selection; if (moveMode == CONTROLLED) { ! if (!selection.isEmpty()) { ! Iterator it = selection.iterator(); controlled = (Entity)it.next(); } ! selection.clear(); ! selection.add(controlled); } ! collect(selection, vertices); } else { threeClickMove(e); --- 165,184 ---- vertices = new HashSet(); ! ! if (selection.isEmpty()) { ! moveEntities.add(target); ! } else { ! moveEntities.addAll(selection); ! } ! if (moveMode == CONTROLLED) { ! if (!moveEntities.isEmpty()) { ! Iterator it = moveEntities.iterator(); controlled = (Entity)it.next(); } ! moveEntities.clear(); ! moveEntities.add(controlled); } ! collect(moveEntities, vertices); } else { threeClickMove(e); *************** *** 186,190 **** private void threeClickMove(MouseEvent e) { vertices = new HashSet(); ! collect(selection, vertices); if (numberOfClicks == 1) { from = findInitial(target, e); --- 193,198 ---- private void threeClickMove(MouseEvent e) { vertices = new HashSet(); ! moveEntities.addAll(selection); ! collect(moveEntities, vertices); if (numberOfClicks == 1) { from = findInitial(target, e); *************** *** 195,199 **** } else if (numberOfClicks == 2) { Vertex movement = findInitial(target, e).minus(from); ! move(vertices, movement); glv.getView().removeTempEdge(threeClickConst); threeClickConst = null; --- 203,207 ---- } else if (numberOfClicks == 2) { Vertex movement = findInitial(target, e).minus(from); ! move(moveEntities, movement); glv.getView().removeTempEdge(threeClickConst); threeClickConst = null; *************** *** 274,277 **** --- 282,286 ---- protected void moved(MouseEvent e) { findTarget(e); + glv.getView().makeTarget(target); if (moveMode == THREE_CLICK && threeClickConst != null) { if (target != null) { Index: MultiExtrudeTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MultiExtrudeTool.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** MultiExtrudeTool.java 12 Mar 2006 12:33:01 -0000 1.8 --- MultiExtrudeTool.java 12 Mar 2006 21:10:29 -0000 1.9 *************** *** 44,47 **** --- 44,50 ---- private Surface top, extrudeSurface; + /** The surfaces to extrude */ + private Set surfaces; + /** A vertex-direction map */ private Map v2dir; *************** *** 82,98 **** v2dir = null; elements = new HashSet(); if (target instanceof Surface) { ! extrudeSurface = (Surface)target; ! View view = glv.getView(); ! Transformation trans = view.transformation(); ! pressX = e.getX(); ! pressY = e.getY(); ! double x = pressX; ! double y = View.getHeight() - pressY; ! 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); } } --- 85,107 ---- v2dir = null; elements = new HashSet(); + surfaces = new HashSet(); + if (target instanceof Surface) { ! if (Selection.primary().isEmpty() || Selection.primary().contains(target)) { ! extrudeSurface = (Surface)target; ! surfaces.addAll(Selection.primary()); ! surfaces.add(extrudeSurface); ! View view = glv.getView(); ! Transformation trans = view.transformation(); ! pressX = e.getX(); ! pressY = e.getY(); ! double x = pressX; ! double y = View.getHeight() - pressY; ! 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); ! } } } *************** *** 145,149 **** if ((e.getX() - pressX) * (e.getX() - pressX) + (e.getY() - pressY) * (e.getY() - pressY) > 16) { ! elements = makeExtrusion(Selection.primary()); } } --- 154,158 ---- if ((e.getX() - pressX) * (e.getX() - pressX) + (e.getY() - pressY) * (e.getY() - pressY) > 16) { ! elements = makeExtrusion(surfaces); } } *************** *** 177,181 **** // we have to remove the extrusion and make a new one remove(elements); ! elements = makeExtrusion(Selection.primary()); direction = normDotDelta; if (v2dir != null) { --- 186,190 ---- // we have to remove the extrusion and make a new one remove(elements); ! elements = makeExtrusion(surfaces); direction = normDotDelta; if (v2dir != null) { *************** *** 237,241 **** holeAnalysis(current); } ! Selection.primary().addAll(tops); } } --- 246,250 ---- holeAnalysis(current); } ! // Selection.primary().addAll(tops); } } *************** *** 281,285 **** protected void moved(MouseEvent e) { findTarget(e); ! } } --- 290,298 ---- protected void moved(MouseEvent e) { findTarget(e); ! if (target instanceof Surface) { ! glv.getView().makeTarget(target); ! } else { ! glv.getView().makeTarget(null); ! } } } |