[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Space.java, 1.140, 1.141
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Michael L. <he...@us...> - 2007-05-11 11:35:08
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10271/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Improved simplification after move Ð empty edges now removed as well as duplicate vertices Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.140 retrieving revision 1.141 diff -C2 -d -r1.140 -r1.141 *** Space.java 11 May 2007 10:44:30 -0000 1.140 --- Space.java 11 May 2007 11:35:08 -0000 1.141 *************** *** 2841,2844 **** --- 2841,2884 ---- } } + { + Map<Edge, Collection<Surface>> surfacemap = new HashMap(); + for (Edge edge : getEdges()) { + surfacemap.put(edge, new LinkedList()); + } + for (Surface surface : getSurfaces()) { + for (Edge current : surface.getEdges()) { + surfacemap.get(current).add(surface); + } + } + Collection<Edge> deletion = new LinkedList(); + for (Edge current : getEdges()) { + if (current.from == current.to) { + deletion.add(current); + } + } + for (Edge current : deletion) { + Collection<Surface> adjacent = surfacemap.get(current); + for (Surface surface : adjacent) { + surface.getEdges().remove(current); + } + remove(current); + } + } + { + + Map<Vertex, List<Edge>> edgemap = new HashMap(); + for (Vertex current : getVertices()) { + edgemap.put(current, new LinkedList()); + } + for (Edge current : getEdges()) { + edgemap.get(current.from).add(current); + edgemap.get(current.to).add(current); + } + Collection<Collection<Edge>> equivalence = new LinkedList(); + for (Vertex vertex : getVertices()) { + List<Edge> flst = edgemap.get(vertex); + } + } + Project.getInstance().changed(Project.getInstance()); } |