[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Line.java, 1.9, 1.10 Geometric.java,
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2006-07-18 14:04:48
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14156/src/net/sourceforge/bprocessor/model Modified Files: Line.java Geometric.java Project.java Log Message: Implemented strategy to rotate a vector by moving the tip Index: Geometric.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometric.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Geometric.java 16 Jun 2006 09:42:57 -0000 1.6 --- Geometric.java 18 Jul 2006 14:04:37 -0000 1.7 *************** *** 54,57 **** public abstract Set collect(); ! } --- 54,62 ---- public abstract Set collect(); ! /** ! * Update after move ! */ ! public void update() { ! ! } } Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Line.java 13 Jul 2006 13:30:14 -0000 1.9 --- Line.java 18 Jul 2006 14:04:37 -0000 1.10 *************** *** 128,130 **** --- 128,164 ---- return Geometry.degreesAboutZ(dir); } + + /** + * Tip + * @return A vertex representing the tip + */ + public Vertex tip() { + double x = getOrigin().getX() + dir.getX(); + double y = getOrigin().getY() + dir.getY(); + double z = getOrigin().getZ() + dir.getZ(); + return new Tip(x, y, z); + } + + /** + * Vertex representing the tip of the vector defining this line + */ + private class Tip extends Vertex { + /** */ + private static final long serialVersionUID = 1L; + /** + * Constructor for Tip + * @param x X + * @param y Y + * @param z Z + */ + public Tip(double x, double y, double z) { + super(x, y, z); + } + /** + * Update the direction based on the placement of the tip + */ + public void update() { + setDirection(minus(getOrigin())); + } + } } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** Project.java 7 Jul 2006 14:07:33 -0000 1.61 --- Project.java 18 Jul 2006 14:04:37 -0000 1.62 *************** *** 285,288 **** --- 285,289 ---- while (iter.hasNext()) { Vertex current = (Vertex) iter.next(); + current.update(); edges.addAll(current.getEdges()); } |