[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Space.java, 1.177, 1.178
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2007-09-28 14:07:00
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22153/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Made some improvements on simplify to split edges at new vertex crossings Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.177 retrieving revision 1.178 diff -C2 -d -r1.177 -r1.178 *** Space.java 27 Sep 2007 12:20:27 -0000 1.177 --- Space.java 28 Sep 2007 14:06:45 -0000 1.178 *************** *** 160,163 **** --- 160,166 ---- if (fl != null) { fl.add(current); + } else { + log.error(from + " werent in the space but were part of edge " + current + + " in space " + this); } Vertex to = current.getTo(); *************** *** 2674,2677 **** --- 2677,2685 ---- /** * Simplify this space + * 1) remove equivalent vertexes (vertex at same position) + * 2) split edges at vertex crossings + * 2) remove edges of length 0 + * 3) remove equivalent edges (edges with same vertexes) + * 4) remove invalid surfaces */ public void simplify() { *************** *** 2710,2713 **** --- 2718,2722 ---- Collection<Collection<Vertex>> equivalences = new LinkedList(); { + //Remove eqivalent vertexes Vertex leader = null; Collection<Vertex> equivalence = null; *************** *** 2763,2766 **** --- 2772,2787 ---- } { + //split edges at coinciding vertices + for (Vertex v : getVertices()) { + for (Edge e : getEdges()) { + if (e.coincides(v)) { + e.split(v); + break; + } + } + } + } + { + //remove edges of length 0 Map<Edge, Collection<Surface>> surfacemap = new HashMap(); for (Edge edge : getEdges()) { *************** *** 2774,2777 **** --- 2795,2799 ---- Collection<Edge> deletion = new LinkedList(); Set<Surface> empties = new HashSet(); + Collection<Surface> affected = new HashSet<Surface>(); for (Edge current : getEdges()) { if (current.from == current.to) { *************** *** 2794,2797 **** --- 2816,2821 ---- } { + // collapse overlaying edges into one, check if resulting surfaces + // remove surfaces that share all edges so that there are only one left Map<Vertex, List<Edge>> edgemap = new HashMap(); for (Vertex current : getVertices()) { |