bprocessor-commit Mailing List for B-processor (Page 115)
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: Michael L. <he...@us...> - 2006-07-23 09:17:50
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16655/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Possible to draw in active plane Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.120 retrieving revision 1.121 diff -C2 -d -r1.120 -r1.121 *** View.java 21 Jul 2006 19:23:33 -0000 1.120 --- View.java 23 Jul 2006 09:17:44 -0000 1.121 *************** *** 263,266 **** --- 263,269 ---- private boolean selectIntersections; + /** Excluded for hit-detection */ + private Collection excluded; + /** The drawing mode. Either wireframe, solid og lighting */ protected int drawMode = View.LIGHTING_MODE; *************** *** 1055,1059 **** drawConstructorLine(cs.getOrigin(), n, dist); } ! } } --- 1058,1087 ---- drawConstructorLine(cs.getOrigin(), n, dist); } ! } else { ! if (cs.isActive()) { ! Vertex origin = cs.getOrigin(); ! Vertex v = i.copy(); ! Vertex u = j.copy(); ! v.scale(5); ! u.scale(5); ! Vertex a = origin.add(u).minus(v); ! Vertex b = origin.add(u).add(v); ! Vertex c = origin.minus(u).add(v); ! Vertex d = origin.minus(u).minus(v); ! ! gl.glEnable(GL.GL_POLYGON_STIPPLE); ! gl.glPolygonStipple(seethrough); ! if (colorize) { ! gl.glColor3fv(CONSTRUCTOR_COLOR); ! } ! gl.glBegin(GL.GL_QUADS); ! 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.glVertex3d(d.getX(), d.getY(), d.getZ()); ! gl.glEnd(); ! gl.glDisable(GL.GL_POLYGON_STIPPLE); ! } ! } } *************** *** 1691,1726 **** while (iter.hasNext()) { Constructor current = (Constructor) iter.next(); ! if (camera.getType() == Camera.PERSPECTIVE) { ! dist = (current.getOrigin().minus(v)).length() * scale; ! } ! if (selectIntersections) { ! pushName(gl, current.getOrigin()); ! drawVertexHit(current.getOrigin()); ! popName(gl); ! if (current instanceof Line) { ! Line line = (Line) current; ! ! Vertex origin = line.getOrigin(); ! Vertex direction = line.getDirection().copy(); ! direction.scale(View.gridSize() * 2); ! Vertex from = origin.minus(direction); ! Vertex to = origin.add(direction); ! Edge constructor = new Edge(from, to); ! constructor.setConstructor(true); ! ! Vertex tip = line.tip(dist / 16 + dist / 20); ! pushName(gl, tip); ! drawVertexHit(tip); popName(gl); ! if (current.isActive()) { ! pushName(gl, constructor); ! drawEdge(constructor); popName(gl); } } - } else { - pushName(gl, current); - drawGeneralConstructor(current, dist, false); - popName(gl); } } --- 1719,1756 ---- while (iter.hasNext()) { Constructor current = (Constructor) iter.next(); ! if (!excluded.contains(current)) { ! if (camera.getType() == Camera.PERSPECTIVE) { ! dist = (current.getOrigin().minus(v)).length() * scale; ! } ! if (selectIntersections) { ! pushName(gl, current.getOrigin()); ! drawVertexHit(current.getOrigin()); popName(gl); ! if (current instanceof Line) { ! Line line = (Line) current; ! Edge guide = line.edge(View.gridSize() * 2); ! Vertex tip = line.tip(dist / 16 + dist / 20); ! pushName(gl, tip); ! drawVertexHit(tip); popName(gl); + if (current.isActive()) { + pushName(gl, guide); + drawEdge(guide); + popName(gl); + } + } else if (current instanceof CoordinateSystem) { + CoordinateSystem system = (CoordinateSystem) current; + Surface surface = system.surface(5); + if (system.isActive() && system.onlyPlane()) { + pushName(gl, surface); + drawSurface(surface); + popName(gl); + } } + } else { + pushName(gl, current); + drawGeneralConstructor(current, dist, false); + popName(gl); } } } *************** *** 2237,2240 **** --- 2267,2272 ---- selectMode = ALL; selectIntersections = intersections; + excluded = unWantedEntities; + glv.repaint(true); |
From: Michael L. <he...@us...> - 2006-07-23 09:17:49
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16655/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Log Message: Possible to draw in active plane Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** AbstractPencil.java 21 Jul 2006 08:06:59 -0000 1.49 --- AbstractPencil.java 23 Jul 2006 09:17:44 -0000 1.50 *************** *** 25,30 **** --- 25,32 ---- import net.sourceforge.bprocessor.gl.view.Transformation; import net.sourceforge.bprocessor.gl.view.View; + import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.Geometric; import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Plane; *************** *** 884,887 **** --- 886,898 ---- affected.addAll(affectedEdges); affected.addAll(affectedSurfaces); + { + Iterator iter = moveElements.iterator(); + while (iter.hasNext()) { + Geometric current = (Geometric) iter.next(); + if (current.parent() instanceof Constructor) { + affected.add(current.parent()); + } + } + } return affected; } |
From: Michael L. <he...@us...> - 2006-07-23 09:17:42
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16633/src/net/sourceforge/bprocessor/model Modified Files: Line.java Geometric.java Point.java Project.java CoordinateSystem.java Log Message: Possible to draw in active plane Index: Geometric.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometric.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Geometric.java 18 Jul 2006 14:04:37 -0000 1.7 --- Geometric.java 23 Jul 2006 09:17:36 -0000 1.8 *************** *** 35,38 **** --- 35,47 ---- /** + * The parent is the by default the owning space. + * Can be overwritten to return something else. + * @return The parent + */ + public Geometric parent() { + return owner; + } + + /** * Get the name * @return The name Index: Point.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Point.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Point.java 21 Jul 2006 14:59:47 -0000 1.4 --- Point.java 23 Jul 2006 09:17:36 -0000 1.5 *************** *** 74,78 **** */ public String getGeneralName() { ! return "Constructor-Point"; } } --- 74,78 ---- */ public String getGeneralName() { ! return "Point"; } } Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** CoordinateSystem.java 21 Jul 2006 14:59:47 -0000 1.16 --- CoordinateSystem.java 23 Jul 2006 09:17:36 -0000 1.17 *************** *** 11,14 **** --- 11,15 ---- import java.util.HashSet; import java.util.Iterator; + import java.util.LinkedList; import java.util.List; import java.util.Set; *************** *** 250,262 **** */ public void setAttributes(List attributes) { ! // TODO Auto-generated method stub } ! /** * @see net.sourceforge.bprocessor.model.Parametric#getAttributes() */ public List getAttributes() { - // TODO Auto-generated method stub ArrayList res = new ArrayList(); return res; } --- 251,277 ---- */ public void setAttributes(List attributes) { ! Vertex orig = new Vertex(0, 0, 0); ! ! orig.setX(((Double)(((Attribute)attributes.get(1)).getValue())).doubleValue()); ! orig.setY(((Double)(((Attribute)attributes.get(2)).getValue())).doubleValue()); ! orig.setZ(((Double)(((Attribute)attributes.get(3)).getValue())).doubleValue()); ! setOrigin(orig); ! setActive(((Boolean)(((Attribute)attributes.get(4)).getValue())).booleanValue()); } ! /** * @see net.sourceforge.bprocessor.model.Parametric#getAttributes() */ public List getAttributes() { ArrayList res = new ArrayList(); + res.add(new Attribute("name", "Origin", false)); + res.add(new Attribute("X", new Double(getOrigin().getX()))); + res.add(new Attribute("Y", new Double(getOrigin().getY()))); + res.add(new Attribute("Z", new Double(getOrigin().getZ()))); + if (isActive()) { + res.add(new Attribute("Active", Boolean.TRUE)); + } else { + res.add(new Attribute("Active", Boolean.FALSE)); + } return res; } *************** *** 266,270 **** */ public String getGeneralName() { ! return "Constructor-Coordinatesystem"; } --- 281,289 ---- */ public String getGeneralName() { ! if (onlyPlane()) { ! return "Plane"; ! } else { ! return "Coordinatesystem"; ! } } *************** *** 284,286 **** --- 303,333 ---- onlyPlane = what; } + + /** + * Surface + * @param size Size + * @return Surface + */ + public Surface surface(double size) { + Vertex origin = getOrigin(); + 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); + Vertex c = origin.minus(u).add(v); + Vertex d = origin.minus(u).minus(v); + Edge e1 = new Edge(a, b); + Edge e2 = new Edge(b, c); + Edge e3 = new Edge(c, d); + Edge e4 = new Edge(d, a); + List edges = new LinkedList(); + edges.add(e1); + edges.add(e2); + edges.add(e3); + edges.add(e4); + Surface surface = new Surface(edges); + return surface; + } } Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Line.java 21 Jul 2006 14:59:47 -0000 1.13 --- Line.java 23 Jul 2006 09:17:36 -0000 1.14 *************** *** 139,143 **** */ public String getGeneralName() { ! return "Constructor-Line"; } --- 139,143 ---- */ public String getGeneralName() { ! return "Line"; } *************** *** 185,188 **** --- 185,204 ---- /** + * Return an edge for this line + * @param length The the length + * @return Edge + */ + public Edge edge(double length) { + Vertex origin = getOrigin(); + Vertex direction = getDirection().copy(); + direction.scale(length); + Vertex from = origin.minus(direction); + Vertex to = origin.add(direction); + Edge constructor = new Guide(from, to); + constructor.setConstructor(true); + return constructor; + } + + /** * Vertex representing the tip of the vector defining this line */ *************** *** 205,208 **** --- 221,253 ---- setDirection(minus(getOrigin())); } + + /** + * Return the line + * @return parent + */ + public Geometric parent() { + return Line.this; + } + } + /** + * Guide + */ + private class Guide extends Edge { + /** + * Constructor + * @param from Vertex + * @param to Vertex + */ + public Guide(Vertex from, Vertex to) { + super(from, to); + } + + /** + * Parent + * @return This line + */ + public Geometric parent() { + return Line.this; + } } } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** Project.java 21 Jul 2006 14:59:47 -0000 1.64 --- Project.java 23 Jul 2006 09:17:36 -0000 1.65 *************** *** 110,117 **** activeCoordinateSystem.setActive(true); world.add(activeCoordinateSystem); - - world.add(new Point(new Vertex(10, 10, 3))); - world.add(new Line(new Vertex(3, 3, 3), new Vertex(1, 1, 0), true)); - world.add(new Line(new Vertex(5, 0, 5), new Vertex(1, 0, 0), false)); constraints = new LinkedList(); globals = new ParameterBlock(); --- 110,113 ---- |
From: Michael L. <he...@us...> - 2006-07-21 19:23:37
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30545/src/net/sourceforge/bprocessor/gl/tool Modified Files: MoveTool.java Log Message: Made constructors hit-detectable with the select-tool Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** MoveTool.java 21 Jul 2006 12:48:12 -0000 1.61 --- MoveTool.java 21 Jul 2006 19:23:33 -0000 1.62 *************** *** 188,196 **** * @param e The KeyEvent */ ! public void keyPressed(KeyEvent e) { if (strategy != null) { strategy.keyPressed(e); } else { - super.keyPressed(e); if (current != null && moveEntities != null && --- 188,195 ---- * @param e The KeyEvent */ ! public void key(KeyEvent e) { if (strategy != null) { strategy.keyPressed(e); } else { if (current != null && moveEntities != null && |
From: Michael L. <he...@us...> - 2006-07-21 19:23:36
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30545/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Made constructors hit-detectable with the select-tool Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.119 retrieving revision 1.120 diff -C2 -d -r1.119 -r1.120 *** View.java 21 Jul 2006 14:57:26 -0000 1.119 --- View.java 21 Jul 2006 19:23:33 -0000 1.120 *************** *** 260,263 **** --- 260,266 ---- private int selectMode; + /** Are intersections wanted in hit-detection? */ + private boolean selectIntersections; + /** The drawing mode. Either wireframe, solid og lighting */ protected int drawMode = View.LIGHTING_MODE; *************** *** 531,535 **** Camera camera = Project.getInstance().getCurrentCamera(); double scale = (camera.getFocalwidth() / 65) * (500 / height); ! drawCoordinateSystem(Project.getInstance().getActiveCoordinateSystem(), camera.dist() * scale); Iterator clipit = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); --- 534,539 ---- Camera camera = Project.getInstance().getCurrentCamera(); double scale = (camera.getFocalwidth() / 65) * (500 / height); ! drawCoordinateSystem(Project.getInstance().getActiveCoordinateSystem(), ! camera.dist() * scale, true); Iterator clipit = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); *************** *** 913,916 **** --- 917,930 ---- drawClipplane(cp); gl.glEnable(GL.GL_DEPTH_TEST); + } else if (o instanceof Constructor) { + Constructor c = (Constructor) o; + Camera camera = Project.getInstance().getCurrentCamera(); + Vertex v = new Vertex(camera.getCamera()); + double scale = (camera.getFocalwidth() / 65) * (500 / height); + double dist = v.minus(new Vertex(camera.getCenter())).length() * scale; + if (camera.getType() == Camera.PERSPECTIVE) { + dist = (c.getOrigin().minus(v)).length() * scale; + } + drawGeneralConstructor(c, dist, false); } } *************** *** 970,991 **** dist = (c.getOrigin().minus(v)).length() * scale; } ! ! if (o instanceof Point) { ! gl.glColor3fv(CONSTRUCTOR_COLOR); ! drawConstructorPoint(((Point)o).getOrigin(), dist); ! } else if (o instanceof Line) { ! gl.glColor3fv(CONSTRUCTOR_COLOR); ! Line l = (Line)o; ! //drawConstructorPoint(l.getOrigin(), dist); ! drawConstructorVector(l.getOrigin(), l.getDirection(), dist); ! if (l.isActive()) { ! drawConstructorLine(l.getOrigin(), l.getDirection(), dist); ! } ! } else if (o instanceof CoordinateSystem) { ! CoordinateSystem coo = (CoordinateSystem)o; ! if (cs != coo) { ! drawCoordinateSystem(coo, dist); ! } ! } } } else { --- 984,988 ---- dist = (c.getOrigin().minus(v)).length() * scale; } ! drawGeneralConstructor(c, dist, true); } } else { *************** *** 997,1013 **** /** * draw the coordinatesystem * @param cs The coordinatesystem * @param dist The distance to the center of the system */ ! private void drawCoordinateSystem(CoordinateSystem cs, double dist) { Vertex i = cs.getI(); Vertex j = cs.getJ(); ! gl.glColor3fv(X_AXIS_COLOR); drawConstructorVector(cs.getOrigin(), i, dist); if (cs.isActive()) { drawConstructorLine(cs.getOrigin(), i, dist); } ! gl.glColor3fv(Y_AXIS_COLOR); drawConstructorVector(cs.getOrigin(), j, dist); if (cs.isActive()) { --- 994,1045 ---- /** + * Draw a constructor + * @param constructor The constructor + * @param dist The dist parameter + * @param colorize Apply color + */ + private void drawGeneralConstructor(Constructor constructor, double dist, boolean colorize) { + if (constructor instanceof Point) { + if (colorize) { + gl.glColor3fv(CONSTRUCTOR_COLOR); + } + drawConstructorPoint(((Point)constructor).getOrigin(), dist); + } else if (constructor instanceof Line) { + if (colorize) { + gl.glColor3fv(CONSTRUCTOR_COLOR); + } + Line l = (Line)constructor; + drawConstructorVector(l.getOrigin(), l.getDirection(), dist); + if (l.isActive()) { + drawConstructorLine(l.getOrigin(), l.getDirection(), dist); + } + } else if (constructor instanceof CoordinateSystem) { + CoordinateSystem system = (CoordinateSystem)constructor; + CoordinateSystem cs = Project.getInstance().getActiveCoordinateSystem(); + if (cs != system) { + drawCoordinateSystem(system, dist, colorize); + } + } + } + + /** * draw the coordinatesystem * @param cs The coordinatesystem * @param dist The distance to the center of the system + * @param colorize Apply color */ ! private void drawCoordinateSystem(CoordinateSystem cs, double dist, boolean colorize) { Vertex i = cs.getI(); Vertex j = cs.getJ(); ! if (colorize) { ! gl.glColor3fv(X_AXIS_COLOR); ! } drawConstructorVector(cs.getOrigin(), i, dist); if (cs.isActive()) { drawConstructorLine(cs.getOrigin(), i, dist); } ! if (colorize) { ! gl.glColor3fv(Y_AXIS_COLOR); ! } drawConstructorVector(cs.getOrigin(), j, dist); if (cs.isActive()) { *************** *** 1016,1020 **** if (!cs.onlyPlane()) { Vertex n = cs.getN(); ! gl.glColor3fv(Z_AXIS_COLOR); drawConstructorVector(cs.getOrigin(), n, dist); if (cs.isActive()) { --- 1048,1054 ---- if (!cs.onlyPlane()) { Vertex n = cs.getN(); ! if (colorize) { ! gl.glColor3fv(Z_AXIS_COLOR); ! } drawConstructorVector(cs.getOrigin(), n, dist); if (cs.isActive()) { *************** *** 1653,1686 **** double dist = v.minus(new Vertex(camera.getCenter())).length() * scale; ! Iterator iter = space.getConstructors().iterator(); while (iter.hasNext()) { Constructor current = (Constructor) iter.next(); ! pushName(gl, current.getOrigin()); ! drawVertexHit(current.getOrigin()); ! popName(gl); ! if (current instanceof Line) { ! Line line = (Line) current; ! ! Vertex origin = line.getOrigin(); ! Vertex direction = line.getDirection().copy(); ! direction.scale(View.gridSize() * 2); ! Vertex from = origin.minus(direction); ! Vertex to = origin.add(direction); ! Edge constructor = new Edge(from, to); ! constructor.setConstructor(true); ! ! if (camera.getType() == Camera.PERSPECTIVE) { ! dist = (origin.minus(v)).length() * scale; ! } ! Vertex tip = line.tip(dist / 16 + dist / 20); ! pushName(gl, tip); ! drawVertexHit(tip); popName(gl); ! if (current.isActive()) { ! pushName(gl, constructor); ! drawEdge(constructor); popName(gl); } } } --- 1687,1726 ---- double dist = v.minus(new Vertex(camera.getCenter())).length() * scale; ! Iterator iter = space.getConstructors().iterator(); while (iter.hasNext()) { Constructor current = (Constructor) iter.next(); ! if (camera.getType() == Camera.PERSPECTIVE) { ! dist = (current.getOrigin().minus(v)).length() * scale; ! } ! if (selectIntersections) { ! pushName(gl, current.getOrigin()); ! drawVertexHit(current.getOrigin()); popName(gl); ! if (current instanceof Line) { ! Line line = (Line) current; ! ! Vertex origin = line.getOrigin(); ! Vertex direction = line.getDirection().copy(); ! direction.scale(View.gridSize() * 2); ! Vertex from = origin.minus(direction); ! Vertex to = origin.add(direction); ! Edge constructor = new Edge(from, to); ! constructor.setConstructor(true); ! ! Vertex tip = line.tip(dist / 16 + dist / 20); ! pushName(gl, tip); ! drawVertexHit(tip); popName(gl); + if (current.isActive()) { + pushName(gl, constructor); + drawEdge(constructor); + popName(gl); + } } + } else { + pushName(gl, current); + drawGeneralConstructor(current, dist, false); + popName(gl); } } *************** *** 2196,2199 **** --- 2236,2240 ---- picking = 10; selectMode = ALL; + selectIntersections = intersections; glv.repaint(true); |
From: rimestad <rim...@us...> - 2006-07-21 15:15:09
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29800/src/net/sourceforge/bprocessor/gui Modified Files: Toolbar.java Log Message: Added mnemonics to most buttons, the only twist is that alt have to be pressed now to activate buttons, but all tooltip include mnemonic info, which look good. Added tooltip to all buttons. Index: Toolbar.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/Toolbar.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Toolbar.java 13 Jun 2006 09:42:35 -0000 1.6 --- Toolbar.java 21 Jul 2006 15:15:01 -0000 1.7 *************** *** 63,70 **** * Register a toolbar action, with a push button. * @param action The action * @return The Button */ ! public JButton registerPushButtonAction(Action action) { JButton tb = new JButton(action); toolBar.add(tb); return tb; --- 63,72 ---- * Register a toolbar action, with a push button. * @param action The action + * @param tooltip The tooltip * @return The Button */ ! public JButton registerPushButtonAction(Action action, String tooltip) { JButton tb = new JButton(action); + tb.setToolTipText(tooltip); toolBar.add(tb); return tb; |
From: rimestad <rim...@us...> - 2006-07-21 15:15:08
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29791/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java ToolFactory.java Log Message: Added mnemonics to most buttons, the only twist is that alt have to be pressed now to activate buttons, but all tooltip include mnemonic info, which look good. Added tooltip to all buttons. Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** ToolFactory.java 21 Jul 2006 08:58:58 -0000 1.54 --- ToolFactory.java 21 Jul 2006 15:14:57 -0000 1.55 *************** *** 21,24 **** --- 21,25 ---- import java.awt.Toolkit; import java.awt.event.ActionEvent; + import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; *************** *** 49,53 **** /** buttons */ ! private Map buttons; /** button group */ --- 50,54 ---- /** buttons */ ! protected Map buttons; /** button group */ *************** *** 219,236 **** selBut = this.registerTool(Tool.SELECT_TOOL, select, "Biconselecttool.gif", "Select"); pencilBut = this.registerTool(Tool.PENCIL_TOOL, pencil, "Biconpentool.gif", "Pencil"); eraserBut = this.registerTool(Tool.ERASER_TOOL, eraser, "Biconeraser.gif", "Eraser"); ! this.registerTool(Tool.ALT_RECT_TOOL, altRect, "Biconaltrect.gif", "Rectangle"); ! this.registerTool(Tool.ARC_TOOL, arc, "Barc.gif", "Arc"); ! tb.addSeparator(3); extrudeBut = this.registerTool(Tool.EXTRUSION_TOOL, extrusion, "Biconextrudetool.gif", "Extrude"); mulextrudeBut = this.registerTool(Tool.MULTI_EXTRUDE_TOOL, mulextrusion, "Biconextrudetool2.gif", "Controlled Extrude"); moveBut = this.registerTool(Tool.MOVE_TOOL, move, "Biconmovetool.gif", "Move"); moveBut.addMouseListener(new MoveButtonMouseListener(moveBut)); rotBut = this.registerTool(Tool.ROTATION_TOOL, rotation, "Biconrotobj.gif", "Rotation"); ! tb.addSeparator(3); tmBut = this.registerTool(Tool.TAPE_MEASURE_TOOL, tapeMeasure, --- 220,245 ---- selBut = this.registerTool(Tool.SELECT_TOOL, select, "Biconselecttool.gif", "Select"); + selBut.setMnemonic(KeyEvent.VK_Q); pencilBut = this.registerTool(Tool.PENCIL_TOOL, pencil, "Biconpentool.gif", "Pencil"); + pencilBut.setMnemonic(KeyEvent.VK_W); eraserBut = this.registerTool(Tool.ERASER_TOOL, eraser, "Biconeraser.gif", "Eraser"); ! eraserBut.setMnemonic(KeyEvent.VK_A); ! JToggleButton rect = ! this.registerTool(Tool.ALT_RECT_TOOL, altRect, "Biconaltrect.gif", "Rectangle"); ! rect.setMnemonic(KeyEvent.VK_S); ! JToggleButton arcb = this.registerTool(Tool.ARC_TOOL, arc, "Barc.gif", "Arc"); ! arcb.setMnemonic(KeyEvent.VK_Z); tb.addSeparator(3); extrudeBut = this.registerTool(Tool.EXTRUSION_TOOL, extrusion, "Biconextrudetool.gif", "Extrude"); + extrudeBut.setMnemonic(KeyEvent.VK_V); mulextrudeBut = this.registerTool(Tool.MULTI_EXTRUDE_TOOL, mulextrusion, "Biconextrudetool2.gif", "Controlled Extrude"); + mulextrudeBut.setMnemonic(KeyEvent.VK_B); moveBut = this.registerTool(Tool.MOVE_TOOL, move, "Biconmovetool.gif", "Move"); + moveBut.setMnemonic(KeyEvent.VK_M); moveBut.addMouseListener(new MoveButtonMouseListener(moveBut)); rotBut = this.registerTool(Tool.ROTATION_TOOL, rotation, "Biconrotobj.gif", "Rotation"); ! rotBut.setMnemonic(KeyEvent.VK_R); tb.addSeparator(3); tmBut = this.registerTool(Tool.TAPE_MEASURE_TOOL, tapeMeasure, *************** *** 244,248 **** tb.addSeparator(3); ! cRotBut = this.registerTool(Tool.CAMERA_TOOL, camera, "Biconrotcam.gif", "Orbit"); flyBut = this.registerTool(Tool.FLY_TOOL, fly, "Biconfly.gif", "Fly"); walkBut = this.registerTool(Tool.WALK_TOOL, walk, "Biconwalk.gif", "Walk"); --- 253,257 ---- tb.addSeparator(3); ! cRotBut = this.registerTool(Tool.CAMERA_TOOL, camera, "Biconrotcam.gif", "Orbit (Space)"); flyBut = this.registerTool(Tool.FLY_TOOL, fly, "Biconfly.gif", "Fly"); walkBut = this.registerTool(Tool.WALK_TOOL, walk, "Biconwalk.gif", "Walk"); *************** *** 256,264 **** }; ! Toolbar.getInstance().registerPushButtonAction(zoomAction); tb.addSeparator(10); - Action orthoAction = new ToolAction(glv, 0, "Borto.gif") { public void actionPerformed(ActionEvent agr0) { --- 265,272 ---- }; ! Toolbar.getInstance().registerPushButtonAction(zoomAction, "Zoom All"); tb.addSeparator(10); Action orthoAction = new ToolAction(glv, 0, "Borto.gif") { public void actionPerformed(ActionEvent agr0) { *************** *** 267,271 **** } }; ! Action perspAction = new ToolAction(glv, 0, "Bpers.gif") { public void actionPerformed(ActionEvent agr0) { --- 275,279 ---- } }; ! Action perspAction = new ToolAction(glv, 0, "Bpers.gif") { public void actionPerformed(ActionEvent agr0) { *************** *** 275,283 **** }; - ButtonGroup viewGroup = new ButtonGroup(); JToggleButton perspBut = Toolbar.getInstance().registerAction(perspAction); viewGroup.add(perspBut); ! viewGroup.add(Toolbar.getInstance().registerAction(orthoAction)); perspBut.setSelected(true); } --- 283,295 ---- }; ButtonGroup viewGroup = new ButtonGroup(); JToggleButton perspBut = Toolbar.getInstance().registerAction(perspAction); + perspBut.setToolTipText("Perspective"); + perspBut.setMnemonic(KeyEvent.VK_J); viewGroup.add(perspBut); ! JToggleButton orthoBut = Toolbar.getInstance().registerAction(orthoAction); ! orthoBut.setToolTipText("Orthographic"); ! orthoBut.setMnemonic(KeyEvent.VK_K); ! viewGroup.add(orthoBut); perspBut.setSelected(true); } Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** AbstractTool.java 20 Jul 2006 13:01:56 -0000 1.87 --- AbstractTool.java 21 Jul 2006 15:14:57 -0000 1.88 *************** *** 259,278 **** } else if (e.getKeyCode() == KeyEvent.VK_X) { c.zoomin(); - } else if (e.getKeyCode() == KeyEvent.VK_Q) { - glv.changeTool(Tool.SELECT_TOOL); - } else if (e.getKeyCode() == KeyEvent.VK_W) { - glv.changeTool(Tool.PENCIL_TOOL); - } else if (e.getKeyCode() == KeyEvent.VK_M) { - glv.changeTool(Tool.MOVE_TOOL); - } else if (e.getKeyCode() == KeyEvent.VK_R) { - glv.changeTool(Tool.CAMERA_TOOL); - } else if (e.getKeyCode() == KeyEvent.VK_E) { - glv.changeTool(Tool.EXTRUSION_TOOL); - } else if (e.getKeyCode() == KeyEvent.VK_F5) { - glv.getView().changeDrawMode(View.WIREFRAME_MODE); - } else if (e.getKeyCode() == KeyEvent.VK_F6) { - glv.getView().changeDrawMode(View.SOLID_MODE); - } else if (e.getKeyCode() == KeyEvent.VK_F7) { - glv.getView().changeDrawMode(View.LIGHTING_MODE); } else { key(e); --- 259,262 ---- |
From: rimestad <rim...@us...> - 2006-07-21 14:59:51
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23765/src/net/sourceforge/bprocessor/model Modified Files: Line.java Point.java Project.java CoordinateSystem.java Log Message: implemented line and point get and set attribute Index: Point.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Point.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Point.java 6 Jul 2006 10:42:08 -0000 1.3 --- Point.java 21 Jul 2006 14:59:47 -0000 1.4 *************** *** 7,10 **** --- 7,11 ---- package net.sourceforge.bprocessor.model; + import java.util.ArrayList; import java.util.HashSet; import java.util.List; *************** *** 52,57 **** */ public void setAttributes(List attributes) { ! // TODO Auto-generated method stub ! } --- 53,60 ---- */ public void setAttributes(List attributes) { ! Vertex orig = getOrigin(); ! orig.setX(((Double)(((Attribute)attributes.get(0)).getValue())).doubleValue()); ! orig.setY(((Double)(((Attribute)attributes.get(1)).getValue())).doubleValue()); ! orig.setZ(((Double)(((Attribute)attributes.get(2)).getValue())).doubleValue()); } *************** *** 60,65 **** */ public List getAttributes() { ! // TODO Auto-generated method stub ! return null; } --- 63,71 ---- */ public List getAttributes() { ! ArrayList res = new ArrayList(); ! res.add(new Attribute("X", new Double(getOrigin().getX()))); ! res.add(new Attribute("Y", new Double(getOrigin().getY()))); ! res.add(new Attribute("Z", new Double(getOrigin().getZ()))); ! return res; } Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** CoordinateSystem.java 21 Jul 2006 10:44:53 -0000 1.15 --- CoordinateSystem.java 21 Jul 2006 14:59:47 -0000 1.16 *************** *** 258,262 **** public List getAttributes() { // TODO Auto-generated method stub ! return null; } --- 258,263 ---- public List getAttributes() { // TODO Auto-generated method stub ! ArrayList res = new ArrayList(); ! return res; } Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Line.java 21 Jul 2006 10:45:43 -0000 1.12 --- Line.java 21 Jul 2006 14:59:47 -0000 1.13 *************** *** 54,58 **** */ public Vertex getDirection() { ! return dir.copy(); } --- 54,58 ---- */ public Vertex getDirection() { ! return dir; } *************** *** 95,99 **** */ public void setAttributes(List attributes) { ! //TODO implement method } --- 95,113 ---- */ public void setAttributes(List attributes) { ! Vertex orig = new Vertex(0, 0, 0); ! ! orig.setX(((Double)(((Attribute)attributes.get(1)).getValue())).doubleValue()); ! orig.setY(((Double)(((Attribute)attributes.get(2)).getValue())).doubleValue()); ! orig.setZ(((Double)(((Attribute)attributes.get(3)).getValue())).doubleValue()); ! setOrigin(orig); ! Vertex dir = new Vertex(0, 0, 0); ! dir.setX(((Double)(((Attribute)attributes.get(5)).getValue())).doubleValue()); ! dir.setY(((Double)(((Attribute)attributes.get(6)).getValue())).doubleValue()); ! dir.setZ(((Double)(((Attribute)attributes.get(7)).getValue())).doubleValue()); ! if (dir.length() != 0) { ! //TODO give some kind of warning ! setDirection(dir); ! } ! setActive(((Boolean)(((Attribute)attributes.get(10)).getValue())).booleanValue()); } *************** *** 102,110 **** */ public List getAttributes() { - //FIXME finish the method ArrayList res = new ArrayList(); ! ! res.add(new Attribute("Origin", getOrigin())); ! res.add(new Attribute("Direction", getDirection())); return res; } --- 116,135 ---- */ public List getAttributes() { ArrayList res = new ArrayList(); ! res.add(new Attribute("name", "Origin", false)); ! res.add(new Attribute("X", new Double(getOrigin().getX()))); ! res.add(new Attribute("Y", new Double(getOrigin().getY()))); ! res.add(new Attribute("Z", new Double(getOrigin().getZ()))); ! res.add(new Attribute("name", "Direction", false)); ! res.add(new Attribute("X", new Double(getDirection().getX()))); ! res.add(new Attribute("Y", new Double(getDirection().getY()))); ! res.add(new Attribute("Z", new Double(getDirection().getZ()))); ! res.add(new Attribute("Degrees-Y", new Double(degreesAboutY()), false)); ! res.add(new Attribute("Degrees-Z", new Double(degreesAboutZ()), false)); ! if (isActive()) { ! res.add(new Attribute("Active", Boolean.TRUE)); ! } else { ! res.add(new Attribute("Active", Boolean.FALSE)); ! } return res; } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** Project.java 21 Jul 2006 10:46:27 -0000 1.63 --- Project.java 21 Jul 2006 14:59:47 -0000 1.64 *************** *** 880,882 **** --- 880,897 ---- this.activeCoordinateSystem = activeCoordinateSystem; } + + /** + * find all constructors + * @return The constructors + */ + public Collection getConstructors() { + Collection res = new HashSet(); + Collection spaces = getSpaces(); + Iterator iter = spaces.iterator(); + while (iter.hasNext()) { + res.addAll(((Space)iter.next()).getConstructors()); + } + res.addAll(world.getConstructors()); + return res; + } } |
From: rimestad <rim...@us...> - 2006-07-21 14:59:01
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23378/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java SpaceTreeView.java Log Message: Added constructors to the tree view Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** GenericTreeView.java 30 May 2006 09:29:02 -0000 1.30 --- GenericTreeView.java 21 Jul 2006 14:58:58 -0000 1.31 *************** *** 41,44 **** --- 41,45 ---- import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Constraint; + import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Entity; *************** *** 94,97 **** --- 95,104 ---- protected static ImageIcon genericgroupicon; + /** Constructor icon */ + protected static ImageIcon constructoricon; + + /** Constructor group icon */ + protected static ImageIcon constructorgroupicon; + static { spaceicon = loadIcon("Biconspace.gif"); *************** *** 104,107 **** --- 111,116 ---- vertexgroupicon = loadIcon("Biconvertexgroup.gif"); genericgroupicon = loadIcon("Bicongenericgroup.gif"); + constructoricon = loadIcon("Biconconstructor.gif"); + constructorgroupicon = loadIcon("Biconconstructorgroup.gif"); } *************** *** 512,515 **** --- 521,550 ---- /** + * ConstructorNode + */ + public class ConstructorNode extends EntityNode { + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * Constructor for ConstructorNode + * @param c The constructor + */ + public ConstructorNode(Constructor c) { + super(c); + } + + /** + * Return icon + * @return Icon + */ + public ImageIcon icon() { + return constructoricon; + } + } + + /** * EdgeNode */ *************** *** 588,594 **** */ public class CameraNode extends EntityNode { ! /** ! * ! */ private static final long serialVersionUID = 1L; --- 623,627 ---- */ public class CameraNode extends EntityNode { ! /** */ private static final long serialVersionUID = 1L; *************** *** 758,761 **** --- 791,826 ---- /** + * Constructor Container + */ + public class ConstructorContainer extends ContainerNode { + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * Constructor + * @param name The name + * @param constructors The constructors + */ + public ConstructorContainer(String name, Collection constructors) { + super(name); + Iterator iter = constructors.iterator(); + while (iter.hasNext()) { + add(new ConstructorNode((Constructor)iter.next())); + } + } + + /** + * Return icon + * @return icon + */ + public ImageIcon icon() { + return constructorgroupicon; + } + } + + /** * EdgeContainer */ Index: SpaceTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/SpaceTreeView.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** SpaceTreeView.java 24 May 2006 13:43:42 -0000 1.11 --- SpaceTreeView.java 21 Jul 2006 14:58:58 -0000 1.12 *************** *** 45,48 **** --- 45,49 ---- root.add(new ParameterBlockNode("Globals", Project.getInstance().getGlobals())); root.add(new GeometryContainer("Geometry", Project.getInstance().world())); + root.add(new ConstructorContainer("Constructors", Project.getInstance().getConstructors())); model.nodeStructureChanged(root); openPaths(paths); |
From: rimestad <rim...@us...> - 2006-07-21 14:57:28
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22962/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Added mnemonic keys for the three view buttons... So now alt has to be used as modifier for activating them Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.118 retrieving revision 1.119 diff -C2 -d -r1.118 -r1.119 *** View.java 21 Jul 2006 10:43:20 -0000 1.118 --- View.java 21 Jul 2006 14:57:26 -0000 1.119 *************** *** 39,42 **** --- 39,43 ---- import java.awt.event.ActionEvent; + import java.awt.event.KeyEvent; import java.net.URL; import java.nio.IntBuffer; *************** *** 168,176 **** /** */ ! public static final int WIREFRAME_MODE = 0; /** */ public static final int SOLID_MODE = 1; /** */ ! public static final int LIGHTING_MODE = 2; /** */ --- 169,177 ---- /** */ ! public static final int WIREFRAME_MODE = 2; /** */ public static final int SOLID_MODE = 1; /** */ ! public static final int LIGHTING_MODE = 0; /** */ *************** *** 421,432 **** bg.add(but); but.setToolTipText("Shading"); but.setSelected(true); but = tb.registerAction(new ViewSolid(glv)); bg.add(but); but.setToolTipText("Solid"); but = tb.registerAction(new ViewWireframe(glv)); bg.add(but); but.setToolTipText("Wireframe"); ! } --- 422,435 ---- bg.add(but); but.setToolTipText("Shading"); + but.setMnemonic(KeyEvent.VK_F5); but.setSelected(true); but = tb.registerAction(new ViewSolid(glv)); bg.add(but); but.setToolTipText("Solid"); + but.setMnemonic(KeyEvent.VK_F6); but = tb.registerAction(new ViewWireframe(glv)); bg.add(but); but.setToolTipText("Wireframe"); ! but.setMnemonic(KeyEvent.VK_F7); } *************** *** 1661,1665 **** Vertex origin = line.getOrigin(); ! Vertex direction = line.getDirection(); direction.scale(View.gridSize() * 2); Vertex from = origin.minus(direction); --- 1664,1668 ---- Vertex origin = line.getOrigin(); ! Vertex direction = line.getDirection().copy(); direction.scale(View.gridSize() * 2); Vertex from = origin.minus(direction); |
From: rimestad <rim...@us...> - 2006-07-21 14:55:35
|
Update of /cvsroot/bprocessor/gui/src/gfx In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22199/src/gfx Added Files: Biconconstructor.gif Biconconstructorgroup.gif Log Message: Icons for the treeview --- NEW FILE: Biconconstructorgroup.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Biconconstructor.gif --- (This appears to be a binary file; contents omitted.) |
From: Michael L. <he...@us...> - 2006-07-21 12:48:15
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4386/src/net/sourceforge/bprocessor/gl/tool Modified Files: MoveTool.java Pencil.java Log Message: Bugfixes in MoveTool Index: Pencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Pencil.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Pencil.java 19 Jul 2006 12:04:17 -0000 1.7 --- Pencil.java 21 Jul 2006 12:48:12 -0000 1.8 *************** *** 64,67 **** --- 64,68 ---- protected void pressed(MouseEvent e) { onVertex(); + moved(e); } Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** MoveTool.java 21 Jul 2006 10:42:06 -0000 1.60 --- MoveTool.java 21 Jul 2006 12:48:12 -0000 1.61 *************** *** 93,96 **** --- 93,97 ---- strategy.pressed(e); } else { + if (start == null) { moveEntities = new HashSet(); *************** *** 115,123 **** } } else { ! start = null; ! moveEntities = null; ! incident = null; ! vertices = null; ! excluded(new HashSet()); Project.getInstance().checkpoint(); } --- 116,121 ---- } } else { ! cleanUp(); ! moved(e); Project.getInstance().checkpoint(); } |
From: rimestad <rim...@us...> - 2006-07-21 10:46:29
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21970/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: added activeCoordinateSystem to Project, with getters and setters Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** Project.java 18 Jul 2006 14:04:37 -0000 1.62 --- Project.java 21 Jul 2006 10:46:27 -0000 1.63 *************** *** 79,82 **** --- 79,85 ---- /** The current state */ private Bmodel currentState; + + /** The activeCoordinateSystem */ + private CoordinateSystem activeCoordinateSystem; /** *************** *** 103,106 **** --- 106,117 ---- world = new Space("World", Space.FUNCTIONAL, true); world.setId(new Long(0)); + activeCoordinateSystem = new CoordinateSystem(new Vertex(1, 0, 0), new Vertex(0, 1, 0), + new Vertex(0, 0, 1), new Vertex(0, 0, 0)); + activeCoordinateSystem.setActive(true); + world.add(activeCoordinateSystem); + + world.add(new Point(new Vertex(10, 10, 3))); + world.add(new Line(new Vertex(3, 3, 3), new Vertex(1, 1, 0), true)); + world.add(new Line(new Vertex(5, 0, 5), new Vertex(1, 0, 0), false)); constraints = new LinkedList(); globals = new ParameterBlock(); *************** *** 855,857 **** --- 866,882 ---- log.info(info); } + + /** + * @return Returns the activeCoordinateSystem. + */ + public CoordinateSystem getActiveCoordinateSystem() { + return activeCoordinateSystem; + } + + /** + * @param activeCoordinateSystem The activeCoordinateSystem to set. + */ + public void setActiveCoordinateSystem(CoordinateSystem activeCoordinateSystem) { + this.activeCoordinateSystem = activeCoordinateSystem; + } } |
From: rimestad <rim...@us...> - 2006-07-21 10:45:47
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21602/src/net/sourceforge/bprocessor/model Modified Files: Line.java Log Message: Made new constructors for line, that includes active boolean Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Line.java 18 Jul 2006 21:50:41 -0000 1.11 --- Line.java 21 Jul 2006 10:45:43 -0000 1.12 *************** *** 24,29 **** */ public Line(Vertex origin) { ! super(origin); ! dir = new Vertex(1, 0, 0); } --- 24,28 ---- */ public Line(Vertex origin) { ! this(origin, new Vertex(1, 0, 0), false); } *************** *** 34,39 **** --- 33,49 ---- */ public Line(Vertex origin, Vertex dir) { + this(origin, dir, false); + } + + /** + * Constructor of the Line with orgin and three angles + * @param origin The origin + * @param dir The vector of direction + * @param active If the constructor is active + */ + public Line(Vertex origin, Vertex dir, boolean active) { super(origin); dir.normalize(); + this.setActive(active); this.dir = dir; } |
From: rimestad <rim...@us...> - 2006-07-21 10:44:58
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21213/src/net/sourceforge/bprocessor/model Modified Files: CoordinateSystem.java Log Message: the given vectors are made orthogonal and normalized. The returned i, j, n are no longer copies Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** CoordinateSystem.java 20 Jul 2006 13:00:40 -0000 1.14 --- CoordinateSystem.java 21 Jul 2006 10:44:53 -0000 1.15 *************** *** 38,42 **** /** ! * Constructor * @param i The i vector * @param j The j vector --- 38,42 ---- /** ! * Constructor secure that they all are orthogonal to each other and normalized * @param i The i vector * @param j The j vector *************** *** 50,55 **** n.normalize(); this.i = i; ! this.j = j; ! this.n = n; onlyPlane = false; } --- 50,55 ---- n.normalize(); this.i = i; ! this.j = n.cross(this.i); ! this.n = this.i.cross(this.j); onlyPlane = false; } *************** *** 94,98 **** */ public Vertex getI() { ! return i.copy(); } --- 94,98 ---- */ public Vertex getI() { ! return i; } *************** *** 102,106 **** */ public Vertex getJ() { ! return j.copy(); } --- 102,106 ---- */ public Vertex getJ() { ! return j; } *************** *** 110,114 **** */ public Vertex getN() { ! return n.copy(); } --- 110,114 ---- */ public Vertex getN() { ! return n; } |
From: rimestad <rim...@us...> - 2006-07-21 10:43:24
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20777/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Changes to the drawing of constructors, yet again everything including constructors are cut by clippingplanes and isActive drawing of lines are working. Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.117 retrieving revision 1.118 diff -C2 -d -r1.117 -r1.118 *** View.java 20 Jul 2006 12:58:52 -0000 1.117 --- View.java 21 Jul 2006 10:43:20 -0000 1.118 *************** *** 524,529 **** // grid and coords are always completely lit gl.glLineWidth(1.0f); ! grid(); ! coords(); Iterator clipit = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); --- 524,532 ---- // grid and coords are always completely lit gl.glLineWidth(1.0f); ! grid(Project.getInstance().getActiveCoordinateSystem()); ! ! Camera camera = Project.getInstance().getCurrentCamera(); ! double scale = (camera.getFocalwidth() / 65) * (500 / height); ! drawCoordinateSystem(Project.getInstance().getActiveCoordinateSystem(), camera.dist() * scale); Iterator clipit = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); *************** *** 661,666 **** /** * Draw a grid */ ! protected void grid() { double size = View.gridSize(); gl.glLineWidth(0.5f); --- 664,670 ---- /** * Draw a grid + * @param cs the coordinatesystem */ ! protected void grid(CoordinateSystem cs) { double size = View.gridSize(); gl.glLineWidth(0.5f); *************** *** 669,682 **** gl.glBegin(GL.GL_LINES); - - - for (int x = -(int)size; x <= (int)size; x++) { ! gl.glVertex3d((double) x * 2, -size * 2, 0); ! gl.glVertex3d((double) x * 2, size * 2, 0); } for (int y = -(int)size; y <= (int)size; y++) { ! gl.glVertex3d(-size * 2, (double) y * 2, 0); ! gl.glVertex3d(size * 2, (double) y * 2, 0); } gl.glEnd(); --- 673,692 ---- gl.glBegin(GL.GL_LINES); for (int x = -(int)size; x <= (int)size; x++) { ! Vertex v1 = new Vertex((double) x * 2, -size * 2, 0); ! Vertex v2 = new Vertex((double) x * 2, size * 2, 0); ! v1 = cs.unTranslate(v1); ! v2 = cs.unTranslate(v2); ! gl.glVertex3d(v1.getX(), v1.getY(), v1.getZ()); ! gl.glVertex3d(v2.getX(), v2.getY(), v2.getZ()); } for (int y = -(int)size; y <= (int)size; y++) { ! Vertex v1 = new Vertex(-size * 2, (double) y * 2, 0); ! Vertex v2 = new Vertex(size * 2, (double) y * 2, 0); ! v1 = cs.unTranslate(v1); ! v2 = cs.unTranslate(v2); ! gl.glVertex3d(v1.getX(), v1.getY(), v1.getZ()); ! gl.glVertex3d(v2.getX(), v2.getY(), v2.getZ()); ! } gl.glEnd(); *************** *** 773,779 **** } ! //Draw constructors ! ! drawConstructors(); { --- 783,790 ---- } ! // draw constructors ! { ! drawConstructors(); ! } { *************** *** 795,799 **** } } - // draw target --- 806,809 ---- *************** *** 950,958 **** double scale = (camera.getFocalwidth() / 65) * (500 / height); double dist = v.minus(new Vertex(camera.getCenter())).length() * scale; ! while (iter.hasNext()) { Object o = iter.next(); Constructor c = (Constructor)o; - if (camera.getType() == Camera.PERSPECTIVE) { dist = (c.getOrigin().minus(v)).length() * scale; --- 960,967 ---- double scale = (camera.getFocalwidth() / 65) * (500 / height); double dist = v.minus(new Vertex(camera.getCenter())).length() * scale; ! CoordinateSystem cs = Project.getInstance().getActiveCoordinateSystem(); while (iter.hasNext()) { Object o = iter.next(); Constructor c = (Constructor)o; if (camera.getType() == Camera.PERSPECTIVE) { dist = (c.getOrigin().minus(v)).length() * scale; *************** *** 960,981 **** if (o instanceof Point) { drawConstructorPoint(((Point)o).getOrigin(), dist); } else if (o instanceof Line) { Line l = (Line)o; ! drawConstructorPoint(l.getOrigin(), dist); drawConstructorVector(l.getOrigin(), l.getDirection(), dist); } else if (o instanceof CoordinateSystem) { ! CoordinateSystem cs = (CoordinateSystem)o; ! Vertex i = cs.getI(); ! Vertex j = cs.getJ(); ! gl.glColor3fv(X_AXIS_COLOR); ! drawConstructorVector(cs.getOrigin(), i, dist); ! gl.glColor3fv(Y_AXIS_COLOR); ! drawConstructorVector(cs.getOrigin(), j, dist); ! if (!cs.onlyPlane()) { ! Vertex n = cs.getN(); ! gl.glColor3fv(Z_AXIS_COLOR); ! drawConstructorVector(cs.getOrigin(), n, dist); ! } } } --- 969,987 ---- if (o instanceof Point) { + gl.glColor3fv(CONSTRUCTOR_COLOR); drawConstructorPoint(((Point)o).getOrigin(), dist); } else if (o instanceof Line) { + gl.glColor3fv(CONSTRUCTOR_COLOR); Line l = (Line)o; ! //drawConstructorPoint(l.getOrigin(), dist); drawConstructorVector(l.getOrigin(), l.getDirection(), dist); + if (l.isActive()) { + drawConstructorLine(l.getOrigin(), l.getDirection(), dist); + } } else if (o instanceof CoordinateSystem) { ! CoordinateSystem coo = (CoordinateSystem)o; ! if (cs != coo) { ! drawCoordinateSystem(coo, dist); ! } } } *************** *** 988,991 **** --- 994,1025 ---- /** + * draw the coordinatesystem + * @param cs The coordinatesystem + * @param dist The distance to the center of the system + */ + private void drawCoordinateSystem(CoordinateSystem cs, double dist) { + Vertex i = cs.getI(); + Vertex j = cs.getJ(); + gl.glColor3fv(X_AXIS_COLOR); + drawConstructorVector(cs.getOrigin(), i, dist); + if (cs.isActive()) { + drawConstructorLine(cs.getOrigin(), i, dist); + } + gl.glColor3fv(Y_AXIS_COLOR); + drawConstructorVector(cs.getOrigin(), j, dist); + if (cs.isActive()) { + drawConstructorLine(cs.getOrigin(), j, dist); + } + if (!cs.onlyPlane()) { + Vertex n = cs.getN(); + gl.glColor3fv(Z_AXIS_COLOR); + drawConstructorVector(cs.getOrigin(), n, dist); + if (cs.isActive()) { + drawConstructorLine(cs.getOrigin(), n, dist); + } + } + } + + /** * Draw a point in the location of center * @param center The location for the point *************** *** 994,998 **** private void drawConstructorPoint(Vertex center, double dist) { gl.glPointSize(8); - gl.glColor3fv(CONSTRUCTOR_COLOR); gl.glBegin(GL.GL_POINTS); gl.glVertex3d(center.getX(), center.getY(), center.getZ()); --- 1028,1031 ---- *************** *** 1027,1031 **** gl.glPopMatrix(); gl.glDisable(GL.GL_LIGHTING); - drawConstructorLine(from, direction, dist); } --- 1060,1063 ---- *************** *** 1593,1604 **** } } ! if (selectMode == CLIPPLANES || selectMode == ALL) { ! { ! Iterator it = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); ! while (it.hasNext()) { ! ClippingPlane cp = (ClippingPlane)it.next(); ! gl.glDisable(GL.GL_CLIP_PLANE0 + cp.getNumber()); ! } } { Iterator it = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); --- 1625,1636 ---- } } ! { ! Iterator it = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); ! while (it.hasNext()) { ! ClippingPlane cp = (ClippingPlane)it.next(); ! gl.glDisable(GL.GL_CLIP_PLANE0 + cp.getNumber()); } + } + if (selectMode == CLIPPLANES || selectMode == ALL) { { Iterator it = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); *************** *** 1643,1649 **** drawVertexHit(tip); popName(gl); ! pushName(gl, constructor); ! drawEdge(constructor); ! popName(gl); } } --- 1675,1683 ---- drawVertexHit(tip); popName(gl); ! if (current.isActive()) { ! pushName(gl, constructor); ! drawEdge(constructor); ! popName(gl); ! } } } |
From: Michael L. <he...@us...> - 2006-07-21 10:42:10
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20095/src/net/sourceforge/bprocessor/gl/tool Modified Files: VectorMoveStrategy.java MoveTool.java ControlledMoveStrategy.java Log Message: Work-in-progress on MoveTool Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** MoveTool.java 3 Jul 2006 14:25:02 -0000 1.59 --- MoveTool.java 21 Jul 2006 10:42:06 -0000 1.60 *************** *** 14,18 **** import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Vertex; - import net.sourceforge.bprocessor.model.Surface; import java.awt.Cursor; --- 14,17 ---- *************** *** 180,194 **** */ protected void move(Set sel, Vertex delta) { - Iterator it = sel.iterator(); - while (it.hasNext()) { - Object elm = it.next(); - if (elm instanceof Vertex) { - ((Vertex)elm).move(delta.getX(), delta.getY(), delta.getZ()); - } else if (elm instanceof Edge) { - ((Edge)elm).move(delta.getX(), delta.getY(), delta.getZ()); - } else if (elm instanceof Surface) { - ((Surface) elm).move(delta.getX(), delta.getY(), delta.getZ()); - } - } } --- 179,182 ---- *************** *** 277,280 **** --- 265,274 ---- } else { super.cleanUp(); + from = null; + vertices = null; + lastMoveDirection = null; + moveEntities = null; + moveConstructor = null; + dragFlag = false; } } Index: VectorMoveStrategy.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/VectorMoveStrategy.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** VectorMoveStrategy.java 14 Jun 2006 14:36:56 -0000 1.4 --- VectorMoveStrategy.java 21 Jul 2006 10:42:06 -0000 1.5 *************** *** 8,18 **** import net.sourceforge.bprocessor.gl.GLView; - //import net.sourceforge.bprocessor.model.Plane; - - //import java.util.HashSet; - - import java.awt.event.MouseEvent; import java.awt.Cursor; --- 8,18 ---- import net.sourceforge.bprocessor.gl.GLView; + import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.Surface; + import net.sourceforge.bprocessor.model.Vertex; import java.awt.Cursor; + import java.util.Iterator; + import java.util.Set; *************** *** 37,53 **** /** ! * Invoked when a mouse button has been pressed on a component. ! * @param e The MouseEvent object ! */ ! protected void pressed(MouseEvent e) { ! super.pressed(e); ! } ! ! /** ! * Invoked when the mouse cursor has been moved ! * @param e The MouseEvent object */ ! protected void moved(MouseEvent e) { ! super.moved(e); } } --- 37,57 ---- /** ! * Move the entire selection ! * @param sel The selection collection ! * @param delta The movement */ ! protected void move(Set sel, Vertex delta) { ! Iterator it = sel.iterator(); ! while (it.hasNext()) { ! Object elm = it.next(); ! if (elm instanceof Vertex) { ! ((Vertex)elm).move(delta.getX(), delta.getY(), delta.getZ()); ! } else if (elm instanceof Edge) { ! ((Edge)elm).move(delta.getX(), delta.getY(), delta.getZ()); ! } else if (elm instanceof Surface) { ! ((Surface) elm).move(delta.getX(), delta.getY(), delta.getZ()); ! } ! } } + } Index: ControlledMoveStrategy.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ControlledMoveStrategy.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ControlledMoveStrategy.java 14 Jun 2006 14:36:56 -0000 1.5 --- ControlledMoveStrategy.java 21 Jul 2006 10:42:06 -0000 1.6 *************** *** 92,104 **** } } ! ! /** ! * Invoked when the mouse is held pressed and moved ! * @param e The MouseEvent object ! */ ! protected void dragged(MouseEvent e) { ! moved(e); ! } ! /** * Finds the direction of the controlled movement. --- 92,96 ---- } } ! /** * Finds the direction of the controlled movement. |
From: Michael L. <he...@us...> - 2006-07-21 08:59:03
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12760/src/net/sourceforge/bprocessor/gl/tool Modified Files: ToolFactory.java Log Message: Remove original rectangle tool from toolbar Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** ToolFactory.java 10 Jul 2006 15:26:38 -0000 1.53 --- ToolFactory.java 21 Jul 2006 08:58:58 -0000 1.54 *************** *** 221,226 **** pencilBut = this.registerTool(Tool.PENCIL_TOOL, pencil, "Biconpentool.gif", "Pencil"); eraserBut = this.registerTool(Tool.ERASER_TOOL, eraser, "Biconeraser.gif", "Eraser"); ! this.registerTool(Tool.RECT_TOOL, rect, "Brect.gif", "Rectangle"); ! this.registerTool(Tool.ALT_RECT_TOOL, altRect, "Biconaltrect.gif", "Alt. Rectangle"); this.registerTool(Tool.ARC_TOOL, arc, "Barc.gif", "Arc"); --- 221,225 ---- pencilBut = this.registerTool(Tool.PENCIL_TOOL, pencil, "Biconpentool.gif", "Pencil"); eraserBut = this.registerTool(Tool.ERASER_TOOL, eraser, "Biconeraser.gif", "Eraser"); ! this.registerTool(Tool.ALT_RECT_TOOL, altRect, "Biconaltrect.gif", "Rectangle"); this.registerTool(Tool.ARC_TOOL, arc, "Barc.gif", "Arc"); |
From: Michael L. <he...@us...> - 2006-07-21 08:54:47
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11202/src/net/sourceforge/bprocessor/gl/tool Modified Files: AltRectTool.java Log Message: Fixed target related bug in AltRectTool Index: AltRectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AltRectTool.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AltRectTool.java 10 Jul 2006 15:26:38 -0000 1.1 --- AltRectTool.java 21 Jul 2006 08:54:44 -0000 1.2 *************** *** 77,80 **** --- 77,81 ---- } } + makeTarget(current); } |
From: Michael L. <he...@us...> - 2006-07-21 08:07:05
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23422/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Plane.java Log Message: Implemented locking to plane in AbstractPencil Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** Edge.java 20 Jul 2006 13:46:46 -0000 1.46 --- Edge.java 21 Jul 2006 08:07:02 -0000 1.47 *************** *** 280,287 **** public Vertex intersection(Vertex vertex) { if (intersects(vertex)) { - Project.info("A-Type"); return vertex; } else { - Project.info("B-Type"); Vertex v = to.minus(from); double length = getLength(); --- 280,285 ---- Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Plane.java 20 Jul 2006 12:56:25 -0000 1.23 --- Plane.java 21 Jul 2006 08:07:02 -0000 1.24 *************** *** 202,205 **** --- 202,219 ---- /** + * Return the projection of the vertex into this Plane + * @param vertex Vertex + * @return Projection of vertex + */ + public Vertex projection(Vertex vertex) { + Vertex vector = vertex.minus(origin()); + Vertex normal = normal(); + double t = vector.dot(normal()); + normal.scale(t / normal.length()); + vector = vector.minus(normal); + return origin().add(vector); + } + + /** * Find the intersection with the edge * @param edge The edge to intersect |
From: Michael L. <he...@us...> - 2006-07-21 08:07:02
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23409/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Log Message: Implemented locking to plane in AbstractPencil Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** AbstractPencil.java 20 Jul 2006 14:21:39 -0000 1.48 --- AbstractPencil.java 21 Jul 2006 08:06:59 -0000 1.49 *************** *** 132,139 **** Surface surface = (Surface) current.object(); lockingPlane = surface.plane(); - Project.info("lock to surface"); } if (current.type() == Intersection.PLANE_INTERSECTION) { - Project.info("lock to plane"); lockingPlane = (Plane) current.object(); } --- 132,137 ---- *************** *** 152,166 **** ray = transformation.unProject(ray); ! ! if (constrain && lockingEdge != null) { ! Vertex v1 = lockingEdge.getDirection(); ! Vertex v2 = ray.getDirection(); ! Vertex v3 = v1.cross(v2); ! Vertex normal = v1.cross(v3); ! normal.normalize(); ! double d = -(lockingEdge.center().dot(normal)); ! work = new Plane(normal.getX(), normal.getY(), normal.getZ(), d); } Collection unwanted = new HashSet(); unwanted.addAll(elements); --- 150,169 ---- ray = transformation.unProject(ray); ! if (constrain) { ! if (lockingEdge != null) { ! Vertex v1 = lockingEdge.getDirection(); ! Vertex v2 = ray.getDirection(); ! Vertex v3 = v1.cross(v2); ! Vertex normal = v1.cross(v3); ! normal.normalize(); ! double d = -(lockingEdge.center().dot(normal)); ! work = new Plane(normal.getX(), normal.getY(), normal.getZ(), d); ! } ! if (lockingPlane != null) { ! work = lockingPlane; ! } } + Collection unwanted = new HashSet(); unwanted.addAll(elements); *************** *** 175,178 **** --- 178,188 ---- intersection = new Intersection(vertex, Intersection.EDGE, lockingEdge); } + + if (lockingPlane != null) { + if (!lockingPlane.contains(intersection.vertex())) { + Vertex vertex = lockingPlane.projection(intersection.vertex()); + intersection = new Intersection(vertex, Intersection.PLANE_INTERSECTION, lockingPlane); + } + } } *************** *** 846,849 **** --- 856,860 ---- lock = false; lockingEdge = null; + lockingPlane = null; constructors(new LinkedList()); feedback(new LinkedList()); |
From: Michael L. <he...@us...> - 2006-07-20 14:21:42
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24891/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Log Message: Attempt to lock to plane Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** AbstractPencil.java 20 Jul 2006 13:46:42 -0000 1.47 --- AbstractPencil.java 20 Jul 2006 14:21:39 -0000 1.48 *************** *** 73,78 **** protected Edge hooverEdge; ! /** Locked */ ! protected Edge locked; /** Whether or not the tool is locked */ --- 73,82 ---- protected Edge hooverEdge; ! /** Locking Edge */ ! protected Edge lockingEdge; ! ! /** Locking Plane */ ! protected Plane lockingPlane; ! /** Whether or not the tool is locked */ *************** *** 117,125 **** planeNormal.getY() * start.vertex().getY() + planeNormal.getZ() * start.vertex().getZ())); if (!constrain) { if (current.type() == Intersection.EDGE) { ! locked = (Edge) current.object(); ! } else { ! locked = null; } } --- 121,140 ---- planeNormal.getY() * start.vertex().getY() + planeNormal.getZ() * start.vertex().getZ())); + } + if (current != null) { if (!constrain) { + lockingEdge = null; + lockingPlane = null; if (current.type() == Intersection.EDGE) { ! lockingEdge = (Edge) current.object(); ! } ! if (current.type() == Intersection.SURFACE) { ! Surface surface = (Surface) current.object(); ! lockingPlane = surface.plane(); ! Project.info("lock to surface"); ! } ! if (current.type() == Intersection.PLANE_INTERSECTION) { ! Project.info("lock to plane"); ! lockingPlane = (Plane) current.object(); } } *************** *** 138,148 **** ! if (constrain && locked != null) { ! Vertex v1 = locked.getDirection(); Vertex v2 = ray.getDirection(); Vertex v3 = v1.cross(v2); Vertex normal = v1.cross(v3); normal.normalize(); ! double d = -(locked.center().dot(normal)); work = new Plane(normal.getX(), normal.getY(), normal.getZ(), d); } --- 153,163 ---- ! if (constrain && lockingEdge != null) { ! Vertex v1 = lockingEdge.getDirection(); Vertex v2 = ray.getDirection(); Vertex v3 = v1.cross(v2); Vertex normal = v1.cross(v3); normal.normalize(); ! double d = -(lockingEdge.center().dot(normal)); work = new Plane(normal.getX(), normal.getY(), normal.getZ(), d); } *************** *** 155,180 **** unwanted, true, work); ! if (constrain && locked != null) { ! Vertex vertex = locked.intersection(intersection.vertex()); ! intersection = new Intersection(vertex, Intersection.EDGE, locked); } return intersection; } /** - * If the tool is locked correct the intersection - * @param intersection the original intersection - * @return the corrected intersection - */ - private Intersection lockedIntersection(Intersection intersection) { - if (locked != null) { - Vertex vertex = locked.intersection(intersection.vertex()); - return new Intersection(vertex, intersection.type(), intersection.object()); - } else { - return intersection; - } - } - - /** * Insert a vertex into model * @param vertex Vertex --- 170,184 ---- unwanted, true, work); ! if (constrain) { ! if (lockingEdge != null) { ! Vertex vertex = lockingEdge.intersection(intersection.vertex()); ! intersection = new Intersection(vertex, Intersection.EDGE, lockingEdge); ! } } + return intersection; } /** * Insert a vertex into model * @param vertex Vertex *************** *** 841,845 **** hooverEdge = null; lock = false; ! locked = null; constructors(new LinkedList()); feedback(new LinkedList()); --- 845,849 ---- hooverEdge = null; lock = false; ! lockingEdge = null; constructors(new LinkedList()); feedback(new LinkedList()); |
From: Michael L. <he...@us...> - 2006-07-20 13:46:49
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9106/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Log Message: Improved shift-locking in AbstractPencil Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** Edge.java 1 May 2006 09:53:39 -0000 1.45 --- Edge.java 20 Jul 2006 13:46:46 -0000 1.46 *************** *** 279,305 **** */ public Vertex intersection(Vertex vertex) { - //FIXME the following seems too longwinded - // There has got to be a better way! if (intersects(vertex)) { return vertex; } else { ! Edge edge = new Edge(getFrom(), vertex); ! CoordinateSystem system = CoordinateSystem.create(this, edge); ! if (system != null) { ! Vertex a = system.translate(getFrom()); ! Vertex b = system.translate(getTo()); ! Vertex p = system.translate(vertex); ! ! Vertex u = b.minus(a); ! u.scale(1 / u.length()); ! Vertex ap = p.minus(a); ! double t = u.dot(ap); ! u.scale(t); ! Vertex q = a.add(u); ! q = system.unTranslate(q); ! return q; ! } else { ! return vertex; ! } } } --- 279,293 ---- */ public Vertex intersection(Vertex vertex) { if (intersects(vertex)) { + Project.info("A-Type"); return vertex; } else { ! Project.info("B-Type"); ! Vertex v = to.minus(from); ! double length = getLength(); ! Vertex w = vertex.minus(from); ! double t = v.dot(w); ! v.scale(t / (length * length)); ! return from.add(v); } } |
From: Michael L. <he...@us...> - 2006-07-20 13:46:47
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9096/src/net/sourceforge/bprocessor/gl/tool Modified Files: MultiExtrudeTool.java AbstractPencil.java Log Message: Improved shift-locking in AbstractPencil Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** AbstractPencil.java 20 Jul 2006 11:33:16 -0000 1.46 --- AbstractPencil.java 20 Jul 2006 13:46:42 -0000 1.47 *************** *** 23,26 **** --- 23,27 ---- import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.model.Intersection; + import net.sourceforge.bprocessor.gl.view.Transformation; import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.model.CoordinateSystem; *************** *** 73,77 **** /** Locked */ ! protected Vertex locked; /** Whether or not the tool is locked */ --- 74,78 ---- /** Locked */ ! protected Edge locked; /** Whether or not the tool is locked */ *************** *** 118,123 **** if (!constrain) { if (current.type() == Intersection.EDGE) { ! locked = start.vertex().minus(current.vertex()); ! locked.normalize(); } else { locked = null; --- 119,123 ---- if (!constrain) { if (current.type() == Intersection.EDGE) { ! locked = (Edge) current.object(); } else { locked = null; *************** *** 125,139 **** } } Collection unwanted = new HashSet(); unwanted.addAll(elements); unwanted.addAll(excluded); ! Intersection intersection = (Intersection) glv.getView().getObjectAtPoint(e.getX(), e.getY(), ! unwanted, true, plane); if (constrain && locked != null) { ! intersection = lockedIntersection(intersection); ! } return intersection; } --- 125,162 ---- } } + Plane work = plane; + + Intersection intersection = null; + Transformation transformation = glv.getView().transformation(); + double x = e.getX(); + double y = View.getHeight() - e.getY(); + + Vertex near = new Vertex(x, y, 0.0); + Vertex far = new Vertex(x, y, 1.0); + Edge ray = new Edge(near, far); + ray = transformation.unProject(ray); + if (constrain && locked != null) { + Vertex v1 = locked.getDirection(); + Vertex v2 = ray.getDirection(); + Vertex v3 = v1.cross(v2); + Vertex normal = v1.cross(v3); + normal.normalize(); + double d = -(locked.center().dot(normal)); + work = new Plane(normal.getX(), normal.getY(), normal.getZ(), d); + } + Collection unwanted = new HashSet(); unwanted.addAll(elements); unwanted.addAll(excluded); ! intersection = (Intersection) glv.getView().getObjectAtPoint(e.getX(), e.getY(), ! unwanted, true, work); ! if (constrain && locked != null) { ! Vertex vertex = locked.intersection(intersection.vertex()); ! intersection = new Intersection(vertex, Intersection.EDGE, locked); ! } return intersection; } *************** *** 145,153 **** */ private Intersection lockedIntersection(Intersection intersection) { ! if (start != null) { ! Vertex direction = locked.copy(); ! Vertex unlocked = intersection.vertex().minus(start.vertex()); ! direction.scale(locked.dot(unlocked)); ! Vertex vertex = start.vertex().add(direction); return new Intersection(vertex, intersection.type(), intersection.object()); } else { --- 168,173 ---- */ private Intersection lockedIntersection(Intersection intersection) { ! if (locked != null) { ! Vertex vertex = locked.intersection(intersection.vertex()); return new Intersection(vertex, intersection.type(), intersection.object()); } else { Index: MultiExtrudeTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MultiExtrudeTool.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** MultiExtrudeTool.java 24 May 2006 19:37:33 -0000 1.19 --- MultiExtrudeTool.java 20 Jul 2006 13:46:42 -0000 1.20 *************** *** 105,110 **** normal.scale(-1); log.info("Length of normal: " + normal.length()); ! lock = true; ! locked = normal; Transformation trans = glv.getView().transformation(); double x = e.getX(); --- 105,110 ---- normal.scale(-1); log.info("Length of normal: " + normal.length()); ! //lock = true; ! //locked = normal; Transformation trans = glv.getView().transformation(); double x = e.getX(); |
From: rimestad <rim...@us...> - 2006-07-20 13:02:00
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23564/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java Log Message: due to change in plane Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** AbstractTool.java 20 Jul 2006 11:08:39 -0000 1.86 --- AbstractTool.java 20 Jul 2006 13:01:56 -0000 1.87 *************** *** 738,742 **** } else if (o instanceof ClippingPlane) { ClippingPlane plane = (ClippingPlane) o; ! vertices.add(plane.origin()); } } --- 738,742 ---- } else if (o instanceof ClippingPlane) { ClippingPlane plane = (ClippingPlane) o; ! vertices.add(plane.center()); } } |