[Bprocessor-commit] gui/src/net/sourceforge/bprocessor/gui PopupMenu.java, 1.13, 1.14
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2006-10-31 13:24:28
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22865/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: changed see above below to focus on, and roll are now aligned with the first edge in the surface Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** PopupMenu.java 31 Oct 2006 10:29:59 -0000 1.13 --- PopupMenu.java 31 Oct 2006 13:24:20 -0000 1.14 *************** *** 68,72 **** if (c.size() == 1) { Surface s = (Surface)c.iterator().next(); ! AbstractAction fromAbove = new EntityMenuAction(s, "See from above") { public void actionPerformed(ActionEvent arg0) { Surface s = (Surface)entity; --- 68,72 ---- if (c.size() == 1) { Surface s = (Surface)c.iterator().next(); ! AbstractAction focus = new EntityMenuAction(s, "Focus on") { public void actionPerformed(ActionEvent arg0) { Surface s = (Surface)entity; *************** *** 78,102 **** double[] dir = new double[]{cam[0] - center[0], cam[1] - center[1], cam[2] - center[2]}; Vertex r = new Vertex(dir); ! Vertex right = r.cross(n); ! if (right.length() > 0.1) { ! double angle = r.angle(n); ! System.out.println(angle); ! Geometry.rotate(angle, right.getX(), right.getY(), right.getZ(), ! current.getRoll(), new double[]{0, 0, 0}); ! current.setCenter(new double[]{c.getX(), c.getY(), c.getZ()}); ! current.setCamera(new double[]{c.getX() + n.getX(), c.getY() + n.getY(), ! c.getZ() + n.getZ()}); ! Project.getInstance().getCurrentCamera().viewEntireModel(1); ! } ! } ! }; ! jm.add(fromAbove); ! AbstractAction fromBelow = new EntityMenuAction(s, "See from below") { ! public void actionPerformed(ActionEvent arg0) { ! Vertex n = ((Surface)entity).normal(); ! } }; ! jm.add(fromBelow); } if (c.size() == 2) { --- 78,91 ---- double[] dir = new double[]{cam[0] - center[0], cam[1] - center[1], cam[2] - center[2]}; Vertex r = new Vertex(dir); ! n = r.projectOnto(n); ! Vertex roll = ((Edge)(s.getEdges().get(0))).getDirection(); ! roll.normalize(); ! current.setRoll(new double[]{roll.getX(), roll.getY(), roll.getZ()}); ! current.setCenter(new double[]{c.getX(), c.getY(), c.getZ()}); ! current.setCamera(new double[]{c.getX() + n.getX(), c.getY() + n.getY(), c.getZ() + n.getZ()}); ! Project.getInstance().getCurrentCamera().viewEntireModel(1); } }; ! jm.add(focus); } if (c.size() == 2) { |