[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Edge.java,1.10,1.11 Vertex.java,1.9,1
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2005-09-28 11:59:13
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16542/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Vertex.java Surface.java Log Message: Copy operations on Surface, Edge, and Vertex Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Surface.java 22 Sep 2005 14:10:47 -0000 1.27 --- Surface.java 28 Sep 2005 11:59:03 -0000 1.28 *************** *** 273,276 **** --- 273,291 ---- /** + * Return a copy of this Surface + * @return + */ + Surface copy() { + Surface surface = new Surface(getName()); + List edges = new ArrayList(); + Iterator iter = getEdges().iterator(); + while(iter.hasNext()) { + Edge current = (Edge) iter.next(); + edges.add(current.copy()); + } + surface.setEdges(edges); + return surface; + } + /** * Adds a hole surface to this surface. * @param inner the hole to add. Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Edge.java 14 Sep 2005 14:05:45 -0000 1.10 --- Edge.java 28 Sep 2005 11:59:03 -0000 1.11 *************** *** 164,167 **** --- 164,177 ---- /** + * Return a copy if this Edge + * @return The copy + */ + Edge copy() { + Edge edge = new Edge(getName()); + edge.setFrom(getFrom().copy()); + edge.setTo(getTo().copy()); + return edge; + } + /** * Move the Edge a distance (dx, dy, dz) * @param dx The x distance Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Vertex.java 22 Sep 2005 14:10:47 -0000 1.9 --- Vertex.java 28 Sep 2005 11:59:03 -0000 1.10 *************** *** 179,182 **** --- 179,183 ---- this.w = w; } + /** *************** *** 189,192 **** --- 190,205 ---- /** + * Return a copy of this Vertex + * @return The copy + */ + Vertex copy() { + Vertex vertex = new Vertex(getName()); + vertex.setX(getX()); + vertex.setY(getY()); + vertex.setZ(getZ()); + return vertex; + } + + /** * scales the vertex by the the given double * @param scale The scale |