[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool FinalMoveTool.java, 1.19, 1.20
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2007-09-05 13:57:26
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28911/src/net/sourceforge/bprocessor/gl/tool Modified Files: FinalMoveTool.java Log Message: Started implementation of plane-constraints in move tool Index: FinalMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** FinalMoveTool.java 4 Sep 2007 13:37:18 -0000 1.19 --- FinalMoveTool.java 5 Sep 2007 13:57:26 -0000 1.20 *************** *** 12,17 **** --- 12,19 ---- import java.util.Collection; import java.util.HashMap; + import java.util.HashSet; import java.util.LinkedList; import java.util.Map; + import java.util.Set; import java.util.Stack; *************** *** 25,28 **** --- 27,31 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; + import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; import net.sourceforge.bprocessor.model.Space; *************** *** 55,66 **** ! private Map<Vertex, Vertex> computeMap(Collection<Vertex> vertices) { ! if (vertices.size() > 0) { ! Space space = vertices.iterator().next().getOwner(); ! return space.directionMap(vertices); ! } else { ! return null; ! } ! } private Map<Vertex, Direction> computeDirectionMap(Collection<Vertex> vertices) { --- 58,62 ---- ! private Map<Vertex, Direction> computeDirectionMap(Collection<Vertex> vertices) { *************** *** 69,72 **** --- 65,69 ---- Map<Vertex, Direction> slidemap = new HashMap(); Map<Vertex, Collection<Edge>> edgemap = space.edgeMap(vertices); + for (Vertex current : vertices) { Collection<Edge> edges = edgemap.get(current); *************** *** 92,105 **** } ! private Map<Vertex, Direction> computeSlideMap(Collection<Vertex> vertices) { ! Map<Vertex, Vertex> edgemap = computeMap(vertices); ! if (edgemap != null) { ! Map<Vertex, Direction> slidemap = new HashMap(); ! for (Vertex current : vertices) { ! slidemap.put(current, new Direction(current.copy(), edgemap.get(current))); } - return slidemap; - } else { - return null; } } --- 89,109 ---- } ! private void computePlanes(Collection<Vertex> vertices) { ! if (vertices.size() > 0) { ! Space space = vertices.iterator().next().getOwner(); ! Set<Vertex> mark = new HashSet(); ! Set<Edge> edges = new HashSet(); ! Set<Surface> surfaces = new HashSet(); ! mark.addAll(vertices); ! for (Edge current : space.getEdges()) { ! if (mark.contains(current.getFrom()) && mark.contains(current.getTo())) { ! edges.add(current); ! } ! } ! for (Surface current : space.getSurfaces()) { ! if (edges.containsAll(current.getEdges())) { ! surfaces.add(current); ! } } } } |