[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool AltMoveTool.java, 1.3, 1.4
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Michael L. <he...@us...> - 2007-03-06 10:41:32
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24025/src/net/sourceforge/bprocessor/gl/tool Modified Files: AltMoveTool.java Log Message: Implemented a "Relate" command that creates a relation between a new coordinate-system and the selected objects. Changed alt-move to also be able to move a coordinate-system Index: AltMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AltMoveTool.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AltMoveTool.java 4 Mar 2007 23:14:40 -0000 1.3 --- AltMoveTool.java 6 Mar 2007 10:41:20 -0000 1.4 *************** *** 11,14 **** --- 11,15 ---- import java.awt.event.MouseEvent; import java.util.Collection; + import java.util.Collections; import java.util.HashMap; import java.util.LinkedList; *************** *** 120,144 **** vertices = surface.collect(); map = edgeMap(space, vertices); - Selection.primary().set(surface); system = surface.coordinateSystem(); - origin = system.getOrigin().copy(); system.onlyPlane(true); system.setActive(true); - start = findIntersection(e); - makeTarget(start); - glv.getView().addTempConstructor(system); ! View view = glv.getView(); ! Transformation trans = view.transformation(); ! double x = e.getX(); ! double y = View.getHeight() - e.getY(); ! 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); ! Plane plane = system.plane(); ! dragplane = plane.orthogonalPlane(ray); } } else { Project.getInstance().checkpoint(); --- 121,149 ---- vertices = surface.collect(); map = edgeMap(space, vertices); Selection.primary().set(surface); system = surface.coordinateSystem(); system.onlyPlane(true); system.setActive(true); ! } else if (target instanceof CoordinateSystem) { ! system = (CoordinateSystem) target; ! Selection.primary().set(system); ! vertices = Collections.EMPTY_LIST; } + origin = system.getOrigin().copy(); + start = new Intersection(origin, Intersection.SURFACE, null); + makeTarget(start); + glv.getView().addTempConstructor(system); + View view = glv.getView(); + Transformation trans = view.transformation(); + double x = e.getX(); + double y = View.getHeight() - e.getY(); + 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); + Plane plane = system.plane(); + dragplane = plane.orthogonalPlane(ray); + } else { Project.getInstance().checkpoint(); |