[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Space.java, 1.246, 1.247
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2009-10-05 10:50:39
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9443/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.246 retrieving revision 1.247 diff -C2 -d -r1.246 -r1.247 *** Space.java 23 Sep 2009 07:50:21 -0000 1.246 --- Space.java 5 Oct 2009 10:50:21 -0000 1.247 *************** *** 26,29 **** --- 26,32 ---- public class Space extends Item { + private static final boolean COPY_ON_EDIT = false; + + /** The elements (a list of spaces) */ protected HashMap<Long, Item> elements; *************** *** 1545,1584 **** */ public void edit() { ! int ns = getSurfaces().size(); ! ! if (ns == 0) { ! Collection<Surface> surfaces = new LinkedList(); ! Collection<Surface> originals = new HashSet(); ! ! Map map = new HashMap(); ! for (Surface current : envelope) { ! originals.add(current); ! originals.addAll(current.getHoles()); ! } ! for (Surface current : originals) { ! surfaces.add((Surface) current.copy(map)); ! } ! for (Surface current : originals) { ! Surface surface = (Surface) map.get(current); ! if (current.getExterior() != null) { ! Surface exterior = (Surface) map.get(current.getExterior()); ! if (exterior != null) { ! exterior.addHole(surface); } } ! } ! Collection<Edge> edges = Surface.edges(surfaces); ! Collection<Vertex> vertices = Edge.vertices(edges); ! for (Vertex current : vertices) { ! add(current); ! } ! for (Edge current : edges) { ! add(current); ! } ! for (Surface current : surfaces) { ! add(current); } } - Project.getInstance().setActiveSpace((Space) this); Selection.primary().clear(); --- 1548,1588 ---- */ public void edit() { ! if (COPY_ON_EDIT) { ! int ns = getSurfaces().size(); ! ! if (ns == 0) { ! Collection<Surface> surfaces = new LinkedList(); ! Collection<Surface> originals = new HashSet(); ! ! Map map = new HashMap(); ! for (Surface current : envelope) { ! originals.add(current); ! originals.addAll(current.getHoles()); ! } ! for (Surface current : originals) { ! surfaces.add((Surface) current.copy(map)); ! } ! for (Surface current : originals) { ! Surface surface = (Surface) map.get(current); ! if (current.getExterior() != null) { ! Surface exterior = (Surface) map.get(current.getExterior()); ! if (exterior != null) { ! exterior.addHole(surface); ! } } } ! Collection<Edge> edges = Surface.edges(surfaces); ! Collection<Vertex> vertices = Edge.vertices(edges); ! for (Vertex current : vertices) { ! add(current); ! } ! for (Edge current : edges) { ! add(current); ! } ! for (Surface current : surfaces) { ! add(current); ! } } } Project.getInstance().setActiveSpace((Space) this); Selection.primary().clear(); |