[Bprocessor-commit] gui/src/net/sourceforge/bprocessor/gui PopupMenu.java, 1.75, 1.76
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2007-11-22 15:36:40
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19866/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: Command to show normals on surfaces in a space Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** PopupMenu.java 21 Nov 2007 13:50:56 -0000 1.75 --- PopupMenu.java 22 Nov 2007 15:36:40 -0000 1.76 *************** *** 308,311 **** --- 308,334 ---- } { + AbstractAction action = new SpaceMenuAction(sp, "Normals") { + public void actionPerformed(ActionEvent event) { + Space union = new Space("Normals", Space.CONSTRUCTION, true); + for (Surface surface : space.getSurfaces()) { + Vertex normal = surface.normal(); + Vertex origin = surface.center(); + + CoordinateSystem system = CoordinateSystem.systemFor(origin, normal); + + Space pyramid = Command.Pyramid.pyramid(0.05, 0.05, 0.2); + for (Vertex current : pyramid.getVertices()) { + current.set(system.unTranslate(current)); + } + union.add(pyramid); + } + Project.getInstance().world().add(union); + Project.getInstance().changed(Project.getInstance()); + Project.getInstance().checkpoint(); + } + }; + menu.add(action); + } + { AbstractAction action = new SpaceMenuAction(sp, "Make Component") { public void actionPerformed(ActionEvent event) { *************** *** 638,641 **** --- 661,673 ---- menu.add(action); } + { + AbstractAction action = new AbstractAction("Pyramid...") { + public void actionPerformed(ActionEvent event) { + Command command = new Command.Pyramid(); + AttributeView.instance().display(command); + } + }; + menu.add(action); + } return menu; } |