bprocessor-commit Mailing List for B-processor (Page 40)
Status: Pre-Alpha
Brought to you by:
henryml
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(117) |
Aug
(151) |
Sep
(157) |
Oct
(81) |
Nov
(117) |
Dec
(119) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(183) |
Feb
(130) |
Mar
(117) |
Apr
(61) |
May
(82) |
Jun
(45) |
Jul
(149) |
Aug
(173) |
Sep
(199) |
Oct
(165) |
Nov
(107) |
Dec
(137) |
2007 |
Jan
(124) |
Feb
(58) |
Mar
(123) |
Apr
(80) |
May
(130) |
Jun
(64) |
Jul
(31) |
Aug
(42) |
Sep
(114) |
Oct
(167) |
Nov
(239) |
Dec
(200) |
2008 |
Jan
(43) |
Feb
(43) |
Mar
(4) |
Apr
(9) |
May
(5) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(9) |
Nov
(12) |
Dec
|
2009 |
Jan
|
Feb
(20) |
Mar
(7) |
Apr
(12) |
May
(34) |
Jun
(72) |
Jul
|
Aug
(3) |
Sep
(31) |
Oct
(2) |
Nov
(8) |
Dec
(4) |
2010 |
Jan
(5) |
Feb
(32) |
Mar
(8) |
Apr
(7) |
May
(36) |
Jun
|
Jul
(11) |
Aug
(15) |
Sep
(7) |
Oct
(2) |
Nov
(13) |
Dec
(80) |
2011 |
Jan
|
Feb
|
Mar
(8) |
Apr
(12) |
May
(32) |
Jun
(9) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(8) |
2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: rimestad <rim...@us...> - 2007-11-16 11:46:55
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13093/src/net/sourceforge/bprocessor/model Modified Files: ClippingPlane.java Log Message: removed update() call in clippingplane to avoid recalc of intersectonpoints for the clipping before the model have been loaded Index: ClippingPlane.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/ClippingPlane.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ClippingPlane.java 13 Nov 2007 12:19:29 -0000 1.23 --- ClippingPlane.java 16 Nov 2007 11:46:50 -0000 1.24 *************** *** 65,69 **** this.toModel = new HashMap(); Project.getInstance().addObserver(this); - update(); } --- 65,68 ---- *************** *** 317,321 **** public void setActive(boolean isActive) { this.isActive = isActive; - update(); } --- 316,319 ---- |
From: Michael L. <he...@us...> - 2007-11-15 13:07:39
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29709/src/net/sourceforge/bprocessor/gl/tool Modified Files: Protractor.java RotationTool.java Log Message: Added handles to GlObjects Index: Protractor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Protractor.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Protractor.java 15 Nov 2007 12:53:56 -0000 1.13 --- Protractor.java 15 Nov 2007 13:07:41 -0000 1.14 *************** *** 340,343 **** --- 340,358 ---- } } + + /** {@inheritDoc} */ + public List<Vertex> handles() { + List<Vertex> handles = new LinkedList(); + Camera camera = Project.getInstance().getCurrentCamera(); + double distance = camera.distance(origin); + double radius = 3 * distance; + double n = 24; + for (int i = 0; i < n; i++) { + double angle = 2 * Math.PI * i / n; + Vertex p = radian(radius * 0.97, angle); + handles.add(p); + } + return handles; + } } } Index: RotationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RotationTool.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** RotationTool.java 15 Nov 2007 12:21:43 -0000 1.29 --- RotationTool.java 15 Nov 2007 13:07:41 -0000 1.30 *************** *** 391,394 **** --- 391,399 ---- } + /** {@inheritDoc} */ + public List<Vertex> handles() { + return new LinkedList(); + } + /** * @inheritDoc |
From: Michael L. <he...@us...> - 2007-11-15 13:07:39
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29709/src/net/sourceforge/bprocessor/gl/model Modified Files: GlCamera.java GlObject.java Log Message: Added handles to GlObjects Index: GlObject.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model/GlObject.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** GlObject.java 15 Nov 2007 12:21:44 -0000 1.7 --- GlObject.java 15 Nov 2007 13:07:41 -0000 1.8 *************** *** 7,13 **** --- 7,15 ---- package net.sourceforge.bprocessor.gl.model; + import java.util.List; import javax.media.opengl.GL; import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.Vertex; /** *************** *** 28,31 **** --- 30,39 ---- */ public void select(GL gl); + + /** + * Returns a collection of handles + * @return collection of handles + */ + public List<Vertex> handles(); /** Index: GlCamera.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model/GlCamera.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GlCamera.java 15 Nov 2007 12:21:44 -0000 1.3 --- GlCamera.java 15 Nov 2007 13:07:41 -0000 1.4 *************** *** 7,10 **** --- 7,13 ---- package net.sourceforge.bprocessor.gl.model; + import java.util.LinkedList; + import java.util.List; + import javax.media.opengl.GL; import com.sun.opengl.util.GLUT; *************** *** 94,96 **** --- 97,103 ---- } + /** {@inheritDoc} */ + public List<Vertex> handles() { + return new LinkedList(); + } } |
From: Michael L. <he...@us...> - 2007-11-15 13:07:39
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29709/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: Added handles to GlObjects Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** Display.java 15 Nov 2007 12:21:44 -0000 1.57 --- Display.java 15 Nov 2007 13:07:41 -0000 1.58 *************** *** 776,779 **** --- 776,780 ---- current.select(gl); pop(); + selectVertices(current.handles()); } } |
From: Michael L. <he...@us...> - 2007-11-15 12:53:56
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23877/src/net/sourceforge/bprocessor/gl/tool Modified Files: Protractor.java Log Message: length field Index: Protractor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Protractor.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Protractor.java 15 Nov 2007 12:21:43 -0000 1.12 --- Protractor.java 15 Nov 2007 12:53:56 -0000 1.13 *************** *** 39,42 **** --- 39,43 ---- private Vertex i0; private Vertex base; + private Vertex direction; /** *************** *** 70,74 **** List edges = new LinkedList(); ! Vertex direction = current.vertex().minus(start.vertex()); if (direction.isZero()) { if (base != null) { --- 71,75 ---- List edges = new LinkedList(); ! direction = current.vertex().minus(start.vertex()); if (direction.isZero()) { if (base != null) { *************** *** 118,121 **** --- 119,141 ---- * {@inheritDoc} */ + protected void updateLength() { + if (base != null) { + if (direction != null) { + double t = base.dot(direction); + double angle = Math.acos(t); + double d = normal.dot(base.cross(direction)); + if (d < 0) { + angle = 2 * Math.PI - angle; + } + double degrees = angle * 180 / Math.PI; + int i = (int) Math.round(degrees); + glv.setLengthValue(String.valueOf(i)); + } + } + } + + /** + * {@inheritDoc} + */ protected void moved(MouseEvent event) { current = findIntersection(event); |
From: Michael L. <he...@us...> - 2007-11-15 12:21:47
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13937/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: Protractor improvement Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** Display.java 13 Nov 2007 12:21:42 -0000 1.56 --- Display.java 15 Nov 2007 12:21:44 -0000 1.57 *************** *** 774,778 **** for (GlObject current : glos) { push(current); ! current.draw(gl); pop(); } --- 774,778 ---- for (GlObject current : glos) { push(current); ! current.select(gl); pop(); } |
From: Michael L. <he...@us...> - 2007-11-15 12:21:47
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13937/src/net/sourceforge/bprocessor/gl/tool Modified Files: Protractor.java RotationTool.java Log Message: Protractor improvement Index: Protractor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Protractor.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Protractor.java 15 Nov 2007 10:41:52 -0000 1.11 --- Protractor.java 15 Nov 2007 12:21:43 -0000 1.12 *************** *** 95,99 **** edges.add(line); feedback(edges); ! protract = new Protract(start.vertex(), i, j); glv.getView().addGlObjects3D(protract); } else { --- 95,99 ---- edges.add(line); feedback(edges); ! protract = new Protract(start.vertex(), i, j, true); glv.getView().addGlObjects3D(protract); } else { *************** *** 109,113 **** Vertex i = system.getI(); Vertex j = system.getJ(); ! protract = new Protract(current.vertex(), i, j); glv.getView().addGlObjects3D(protract); } --- 109,113 ---- Vertex i = system.getI(); Vertex j = system.getJ(); ! protract = new Protract(current.vertex(), i, j, false); glv.getView().addGlObjects3D(protract); } *************** *** 219,222 **** --- 219,223 ---- private Vertex u; private Vertex v; + private boolean hitable; /** *************** *** 225,233 **** * @param i Vertex * @param j Vertex */ ! public Protract(Vertex origin, Vertex i, Vertex j) { this.origin = origin; this.u = i; this.v = j; } --- 226,236 ---- * @param i Vertex * @param j Vertex + * @param hitable hitable */ ! public Protract(Vertex origin, Vertex i, Vertex j, boolean hitable) { this.origin = origin; this.u = i; this.v = j; + this.hitable = hitable; } *************** *** 241,244 **** --- 244,259 ---- /** {@inheritDoc} */ public void draw(GL gl) { + drawNormal(gl); + } + + /** {@inheritDoc} */ + public Intersection intersection(Edge e) { + Vertex n = u.cross(v); + Plane plane = new Plane(n, origin); + Vertex vertex = plane.intersection(e); + return new Intersection(vertex, Intersection.PLANE_INTERSECTION, plane); + } + + private void drawNormal(GL gl) { Camera camera = Project.getInstance().getCurrentCamera(); double distance = camera.distance(origin); *************** *** 275,280 **** { gl.glBegin(GL.GL_LINES); ! for (int i = 0; i < 36; i++) { ! double angle = 2 * Math.PI * i / 36; Vertex p = radian(radius, angle); Vertex q = radian(radius * 0.95, angle); --- 290,295 ---- { gl.glBegin(GL.GL_LINES); ! for (int i = 0; i < 24; i++) { ! double angle = 2 * Math.PI * i / 24; Vertex p = radian(radius, angle); Vertex q = radian(radius * 0.95, angle); *************** *** 285,295 **** } } /** {@inheritDoc} */ ! public Intersection intersection(Edge e) { ! Vertex n = u.cross(v); ! Plane plane = new Plane(n, origin); ! Vertex vertex = plane.intersection(e); ! return new Intersection(vertex, Intersection.PLANE_INTERSECTION, plane); } } --- 300,322 ---- } } + private void drawSelect(GL gl) { + Camera camera = Project.getInstance().getCurrentCamera(); + double distance = camera.distance(origin); + double radius = 3 * distance; + double n = 36; + gl.glBegin(GL.GL_POLYGON); + for (int i = 0; i < n; i++) { + double angle = 2 * Math.PI * i / n; + Vertex p = radian(radius, angle); + gl.glVertex3d(p.getX(), p.getY(), p.getZ()); + } + gl.glEnd(); + } /** {@inheritDoc} */ ! public void select(GL gl) { ! if (hitable) { ! drawSelect(gl); ! } } } Index: RotationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RotationTool.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** RotationTool.java 15 Nov 2007 10:41:52 -0000 1.28 --- RotationTool.java 15 Nov 2007 12:21:43 -0000 1.29 *************** *** 386,389 **** --- 386,394 ---- } + /** {@inheritDoc} */ + public void select(GL gl) { + draw(gl); + } + /** * @inheritDoc |
From: Michael L. <he...@us...> - 2007-11-15 12:21:47
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13937/src/net/sourceforge/bprocessor/gl/model Modified Files: GlCamera.java GlObject.java Log Message: Protractor improvement Index: GlObject.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model/GlObject.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** GlObject.java 15 Nov 2007 10:41:52 -0000 1.6 --- GlObject.java 15 Nov 2007 12:21:44 -0000 1.7 *************** *** 22,25 **** --- 22,31 ---- */ public void draw(GL gl); + + /** + * Draw the object for selection + * @param gl the GL interface + */ + public void select(GL gl); /** Index: GlCamera.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model/GlCamera.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GlCamera.java 15 Nov 2007 10:41:52 -0000 1.2 --- GlCamera.java 15 Nov 2007 12:21:44 -0000 1.3 *************** *** 60,63 **** --- 60,68 ---- gl.glDisable(GL.GL_LIGHTING); } + + /** {@inheritDoc} */ + public void select(GL gl) { + draw(gl); + } /** |
From: Michael L. <he...@us...> - 2007-11-15 10:41:57
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7016/src/net/sourceforge/bprocessor/gl/model Modified Files: GlCamera.java GlObject.java Log Message: simplification of GlObject Index: GlObject.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model/GlObject.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GlObject.java 20 Feb 2007 15:12:04 -0000 1.5 --- GlObject.java 15 Nov 2007 10:41:52 -0000 1.6 *************** *** 10,15 **** import javax.media.opengl.GL; import net.sourceforge.bprocessor.model.Edge; - import net.sourceforge.bprocessor.model.Plane; - import net.sourceforge.bprocessor.model.Vertex; /** --- 10,13 ---- *************** *** 30,39 **** * @return The intersection vertex */ ! public Vertex intersection(Edge e); ! ! /** ! * Return the associated plane for the GlObject ! * @return The plane ! */ ! public Plane getPlane(); } --- 28,31 ---- * @return The intersection vertex */ ! public Intersection intersection(Edge e); } Index: GlCamera.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model/GlCamera.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GlCamera.java 20 Feb 2007 15:13:00 -0000 1.1 --- GlCamera.java 15 Nov 2007 10:41:52 -0000 1.2 *************** *** 8,16 **** import javax.media.opengl.GL; - - import org.apache.log4j.Logger; - import com.sun.opengl.util.GLUT; - import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Edge; --- 8,12 ---- *************** *** 23,30 **** */ public class GlCamera implements GlObject { - - /** The logger */ - private static Logger log = Logger.getLogger(GlCamera.class); - /** The camera to represent in 3d */ private Camera cam; --- 19,22 ---- *************** *** 86,92 **** * {@inheritDoc} */ ! public Vertex intersection(Edge e) { ! Plane p = getPlane(); ! return p.intersection(e); } /** --- 78,83 ---- * {@inheritDoc} */ ! public Intersection intersection(Edge e) { ! return null; } /** |
From: Michael L. <he...@us...> - 2007-11-15 10:41:50
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7016/src/net/sourceforge/bprocessor/gl/tool Modified Files: Protractor.java RotationTool.java Log Message: simplification of GlObject Index: Protractor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Protractor.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Protractor.java 15 Nov 2007 08:41:09 -0000 1.10 --- Protractor.java 15 Nov 2007 10:41:52 -0000 1.11 *************** *** 17,20 **** --- 17,21 ---- import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.model.GlObject; + import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.model.Camera; *************** *** 286,298 **** /** {@inheritDoc} */ ! public Plane getPlane() { Vertex n = u.cross(v); Plane plane = new Plane(n, origin); ! return plane; ! } ! ! /** {@inheritDoc} */ ! public Vertex intersection(Edge e) { ! return getPlane().intersection(e); } } --- 287,295 ---- /** {@inheritDoc} */ ! public Intersection intersection(Edge e) { Vertex n = u.cross(v); Plane plane = new Plane(n, origin); ! Vertex vertex = plane.intersection(e); ! return new Intersection(vertex, Intersection.PLANE_INTERSECTION, plane); } } Index: RotationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RotationTool.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** RotationTool.java 20 Jun 2007 13:17:56 -0000 1.27 --- RotationTool.java 15 Nov 2007 10:41:52 -0000 1.28 *************** *** 389,393 **** * @inheritDoc */ ! public Vertex intersection(Edge e) { Vertex i = plane.intersection(e); Iterator<Line> iter = edges.iterator(); --- 389,393 ---- * @inheritDoc */ ! public Intersection intersection(Edge e) { Vertex i = plane.intersection(e); Iterator<Line> iter = edges.iterator(); *************** *** 406,410 **** } } ! return i; } --- 406,410 ---- } } ! return new Intersection(i, Intersection.PLANE_INTERSECTION, plane); } |
From: Michael L. <he...@us...> - 2007-11-15 10:41:50
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7016/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: simplification of GlObject Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.259 retrieving revision 1.260 diff -C2 -d -r1.259 -r1.260 *** View.java 15 Nov 2007 08:41:09 -0000 1.259 --- View.java 15 Nov 2007 10:41:53 -0000 1.260 *************** *** 1418,1425 **** } else { if (glo != null) { ! Vertex intersection = glo.intersection(ray); ! if (intersection != null) { ! return new Intersection(intersection, Intersection.PLANE_INTERSECTION, glo.getPlane()); ! } } else if (edge != null) { if (!edge.getStrippled()) { --- 1418,1422 ---- } else { if (glo != null) { ! return glo.intersection(ray); } else if (edge != null) { if (!edge.getStrippled()) { |
From: Michael L. <he...@us...> - 2007-11-15 08:41:06
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23704/src/net/sourceforge/bprocessor/gl/tool Modified Files: Protractor.java Log Message: some progress on protractor Index: Protractor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Protractor.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Protractor.java 15 Nov 2007 07:17:32 -0000 1.9 --- Protractor.java 15 Nov 2007 08:41:09 -0000 1.10 *************** *** 36,39 **** --- 36,40 ---- private Protract protract; private Vertex normal; + private Vertex i0; private Vertex base; *************** *** 53,59 **** * @return Line */ ! protected Line createConstructor(Vertex start, Vertex end) { ! Vertex direction = end.minus(start); ! direction.normalize(); return new Line(start, direction, true, true); } --- 54,58 ---- * @return Line */ ! protected Line createConstructor(Vertex start, Vertex direction) { return new Line(start, direction, true, true); } *************** *** 69,79 **** if (start != null) { List edges = new LinkedList(); Line line; ! line = createConstructor(start.vertex(), current.vertex()); edges.add(line); feedback(edges); - Vertex i = current.vertex().minus(start.vertex()); - i.normalize(); - Vertex j = normal.cross(i); protract = new Protract(start.vertex(), i, j); glv.getView().addGlObjects3D(protract); --- 68,97 ---- if (start != null) { List edges = new LinkedList(); + + Vertex direction = current.vertex().minus(start.vertex()); + if (direction.isZero()) { + if (base != null) { + direction = base; + } else { + direction = i0; + } + } else { + direction.normalize(); + } + + Vertex i; + + if (base != null) { + i = base; + } else { + i = direction; + } + + Vertex j = normal.cross(i); + Line line; ! line = createConstructor(start.vertex(), direction); edges.add(line); feedback(edges); protract = new Protract(start.vertex(), i, j); glv.getView().addGlObjects3D(protract); *************** *** 112,116 **** @Override public void onVertex() { ! Line l = createConstructor(start.vertex(), current.vertex()); Geometry.insertConstructor(l); start = null; --- 130,136 ---- @Override public void onVertex() { ! Vertex direction = current.vertex().minus(start.vertex()); ! direction.normalize(); ! Line l = createConstructor(start.vertex(), direction); Geometry.insertConstructor(l); start = null; *************** *** 135,145 **** Plane plane = system.plane(); normal = system.getN(); lockingPlane = plane; lock = true; } else { ! onVertex(); } - updateFeedback(); - updateConstructors(); } --- 155,179 ---- Plane plane = system.plane(); normal = system.getN(); + i0 = system.getI(); lockingPlane = plane; lock = true; + updateFeedback(); + updateConstructors(); } else { ! if (base == null) { ! Vertex i = current.vertex().minus(start.vertex()); ! if (i.isZero()) { ! i = i0; ! } else { ! i.normalize(); ! } ! base = i; ! updateFeedback(); ! updateConstructors(); ! } else { ! onVertex(); ! moved(event); ! } } } *************** *** 167,175 **** */ public void cleanUp() { if (protract != null) { glv.getView().removeGlObjects3D(protract); protract = null; - base = null; } } --- 201,212 ---- */ public void cleanUp() { + super.cleanUp(); if (protract != null) { glv.getView().removeGlObjects3D(protract); protract = null; } + i0 = null; + normal = null; + base = null; } *************** *** 250,259 **** /** {@inheritDoc} */ public Plane getPlane() { ! return null; } /** {@inheritDoc} */ public Vertex intersection(Edge e) { ! return null; } } --- 287,298 ---- /** {@inheritDoc} */ public Plane getPlane() { ! Vertex n = u.cross(v); ! Plane plane = new Plane(n, origin); ! return plane; } /** {@inheritDoc} */ public Vertex intersection(Edge e) { ! return getPlane().intersection(e); } } |
From: Michael L. <he...@us...> - 2007-11-15 08:41:06
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23704/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: some progress on protractor Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.258 retrieving revision 1.259 diff -C2 -d -r1.258 -r1.259 *** View.java 13 Nov 2007 12:19:22 -0000 1.258 --- View.java 15 Nov 2007 08:41:09 -0000 1.259 *************** *** 1324,1330 **** bufferOffset += 3; } ! } ! log.debug("Found surface:" + surface + " edge:" + edge + " vertex:" + vertex + ! " glObject:" + glo); if (surface != null) { if (unWantedEntities.contains(surface)) { --- 1324,1328 ---- bufferOffset += 3; } ! } if (surface != null) { if (unWantedEntities.contains(surface)) { |
From: Michael L. <he...@us...> - 2007-11-15 07:17:33
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22866/src/net/sourceforge/bprocessor/model Modified Files: Plane.java Log Message: Protractor work Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Plane.java 13 Nov 2007 12:19:29 -0000 1.32 --- Plane.java 15 Nov 2007 07:17:28 -0000 1.33 *************** *** 306,310 **** } if (index == Y) { ! i = new Vertex(0, 0, 1); } if (index == Z) { --- 306,310 ---- } if (index == Y) { ! i = new Vertex(1, 0, 0); } if (index == Z) { |
From: Michael L. <he...@us...> - 2007-11-15 07:17:29
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22874/src/net/sourceforge/bprocessor/gl/tool Modified Files: Protractor.java Log Message: Protractor work Index: Protractor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Protractor.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Protractor.java 14 Nov 2007 10:34:29 -0000 1.8 --- Protractor.java 15 Nov 2007 07:17:32 -0000 1.9 *************** *** 18,21 **** --- 18,22 ---- import net.sourceforge.bprocessor.gl.model.GlObject; import net.sourceforge.bprocessor.gl.view.View; + import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; *************** *** 34,37 **** --- 35,40 ---- private Protract protract; + private Vertex normal; + private Vertex base; /** *************** *** 70,76 **** edges.add(line); feedback(edges); } else { feedback(new LinkedList()); ! protract = new Protract(current.vertex()); glv.getView().addGlObjects3D(protract); } --- 73,94 ---- edges.add(line); feedback(edges); + Vertex i = current.vertex().minus(start.vertex()); + i.normalize(); + Vertex j = normal.cross(i); + protract = new Protract(start.vertex(), i, j); + glv.getView().addGlObjects3D(protract); } else { feedback(new LinkedList()); ! CoordinateSystem system; ! Surface surface = View.getLastSurface(); ! if (surface != null) { ! system = surface.coordinateSystem(); ! system = system.plane().coordinateSystem(); ! } else { ! system = Project.getInstance().getActiveCoordinateSystem(); ! } ! Vertex i = system.getI(); ! Vertex j = system.getJ(); ! protract = new Protract(current.vertex(), i, j); glv.getView().addGlObjects3D(protract); } *************** *** 107,117 **** if (start == null) { start = current; ! CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); ! system = system.copy(start.vertex()); ! Plane plane = system.plane(); Surface surface = View.getLastSurface(); if (surface != null) { ! plane = surface.plane(); } lockingPlane = plane; lock = true; --- 125,138 ---- if (start == null) { start = current; ! CoordinateSystem system; Surface surface = View.getLastSurface(); if (surface != null) { ! system = surface.coordinateSystem(); ! system = system.plane().coordinateSystem(); ! } else { ! system = Project.getInstance().getActiveCoordinateSystem(); } + Plane plane = system.plane(); + normal = system.getN(); lockingPlane = plane; lock = true; *************** *** 149,152 **** --- 170,174 ---- glv.getView().removeGlObjects3D(protract); protract = null; + base = null; } } *************** *** 157,186 **** public static class Protract implements GlObject { private Vertex origin; /** * Constructs a Protract * @param origin Vertex */ ! public Protract(Vertex origin) { this.origin = origin; } /** {@inheritDoc} */ public void draw(GL gl) { ! gl.glPushMatrix(); ! gl.glTranslated(origin.getX(), origin.getY(), origin.getZ()); ! double radius = 1; ! double n = 24; gl.glLineWidth(1.5f); gl.glColor3fv(View.CONSTRUCTOR_COLOR, 0); ! gl.glBegin(GL.GL_LINE_LOOP); ! for (int i = 0; i < n; i++) { ! double angle = 2 * Math.PI * i / n; ! double x = Math.cos(angle) * radius; ! double y = Math.sin(angle) * radius; ! gl.glVertex3d(x, y, 0); } - gl.glEnd(); - gl.glPopMatrix(); } --- 179,249 ---- public static class Protract implements GlObject { private Vertex origin; + private Vertex u; + private Vertex v; /** * Constructs a Protract * @param origin Vertex + * @param i Vertex + * @param j Vertex */ ! public Protract(Vertex origin, Vertex i, Vertex j) { this.origin = origin; + this.u = i; + this.v = j; + } + + private Vertex radian(double radius, double angle) { + double x = Math.cos(angle) * radius; + double y = Math.sin(angle) * radius; + Vertex p = origin.add(u.scale(x).add(v.scale(y))); + return p; } /** {@inheritDoc} */ public void draw(GL gl) { ! Camera camera = Project.getInstance().getCurrentCamera(); ! double distance = camera.distance(origin); ! double radius = 3 * distance; ! double n = 36; gl.glLineWidth(1.5f); gl.glColor3fv(View.CONSTRUCTOR_COLOR, 0); ! { ! gl.glBegin(GL.GL_LINE_LOOP); ! for (int i = 0; i < n; i++) { ! double angle = 2 * Math.PI * i / n; ! Vertex p = radian(radius, angle); ! gl.glVertex3d(p.getX(), p.getY(), p.getZ()); ! } ! gl.glEnd(); ! gl.glBegin(GL.GL_LINE_LOOP); ! for (int i = 0; i < n; i++) { ! double angle = 2 * Math.PI * i / n; ! Vertex p = radian(radius * 0.6, angle); ! gl.glVertex3d(p.getX(), p.getY(), p.getZ()); ! } ! gl.glEnd(); ! } ! { ! Vertex a = radian(radius, 0.1); ! Vertex b = radian(radius * 0.85, 0); ! Vertex c = radian(radius, -0.1); ! gl.glBegin(GL.GL_TRIANGLES); ! gl.glVertex3d(a.getX(), a.getY(), a.getZ()); ! gl.glVertex3d(b.getX(), b.getY(), b.getZ()); ! gl.glVertex3d(c.getX(), c.getY(), c.getZ()); ! gl.glEnd(); ! } ! { ! gl.glBegin(GL.GL_LINES); ! for (int i = 0; i < 36; i++) { ! double angle = 2 * Math.PI * i / 36; ! Vertex p = radian(radius, angle); ! Vertex q = radian(radius * 0.95, angle); ! gl.glVertex3d(p.getX(), p.getY(), p.getZ()); ! gl.glVertex3d(q.getX(), q.getY(), q.getZ()); ! } ! gl.glEnd(); } } |
From: Michael L. <he...@us...> - 2007-11-14 10:34:33
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17018/src/net/sourceforge/bprocessor/gl/tool Modified Files: Protractor.java ToolFactory.java Log Message: Reintroducing the protractor, but not finished Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** ToolFactory.java 12 Nov 2007 07:40:54 -0000 1.89 --- ToolFactory.java 14 Nov 2007 10:34:29 -0000 1.90 *************** *** 92,95 **** --- 92,97 ---- private AbstractPencil tapeMeasure; + private AbstractTool protractor; + /** Constructor tool */ private ConstructorTool constructor; *************** *** 186,189 **** --- 188,192 ---- clipplane = new ClipplaneTool(glv, pencilcursor); tapeMeasure = new TapeMeasure(glv, pencilcursor); + protractor = new Protractor(glv, pencilcursor); relation = new RelationTool(glv, arrowAddCursor); camera = new CameraTool(glv, rotationCursor); *************** *** 219,226 **** registerTool(Tool.MULTI_EXTRUDE_TOOL, multiExtrude, "Biconextrudetool2.gif", "Extend"); ! //this.registerTool(Tool.MOVE_TOOL, alternate, "Biconmovetool.gif", "Move"); ! //registerTool(Tool.CONTROLLED_MOVE_TOOL, controlled, "Biconmovetool.gif", "Controlled Move"); ! //registerTool(Tool.ALT_MOVE_TOOL, altMoveTool, "Biconmovetool.gif", "Alternative Moving"); ! //registerTool(Tool.EDGE_MOVE_TOOL, edgeMoveTool, "Biconmovetool.gif", "Edge moving"); JToggleButton moveBut = registerTool(Tool.FINAL_MOVE_TOOL, finalMoveTool, "Bmovetool.gif", "Final Move"); --- 222,226 ---- registerTool(Tool.MULTI_EXTRUDE_TOOL, multiExtrude, "Biconextrudetool2.gif", "Extend"); ! JToggleButton moveBut = registerTool(Tool.FINAL_MOVE_TOOL, finalMoveTool, "Bmovetool.gif", "Final Move"); *************** *** 228,236 **** JToggleButton rotationBut = this.registerTool(Tool.ROTATION_TOOL, rotation, "Biconrotaxe.gif", "Rotate"); tb.addSeparator(5); ! JToggleButton tmBut = this.registerTool(Tool.TAPE_MEASURE_TOOL, tapeMeasure, ! "Bicontapemes.gif", "Tape Measure"); ! this.registerTool(Tool.CONSTRUCTOR_TOOL, constructor, "Biconconstructor.gif", "Constructor"); ! this.registerTool(Tool.RELATION_TOOL, relation, "chaintool.gif", "Create relation"); tb.addSeparator(5); --- 228,237 ---- JToggleButton rotationBut = this.registerTool(Tool.ROTATION_TOOL, rotation, "Biconrotaxe.gif", "Rotate"); + tb.addSeparator(5); ! registerTool(Tool.TAPE_MEASURE_TOOL, tapeMeasure, "Bicontapemes.gif", "Tape Measure"); ! registerTool(Tool.PROTRACTOR_TOOL, protractor, "Bprotrac.gif", "Protractor"); ! registerTool(Tool.CONSTRUCTOR_TOOL, constructor, "Biconconstructor.gif", "Constructor"); ! registerTool(Tool.RELATION_TOOL, relation, "chaintool.gif", "Create relation"); tb.addSeparator(5); Index: Protractor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Protractor.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Protractor.java 19 Sep 2007 20:57:47 -0000 1.7 --- Protractor.java 14 Nov 2007 10:34:29 -0000 1.8 *************** *** 13,20 **** --- 13,29 ---- import java.util.List; + import javax.media.opengl.GL; + import net.sourceforge.bprocessor.gl.GLView; + import net.sourceforge.bprocessor.gl.model.GlObject; + import net.sourceforge.bprocessor.gl.view.View; + import net.sourceforge.bprocessor.model.CoordinateSystem; + import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Line; + import net.sourceforge.bprocessor.model.Plane; + import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; + import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 24,27 **** --- 33,38 ---- public class Protractor extends AbstractPencil { + private Protract protract; + /** * Constructor *************** *** 40,60 **** */ protected Line createConstructor(Vertex start, Vertex end) { ! return new Line(start, end.minus(start), true, true); } /** * Update feedback - * */ protected void updateFeedback() { if (start != null) { List edges = new LinkedList(); ! Line l; ! ! l = createConstructor(start.vertex(), current.vertex()); ! ! edges.add(l); feedback(edges); } else { feedback(new LinkedList()); } makeTarget(current); --- 51,77 ---- */ protected Line createConstructor(Vertex start, Vertex end) { ! Vertex direction = end.minus(start); ! direction.normalize(); ! return new Line(start, direction, true, true); } + /** * Update feedback */ protected void updateFeedback() { + if (protract != null) { + glv.getView().removeGlObjects3D(protract); + protract = null; + } if (start != null) { List edges = new LinkedList(); ! Line line; ! line = createConstructor(start.vertex(), current.vertex()); ! edges.add(line); feedback(edges); } else { feedback(new LinkedList()); + protract = new Protract(current.vertex()); + glv.getView().addGlObjects3D(protract); } makeTarget(current); *************** *** 62,69 **** /** ! * @param e MouseEven */ ! protected void moved(MouseEvent e) { ! current = findIntersection(e); if (current != null) { updateFeedback(); --- 79,86 ---- /** ! * {@inheritDoc} */ ! protected void moved(MouseEvent event) { ! current = findIntersection(event); if (current != null) { updateFeedback(); *************** *** 80,91 **** Geometry.insertConstructor(l); start = null; } /** ! * @param e MouseEven */ ! protected void pressed(MouseEvent e) { if (start == null) { start = current; } else { onVertex(); --- 97,119 ---- Geometry.insertConstructor(l); start = null; + cleanUp(); } /** ! * {@inheritDoc} */ ! protected void pressed(MouseEvent event) { ! current = findIntersection(event); if (start == null) { start = current; + CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); + system = system.copy(start.vertex()); + Plane plane = system.plane(); + Surface surface = View.getLastSurface(); + if (surface != null) { + plane = surface.plane(); + } + lockingPlane = plane; + lock = true; } else { onVertex(); *************** *** 96,108 **** /** ! * @param e MouseEven */ ! protected void dragged(MouseEvent e) { } /** ! * @param e MouseEven */ ! protected void released(MouseEvent e) { } --- 124,136 ---- /** ! * {@inheritDoc} */ ! protected void dragged(MouseEvent event) { } /** ! * {@inheritDoc} */ ! protected void released(MouseEvent event) { } *************** *** 113,115 **** --- 141,197 ---- Selection.primary().clear(); } + + /** + * {@inheritDoc} + */ + public void cleanUp() { + if (protract != null) { + glv.getView().removeGlObjects3D(protract); + protract = null; + } + } + + /** + * Protract + */ + public static class Protract implements GlObject { + private Vertex origin; + + /** + * Constructs a Protract + * @param origin Vertex + */ + public Protract(Vertex origin) { + this.origin = origin; + } + + /** {@inheritDoc} */ + public void draw(GL gl) { + gl.glPushMatrix(); + gl.glTranslated(origin.getX(), origin.getY(), origin.getZ()); + double radius = 1; + double n = 24; + gl.glLineWidth(1.5f); + gl.glColor3fv(View.CONSTRUCTOR_COLOR, 0); + gl.glBegin(GL.GL_LINE_LOOP); + for (int i = 0; i < n; i++) { + double angle = 2 * Math.PI * i / n; + double x = Math.cos(angle) * radius; + double y = Math.sin(angle) * radius; + gl.glVertex3d(x, y, 0); + } + gl.glEnd(); + gl.glPopMatrix(); + } + + /** {@inheritDoc} */ + public Plane getPlane() { + return null; + } + + /** {@inheritDoc} */ + public Vertex intersection(Edge e) { + return null; + } + } } |
From: Michael L. <he...@us...> - 2007-11-13 12:40:16
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31121/src/net/sourceforge/bprocessor/model Modified Files: Vertex.java Log Message: changed implementation of some math operations on vertex Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** Vertex.java 13 Nov 2007 12:21:49 -0000 1.69 --- Vertex.java 13 Nov 2007 12:40:19 -0000 1.70 *************** *** 213,223 **** /** * Return a scaled copy of this Vertex ! * @param scale the amout to scale the copy * @return a scaled copy */ ! public Vertex scale(double scale) { ! Vertex v = this.copy(); ! v.scaleInPlace(scale); ! return v; } --- 213,221 ---- /** * Return a scaled copy of this Vertex ! * @param t the amout to scale the copy * @return a scaled copy */ ! public Vertex scale(double t) { ! return new Vertex(x * t, y * t, z * t); } *************** *** 247,255 **** */ public Vertex minus(Vertex v) { ! Vertex res = new Vertex(); ! res.setX(this.getX() - v.getX()); ! res.setY(this.getY() - v.getY()); ! res.setZ(this.getZ() - v.getZ()); ! return res; } --- 245,249 ---- */ public Vertex minus(Vertex v) { ! return new Vertex(x - v.x, y - v.y, z - v.z); } *************** *** 260,268 **** */ public Vertex add(Vertex v) { ! Vertex res = new Vertex(); ! res.setX(this.getX() + v.getX()); ! res.setY(this.getY() + v.getY()); ! res.setZ(this.getZ() + v.getZ()); ! return res; } --- 254,258 ---- */ public Vertex add(Vertex v) { ! return new Vertex(x + v.x, y + v.y, z + v.z); } *************** *** 274,280 **** 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; } --- 264,270 ---- public Vertex cross(Vertex v) { Vertex cross = new Vertex(); ! cross.x = y * v.z - v.y * z; ! cross.y = z * v.x - v.z * x; ! cross.z = x * v.y - v.x * y; return cross; } *************** *** 295,299 **** */ public double angle(Vertex v) { ! return Math.acos(this.dot(v) / (this.length() * v.length())); } --- 285,289 ---- */ public double angle(Vertex v) { ! return Math.acos(dot(v) / (length() * v.length())); } *************** *** 303,307 **** */ public double length() { ! return Math.sqrt(getX() * getX() + getY() * getY() + getZ() * getZ()); } --- 293,297 ---- */ public double length() { ! return Math.sqrt(x * x + y * y + z * z); } *************** *** 312,353 **** */ public double distance(Vertex v) { ! double dx = v.getX() - getX(); ! double dy = v.getY() - getY(); ! double dz = v.getZ() - getZ(); return Math.sqrt(dx * dx + dy * dy + dz * dz); } /** - * Computes the the determinant of this and to other vertecies. - * The form is: determinant{this, v, u}. - * @param v the second vertex - * @param u the third vertex - * @return the determinant. - */ - public double determinant(Vertex v, Vertex u) { - double tx = this.getX(); - double ty = this.getY(); - double tz = this.getZ(); - - double vx = v.getX(); - double vy = v.getY(); - double vz = v.getZ(); - - double ux = u.getX(); - double uy = u.getY(); - double uz = u.getZ(); - - double result = tx * ((vy * uz) - (vz * uy)); - result -= vx * ((ty * uz) - (tz * uy)); - result += ux * ((ty * vz) - (tz * vy)); - return result; - } - - /** * Is this a zero vector? * @return True if this is a zero vector */ public boolean isZero() { ! return (length() < 0.0000001); } --- 302,317 ---- */ public double distance(Vertex v) { ! double dx = v.x - x; ! double dy = v.y - y; ! double dz = v.z - z; return Math.sqrt(dx * dx + dy * dy + dz * dz); } /** * Is this a zero vector? * @return True if this is a zero vector */ public boolean isZero() { ! return (length() < 0.0000001); } |
From: Michael L. <he...@us...> - 2007-11-13 12:21:48
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23676/src/net/sourceforge/bprocessor/model/modellor Modified Files: InnerWallModellor.java Log Message: Renamed copy(scale) to scale Index: InnerWallModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/InnerWallModellor.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** InnerWallModellor.java 13 Nov 2007 12:19:30 -0000 1.11 --- InnerWallModellor.java 13 Nov 2007 12:21:49 -0000 1.12 *************** *** 206,211 **** Edge topCopy = bottom.copy(); Edge rightCopy = right.copy(); ! Vertex up = cs.getN().copy(JOIST_WIDTH / cs.getN().length()); ! Vertex left = cs.getI().copy(-JOIST_WIDTH / cs.getI().length()); topCopy.move(up); rightCopy.move(left); --- 206,211 ---- Edge topCopy = bottom.copy(); Edge rightCopy = right.copy(); ! Vertex up = cs.getN().scale(JOIST_WIDTH / cs.getN().length()); ! Vertex left = cs.getI().scale(-JOIST_WIDTH / cs.getI().length()); topCopy.move(up); rightCopy.move(left); *************** *** 236,240 **** length = e.getLength() - (JOIST_WIDTH * 2); } else if (horizontal(e)) { ! i = cs.getN().copy(-1); j = cs.getJ().copy(); n = cs.getI().copy(); --- 236,240 ---- length = e.getLength() - (JOIST_WIDTH * 2); } else if (horizontal(e)) { ! i = cs.getN().scale(-1); j = cs.getJ().copy(); n = cs.getI().copy(); *************** *** 451,455 **** supports.add(support1); Edge support2 = support1.copy(); ! Vertex move = cs.getI().copy(JOIST_WIDTH / cs.getI().length()); support2.move(move); supports.add(support2); --- 451,455 ---- supports.add(support1); Edge support2 = support1.copy(); ! Vertex move = cs.getI().scale(JOIST_WIDTH / cs.getI().length()); support2.move(move); supports.add(support2); |
From: Michael L. <he...@us...> - 2007-11-13 12:21:46
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23676/src/net/sourceforge/bprocessor/model Modified Files: Vertex.java Log Message: Renamed copy(scale) to scale Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** Vertex.java 13 Nov 2007 12:19:29 -0000 1.68 --- Vertex.java 13 Nov 2007 12:21:49 -0000 1.69 *************** *** 216,220 **** * @return a scaled copy */ ! public Vertex copy(double scale) { Vertex v = this.copy(); v.scaleInPlace(scale); --- 216,220 ---- * @return a scaled copy */ ! public Vertex scale(double scale) { Vertex v = this.copy(); v.scaleInPlace(scale); |
From: Michael L. <he...@us...> - 2007-11-13 12:21:43
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23662/src/net/sourceforge/bprocessor/facade/modellor Modified Files: NetFacadeModellor.java FacadeModellor.java Log Message: Renamed copy(scale) to scale Index: NetFacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/NetFacadeModellor.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** NetFacadeModellor.java 13 Nov 2007 12:19:10 -0000 1.41 --- NetFacadeModellor.java 13 Nov 2007 12:21:46 -0000 1.42 *************** *** 685,689 **** deltaCorrection *= -1; } ! Vertex n = s.normal().copy(delta * deltaCorrection); s.move(n.getX(), n.getY(), n.getZ()); } --- 685,689 ---- deltaCorrection *= -1; } ! Vertex n = s.normal().scale(delta * deltaCorrection); s.move(n.getX(), n.getY(), n.getZ()); } Index: FacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/FacadeModellor.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** FacadeModellor.java 13 Nov 2007 12:19:11 -0000 1.36 --- FacadeModellor.java 13 Nov 2007 12:21:46 -0000 1.37 *************** *** 463,470 **** frame = frameWidth; } ! Vertex topOffset = vertDir.copy(frame / vertDir.length()); ! Vertex leftOffset = horDir.copy(frame / horDir.length()); ! Vertex bottomOffset = vertDir.copy((vertEdge.getLength() - frame) / vertDir.length()); ! Vertex rightOffset = horDir.copy((horEdge.getLength() - frame) / horDir.length()); topBound = new Line(cross.add(topOffset), horDir); leftBound = new Line(cross.add(leftOffset), vertDir); --- 463,470 ---- frame = frameWidth; } ! Vertex topOffset = vertDir.scale(frame / vertDir.length()); ! Vertex leftOffset = horDir.scale(frame / horDir.length()); ! Vertex bottomOffset = vertDir.scale((vertEdge.getLength() - frame) / vertDir.length()); ! Vertex rightOffset = horDir.scale((horEdge.getLength() - frame) / horDir.length()); topBound = new Line(cross.add(topOffset), horDir); leftBound = new Line(cross.add(leftOffset), vertDir); *************** *** 563,569 **** if (type == SINGLE_BAR) { vDir = vertSegs[0][0].getDirection(); ! vDir = vDir.copy((vertPostWidth / 2) / vDir.length()); hDir = horSegs[0][0].getDirection(); ! hDir = hDir.copy((horPostWidth / 2) / hDir.length()); } List slist = new LinkedList(); --- 563,569 ---- if (type == SINGLE_BAR) { vDir = vertSegs[0][0].getDirection(); ! vDir = vDir.scale((vertPostWidth / 2) / vDir.length()); hDir = horSegs[0][0].getDirection(); ! hDir = hDir.scale((horPostWidth / 2) / hDir.length()); } List slist = new LinkedList(); *************** *** 642,653 **** if (dirChanged) { if (j + dj > 0 && j + dj < horPosts + 1) { ! next.move(vDir.copy(stepI).getX(), ! vDir.copy(stepI).getY(), ! vDir.copy(stepI).getZ()); } if (i + di > 0 && i + di < vertPosts + 1) { ! next.move(hDir.copy(-stepJ).getX(), ! hDir.copy(-stepJ).getY(), ! hDir.copy(-stepJ).getZ()); } } --- 642,653 ---- if (dirChanged) { if (j + dj > 0 && j + dj < horPosts + 1) { ! next.move(vDir.scale(stepI).getX(), ! vDir.scale(stepI).getY(), ! vDir.scale(stepI).getZ()); } if (i + di > 0 && i + di < vertPosts + 1) { ! next.move(hDir.scale(-stepJ).getX(), ! hDir.scale(-stepJ).getY(), ! hDir.scale(-stepJ).getZ()); } } *************** *** 657,664 **** next = vertSegs[i + di][j + dj].intersection(horSegs[i + di][j + dj]); if (j + dj > 0 && j + dj < horPosts + 1) { ! next = next.add(vDir.copy(stepI)); } if (i + di > 0 && i + di < vertPosts + 1) { ! next = next.add(hDir.copy(-stepJ)); } } --- 657,664 ---- next = vertSegs[i + di][j + dj].intersection(horSegs[i + di][j + dj]); if (j + dj > 0 && j + dj < horPosts + 1) { ! next = next.add(vDir.scale(stepI)); } if (i + di > 0 && i + di < vertPosts + 1) { ! next = next.add(hDir.scale(-stepJ)); } } |
From: Michael L. <he...@us...> - 2007-11-13 12:21:39
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23648/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: Renamed copy(scale) to scale Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** Display.java 13 Nov 2007 11:06:58 -0000 1.55 --- Display.java 13 Nov 2007 12:21:42 -0000 1.56 *************** *** 1172,1176 **** for (int i = 0; i < n; i++) { ! Vertex o = origin.add(u.copy(i * delta)); Line line = new Line(o, v); Edge edge = line.edge(size / 2); --- 1172,1176 ---- for (int i = 0; i < n; i++) { ! Vertex o = origin.add(u.scale(i * delta)); Line line = new Line(o, v); Edge edge = line.edge(size / 2); *************** *** 1178,1182 **** } for (int i = 1; i < n; i++) { ! Vertex o = origin.add(u.copy(-i * delta)); Line line = new Line(o, v); Edge edge = line.edge(size / 2); --- 1178,1182 ---- } for (int i = 1; i < n; i++) { ! Vertex o = origin.add(u.scale(-i * delta)); Line line = new Line(o, v); Edge edge = line.edge(size / 2); *************** *** 1184,1188 **** } for (int i = 0; i < n; i++) { ! Vertex o = origin.add(v.copy(i * delta)); Line line = new Line(o, u); Edge edge = line.edge(size / 2); --- 1184,1188 ---- } for (int i = 0; i < n; i++) { ! Vertex o = origin.add(v.scale(i * delta)); Line line = new Line(o, u); Edge edge = line.edge(size / 2); *************** *** 1190,1194 **** } for (int i = 1; i < n; i++) { ! Vertex o = origin.add(v.copy(-i * delta)); Line line = new Line(o, u); Edge edge = line.edge(size / 2); --- 1190,1194 ---- } for (int i = 1; i < n; i++) { ! Vertex o = origin.add(v.scale(-i * delta)); Line line = new Line(o, u); Edge edge = line.edge(size / 2); |
From: Michael L. <he...@us...> - 2007-11-13 12:19:32
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22683/src/net/sourceforge/bprocessor/model Modified Files: Direction.java Geometry.java Line.java EnergyCalc.java Command.java CoordinateSystem.java Edge.java Vertex.java ClippingPlane.java SpaceAnalysis.java Surface.java Camera.java Space.java Plane.java Log Message: renamed Vertex.scale to scaleInPlace Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Command.java 13 Nov 2007 09:03:41 -0000 1.27 --- Command.java 13 Nov 2007 12:19:29 -0000 1.28 *************** *** 537,541 **** double length = v.length(); double delta = length / n; ! v.scale(delta / length); Vertex current = from; Space space = edge.getOwner(); --- 537,541 ---- double length = v.length(); double delta = length / n; ! v.scaleInPlace(delta / length); Vertex current = from; Space space = edge.getOwner(); *************** *** 602,606 **** Vertex normal = v.copy(); normal.setZ(0); ! normal.scale(-1); normal.normalize(); normals.add(normal); --- 602,606 ---- Vertex normal = v.copy(); normal.setZ(0); ! normal.scaleInPlace(-1); normal.normalize(); normals.add(normal); Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** CoordinateSystem.java 13 Nov 2007 09:46:28 -0000 1.63 --- CoordinateSystem.java 13 Nov 2007 12:19:29 -0000 1.64 *************** *** 320,330 **** Vertex origin = v0; Vertex i = v1.minus(v0); ! i.scale(1 / i.length()); Vertex v = v2.minus(v1); Vertex n = i.cross(v); if (n.length() > 0) { ! n.scale(1 / n.length()); Vertex j = n.cross(i); ! j.scale(1 / j.length()); return new CoordinateSystem(i, j, n, origin); } else { --- 320,330 ---- Vertex origin = v0; Vertex i = v1.minus(v0); ! i.scaleInPlace(1 / i.length()); Vertex v = v2.minus(v1); Vertex n = i.cross(v); if (n.length() > 0) { ! n.scaleInPlace(1 / n.length()); Vertex j = n.cross(i); ! j.scaleInPlace(1 / j.length()); return new CoordinateSystem(i, j, n, origin); } else { *************** *** 401,405 **** projection.setZ(n.getZ()); double scalar = n.dot(vector); ! projection.scale(scalar); return projection; } --- 401,405 ---- projection.setZ(n.getZ()); double scalar = n.dot(vector); ! projection.scaleInPlace(scalar); return projection; } *************** *** 425,429 **** double t = vector.dot(n); Vertex normal = n.copy(); ! normal.scale(t); vector = vector.minus(normal); return origin.add(vector); --- 425,429 ---- double t = vector.dot(n); Vertex normal = n.copy(); ! normal.scaleInPlace(t); vector = vector.minus(normal); return origin.add(vector); *************** *** 466,474 **** public Vertex unTranslate(Vertex vertex) { Vertex ii = i.copy(); ! ii.scale(vertex.getX()); Vertex jj = j.copy(); ! jj.scale(vertex.getY()); Vertex nn = n.copy(); ! nn.scale(vertex.getZ()); Vertex result = getOrigin().add(ii).add(jj).add(nn); return result; --- 466,474 ---- public Vertex unTranslate(Vertex vertex) { Vertex ii = i.copy(); ! ii.scaleInPlace(vertex.getX()); Vertex jj = j.copy(); ! jj.scaleInPlace(vertex.getY()); Vertex nn = n.copy(); ! nn.scaleInPlace(vertex.getZ()); Vertex result = getOrigin().add(ii).add(jj).add(nn); return result; *************** *** 633,638 **** Vertex v = i.copy(); Vertex u = j.copy(); ! v.scale(size); ! u.scale(size); Vertex a = origin.add(u).minus(v); Vertex b = origin.add(u).add(v); --- 633,638 ---- Vertex v = i.copy(); Vertex u = j.copy(); ! v.scaleInPlace(size); ! u.scaleInPlace(size); Vertex a = origin.add(u).minus(v); Vertex b = origin.add(u).add(v); *************** *** 694,703 **** Vertex o = getOrigin(); Vertex i = getI().copy(); ! i.scale(size); Vertex from = o.minus(i); Vertex to = o.add(i); list.add(new Guide(from, to)); Vertex j = getJ().copy(); ! j.scale(size); from = o.minus(j); to = o.add(j); --- 694,703 ---- Vertex o = getOrigin(); Vertex i = getI().copy(); ! i.scaleInPlace(size); Vertex from = o.minus(i); Vertex to = o.add(i); list.add(new Guide(from, to)); Vertex j = getJ().copy(); ! j.scaleInPlace(size); from = o.minus(j); to = o.add(j); *************** *** 705,709 **** if (!onlyPlane()) { Vertex n = getN().copy(); ! n.scale(size); from = o.minus(n); to = o.add(n); --- 705,709 ---- if (!onlyPlane()) { Vertex n = getN().copy(); ! n.scaleInPlace(size); from = o.minus(n); to = o.add(n); *************** *** 753,757 **** i = j; j = tmp; ! n.scale(-1); } --- 753,757 ---- i = j; j = tmp; ! n.scaleInPlace(-1); } *************** *** 857,861 **** this.vector = vector; Vertex v = vector.copy(); ! v.scale(distance); v = getOrigin().add(v); setX(v.getX()); --- 857,861 ---- this.vector = vector; Vertex v = vector.copy(); ! v.scaleInPlace(distance); v = getOrigin().add(v); setX(v.getX()); Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.205 retrieving revision 1.206 diff -C2 -d -r1.205 -r1.206 *** Surface.java 13 Nov 2007 10:04:29 -0000 1.205 --- Surface.java 13 Nov 2007 12:19:29 -0000 1.206 *************** *** 626,630 **** public Surface extrusion(double delta, Collection sides) { Vertex normal = normal(); ! normal.scale(delta); List vertices = getVertices(); List edges = getEdges(); --- 626,630 ---- public Surface extrusion(double delta, Collection sides) { Vertex normal = normal(); ! normal.scaleInPlace(delta); List vertices = getVertices(); List edges = getEdges(); *************** *** 794,798 **** } else { Vertex ncopy = normal.copy(); ! ncopy.scale(distance); vmap[i] = v[i].copy().add(ncopy); } --- 794,798 ---- } else { Vertex ncopy = normal.copy(); ! ncopy.scaleInPlace(distance); vmap[i] = v[i].copy().add(ncopy); } *************** *** 1611,1618 **** origin = getFirstVertex(); i = e0.otherVertex(origin).minus(origin); ! i.scale(1 / i.length()); j = n.cross(i); if (j != null) { ! j.scale(1 / j.length()); return new CoordinateSystem(i, j, n, origin.copy()); } --- 1611,1618 ---- origin = getFirstVertex(); i = e0.otherVertex(origin).minus(origin); ! i.scaleInPlace(1 / i.length()); j = n.cross(i); if (j != null) { ! j.scaleInPlace(1 / j.length()); return new CoordinateSystem(i, j, n, origin.copy()); } Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** Edge.java 13 Nov 2007 09:46:27 -0000 1.100 --- Edge.java 13 Nov 2007 12:19:29 -0000 1.101 *************** *** 471,475 **** Vertex w = vertex.minus(from); double t = v.dot(w); ! v.scale(t / (length * length)); return from.add(v); } --- 471,475 ---- Vertex w = vertex.minus(from); double t = v.dot(w); ! v.scaleInPlace(t / (length * length)); return from.add(v); } *************** *** 607,611 **** } if ((t > 0 && t < 1)) { ! r.scale(t); Vertex p = p0.add(r).minus(q); if (p.length() < 0.0000001) { --- 607,611 ---- } if ((t > 0 && t < 1)) { ! r.scaleInPlace(t); Vertex p = p0.add(r).minus(q); if (p.length() < 0.0000001) { *************** *** 635,639 **** t = (q.getZ() - p0.getZ()) / r.getZ(); } ! r.scale(t); Vertex p = p0.add(r).minus(q); if (p.length() < 0.0000001) { --- 635,639 ---- t = (q.getZ() - p0.getZ()) / r.getZ(); } ! r.scaleInPlace(t); Vertex p = p0.add(r).minus(q); if (p.length() < 0.0000001) { *************** *** 771,780 **** org1 = dir1.cross(normal); org1.normalize(); ! org1.scale(((Double)offsetMap.get(e1)).doubleValue()); } if (which.contains(e2)) { org2 = dir2.cross(normal); org2.normalize(); ! org2.scale(((Double)offsetMap.get(e2)).doubleValue()); } org1 = org1.add(work); --- 771,780 ---- org1 = dir1.cross(normal); org1.normalize(); ! org1.scaleInPlace(((Double)offsetMap.get(e1)).doubleValue()); } if (which.contains(e2)) { org2 = dir2.cross(normal); org2.normalize(); ! org2.scaleInPlace(((Double)offsetMap.get(e2)).doubleValue()); } org1 = org1.add(work); *************** *** 801,805 **** scale = ((Double)offsetMap.get(e2)).doubleValue(); } ! mainDir.scale(scale); } v2Dir.put(work, mainDir); --- 801,805 ---- scale = ((Double)offsetMap.get(e2)).doubleValue(); } ! mainDir.scaleInPlace(scale); } v2Dir.put(work, mainDir); *************** *** 863,867 **** Vertex workDir = (Vertex)directions.get(work); workDir.normalize(); ! workDir.scale(((Double)offsetMap.get(e1)).doubleValue() / workDir.dot(dir1)); ((Vertex)v2v.get(work)).move(workDir.getX(), workDir.getY(), workDir.getZ()); --- 863,867 ---- Vertex workDir = (Vertex)directions.get(work); workDir.normalize(); ! workDir.scaleInPlace(((Double)offsetMap.get(e1)).doubleValue() / workDir.dot(dir1)); ((Vertex)v2v.get(work)).move(workDir.getX(), workDir.getY(), workDir.getZ()); *************** *** 872,876 **** Vertex workDir = (Vertex)directions.get(work); workDir.normalize(); ! workDir.scale(((Double)offsetMap.get(e2)).doubleValue() / workDir.dot(dir2)); ((Vertex)v2v.get(work)).move(workDir.getX(), workDir.getY(), workDir.getZ()); --- 872,876 ---- Vertex workDir = (Vertex)directions.get(work); workDir.normalize(); ! workDir.scaleInPlace(((Double)offsetMap.get(e2)).doubleValue() / workDir.dot(dir2)); ((Vertex)v2v.get(work)).move(workDir.getX(), workDir.getY(), workDir.getZ()); *************** *** 1006,1010 **** dir2.normalize(); Vertex mainDir = dir1.add(dir2); ! mainDir.scale(1 / mainDir.dot(dir1)); dir.setDirection(mainDir); } else { --- 1006,1010 ---- dir2.normalize(); Vertex mainDir = dir1.add(dir2); ! mainDir.scaleInPlace(1 / mainDir.dot(dir1)); dir.setDirection(mainDir); } else { *************** *** 1024,1028 **** Vertex dir2 = other.minus(work); dir2.normalize(); ! dir2.scale(1 / dir2.dot(dir1)); dir.setDirection(dir2); } else { --- 1024,1028 ---- Vertex dir2 = other.minus(work); dir2.normalize(); ! dir2.scaleInPlace(1 / dir2.dot(dir1)); dir.setDirection(dir2); } else { *************** *** 1046,1050 **** Vertex dir1 = other.minus(work); dir1.normalize(); ! dir1.scale(1 / dir1.dot(dir2)); dir.setDirection(dir1); } else { --- 1046,1050 ---- Vertex dir1 = other.minus(work); dir1.normalize(); ! dir1.scaleInPlace(1 / dir1.dot(dir2)); dir.setDirection(dir1); } else { *************** *** 1061,1067 **** Direction cur = (Direction)diriter.next(); Vertex dir = cur.getDirection(); ! dir.scale(-1); dir = dir.copy(); ! dir.scale(offset); cur.getVertex().move(dir.getX(), dir.getY(), dir.getZ()); } --- 1061,1067 ---- Direction cur = (Direction)diriter.next(); Vertex dir = cur.getDirection(); ! dir.scaleInPlace(-1); dir = dir.copy(); ! dir.scaleInPlace(offset); cur.getVertex().move(dir.getX(), dir.getY(), dir.getZ()); } Index: ClippingPlane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClippingPlane.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ClippingPlane.java 13 Nov 2007 09:46:27 -0000 1.22 --- ClippingPlane.java 13 Nov 2007 12:19:29 -0000 1.23 *************** *** 87,91 **** Vertex n = c.getN().copy(); n.normalize(); ! n.scale(0.00001); c.move(n.getX(), n.getY(), n.getZ()); plane = c.plane(); --- 87,91 ---- Vertex n = c.getN().copy(); n.normalize(); ! n.scaleInPlace(0.00001); c.move(n.getX(), n.getY(), n.getZ()); plane = c.plane(); Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** Camera.java 12 Oct 2007 14:34:37 -0000 1.46 --- Camera.java 13 Nov 2007 12:19:29 -0000 1.47 *************** *** 388,397 **** public static void rotateHorizontallyEye(Camera c, double angle) { Vertex up = new Vertex(c.roll[0], c.roll[1], c.roll[2]); ! up.scale(1 / up.length()); double x = c.center[0] - c.camera[0]; double y = c.center[1] - c.camera[1]; double z = c.center[2] - c.camera[2]; Vertex forward = new Vertex(x, y, z); ! forward.scale(1 / forward.length()); Geometry.rotate(angle, 0, 0, 1, c.center, c.camera); Geometry.rotate(angle, 0, 0, 1, c.roll, new double[]{0, 0, 0}); --- 388,397 ---- public static void rotateHorizontallyEye(Camera c, double angle) { Vertex up = new Vertex(c.roll[0], c.roll[1], c.roll[2]); ! up.scaleInPlace(1 / up.length()); double x = c.center[0] - c.camera[0]; double y = c.center[1] - c.camera[1]; double z = c.center[2] - c.camera[2]; Vertex forward = new Vertex(x, y, z); ! forward.scaleInPlace(1 / forward.length()); Geometry.rotate(angle, 0, 0, 1, c.center, c.camera); Geometry.rotate(angle, 0, 0, 1, c.roll, new double[]{0, 0, 0}); *************** *** 405,416 **** public static void rotateVerticallyEye(Camera c, double angle) { Vertex up = new Vertex(c.roll[0], c.roll[1], c.roll[2]); ! up.scale(1 / up.length()); double x = c.center[0] - c.camera[0]; double y = c.center[1] - c.camera[1]; double z = c.center[2] - c.camera[2]; Vertex forward = new Vertex(x, y, z); ! forward.scale(1 / forward.length()); Vertex sidewards = up.cross(forward); ! sidewards.scale(1 / sidewards.length()); Geometry.rotate(angle, sidewards.getX(), sidewards.getY(), sidewards.getZ(), --- 405,416 ---- public static void rotateVerticallyEye(Camera c, double angle) { Vertex up = new Vertex(c.roll[0], c.roll[1], c.roll[2]); ! up.scaleInPlace(1 / up.length()); double x = c.center[0] - c.camera[0]; double y = c.center[1] - c.camera[1]; double z = c.center[2] - c.camera[2]; Vertex forward = new Vertex(x, y, z); ! forward.scaleInPlace(1 / forward.length()); Vertex sidewards = up.cross(forward); ! sidewards.scaleInPlace(1 / sidewards.length()); Geometry.rotate(angle, sidewards.getX(), sidewards.getY(), sidewards.getZ(), *************** *** 451,455 **** //forward.scale(1 / forward.length()); Vertex sidewards = up.cross(forward); ! sidewards.scale(1 / sidewards.length()); Geometry.rotate(angle, sidewards.getX(), sidewards.getY(), sidewards.getZ(), --- 451,455 ---- //forward.scale(1 / forward.length()); Vertex sidewards = up.cross(forward); ! sidewards.scaleInPlace(1 / sidewards.length()); Geometry.rotate(angle, sidewards.getX(), sidewards.getY(), sidewards.getZ(), *************** *** 471,475 **** double z = c.center[2] - c.camera[2]; Vertex forward = new Vertex(x, y, z); ! forward.scale(1 / forward.length()); Geometry.rotate(angle / 2, forward.getX(), forward.getY(), forward.getZ(), c.roll, new double[] {0, 0, 0}); --- 471,475 ---- double z = c.center[2] - c.camera[2]; Vertex forward = new Vertex(x, y, z); ! forward.scaleInPlace(1 / forward.length()); Geometry.rotate(angle / 2, forward.getX(), forward.getY(), forward.getZ(), c.roll, new double[] {0, 0, 0}); *************** *** 522,526 **** if (p1 != null && p2 != null) { Vertex modelCenter = p1.minus(p2); ! modelCenter.scale(1.0 / 2.0); modelCenter = modelCenter.add(p2); //expand sphere if needs --- 522,526 ---- if (p1 != null && p2 != null) { Vertex modelCenter = p1.minus(p2); ! modelCenter.scaleInPlace(1.0 / 2.0); modelCenter = modelCenter.add(p2); //expand sphere if needs *************** *** 533,537 **** if (dist > radius) { radius = (dist + radius) / 2.0; ! dV.scale((dist - radius) / dist); modelCenter = modelCenter.add(dV); } --- 533,537 ---- if (dist > radius) { radius = (dist + radius) / 2.0; ! dV.scaleInPlace((dist - radius) / dist); modelCenter = modelCenter.add(dV); } *************** *** 547,551 **** camera[1] - center[1], camera[2] - center[2]); ! cameraPos.scale(cameraDistance / cameraPos.length()); cameraPos = cameraPos.add(modelCenter); setCenter(new double[] {modelCenter.getX(), --- 547,551 ---- camera[1] - center[1], camera[2] - center[2]); ! cameraPos.scaleInPlace(cameraDistance / cameraPos.length()); cameraPos = cameraPos.add(modelCenter); setCenter(new double[] {modelCenter.getX(), *************** *** 791,795 **** double[] center = current.getCenter(); Vertex back = new Vertex(camera).minus(new Vertex(center)); ! back.scale(length / back.length()); camera[0] = center[0] + back.getX(); camera[1] = center[1] + back.getY(); --- 791,795 ---- double[] center = current.getCenter(); Vertex back = new Vertex(camera).minus(new Vertex(center)); ! back.scaleInPlace(length / back.length()); camera[0] = center[0] + back.getX(); camera[1] = center[1] + back.getY(); Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Plane.java 28 Sep 2007 14:04:58 -0000 1.31 --- Plane.java 13 Nov 2007 12:19:29 -0000 1.32 *************** *** 105,109 **** public Vertex normal() { Vertex normal = new Vertex(a, b, c); ! normal.scale(1 / normal.length()); return normal; } --- 105,109 ---- public Vertex normal() { Vertex normal = new Vertex(a, b, c); ! normal.scaleInPlace(1 / normal.length()); return normal; } *************** *** 167,171 **** Vertex temp = alfa.cross(beta); Vertex norm = temp.cross(beta); ! norm.scale(1 / norm.length()); Vertex intersec = intersection(rayIn); double a = norm.getX(); --- 167,171 ---- Vertex temp = alfa.cross(beta); Vertex norm = temp.cross(beta); ! norm.scaleInPlace(1 / norm.length()); Vertex intersec = intersection(rayIn); double a = norm.getX(); *************** *** 235,239 **** Vertex normal = normal(); double t = vector.dot(normal()); ! normal.scale(t / normal.length()); vector = vector.minus(normal); return origin().add(vector); --- 235,239 ---- Vertex normal = normal(); double t = vector.dot(normal()); ! normal.scaleInPlace(t / normal.length()); vector = vector.minus(normal); return origin().add(vector); *************** *** 316,320 **** i.setY(i.getY() - n.getY() * t); i.setZ(i.getZ() - n.getZ() * t); ! i.scale(1 / i.length()); j = n.cross(i); --- 316,320 ---- i.setY(i.getY() - n.getY() * t); i.setZ(i.getZ() - n.getZ() * t); ! i.scaleInPlace(1 / i.length()); j = n.cross(i); Index: SpaceAnalysis.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SpaceAnalysis.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SpaceAnalysis.java 29 Sep 2007 13:06:34 -0000 1.7 --- SpaceAnalysis.java 13 Nov 2007 12:19:29 -0000 1.8 *************** *** 125,129 **** Vertex i = leader.normal(); int direction = travel(leader, edge); ! n.scale(direction); Surface selected = leader; double minimum = 2 * Math.PI; --- 125,129 ---- Vertex i = leader.normal(); int direction = travel(leader, edge); ! n.scaleInPlace(direction); Surface selected = leader; double minimum = 2 * Math.PI; *************** *** 133,137 **** Vertex normal = current.normal(); if (travel(current, edge) != direction) { ! normal.scale(-1); } double t = i.dot(normal); --- 133,137 ---- Vertex normal = current.normal(); if (travel(current, edge) != direction) { ! normal.scaleInPlace(-1); } double t = i.dot(normal); Index: Direction.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Direction.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Direction.java 27 Sep 2007 10:41:45 -0000 1.15 --- Direction.java 13 Nov 2007 12:19:29 -0000 1.16 *************** *** 55,59 **** double slideScale; Vertex vunit = v.copy(); ! vunit.scale(1 / v.length()); if (v.getX() != 0) { slideScale = v.getX() / (slideDir.dot(vunit) * vunit.getX()); --- 55,59 ---- double slideScale; Vertex vunit = v.copy(); ! vunit.scaleInPlace(1 / v.length()); if (v.getX() != 0) { slideScale = v.getX() / (slideDir.dot(vunit) * vunit.getX()); *************** *** 64,68 **** } direction = slideDir; ! direction.scale(slideScale); } --- 64,68 ---- } direction = slideDir; ! direction.scaleInPlace(slideScale); } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.207 retrieving revision 1.208 diff -C2 -d -r1.207 -r1.208 *** Space.java 13 Nov 2007 10:48:39 -0000 1.207 --- Space.java 13 Nov 2007 12:19:29 -0000 1.208 *************** *** 1165,1169 **** average = average.add((Vertex)it.next()); } ! average.scale(1.0 / (double)verts.size()); } return average; --- 1165,1169 ---- average = average.add((Vertex)it.next()); } ! average.scaleInPlace(1.0 / (double)verts.size()); } return average; *************** *** 1884,1890 **** Vertex spaceVector = s.normal(); if (s.getFrontDomain() == this) { ! spaceVector.scale(1 / spaceVector.length()); } else if (s.getBackDomain() == this) { ! spaceVector.scale(-1 / spaceVector.length()); } else { return false; --- 1884,1890 ---- Vertex spaceVector = s.normal(); if (s.getFrontDomain() == this) { ! spaceVector.scaleInPlace(1 / spaceVector.length()); } else if (s.getBackDomain() == this) { ! spaceVector.scaleInPlace(-1 / spaceVector.length()); } else { return false; *************** *** 1915,1919 **** //Building a coordinate system: Vertex n = sharedEdge.getDirection(); ! n.scale(1 / n.length()); Vertex j = startSurface.normal(); --- 1915,1919 ---- //Building a coordinate system: Vertex n = sharedEdge.getDirection(); ! n.scaleInPlace(1 / n.length()); Vertex j = startSurface.normal(); *************** *** 1922,1928 **** } if (startSurface.getFrontDomain() == this) { ! j.scale(1 / j.length()); } else { ! j.scale(-1 / j.length()); } --- 1922,1928 ---- } if (startSurface.getFrontDomain() == this) { ! j.scaleInPlace(1 / j.length()); } else { ! j.scaleInPlace(-1 / j.length()); } *************** *** 1937,1941 **** n.getZ() * sharedVertex.getZ())); Vertex i = (p.project(sharedVertex)).minus(p.project(adjacentVertex)); ! i.scale(1 / i.length()); CoordinateSystem cs = new CoordinateSystem(i, j , n, sharedVertex); --- 1937,1941 ---- n.getZ() * sharedVertex.getZ())); Vertex i = (p.project(sharedVertex)).minus(p.project(adjacentVertex)); ! i.scaleInPlace(1 / i.length()); CoordinateSystem cs = new CoordinateSystem(i, j , n, sharedVertex); *************** *** 1983,1987 **** Vertex projNotShared = coordinateSystem.projection(notShared); Vertex projEdgeDir = projNotShared.minus(projShared); ! projEdgeDir.scale(1 / projEdgeDir.length()); Vertex xAxis = coordinateSystem.getI().copy(); double cosAngle = xAxis.dot(projEdgeDir); --- 1983,1987 ---- Vertex projNotShared = coordinateSystem.projection(notShared); Vertex projEdgeDir = projNotShared.minus(projShared); ! projEdgeDir.scaleInPlace(1 / projEdgeDir.length()); Vertex xAxis = coordinateSystem.getI().copy(); double cosAngle = xAxis.dot(projEdgeDir); Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** Geometry.java 9 Nov 2007 09:45:25 -0000 1.64 --- Geometry.java 13 Nov 2007 12:19:29 -0000 1.65 *************** *** 122,128 **** double tetra = angle(projection); if (tetra > 0) { ! normal.scale(-1); } ! normal.scale(1 / normal.length()); return normal; } --- 122,128 ---- double tetra = angle(projection); if (tetra > 0) { ! normal.scaleInPlace(-1); } ! normal.scaleInPlace(1 / normal.length()); return normal; } *************** *** 222,226 **** double t = v.dot(normal); Vertex up = normal.copy(); ! up.scale(t); projection.add(v.minus(up)); } --- 222,226 ---- double t = v.dot(normal); Vertex up = normal.copy(); ! up.scaleInPlace(t); projection.add(v.minus(up)); } Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** Line.java 12 Nov 2007 08:05:25 -0000 1.36 --- Line.java 13 Nov 2007 12:19:29 -0000 1.37 *************** *** 130,134 **** public Vertex getPointAt(double t) { Vertex tmp = direction.copy(); ! tmp.scale(t); return getOrigin().add(tmp); } --- 130,134 ---- public Vertex getPointAt(double t) { Vertex tmp = direction.copy(); ! tmp.scaleInPlace(t); return getOrigin().add(tmp); } *************** *** 195,199 **** Vertex origin = getOrigin(); Vertex direction = getDirection().copy(); ! direction.scale(length); Vertex from = origin.minus(direction); Vertex to = origin.add(direction); --- 195,199 ---- Vertex origin = getOrigin(); Vertex direction = getDirection().copy(); ! direction.scaleInPlace(length); Vertex from = origin.minus(direction); Vertex to = origin.add(direction); *************** *** 261,266 **** double s = ((v2 * w1 - v1 * w2) / denom); double t = ((u1 * w2 - u2 * w1) / -denom); ! d.scale(-s); ! c.scale(-t); Vertex inter1 = d.add(o); Vertex inter2 = c.add(p); --- 261,266 ---- double s = ((v2 * w1 - v1 * w2) / denom); double t = ((u1 * w2 - u2 * w1) / -denom); ! d.scaleInPlace(-s); ! c.scaleInPlace(-t); Vertex inter1 = d.add(o); Vertex inter2 = c.add(p); Index: EnergyCalc.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/EnergyCalc.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** EnergyCalc.java 19 Sep 2007 09:28:22 -0000 1.12 --- EnergyCalc.java 13 Nov 2007 12:19:29 -0000 1.13 *************** *** 94,98 **** Vertex normal = current.normal(); if (current.getBackDomain().isConstructionSpace()) { ! normal.scale(-1); } Vertex origin = current.center(); --- 94,98 ---- Vertex normal = current.normal(); if (current.getBackDomain().isConstructionSpace()) { ! normal.scaleInPlace(-1); } Vertex origin = current.center(); Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** Vertex.java 13 Nov 2007 09:42:24 -0000 1.67 --- Vertex.java 13 Nov 2007 12:19:29 -0000 1.68 *************** *** 218,222 **** public Vertex copy(double scale) { Vertex v = this.copy(); ! v.scale(scale); return v; } --- 218,222 ---- public Vertex copy(double scale) { Vertex v = this.copy(); ! v.scaleInPlace(scale); return v; } *************** *** 239,251 **** } ! /** ! * scales the vertex by the the given double ! * @param scale The scale ! */ ! public void scale(double scale) { ! setX(getX() * scale); ! setY(getY() * scale); ! setZ(getZ() * scale); ! } /** --- 239,243 ---- } ! /** *************** *** 384,387 **** --- 376,389 ---- this.setZ(getZ() + dz); } + + /** + * scales the vertex by the the given double + * @param scale The scale + */ + public void scaleInPlace(double scale) { + setX(getX() * scale); + setY(getY() * scale); + setZ(getZ() * scale); + } /** *************** *** 498,502 **** public void normalize() { if (getX() != 0.0 || getY() != 0.0 || getZ() != 0.0) { ! scale(1 / length()); } } --- 500,504 ---- public void normalize() { if (getX() != 0.0 || getY() != 0.0 || getZ() != 0.0) { ! scaleInPlace(1 / length()); } } *************** *** 546,550 **** double scale = this.dot(onto) / onto.dot(onto); Vertex res = onto.copy(); ! res.scale(scale); return res; } --- 548,552 ---- double scale = this.dot(onto) / onto.dot(onto); Vertex res = onto.copy(); ! res.scaleInPlace(scale); return res; } |
From: Michael L. <he...@us...> - 2007-11-13 12:19:32
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/constraints In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22683/src/net/sourceforge/bprocessor/model/constraints Modified Files: OffsetConstraint.java Log Message: renamed Vertex.scale to scaleInPlace Index: OffsetConstraint.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/constraints/OffsetConstraint.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** OffsetConstraint.java 16 Apr 2007 15:55:43 -0000 1.7 --- OffsetConstraint.java 13 Nov 2007 12:19:30 -0000 1.8 *************** *** 135,139 **** Vertex origin = system.getOrigin(); Vertex n = system.getN(); ! n.scale(1 / n.length()); Vertex v = slave.getFirstVertex(); Vertex u = v.minus(origin); --- 135,139 ---- Vertex origin = system.getOrigin(); Vertex n = system.getN(); ! n.scaleInPlace(1 / n.length()); Vertex v = slave.getFirstVertex(); Vertex u = v.minus(origin); *************** *** 150,154 **** CoordinateSystem system = master.coordinateSystem(); Vertex n = system.getN(); ! n.scale(1 / n.length()); Set vertices = new HashSet(); --- 150,154 ---- CoordinateSystem system = master.coordinateSystem(); Vertex n = system.getN(); ! n.scaleInPlace(1 / n.length()); Set vertices = new HashSet(); |
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22683/src/net/sourceforge/bprocessor/model/modellor Modified Files: InnerWallModellor.java ModelBathModellor2.java TileModellor.java WindowModellor.java WallPartingModellor.java Log Message: renamed Vertex.scale to scaleInPlace Index: TileModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/TileModellor.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** TileModellor.java 5 Nov 2007 10:18:50 -0000 1.22 --- TileModellor.java 13 Nov 2007 12:19:30 -0000 1.23 *************** *** 353,362 **** Collection<Vertex> createdVerts, Vertex increment) { ! increment.scale(-1); do { slider.move(increment); } while (cs.translate(slider.getFrom()).getY() > minY && cs.translate(slider.getFrom()).getX() > minX); ! increment.scale(-1); do { List<Vertex> intersections = new LinkedList<Vertex>(); --- 353,362 ---- Collection<Vertex> createdVerts, Vertex increment) { ! increment.scaleInPlace(-1); do { slider.move(increment); } while (cs.translate(slider.getFrom()).getY() > minY && cs.translate(slider.getFrom()).getX() > minX); ! increment.scaleInPlace(-1); do { List<Vertex> intersections = new LinkedList<Vertex>(); Index: WindowModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/WindowModellor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** WindowModellor.java 9 Nov 2007 09:45:25 -0000 1.4 --- WindowModellor.java 13 Nov 2007 12:19:30 -0000 1.5 *************** *** 143,147 **** //make hole in frame Vertex normal = surface.normal(); ! normal.scale(-offset); inner.move(normal.getX(), normal.getY(), normal.getZ()); List holeedges = Edge.offset(inner.getEdges(), inner, -framewidth); --- 143,147 ---- //make hole in frame Vertex normal = surface.normal(); ! normal.scaleInPlace(-offset); inner.move(normal.getX(), normal.getY(), normal.getZ()); List holeedges = Edge.offset(inner.getEdges(), inner, -framewidth); Index: WallPartingModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/WallPartingModellor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** WallPartingModellor.java 5 Nov 2007 10:18:50 -0000 1.4 --- WallPartingModellor.java 13 Nov 2007 12:19:30 -0000 1.5 *************** *** 95,102 **** Vertex delta = outer.getDirection(); delta.normalize(); ! delta.scale(wallThickness - 0.005); outerCopy.getFrom().move(delta.getX(), delta.getY(), delta.getZ()); delta.normalize(); ! delta.scale(wallThickness); tileCopy.getFrom().move(delta.getX(), delta.getY(), delta.getZ()); fromInnerOffset = null; --- 95,102 ---- Vertex delta = outer.getDirection(); delta.normalize(); ! delta.scaleInPlace(wallThickness - 0.005); outerCopy.getFrom().move(delta.getX(), delta.getY(), delta.getZ()); delta.normalize(); ! delta.scaleInPlace(wallThickness); tileCopy.getFrom().move(delta.getX(), delta.getY(), delta.getZ()); fromInnerOffset = null; *************** *** 104,113 **** Vertex delta = outer.getDirection(); delta.normalize(); ! delta.scale(wallThickness); tileCopy.getFrom().move(delta.getX(), delta.getY(), delta.getZ()); if (corner.equals("Split")) { fromInnerOffset = delta; fromInnerOffset.normalize(); ! fromInnerOffset.scale(wallThickness - 0.005); } } --- 104,113 ---- Vertex delta = outer.getDirection(); delta.normalize(); ! delta.scaleInPlace(wallThickness); tileCopy.getFrom().move(delta.getX(), delta.getY(), delta.getZ()); if (corner.equals("Split")) { fromInnerOffset = delta; fromInnerOffset.normalize(); ! fromInnerOffset.scaleInPlace(wallThickness - 0.005); } } *************** *** 123,131 **** Vertex delta = outer.getDirection(); delta.normalize(); ! delta.scale(-1); ! delta.scale(wallThickness - 0.005); outerCopy.getTo().move(delta.getX(), delta.getY(), delta.getZ()); delta.normalize(); ! delta.scale(wallThickness); tileCopy.getTo().move(delta.getX(), delta.getY(), delta.getZ()); toInnerOffset = null; --- 123,131 ---- Vertex delta = outer.getDirection(); delta.normalize(); ! delta.scaleInPlace(-1); ! delta.scaleInPlace(wallThickness - 0.005); outerCopy.getTo().move(delta.getX(), delta.getY(), delta.getZ()); delta.normalize(); ! delta.scaleInPlace(wallThickness); tileCopy.getTo().move(delta.getX(), delta.getY(), delta.getZ()); toInnerOffset = null; *************** *** 133,143 **** Vertex delta = outer.getDirection(); delta.normalize(); ! delta.scale(-1); ! delta.scale(wallThickness); tileCopy.getTo().move(delta.getX(), delta.getY(), delta.getZ()); if (corner.equals("Split")) { toInnerOffset = delta; toInnerOffset.normalize(); ! toInnerOffset.scale(wallThickness - 0.005); } } --- 133,143 ---- Vertex delta = outer.getDirection(); delta.normalize(); ! delta.scaleInPlace(-1); ! delta.scaleInPlace(wallThickness); tileCopy.getTo().move(delta.getX(), delta.getY(), delta.getZ()); if (corner.equals("Split")) { toInnerOffset = delta; toInnerOffset.normalize(); ! toInnerOffset.scaleInPlace(wallThickness - 0.005); } } *************** *** 157,161 **** dir.normalize(); Vertex usedDir = dir.copy(); ! usedDir.scale(wallThickness - 0.005); inner.move(usedDir); Edge between1 = new Edge(outerCopy.getFrom(), inner.getFrom()); --- 157,161 ---- dir.normalize(); Vertex usedDir = dir.copy(); ! usedDir.scaleInPlace(wallThickness - 0.005); inner.move(usedDir); Edge between1 = new Edge(outerCopy.getFrom(), inner.getFrom()); *************** *** 172,180 **** //surface for tiles dir.normalize(); ! dir.scale(wallThickness - 0.005); tileCopy.move(dir); Edge inner2 = tileCopy.copy(); dir.normalize(); ! dir.scale(0.005); inner2.move(dir); between1 = new Edge(tileCopy.getFrom(), inner2.getFrom()); --- 172,180 ---- //surface for tiles dir.normalize(); ! dir.scaleInPlace(wallThickness - 0.005); tileCopy.move(dir); Edge inner2 = tileCopy.copy(); dir.normalize(); ! dir.scaleInPlace(0.005); inner2.move(dir); between1 = new Edge(tileCopy.getFrom(), inner2.getFrom()); Index: InnerWallModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/InnerWallModellor.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** InnerWallModellor.java 5 Nov 2007 10:18:50 -0000 1.10 --- InnerWallModellor.java 13 Nov 2007 12:19:30 -0000 1.11 *************** *** 228,232 **** if (vertical(e)) { dir.normalize(); ! dir.scale(JOIST_WIDTH); o = e.getFrom(); o = o.add(dir); --- 228,232 ---- if (vertical(e)) { dir.normalize(); ! dir.scaleInPlace(JOIST_WIDTH); o = e.getFrom(); o = o.add(dir); *************** *** 274,278 **** Vertex j = cs.getJ().copy(); j.normalize(); ! j.scale(SHEET_THICKNESS + JOIST_DEPTH); sheet2.move(j.getX(), j.getY(), j.getZ()); double correction = 1; --- 274,278 ---- Vertex j = cs.getJ().copy(); j.normalize(); ! j.scaleInPlace(SHEET_THICKNESS + JOIST_DEPTH); sheet2.move(j.getX(), j.getY(), j.getZ()); double correction = 1; *************** *** 375,379 **** j = surface.normal(); if (surface.getBackDomain() == space) { ! j.scale(-1); } i = j.cross(n); --- 375,379 ---- j = surface.normal(); if (surface.getBackDomain() == space) { ! j.scaleInPlace(-1); } i = j.cross(n); *************** *** 385,389 **** Vertex topToBottom = vertical.otherVertex(origin).minus(origin); Vertex interval = horizontal.getDirection(); ! interval.scale(joistInterval / interval.length()); Vertex current = origin.copy(); current.move(interval.getX(), interval.getY(), interval.getZ()); --- 385,389 ---- Vertex topToBottom = vertical.otherVertex(origin).minus(origin); Vertex interval = horizontal.getDirection(); ! interval.scaleInPlace(joistInterval / interval.length()); Vertex current = origin.copy(); current.move(interval.getX(), interval.getY(), interval.getZ()); Index: ModelBathModellor2.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/ModelBathModellor2.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ModelBathModellor2.java 5 Nov 2007 10:18:50 -0000 1.10 --- ModelBathModellor2.java 13 Nov 2007 12:19:30 -0000 1.11 *************** *** 223,230 **** Vertex delta = outer.getDirection(); delta.normalize(); ! delta.scale(wallThickness - 0.005); outerCopy.getFrom().move(delta.getX(), delta.getY(), delta.getZ()); delta.normalize(); ! delta.scale(wallThickness); tileCopy.getFrom().move(delta.getX(), delta.getY(), delta.getZ()); fromInnerOffset = null; --- 223,230 ---- Vertex delta = outer.getDirection(); delta.normalize(); ! delta.scaleInPlace(wallThickness - 0.005); outerCopy.getFrom().move(delta.getX(), delta.getY(), delta.getZ()); delta.normalize(); ! delta.scaleInPlace(wallThickness); tileCopy.getFrom().move(delta.getX(), delta.getY(), delta.getZ()); fromInnerOffset = null; *************** *** 232,241 **** Vertex delta = outer.getDirection(); delta.normalize(); ! delta.scale(wallThickness); tileCopy.getFrom().move(delta.getX(), delta.getY(), delta.getZ()); if (corner.equals("Split")) { fromInnerOffset = delta; fromInnerOffset.normalize(); ! fromInnerOffset.scale(wallThickness - 0.005); } } --- 232,241 ---- Vertex delta = outer.getDirection(); delta.normalize(); ! delta.scaleInPlace(wallThickness); tileCopy.getFrom().move(delta.getX(), delta.getY(), delta.getZ()); if (corner.equals("Split")) { fromInnerOffset = delta; fromInnerOffset.normalize(); ! fromInnerOffset.scaleInPlace(wallThickness - 0.005); } } *************** *** 251,259 **** Vertex delta = outer.getDirection(); delta.normalize(); ! delta.scale(-1); ! delta.scale(wallThickness - 0.005); outerCopy.getTo().move(delta.getX(), delta.getY(), delta.getZ()); delta.normalize(); ! delta.scale(wallThickness); tileCopy.getTo().move(delta.getX(), delta.getY(), delta.getZ()); toInnerOffset = null; --- 251,259 ---- Vertex delta = outer.getDirection(); delta.normalize(); ! delta.scaleInPlace(-1); ! delta.scaleInPlace(wallThickness - 0.005); outerCopy.getTo().move(delta.getX(), delta.getY(), delta.getZ()); delta.normalize(); ! delta.scaleInPlace(wallThickness); tileCopy.getTo().move(delta.getX(), delta.getY(), delta.getZ()); toInnerOffset = null; *************** *** 261,271 **** Vertex delta = outer.getDirection(); delta.normalize(); ! delta.scale(-1); ! delta.scale(wallThickness); tileCopy.getTo().move(delta.getX(), delta.getY(), delta.getZ()); if (corner.equals("Split")) { toInnerOffset = delta; toInnerOffset.normalize(); ! toInnerOffset.scale(wallThickness - 0.005); } } --- 261,271 ---- Vertex delta = outer.getDirection(); delta.normalize(); ! delta.scaleInPlace(-1); ! delta.scaleInPlace(wallThickness); tileCopy.getTo().move(delta.getX(), delta.getY(), delta.getZ()); if (corner.equals("Split")) { toInnerOffset = delta; toInnerOffset.normalize(); ! toInnerOffset.scaleInPlace(wallThickness - 0.005); } } *************** *** 285,289 **** dir.normalize(); Vertex usedDir = dir.copy(); ! usedDir.scale(wallThickness - 0.005); inner.move(usedDir); Edge between1 = new Edge(outerCopy.getFrom(), inner.getFrom()); --- 285,289 ---- dir.normalize(); Vertex usedDir = dir.copy(); ! usedDir.scaleInPlace(wallThickness - 0.005); inner.move(usedDir); Edge between1 = new Edge(outerCopy.getFrom(), inner.getFrom()); *************** *** 300,308 **** //surface for tiles dir.normalize(); ! dir.scale(wallThickness - 0.005); tileCopy.move(dir); Edge inner2 = tileCopy.copy(); dir.normalize(); ! dir.scale(0.005); inner2.move(dir); between1 = new Edge(tileCopy.getFrom(), inner2.getFrom()); --- 300,308 ---- //surface for tiles dir.normalize(); ! dir.scaleInPlace(wallThickness - 0.005); tileCopy.move(dir); Edge inner2 = tileCopy.copy(); dir.normalize(); ! dir.scaleInPlace(0.005); inner2.move(dir); between1 = new Edge(tileCopy.getFrom(), inner2.getFrom()); *************** *** 546,550 **** Vertex orthoDir = alongE.cross(cross); Vertex deltaUnit = orthoDir.copy(); ! orthoDir.scale(wallThickness); double slideScale = 0; if (deltaUnit.getX() != 0) { --- 546,550 ---- Vertex orthoDir = alongE.cross(cross); Vertex deltaUnit = orthoDir.copy(); ! orthoDir.scaleInPlace(wallThickness); double slideScale = 0; if (deltaUnit.getX() != 0) { *************** *** 556,560 **** slideScale = orthoDir.getZ() / (direction.dot(deltaUnit) * deltaUnit.getZ()); } ! direction.scale(slideScale); //Create other edge and connections Edge moved = copy.copy(); --- 556,560 ---- slideScale = orthoDir.getZ() / (direction.dot(deltaUnit) * deltaUnit.getZ()); } ! direction.scaleInPlace(slideScale); //Create other edge and connections Edge moved = copy.copy(); |
From: Michael L. <he...@us...> - 2007-11-13 12:19:21
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22651/src/net/sourceforge/bprocessor/gl/tool Modified Files: OffsetTool.java ExtrusionTool.java ClipplaneTool.java EdgeMoveTool.java FinalMoveTool.java AbstractPencil.java TapeMeasure.java AbstractTool.java CameraFlyTool.java ArcTool.java RectTool.java AltMoveTool.java CameraWalkTool.java ControlledMoveTool.java Log Message: renamed Vertex.scale to scaleInPlace Index: EdgeMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/EdgeMoveTool.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** EdgeMoveTool.java 7 May 2007 13:29:49 -0000 1.3 --- EdgeMoveTool.java 13 Nov 2007 12:19:22 -0000 1.4 *************** *** 182,186 **** Vertex norm = ray.getDirection(); norm.normalize(); ! norm.scale(-1); dragplane = new Plane(norm.getX(), norm.getY(), norm.getZ(), start.vertex()); } else { --- 182,186 ---- Vertex norm = ray.getDirection(); norm.normalize(); ! norm.scaleInPlace(-1); dragplane = new Plane(norm.getX(), norm.getY(), norm.getZ(), start.vertex()); } else { Index: OffsetTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OffsetTool.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** OffsetTool.java 12 Nov 2007 20:11:55 -0000 1.22 --- OffsetTool.java 13 Nov 2007 12:19:21 -0000 1.23 *************** *** 119,127 **** if (offsetSurface.surrounds(current.vertex())) { if (outNormal.dot(current.vertex().minus(edgePoint)) > 0) { ! outNormal.scale(-1); } } else { if (outNormal.dot(current.vertex().minus(edgePoint)) < 0) { ! outNormal.scale(-1); } } --- 119,127 ---- if (offsetSurface.surrounds(current.vertex())) { if (outNormal.dot(current.vertex().minus(edgePoint)) > 0) { ! outNormal.scaleInPlace(-1); } } else { if (outNormal.dot(current.vertex().minus(edgePoint)) < 0) { ! outNormal.scaleInPlace(-1); } } *************** *** 136,145 **** if (s.surrounds(current.vertex())) { if (outNormal.dot(current.vertex().minus(edgePoint)) > 0) { ! outNormal.scale(-1); } log.debug("Surrounds"); } else { if (outNormal.dot(current.vertex().minus(edgePoint)) < 0) { ! outNormal.scale(-1); } } --- 136,145 ---- if (s.surrounds(current.vertex())) { if (outNormal.dot(current.vertex().minus(edgePoint)) > 0) { ! outNormal.scaleInPlace(-1); } log.debug("Surrounds"); } else { if (outNormal.dot(current.vertex().minus(edgePoint)) < 0) { ! outNormal.scaleInPlace(-1); } } *************** *** 201,205 **** Direction d = directionMap.get(origin); Vertex moveDelta = d.getDirection().copy(); ! moveDelta.scale(length); Vertex to = origin.add(moveDelta); d.getVertex().set(to); --- 201,205 ---- Direction d = directionMap.get(origin); Vertex moveDelta = d.getDirection().copy(); ! moveDelta.scaleInPlace(length); Vertex to = origin.add(moveDelta); d.getVertex().set(to); Index: ClipplaneTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ClipplaneTool.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ClipplaneTool.java 20 Jun 2007 13:17:56 -0000 1.12 --- ClipplaneTool.java 13 Nov 2007 12:19:22 -0000 1.13 *************** *** 59,63 **** boolean front = glv.getView().facingFront(system); if (front) { ! n.scale(-1); } system = new CoordinateSystem(i, j, n, o); --- 59,63 ---- boolean front = glv.getView().facingFront(system); if (front) { ! n.scaleInPlace(-1); } system = new CoordinateSystem(i, j, n, o); Index: ControlledMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ControlledMoveTool.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ControlledMoveTool.java 27 Sep 2007 10:40:38 -0000 1.9 --- ControlledMoveTool.java 13 Nov 2007 12:19:22 -0000 1.10 *************** *** 248,252 **** Vertex normal = surface.normal(); Vertex dir = edgeDir.cross(normal); ! dir.scale(1 / dir.length()); return dir; } --- 248,252 ---- Vertex normal = surface.normal(); Vertex dir = edgeDir.cross(normal); ! dir.scaleInPlace(1 / dir.length()); return dir; } *************** *** 266,280 **** if (slideMap != null && slideMap.keySet().containsAll(vertices)) { Vertex directionCopy = direction.copy(); ! directionCopy.scale(1 / directionCopy.length()); ! directionCopy.scale(delta.dot(directionCopy)); delta = directionCopy; if (delta.length() != 0) { Vertex deltaUnit = delta.copy(); ! deltaUnit.scale(1 / delta.length()); Iterator it = vertices.iterator(); while (it.hasNext()) { Vertex vertex = (Vertex)it.next(); Vertex slideDir = ((Vertex)slideMap.get(vertex)).copy(); ! slideDir.scale(1 / slideDir.length()); double slideScale; if (delta == null) { --- 266,280 ---- if (slideMap != null && slideMap.keySet().containsAll(vertices)) { Vertex directionCopy = direction.copy(); ! directionCopy.scaleInPlace(1 / directionCopy.length()); ! directionCopy.scaleInPlace(delta.dot(directionCopy)); delta = directionCopy; if (delta.length() != 0) { Vertex deltaUnit = delta.copy(); ! deltaUnit.scaleInPlace(1 / delta.length()); Iterator it = vertices.iterator(); while (it.hasNext()) { Vertex vertex = (Vertex)it.next(); Vertex slideDir = ((Vertex)slideMap.get(vertex)).copy(); ! slideDir.scaleInPlace(1 / slideDir.length()); double slideScale; if (delta == null) { *************** *** 294,298 **** slideScale = delta.getZ() / (slideDir.dot(deltaUnit) * deltaUnit.getZ()); } ! slideDir.scale(slideScale); vertex.move(slideDir.getX(), slideDir.getY(), slideDir.getZ()); } --- 294,298 ---- slideScale = delta.getZ() / (slideDir.dot(deltaUnit) * deltaUnit.getZ()); } ! slideDir.scaleInPlace(slideScale); vertex.move(slideDir.getX(), slideDir.getY(), slideDir.getZ()); } Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** ExtrusionTool.java 27 Sep 2007 10:39:43 -0000 1.69 --- ExtrusionTool.java 13 Nov 2007 12:19:22 -0000 1.70 *************** *** 443,447 **** Vertex dir = to.minus(from); dir.normalize(); ! dir.scale(length); to = from.add(dir); } else { --- 443,447 ---- Vertex dir = to.minus(from); dir.normalize(); ! dir.scaleInPlace(length); to = from.add(dir); } else { Index: TapeMeasure.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/TapeMeasure.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TapeMeasure.java 20 Jun 2007 13:17:55 -0000 1.4 --- TapeMeasure.java 13 Nov 2007 12:19:22 -0000 1.5 *************** *** 59,63 **** Vertex projected = current.vertex().minus(origin); double t = normal.dot(projected); ! normal.scale(t); projected = projected.minus(normal); Edge ortho = new Edge(origin, origin.add(projected)); --- 59,63 ---- Vertex projected = current.vertex().minus(origin); double t = normal.dot(projected); ! normal.scaleInPlace(t); projected = projected.minus(normal); Edge ortho = new Edge(origin, origin.add(projected)); *************** *** 156,160 **** Vertex direction = lengthEdge.getDirection(); direction.normalize(); ! direction.scale(value); Vertex origin = start.vertex().add(direction); Line line = new Line(origin, originalEdge.getDirection(), true, false); --- 156,160 ---- Vertex direction = lengthEdge.getDirection(); direction.normalize(); ! direction.scaleInPlace(value); Vertex origin = start.vertex().add(direction); Line line = new Line(origin, originalEdge.getDirection(), true, false); Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.135 retrieving revision 1.136 diff -C2 -d -r1.135 -r1.136 *** AbstractTool.java 12 Nov 2007 08:05:34 -0000 1.135 --- AbstractTool.java 13 Nov 2007 12:19:22 -0000 1.136 *************** *** 298,305 **** double z = c.getCenter()[2] - c.getCamera()[2]; Vertex forward = new Vertex(x, y, z); ! forward.scale(2 / forward.length()); Vertex sidewards = up.cross(forward); ! sidewards.scale(2 / sidewards.length()); ! up.scale(2 / up.length()); --- 298,305 ---- double z = c.getCenter()[2] - c.getCamera()[2]; Vertex forward = new Vertex(x, y, z); ! forward.scaleInPlace(2 / forward.length()); Vertex sidewards = up.cross(forward); ! sidewards.scaleInPlace(2 / sidewards.length()); ! up.scaleInPlace(2 / up.length()); Index: ArcTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ArcTool.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ArcTool.java 9 Nov 2007 09:45:32 -0000 1.19 --- ArcTool.java 13 Nov 2007 12:19:22 -0000 1.20 *************** *** 85,89 **** Vertex v1 = m.minus(p); ! v1.scale(0.5); Vertex m1 = p.add(v1); --- 85,89 ---- Vertex v1 = m.minus(p); ! v1.scaleInPlace(0.5); Vertex m1 = p.add(v1); *************** *** 92,100 **** v1.setX(-y); v1.setY(x); ! v1.scale(10 / v1.length()); Edge l1 = new Edge(m1.minus(v1), m1.add(v1)); Vertex v2 = m.minus(q); ! v2.scale(0.5); Vertex m2 = q.add(v2); --- 92,100 ---- v1.setX(-y); v1.setY(x); ! v1.scaleInPlace(10 / v1.length()); Edge l1 = new Edge(m1.minus(v1), m1.add(v1)); Vertex v2 = m.minus(q); ! v2.scaleInPlace(0.5); Vertex m2 = q.add(v2); *************** *** 103,107 **** v2.setX(-y); v2.setY(x); ! v2.scale(10 / v2.length()); Edge l2 = new Edge(m2.minus(v2), m2.add(v2)); l1.setStrippled(true); --- 103,107 ---- v2.setX(-y); v2.setY(x); ! v2.scaleInPlace(10 / v2.length()); Edge l2 = new Edge(m2.minus(v2), m2.add(v2)); l1.setStrippled(true); *************** *** 117,121 **** Vertex u1 = p.minus(center); radius = u1.length(); ! u1.scale(1 / radius); tetra1 = Math.acos(u1.getX()); if (u1.getY() < 0) { --- 117,121 ---- Vertex u1 = p.minus(center); radius = u1.length(); ! u1.scaleInPlace(1 / radius); tetra1 = Math.acos(u1.getX()); if (u1.getY() < 0) { *************** *** 123,127 **** } Vertex u2 = q.minus(center); ! u2.scale(1 / radius); tetra2 = Math.acos(u2.getX()); if (u2.getY() < 0) { --- 123,127 ---- } Vertex u2 = q.minus(center); ! u2.scaleInPlace(1 / radius); tetra2 = Math.acos(u2.getX()); if (u2.getY() < 0) { *************** *** 213,217 **** end = current; Vertex between = end.vertex().minus(first.vertex()); ! between.scale(0.5); start = new Intersection(first.vertex().add(between), Intersection.VERTEX, null); } else { --- 213,217 ---- end = current; Vertex between = end.vertex().minus(first.vertex()); ! between.scaleInPlace(0.5); start = new Intersection(first.vertex().add(between), Intersection.VERTEX, null); } else { Index: CameraWalkTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CameraWalkTool.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CameraWalkTool.java 20 Jun 2007 13:17:55 -0000 1.8 --- CameraWalkTool.java 13 Nov 2007 12:19:22 -0000 1.9 *************** *** 83,89 **** double z = c.getCenter()[2] - c.getCamera()[2]; Vertex forward = new Vertex(x, y, z); ! forward.scale(2 / forward.length()); Vertex sidewards = up.cross(forward); ! sidewards.scale(2 / sidewards.length()); if (e.getKeyCode() == KeyEvent.VK_UP) { --- 83,89 ---- double z = c.getCenter()[2] - c.getCamera()[2]; Vertex forward = new Vertex(x, y, z); ! forward.scaleInPlace(2 / forward.length()); Vertex sidewards = up.cross(forward); ! sidewards.scaleInPlace(2 / sidewards.length()); if (e.getKeyCode() == KeyEvent.VK_UP) { Index: CameraFlyTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CameraFlyTool.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CameraFlyTool.java 20 Jun 2007 13:17:56 -0000 1.10 --- CameraFlyTool.java 13 Nov 2007 12:19:22 -0000 1.11 *************** *** 84,90 **** double z = c.getCenter()[2] - c.getCamera()[2]; Vertex forward = new Vertex(x, y, z); ! forward.scale(2 / forward.length()); Vertex sidewards = up.cross(forward); ! sidewards.scale(2 / sidewards.length()); if (e.getKeyCode() == KeyEvent.VK_UP) { --- 84,90 ---- double z = c.getCenter()[2] - c.getCamera()[2]; Vertex forward = new Vertex(x, y, z); ! forward.scaleInPlace(2 / forward.length()); Vertex sidewards = up.cross(forward); ! sidewards.scaleInPlace(2 / sidewards.length()); if (e.getKeyCode() == KeyEvent.VK_UP) { Index: FinalMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** FinalMoveTool.java 8 Nov 2007 08:26:50 -0000 1.31 --- FinalMoveTool.java 13 Nov 2007 12:19:22 -0000 1.32 *************** *** 253,257 **** Vertex v = to.minus(current); double length = v.length(); ! v.scale(1 / length); direction = new Direction(current.copy(), v, Double.NEGATIVE_INFINITY, length); } else { --- 253,257 ---- Vertex v = to.minus(current); double length = v.length(); ! v.scaleInPlace(1 / length); direction = new Direction(current.copy(), v, Double.NEGATIVE_INFINITY, length); } else { *************** *** 299,303 **** } Vertex u = n.copy(); ! u.scale(t); current.set(original.add(u)); } --- 299,303 ---- } Vertex u = n.copy(); ! u.scaleInPlace(t); current.set(original.add(u)); } *************** *** 379,383 **** private void multiply(int i) { Vertex v = direction.copy(); ! v.scale(i); Mesh copy = mesh.copyAndAssign(new HashMap()); for (Vertex current : copy.vertices()) { --- 379,383 ---- private void multiply(int i) { Vertex v = direction.copy(); ! v.scaleInPlace(i); Mesh copy = mesh.copyAndAssign(new HashMap()); for (Vertex current : copy.vertices()) { *************** *** 394,398 **** double d = (double) i * delta; ! v.scale(d / v.length()); Mesh copy = mesh.copyAndAssign(new HashMap()); for (Vertex current : copy.vertices()) { --- 394,398 ---- double d = (double) i * delta; ! v.scaleInPlace(d / v.length()); Mesh copy = mesh.copyAndAssign(new HashMap()); for (Vertex current : copy.vertices()) { Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** AbstractPencil.java 12 Nov 2007 14:47:36 -0000 1.97 --- AbstractPencil.java 13 Nov 2007 12:19:22 -0000 1.98 *************** *** 737,741 **** Vertex v = current.vertex().minus(before); if (v.length() > Geometry.EPS) { ! v.scale(length / v.length()); Vertex to = before.add(v); current = new Intersection(to, Intersection.VERTEX, to); --- 737,741 ---- Vertex v = current.vertex().minus(before); if (v.length() > Geometry.EPS) { ! v.scaleInPlace(length / v.length()); Vertex to = before.add(v); current = new Intersection(to, Intersection.VERTEX, to); Index: AltMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AltMoveTool.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** AltMoveTool.java 29 May 2007 11:49:14 -0000 1.12 --- AltMoveTool.java 13 Nov 2007 12:19:22 -0000 1.13 *************** *** 92,96 **** Vertex normal = system.getN().copy(); double distance = normal.dot(delta); ! normal.scale(distance); Vertex to = from.add(normal); makeTarget(current); --- 92,96 ---- Vertex normal = system.getN().copy(); double distance = normal.dot(delta); ! normal.scaleInPlace(distance); Vertex to = from.add(normal); makeTarget(current); Index: RectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RectTool.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** RectTool.java 9 Nov 2007 09:45:32 -0000 1.24 --- RectTool.java 13 Nov 2007 12:19:22 -0000 1.25 *************** *** 79,84 **** Vertex delta = lastCurrent.minus(current.vertex()); Vertex baseProjection = baseEdge.getDirection(); ! baseProjection.scale(1 / baseProjection.length()); ! baseProjection.scale(delta.dot(baseProjection)); Vertex movement = baseProjection.minus(delta); movingEdge.move(movement.getX(), movement.getY(), movement.getZ()); --- 79,84 ---- Vertex delta = lastCurrent.minus(current.vertex()); Vertex baseProjection = baseEdge.getDirection(); ! baseProjection.scaleInPlace(1 / baseProjection.length()); ! baseProjection.scaleInPlace(delta.dot(baseProjection)); Vertex movement = baseProjection.minus(delta); movingEdge.move(movement.getX(), movement.getY(), movement.getZ()); *************** *** 100,104 **** double length = start.vertex().minus(current.vertex()).length(); Vertex direction = movingEdge.getFrom().minus(baseEdge.getTo()); ! direction.scale((length - direction.length()) / direction.length()); movingEdge.move(direction.getX(), direction.getY(), direction.getZ()); Geometry.insertEdges(rectangle); --- 100,104 ---- double length = start.vertex().minus(current.vertex()).length(); Vertex direction = movingEdge.getFrom().minus(baseEdge.getTo()); ! direction.scaleInPlace((length - direction.length()) / direction.length()); movingEdge.move(direction.getX(), direction.getY(), direction.getZ()); Geometry.insertEdges(rectangle); |