[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Line.java, 1.35, 1.36 Command.java,
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2007-11-12 08:05:31
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31972/src/net/sourceforge/bprocessor/model Modified Files: Line.java Command.java Constructor.java Log Message: coordinate systems Index: Constructor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Constructor.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Constructor.java 10 Oct 2007 08:32:00 -0000 1.23 --- Constructor.java 12 Nov 2007 08:05:25 -0000 1.24 *************** *** 29,36 **** /** Tells if the constructor is extended for hit or not */ ! private boolean active; /** Specify wether the constructor is changable */ ! private boolean editable; /** Set of geometrics connected to this constructor */ --- 29,36 ---- /** Tells if the constructor is extended for hit or not */ ! protected boolean active; /** Specify wether the constructor is changable */ ! protected boolean editable; /** Set of geometrics connected to this constructor */ Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Command.java 9 Nov 2007 09:45:25 -0000 1.23 --- Command.java 12 Nov 2007 08:05:25 -0000 1.24 *************** *** 739,746 **** --- 739,749 ---- @Override public void evaluate() { + List<Vertex> locals = system.translate(vertices); double sx = parameters.getDouble("translate x"); double sy = parameters.getDouble("translate y"); double sz = parameters.getDouble("translate z"); + + System.out.println("translate " + sx + ", " + sy + ", " + sz); for (Vertex current : locals) { current.setX(current.getX() + sx); Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Line.java 2 Oct 2007 12:37:56 -0000 1.35 --- Line.java 12 Nov 2007 08:05:25 -0000 1.36 *************** *** 18,34 **** */ public class Line extends Constructor { - /** - * - */ - private static final long serialVersionUID = 1L; - /** The logger */ private static Logger log = Logger.getLogger(Line.class); /** The direction vector */ ! private Vertex dir; ! ! /** The edge the center of this Line is to be moved on */ ! private Edge constraint; /** --- 18,26 ---- */ public class Line extends Constructor { /** The logger */ private static Logger log = Logger.getLogger(Line.class); /** The direction vector */ ! private Vertex direction; /** *************** *** 36,48 **** */ public Line() { - super(); - } - - /** - * Constuctor of Line with only the origin and a standard direction of (1,0,0) - * @param origin The origin - */ - public Line(Vertex origin) { - this(origin, new Vertex(1, 0, 0), false); } --- 28,31 ---- *************** *** 53,70 **** */ public Line(Vertex origin, Vertex dir) { ! this(origin, dir, false); ! } ! ! /** ! * Constructor of the Line with orgin and three angles ! * @param origin The origin ! * @param dir The vector of direction ! * @param active If the constructor is active ! */ ! public Line(Vertex origin, Vertex dir, boolean active) { ! super(origin); ! dir.normalize(); ! this.setActive(active); ! this.dir = dir; } --- 36,41 ---- */ public Line(Vertex origin, Vertex dir) { ! this.origin = origin; ! this.direction = dir; } *************** *** 77,96 **** */ public Line(Vertex origin, Vertex dir, boolean active, boolean editable) { ! super(origin, active, editable); ! dir.normalize(); ! this.dir = dir; ! } ! ! /** ! * Constructor of the Line with orgin and three angles ! * @param origin The origin ! * @param dir The vector of direction ! * @param constraint The bounded placements ! * @param active If the constructor is active ! * @param editable If the constructor is editable ! */ ! public Line(Vertex origin, Vertex dir, Edge constraint, boolean active, boolean editable) { ! this(origin, dir, active, editable); ! this.constraint = constraint; } --- 48,55 ---- */ public Line(Vertex origin, Vertex dir, boolean active, boolean editable) { ! this.origin = origin; ! this.direction = dir; ! this.active = active; ! this.editable = editable; } *************** *** 100,104 **** */ public Vertex getDirection() { ! return dir; } --- 59,63 ---- */ public Vertex getDirection() { ! return direction; } *************** *** 115,120 **** */ public void setDirection(Vertex dir) { ! this.dir = dir; ! dir.normalize(); } --- 74,78 ---- */ public void setDirection(Vertex dir) { ! this.direction = dir; } *************** *** 171,175 **** */ public Vertex getPointAt(double t) { ! Vertex tmp = dir.copy(); tmp.scale(t); return getOrigin().add(tmp); --- 129,133 ---- */ public Vertex getPointAt(double t) { ! Vertex tmp = direction.copy(); tmp.scale(t); return getOrigin().add(tmp); *************** *** 191,200 **** /** {@inheritDoc} */ public double degreesAboutY() { ! return Geometry.degreesAboutY(dir); } /** {@inheritDoc} */ public double degreesAboutZ() { ! return Geometry.degreesAboutZ(dir); } --- 149,158 ---- /** {@inheritDoc} */ public double degreesAboutY() { ! return Geometry.degreesAboutY(direction); } /** {@inheritDoc} */ public double degreesAboutZ() { ! return Geometry.degreesAboutZ(direction); } *************** *** 213,219 **** */ public Vertex tip(double distance) { ! double x = getOrigin().getX() + dir.getX() * distance; ! double y = getOrigin().getY() + dir.getY() * distance; ! double z = getOrigin().getZ() + dir.getZ() * distance; return new Tip(x, y, z); } --- 171,177 ---- */ public Vertex tip(double distance) { ! double x = getOrigin().getX() + direction.getX() * distance; ! double y = getOrigin().getY() + direction.getY() * distance; ! double z = getOrigin().getZ() + direction.getZ() * distance; return new Tip(x, y, z); } *************** *** 401,423 **** } - /** {@inheritDoc} */ - public Vertex canMove(double x, double y, double z, Collection entities) { - // TODO Think it through - Vertex move = new Vertex(x, y, z); - if (constraint != null) { - move = move.projectOnto(constraint.getDirection()); - Vertex to = getOrigin().add(move); - if (!constraint.coincides(to)) { - Vertex where = to.minus(constraint.getFrom()); - Vertex where2 = to.minus(constraint.getTo()); - if (where.length() > where2.length()) { - where = where2; - } - log.info("there were so long " + where); - move = where.minus(move); - } - } - return move; - } /** --- 359,362 ---- |