[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Geometric.java,1.4,1.5 Edge.java,1.43
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Nordholt <nor...@us...> - 2006-04-05 10:23:37
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12025 Modified Files: Geometric.java Edge.java Surface.java Vertex.java Log Message: added method for collecting the set of vertices in a geometric Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** Surface.java 5 Apr 2006 09:35:58 -0000 1.86 --- Surface.java 5 Apr 2006 10:23:22 -0000 1.87 *************** *** 901,904 **** --- 901,919 ---- return null; } + + /** + * Collects the set of vertices in this surface + * @return the set of vertices + */ + public Set collect() { + Set result = new HashSet(this.getVertices()); + if (holes != null) { + Iterator it = holes.iterator(); + while (it.hasNext()) { + result.addAll(((Geometric)it.next()).collect()); + } + } + return result; + } /** Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** Edge.java 29 Mar 2006 13:18:35 -0000 1.43 --- Edge.java 5 Apr 2006 10:23:22 -0000 1.44 *************** *** 459,462 **** --- 459,473 ---- return to.minus(from); } + + /** + * Collects the set of vertices in this edge + * @return the set of vertices + */ + public Set collect() { + Set result = new HashSet(); + result.add(this.to); + result.add(this.from); + return result; + } /** Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Vertex.java 25 Mar 2006 18:08:32 -0000 1.31 --- Vertex.java 5 Apr 2006 10:23:22 -0000 1.32 *************** *** 311,314 **** --- 311,324 ---- return this; } + + /** + * Collects this vertex + * @return the set containing this vertex + */ + public Set collect() { + Set result = new HashSet(); + result.add(this); + return result; + } /** Index: Geometric.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometric.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Geometric.java 25 Mar 2006 18:08:32 -0000 1.4 --- Geometric.java 5 Apr 2006 10:23:22 -0000 1.5 *************** *** 8,11 **** --- 8,13 ---- package net.sourceforge.bprocessor.model; + import java.util.Set; + /** * The Geometric as a super class for geometric entities *************** *** 46,49 **** --- 48,57 ---- } + /** + * Collects the set of vertices in this geometric + * @return the set of vertices + */ + public abstract Set collect(); + } |