[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Vertex.java, 1.66, 1.67
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2007-11-13 09:42:22
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20513/src/net/sourceforge/bprocessor/model Modified Files: Vertex.java Log Message: fixed stuff in vertex Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** Vertex.java 22 Oct 2007 19:26:32 -0000 1.66 --- Vertex.java 13 Nov 2007 09:42:24 -0000 1.67 *************** *** 18,33 **** /** ! * The vertex ! * @hibernate.class ! * table="VERTEX" ! * lazy="false" ! * @hibernate.cache ! * usage="read-write" */ public class Vertex extends Geometric implements Parametric { - /** Default */ - private static final long serialVersionUID = 1L; - - /** The logger */ private static Logger log = Logger.getLogger(Vertex.class); --- 18,24 ---- /** ! * Vertex */ public class Vertex extends Geometric implements Parametric { private static Logger log = Logger.getLogger(Vertex.class); *************** *** 84,94 **** */ public Vertex(double[] v) { ! if (v.length == 3) { ! setX(v[0]); ! setY(v[1]); ! setZ(v[2]); ! } else { ! log.error("Wrong amount of arguments were " + v.length + " should be 3"); ! } } --- 75,81 ---- */ public Vertex(double[] v) { ! setX(v[0]); ! setY(v[1]); ! setZ(v[2]); } *************** *** 156,173 **** /** - * Set the placement of this to the given vertex - * @param other Vertex - */ - public void set(Vertex other) { - if (other != null) { - setX(other.getX()); - setY(other.getY()); - setZ(other.getZ()); - } else { - log.error(this + " were set with a null vertex as argument"); - } - } - - /** * Set the z coordinate * @param z The z coordinate --- 143,146 ---- *************** *** 178,181 **** --- 151,164 ---- /** + * Set the placement of this to the given vertex + * @param other Vertex + */ + public void set(Vertex other) { + setX(other.getX()); + setY(other.getY()); + setZ(other.getZ()); + } + + /** * Return x, y, z in a double array * @return Values *************** *** 298,309 **** */ public Vertex cross(Vertex v) { ! if (v != null) { ! Vertex cross = new Vertex(); ! cross.setX(this.getY() * v.getZ() - v.getY() * this.getZ()); ! cross.setY(this.getZ() * v.getX() - v.getZ() * this.getX()); ! cross.setZ(this.getX() * v.getY() - v.getX() * this.getY()); ! return cross; ! } ! return null; } --- 281,289 ---- */ public Vertex cross(Vertex v) { ! Vertex cross = new Vertex(); ! cross.setX(this.getY() * v.getZ() - v.getY() * this.getZ()); ! cross.setY(this.getZ() * v.getX() - v.getZ() * this.getX()); ! cross.setZ(this.getX() * v.getY() - v.getX() * this.getY()); ! return cross; } *************** *** 571,579 **** return null; } ! ! /** {@inheritDoc} */ ! public Vertex canMove(double x, double y, double z, Collection entities) { ! // TODO Think it through ! return new Vertex(x, y, z); } } --- 551,561 ---- return null; } ! ! /** ! * Info ! * @param object Object ! */ ! public static void info(Object object) { ! log.info(object); } } |