[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Edge.java,1.27,1.28 Vertex.java,1.19,
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2006-01-27 11:41:19
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23360/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Vertex.java Space.java Log Message: Made Entity abstract so that center could be common for Edge, Space, Surface and Vertex. Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Space.java 13 Jan 2006 09:30:01 -0000 1.13 --- Space.java 27 Jan 2006 11:41:08 -0000 1.14 *************** *** 216,218 **** --- 216,226 ---- this.modellor = modellor; } + + /** + * Return the center of gravity + * @return The center vertex + */ + public Vertex center() { + return null; + } } Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Vertex.java 23 Jan 2006 10:16:32 -0000 1.19 --- Vertex.java 27 Jan 2006 11:41:08 -0000 1.20 *************** *** 325,327 **** --- 325,335 ---- ", " + z + "]"; } + + /** + * Return the center (which is the vertex itself) + * @return The center vertex + */ + public Vertex center() { + return this; + } } Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Edge.java 24 Jan 2006 14:10:42 -0000 1.27 --- Edge.java 27 Jan 2006 11:41:07 -0000 1.28 *************** *** 343,351 **** * @return The center point as a double array with x y z */ ! public double[] center() { double x = (to.getX() - from.getX()) / 2.0; double y = (to.getY() - from.getY()) / 2.0; double z = (to.getZ() - from.getZ()) / 2.0; ! return new double[]{from.getX() + x, from.getY() + y, from.getZ() + z}; } --- 343,351 ---- * @return The center point as a double array with x y z */ ! public Vertex center() { double x = (to.getX() - from.getX()) / 2.0; double y = (to.getY() - from.getY()) / 2.0; double z = (to.getZ() - from.getZ()) / 2.0; ! return new Vertex(from.getX() + x, from.getY() + y, from.getZ() + z); } |