[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Edge.java, 1.48, 1.49 Vertex.java, 1
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2006-08-04 11:48:08
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6388/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Vertex.java Log Message: Refactoring of Move Tool Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** Edge.java 3 Aug 2006 14:35:21 -0000 1.48 --- Edge.java 4 Aug 2006 11:48:04 -0000 1.49 *************** *** 497,499 **** --- 497,514 ---- return "Edge"; } + + /** + * Collect all surfaces from a collection of edges + * @param edges Collection of edges + * @return Surfaces + */ + public static Set surfaces(Collection edges) { + Set surfaces = new HashSet(); + Iterator iter = edges.iterator(); + while (iter.hasNext()) { + Edge current = (Edge) iter.next(); + surfaces.addAll(current.getSurfaces()); + } + return surfaces; + } } Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** Vertex.java 3 Aug 2006 14:33:42 -0000 1.40 --- Vertex.java 4 Aug 2006 11:48:04 -0000 1.41 *************** *** 436,440 **** } } ! /** * Project this vertex onto the vertex given as argument --- 436,455 ---- } } ! ! /** ! * Collect all edges from a collection of vertices ! * @param vertices Collection of vertices ! * @return Edges ! */ ! public static Set edges(Collection vertices) { ! Set edges = new HashSet(); ! Iterator iter = vertices.iterator(); ! while (iter.hasNext()) { ! Vertex current = (Vertex) iter.next(); ! edges.addAll(current.getEdges()); ! } ! return edges; ! } ! /** * Project this vertex onto the vertex given as argument |