[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view PopupMenu.java, 1.14, 1.15
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2008-01-24 10:35:27
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26993/src/net/sourceforge/bprocessor/gl/view Modified Files: PopupMenu.java Log Message: make union is more intelligent wrt selection geometry, constraints and globals removed from D-View Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/PopupMenu.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** PopupMenu.java 23 Jan 2008 14:49:29 -0000 1.14 --- PopupMenu.java 24 Jan 2008 10:35:31 -0000 1.15 *************** *** 11,14 **** --- 11,15 ---- import java.util.Collection; import java.util.HashMap; + import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; *************** *** 511,515 **** AbstractAction action = new GeometricMenuAction(arguments, "Make Union") { public void actionPerformed(ActionEvent event) { ! Mesh mesh = new Mesh(entities); HashMap map = new HashMap(); Mesh copy = mesh.copy(map); --- 512,546 ---- AbstractAction action = new GeometricMenuAction(arguments, "Make Union") { public void actionPerformed(ActionEvent event) { ! Collection<Geometric> geometrics = new LinkedList(); ! { ! Set<Space> spaces = new HashSet(); ! Set<Surface> surfaces = new HashSet(); ! Set<Edge> edges = new HashSet(); ! Set<Vertex> vertices = new HashSet(); ! ! for (Geometric current : entities) { ! if (current instanceof Space) { ! spaces.add((Space) current); ! } else if (current instanceof Surface) { ! surfaces.add((Surface) current); ! } else if (current instanceof Edge) { ! edges.add((Edge) current); ! } else if (current instanceof Vertex) { ! vertices.add((Vertex) current); ! } ! } ! spaces.addAll(Surface.spaces(surfaces)); ! for (Space current : spaces) { ! surfaces.addAll(current.getEnvelope()); ! } ! edges.addAll(Surface.edges(surfaces)); ! vertices.addAll(Edge.vertices(edges)); ! geometrics.addAll(spaces); ! geometrics.addAll(surfaces); ! geometrics.addAll(edges); ! geometrics.addAll(vertices); ! } ! ! Mesh mesh = new Mesh(geometrics); HashMap map = new HashMap(); Mesh copy = mesh.copy(map); |