bprocessor-commit Mailing List for B-processor (Page 14)
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...> - 2010-01-13 10:58:42
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv15655/src/net/sourceforge/bprocessor/model Modified Files: Instance.java Space.java Persistence.java Log Message: new rotation tool Index: Instance.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Instance.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Instance.java 21 Sep 2009 11:00:46 -0000 1.12 --- Instance.java 13 Jan 2010 10:58:34 -0000 1.13 *************** *** 27,33 **** private Space proto; ! /** A anchor for instances */ protected CoordinateSystem anchor; /** * Constructs instance --- 27,37 ---- private Space proto; ! /** ! * ! */ protected CoordinateSystem anchor; + private CoordinateSystem transformation; + /** * Constructs instance *************** *** 60,90 **** proto = space; if (anchor == null) { ! Collection<CoordinateSystem> anchors = space.getCoordinateSystems(); ! if (anchors.size() > 0) { ! anchor = anchors.iterator().next().copy(); ! } else { ! CoordinateSystem system ! = (CoordinateSystem) Project.getInstance().world().getConstructor(1); ! anchor = system.copy(); ! } } } /** ! * Getter for anchor ! * @return The anchor */ ! public CoordinateSystem getInstanceAnchor() { return anchor; } /** ! * set the anchor for a instance ! * @param cs the coordinatesystem to use as anchor */ ! public void setInstanceAnchor(CoordinateSystem cs) { ! anchor = cs; } --- 64,113 ---- proto = space; if (anchor == null) { ! CoordinateSystem system ! = (CoordinateSystem) Project.getInstance().world().getConstructor(1); ! anchor = system.copy(); } } /** ! * @param system CoordinateSystem */ ! public void setAnchor(CoordinateSystem system) { ! anchor = system; ! transformation = null; ! } ! ! /** ! * ! * @return CoordinateSystem ! */ ! public CoordinateSystem getAnchor() { return anchor; } /** ! * ! * @return CoordinateSystem */ ! public CoordinateSystem getTransformation() { ! transformation = null; ! if (transformation == null) { ! CoordinateSystem handle = getHandle(); ! CoordinateSystem zero = new CoordinateSystem(new Vertex(1, 0, 0), new Vertex(0, 1, 0), ! new Vertex(0, 0, 1), new Vertex(0, 0, 0)); ! transformation = handle.translate(zero); ! transformation = anchor.unTranslate(transformation); ! return transformation; ! } ! return transformation; } + /** + * + * @return handle + */ + public CoordinateSystem getHandle() { + return proto.getHandle(); + } *************** *** 115,119 **** List<Edge> edges = new LinkedList(); for (Edge current : interior) { ! edges.add(anchor.unTranslate(current)); } return edges; --- 138,142 ---- List<Edge> edges = new LinkedList(); for (Edge current : interior) { ! edges.add(getTransformation().unTranslate(current)); } return edges; *************** *** 144,148 **** Space duplicate = proto.copy(new HashMap()); List<Vertex> vertices = new ArrayList(duplicate.collect()); ! anchor.unTranslateIt(vertices); for (Vertex current : vertices) { current.update(); --- 167,171 ---- Space duplicate = proto.copy(new HashMap()); List<Vertex> vertices = new ArrayList(duplicate.collect()); ! getTransformation().unTranslateIt(vertices); for (Vertex current : vertices) { current.update(); Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** Persistence.java 18 Sep 2009 09:09:06 -0000 1.84 --- Persistence.java 13 Jan 2010 10:58:34 -0000 1.85 *************** *** 307,311 **** CoordinateSystem anchor; anchor = internalizeCoordinateSystem(xml.getAnchor(), mapper, xmls); ! space.setInstanceAnchor(anchor); } space.setOwner(owner); --- 307,311 ---- CoordinateSystem anchor; anchor = internalizeCoordinateSystem(xml.getAnchor(), mapper, xmls); ! space.setAnchor(anchor); } space.setOwner(owner); *************** *** 1147,1151 **** } map.put(space, xml); ! xml.setAnchor(externalizeCoordinateSystem(space.getInstanceAnchor(), map)); return xml; } --- 1147,1151 ---- } map.put(space, xml); ! xml.setAnchor(externalizeCoordinateSystem(space.getAnchor(), map)); return xml; } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.247 retrieving revision 1.248 diff -C2 -d -r1.247 -r1.248 *** Space.java 5 Oct 2009 10:50:21 -0000 1.247 --- Space.java 13 Jan 2010 10:58:34 -0000 1.248 *************** *** 553,556 **** --- 553,567 ---- /** + * + * @return handle coordinate system + */ + public CoordinateSystem getHandle() { + for (CoordinateSystem current : getCoordinateSystems()) { + return current; + } + return Project.getInstance().getActiveCoordinateSystem().copy(); + } + + /** * Return the vertices * @return The vertices |
From: Michael L. <he...@us...> - 2010-01-13 10:58:39
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv15624/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: new rotation tool Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** Display.java 5 Oct 2009 10:50:24 -0000 1.99 --- Display.java 13 Jan 2010 10:58:30 -0000 1.100 *************** *** 926,930 **** gl.glPushMatrix(); if (space == active) { ! paint(space.getInstanceAnchor()); } translateToCoordinatesystem(space); --- 926,932 ---- gl.glPushMatrix(); if (space == active) { ! paint(space.getAnchor()); ! } else { ! paint(space.getAnchor()); } translateToCoordinatesystem(space); *************** *** 1236,1240 **** if (current instanceof Instance) { Instance instance = (Instance) current; ! translation.add(0, instance.getInstanceAnchor()); } current = current.getOwner(); --- 1238,1242 ---- if (current instanceof Instance) { Instance instance = (Instance) current; ! translation.add(0, instance.getTransformation()); } current = current.getOwner(); |
From: Michael L. <he...@us...> - 2010-01-13 10:58:38
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv15624/src/net/sourceforge/bprocessor/gl/model Modified Files: SelectionPath.java Log Message: new rotation tool Index: SelectionPath.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model/SelectionPath.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SelectionPath.java 12 Dec 2007 14:38:48 -0000 1.3 --- SelectionPath.java 13 Jan 2010 10:58:30 -0000 1.4 *************** *** 99,103 **** for (Geometric current : reversed) { if (current instanceof Instance) { ! CoordinateSystem cs = ((Instance)current).getInstanceAnchor(); cs.unTranslateIt(vertices); } --- 99,103 ---- for (Geometric current : reversed) { if (current instanceof Instance) { ! CoordinateSystem cs = ((Instance)current).getTransformation(); cs.unTranslateIt(vertices); } *************** *** 115,119 **** for (Geometric current : path) { if (current instanceof Instance) { ! CoordinateSystem cs = ((Instance)current).getInstanceAnchor(); cs.translateIt(geometric.collect()); } --- 115,119 ---- for (Geometric current : path) { if (current instanceof Instance) { ! CoordinateSystem cs = ((Instance)current).getTransformation(); cs.translateIt(geometric.collect()); } |
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv15624/src/net/sourceforge/bprocessor/gl/tool Modified Files: ToolFactory.java RotationTool.java FinalMoveTool.java AbstractPencil.java Added Files: RotationToolB.java Log Message: new rotation tool Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** ToolFactory.java 14 Sep 2009 16:22:59 -0000 1.106 --- ToolFactory.java 13 Jan 2010 10:58:30 -0000 1.107 *************** *** 75,79 **** private AbstractTool protractor; private FinalMoveTool moving; ! private RotationTool rotation; private OffsetTool offset; private ExtrusionTool extrude; --- 75,79 ---- private AbstractTool protractor; private FinalMoveTool moving; ! private RotationToolB rotation; private OffsetTool offset; private ExtrusionTool extrude; *************** *** 146,150 **** eraser = new EraserTool(editor, pencilcursor); arc = new ArcTool(editor, pencilcursor); ! rotation = new RotationTool(editor, null); extrude = new ExtrusionTool(editor, pencilcursor); extend = new ExtendTool(editor, pencilcursor); --- 146,150 ---- eraser = new EraserTool(editor, pencilcursor); arc = new ArcTool(editor, pencilcursor); ! rotation = new RotationToolB(editor, null); extrude = new ExtrusionTool(editor, pencilcursor); extend = new ExtendTool(editor, pencilcursor); Index: FinalMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** FinalMoveTool.java 22 Dec 2009 13:51:51 -0000 1.55 --- FinalMoveTool.java 13 Jan 2010 10:58:30 -0000 1.56 *************** *** 216,220 **** public InstanceMove(Instance instance, CoordinateSystem handle) { this.instance = instance; ! this.initialCoordinate = instance.getInstanceAnchor().copy(); this.handle = handle.copy(); CoordinateSystem tmp = this.initialCoordinate.unTranslate(this.handle); --- 216,220 ---- public InstanceMove(Instance instance, CoordinateSystem handle) { this.instance = instance; ! this.initialCoordinate = instance.getAnchor(); this.handle = handle.copy(); CoordinateSystem tmp = this.initialCoordinate.unTranslate(this.handle); *************** *** 235,240 **** CoordinateSystem cs = null; if (current.object() instanceof Surface) { - // convert the handle into the coordinatesystems of the surface and translate - //the instance anchor according to that Surface surface = (Surface)current.object(); Vertex n = surface.normal(); --- 235,238 ---- *************** *** 262,271 **** prevCs = cs; } ! CoordinateSystem zero = new CoordinateSystem(new Vertex(1, 0, 0), new Vertex(0, 1, 0), ! new Vertex(0, 0, 1), new Vertex(0, 0, 0)); ! CoordinateSystem tmp = handle.translate(zero); ! tmp = cs.unTranslate(tmp); ! instance.getInstanceAnchor().setOrigin(tmp.center()); ! instance.getInstanceAnchor().setIJN(tmp.getI(), tmp.getJ(), tmp.getN()); } --- 260,264 ---- prevCs = cs; } ! instance.setAnchor(cs); } *************** *** 274,278 **** */ public void revert() { ! instance.getInstanceAnchor().setAttributes(initialCoordinate.getAttributes()); } } --- 267,271 ---- */ public void revert() { ! instance.setAnchor(initialCoordinate); } } *************** *** 626,631 **** */ public void activate(Instance instance) { ! CoordinateSystem anchor = instance.getInstanceAnchor(); ! Vertex center = anchor.unTranslate(anchor.getOrigin()); Intersection intersection = new Intersection(center, Intersection.VERTEX, instance); LinkedList<Geometric> geometrics = new LinkedList(); --- 619,624 ---- */ public void activate(Instance instance) { ! CoordinateSystem transformation = instance.getTransformation(); ! Vertex center = transformation.unTranslate(transformation.getOrigin()); Intersection intersection = new Intersection(center, Intersection.VERTEX, instance); LinkedList<Geometric> geometrics = new LinkedList(); *************** *** 674,689 **** if (geometrics.size() == 1) { ! Geometric work = geometrics.iterator().next(); ! if (work instanceof Instance) { ! Instance space = (Instance)work; ! CoordinateSystem anchor = null; ! for (CoordinateSystem currentSystem : space.getProto().getCoordinateSystems()) { ! anchor = currentSystem; ! break; ! } ! if (anchor == null) { ! anchor = Project.getInstance().getActiveCoordinateSystem().copy(); ! } ! mover = new InstanceMove(space, anchor); } } --- 667,675 ---- if (geometrics.size() == 1) { ! Geometric first = geometrics.iterator().next(); ! if (first instanceof Instance) { ! Instance instance = (Instance) first; ! CoordinateSystem handle = instance.getHandle(); ! mover = new InstanceMove(instance, handle); } } --- NEW FILE: RotationToolB.java --- //--------------------------------------------------------------------------------- // $Id: RotationToolB.java,v 1.1 2010/01/13 10:58:30 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gl.tool; import java.awt.Cursor; import java.awt.event.MouseEvent; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import net.sourceforge.bprocessor.gl.Editor; 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.Instance; import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Vertex; /** * */ public class RotationToolB extends AbstractPencil { private CoordinateSystem system; private Protract protract; private Vertex base; private List<Vertex> vertices; private List<Vertex> originals; /** * * @param editor Editor * @param cursor Cursor */ public RotationToolB(Editor editor, Cursor cursor) { super(editor, cursor); showConstructors = false; } /** * */ public void onVertex() { } private void cache() { originals = new LinkedList(); for (Vertex current : vertices) { originals.add(current.copy()); } } private void reset() { Iterator<Vertex> actual = vertices.iterator(); Iterator<Vertex> original = originals.iterator(); while (actual.hasNext()) { Vertex current = actual.next(); Vertex value = original.next(); current.set(value); } } private void rotate(double angle) { if (!Double.isNaN(angle)) { Vertex center = center(); Vertex n = normal(); double x = n.getX(); double y = n.getY(); double z = n.getZ(); reset(); for (Vertex current : vertices) { Geometry.rotate(angle, x, y, z, current, center); } for (Vertex current : vertices) { current.update(); } } } private void finish() { base = null; Project.getInstance().checkpoint(); Project.getInstance().changed(vertices); cache(); } /** * {@inheritDoc} */ protected void moved(MouseEvent e) { current = findIntersection(e); if (current != null) { if (system != null) { if (base != null) { double angle = angle(); if (!Double.isNaN(angle)) { rotate(angle); } } } updateFeedback(); } } /** * {@inheritDoc} */ protected void pressed(MouseEvent e) { current = findIntersection(e); if (current != null) { if (system != null) { if (base == null) { base = direction(); } else { double angle = angle(); rotate(angle); finish(); } } else { if (start == null) { start = current; } else { Vertex origin = start.vertex(); Vertex to = current.vertex(); Vertex n = to.minus(origin); if (!n.isZero()) { n.normalize(); system = CoordinateSystem.systemFor(origin, n); start = null; } } } updateFeedback(); } } private Vertex direction() { Plane plane = system.plane(); Vertex vertex = plane.projection(current.vertex()); Vertex u = vertex.minus(system.getOrigin()); u.normalize(); return u; } private Vertex center() { return system.getOrigin(); } private Vertex normal() { return system.getN(); } private Vertex base() { if (base != null) { return base; } else { return system.getI(); } } private double angle() { Vertex i = base(); Vertex u = direction(); if (u.isZero()) { return Double.NaN; } if (i.cross(u).isZero()) { return 0; } else { double angle = i.angle(u); double box = i.cross(u).dot(system.getN()); if (box < 0) { angle = -angle; } return angle; } } /** * {@inheritDoc} */ protected void updateLength() { if (system != null) { double angle = angle() * 180 / Math.PI; setLength(angle / 1000); } else { clearLength(); } } /** * Update feedback */ protected void updateFeedback() { if (protract != null) { editor.getView().removeGlObjects3D(protract); protract = null; } List<Edge> edges = new LinkedList(); if (current != null) { if (system != null) { showConstructors = false; Vertex center = system.getOrigin(); Vertex i = base(); Vertex j = normal().cross(i); protract = new Protract(center, i, j, true); editor.getView().addGlObjects3D(protract); } else { showConstructors = true; if (start != null) { Vertex origin = start.vertex(); Vertex to = current.vertex(); Edge axis = new Edge(origin, to); axis.setStrippled(true); edges.add(axis); } } } feedback(edges); makeTarget(current); updateConstructors(); } /** * {@inheritDoc} */ public void apply(double value) { if (protract != null) { double angle = (value * 1000) * Math.PI / 180; rotate(angle); finish(); } } /** * {@inheritDoc} */ public void prepare() { setLabel("Angle:"); if (Selection.primary().size() == 1) { Geometric geometric = Selection.primary().iterator().next(); system = systemFor(geometric); if (system != null) { system = system.copy(); } } vertices = new LinkedList(Selection.primary().collect()); cache(); } private CoordinateSystem systemFor(Geometric geometric) { if (geometric instanceof Instance) { return systemFor((Instance) geometric); } return null; } private CoordinateSystem systemFor(Instance instance) { return instance.getAnchor(); } /** * {@inheritDoc} */ public String initialTip() { return "Rotate"; } /** * {@inheritDoc} */ public void cleanUp() { super.cleanUp(); if (protract != null) { editor.getView().removeGlObjects3D(protract); protract = null; } base = null; system = null; } } Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** AbstractPencil.java 22 Dec 2009 13:51:51 -0000 1.111 --- AbstractPencil.java 13 Jan 2010 10:58:30 -0000 1.112 *************** *** 13,16 **** --- 13,17 ---- import java.awt.event.MouseEvent; import java.util.Collection; + import java.util.Collections; import java.util.HashSet; import java.util.Iterator; *************** *** 122,125 **** --- 123,128 ---- protected boolean dragging; + protected boolean showConstructors; + /** An extension of the locking edge when moving * outside the lockingedge */ *************** *** 144,147 **** --- 147,151 ---- lock = false; active = false; + showConstructors = true; } *************** *** 420,425 **** */ protected void updateConstructors() { ! List constructors = computeConstructors(); ! constructors(constructors); number = ""; updateLength(); --- 424,433 ---- */ protected void updateConstructors() { ! if (showConstructors) { ! List constructors = computeConstructors(); ! constructors(constructors); ! } else { ! constructors(Collections.EMPTY_LIST); ! } number = ""; updateLength(); Index: RotationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RotationTool.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** RotationTool.java 22 Dec 2009 13:51:51 -0000 1.35 --- RotationTool.java 13 Jan 2010 10:58:30 -0000 1.36 *************** *** 45,49 **** /** The vertexes to rotate */ ! private Set vertices = new HashSet(); /** The first pressed point */ private Vertex p1; --- 45,49 ---- /** The vertexes to rotate */ ! private Set<Vertex> vertices = new HashSet(); /** The first pressed point */ private Vertex p1; *************** *** 54,58 **** /** the previous vertex when moving the mouse */ private Vertex previous; ! /** The plane whose normal is rotated aboud */ private Plane onto; /** The gl object drawing the rotation circle */ --- 54,58 ---- /** the previous vertex when moving the mouse */ private Vertex previous; ! /** The plane whose normal is rotated around */ private Plane onto; /** The gl object drawing the rotation circle */ *************** *** 295,303 **** */ private void rotate(double angle) { ! Iterator iter = vertices.iterator(); ! while (iter.hasNext()) { ! Vertex v = (Vertex)iter.next(); ! Geometry.rotate(angle, onto.getDoublev()[Vertex.X], ! onto.getDoublev()[Vertex.Y], onto.getDoublev()[Vertex.Z], v, p1); } } --- 295,303 ---- */ private void rotate(double angle) { ! for (Vertex v : vertices) { ! Vertex n = onto.normal(); ! Geometry.rotate(angle, n.getX(), ! n.getY(), n.getZ(), v, p1); ! v.update(); } } |
From: Michael L. <he...@us...> - 2009-12-22 14:54:45
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv8680/src/net/sourceforge/bprocessor/gl/tool Modified Files: Protractor.java Added Files: Protract.java Log Message: --- NEW FILE: Protract.java --- //--------------------------------------------------------------------------------- // $Id: Protract.java,v 1.1 2009/12/22 14:54:34 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gl.tool; import java.util.LinkedList; import java.util.List; import javax.media.opengl.GL; 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; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Vertex; /** * Protract */ public class Protract implements GlObject { private Vertex origin; private Vertex u; private Vertex v; private boolean hitable; /** * Constructs a Protract * @param origin Vertex * @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; } /** * * @param radius double * @param angle double * @return Vertex */ public 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) { 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); 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 < 24; i++) { double angle = 2 * Math.PI * i / 24; 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(); } } 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); } } /** {@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: Protractor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Protractor.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Protractor.java 22 Dec 2009 14:33:34 -0000 1.22 --- Protractor.java 22 Dec 2009 14:54:34 -0000 1.23 *************** *** 13,25 **** import java.util.List; - import javax.media.opengl.GL; import net.sourceforge.bprocessor.gl.Editor; - 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; import net.sourceforge.bprocessor.model.CoordinateSystem; - import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Line; --- 13,21 ---- *************** *** 270,396 **** } ! /** ! * Protract ! */ ! public static class Protract implements GlObject { ! private Vertex origin; ! private Vertex u; ! private Vertex v; ! private boolean hitable; ! ! /** ! * Constructs a Protract ! * @param origin Vertex ! * @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; ! } ! ! 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) { ! 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); ! 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 < 24; i++) { ! double angle = 2 * Math.PI * i / 24; ! 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(); ! } ! } ! 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); ! } ! } ! ! /** {@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; ! } ! } } --- 266,269 ---- } ! } |
From: Michael L. <he...@us...> - 2009-12-22 14:33:44
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv5227/src/net/sourceforge/bprocessor/gl/tool Modified Files: Protractor.java TapeMeasure.java Log Message: Index: Protractor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Protractor.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Protractor.java 22 Dec 2009 13:51:51 -0000 1.21 --- Protractor.java 22 Dec 2009 14:33:34 -0000 1.22 *************** *** 247,250 **** --- 247,262 ---- * {@inheritDoc} */ + public void apply(double value) { + if (protract != null) { + double angle = (value * 1000) * Math.PI / 180; + Vertex to = protract.radian(1, angle); + current = new Intersection(to, Intersection.VERTEX, to); + onVertex(); + } + } + + /** + * {@inheritDoc} + */ public void cleanUp() { super.cleanUp(); Index: TapeMeasure.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/TapeMeasure.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TapeMeasure.java 22 Dec 2009 13:51:51 -0000 1.12 --- TapeMeasure.java 22 Dec 2009 14:33:34 -0000 1.13 *************** *** 155,159 **** /** ! * @param value Length */ public void apply(double value) { --- 155,159 ---- /** ! * {@inheritDoc} */ public void apply(double value) { |
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv26364/src/net/sourceforge/bprocessor/gl/tool Modified Files: OffsetTool.java ExtrusionTool.java ConstructorTool.java FinalMoveTool.java AbstractPencil.java TapeMeasure.java ExtendTool.java Protractor.java AbstractTool.java RotationTool.java ArcTool.java RectTool.java Pencil.java EraserTool.java Removed Files: MoveTool.java EdgeMoveTool.java AltMoveTool.java ControlledMoveTool.java Log Message: length label --- EdgeMoveTool.java DELETED --- Index: RectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RectTool.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** RectTool.java 11 Dec 2007 14:49:11 -0000 1.29 --- RectTool.java 22 Dec 2009 13:51:51 -0000 1.30 *************** *** 203,206 **** --- 203,207 ---- public void prepare() { Selection.primary().clear(); + setLabel("Length:"); } Index: OffsetTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OffsetTool.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** OffsetTool.java 11 Dec 2007 14:49:11 -0000 1.27 --- OffsetTool.java 22 Dec 2009 13:51:51 -0000 1.28 *************** *** 360,364 **** @Override public void prepare() { ! super.prepare(); finalEdgeList.clear(); Selection selection = getSelection(); --- 360,364 ---- @Override public void prepare() { ! setLabel("Length:"); finalEdgeList.clear(); Selection selection = getSelection(); --- ControlledMoveTool.java DELETED --- Index: ConstructorTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ConstructorTool.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ConstructorTool.java 30 Dec 2007 23:24:32 -0000 1.19 --- ConstructorTool.java 22 Dec 2009 13:51:51 -0000 1.20 *************** *** 131,134 **** --- 131,142 ---- /** + * {@inheritDoc} + */ + public void prepare() { + super.prepare(); + } + + + /** * Process click * @param e MouseEvent Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** ExtrusionTool.java 25 Jun 2009 22:17:40 -0000 1.76 --- ExtrusionTool.java 22 Dec 2009 13:51:51 -0000 1.77 *************** *** 478,481 **** --- 478,482 ---- public void prepare() { cleanSelection(); + setLabel("Length:"); } Index: TapeMeasure.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/TapeMeasure.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TapeMeasure.java 11 Dec 2007 14:49:11 -0000 1.11 --- TapeMeasure.java 22 Dec 2009 13:51:51 -0000 1.12 *************** *** 190,193 **** --- 190,200 ---- /** + * {@inheritDoc} + */ + public void prepare() { + setLabel("Length:"); + } + + /** * Tip on how to set the first click * @return short describtion of what to do Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.152 retrieving revision 1.153 diff -C2 -d -r1.152 -r1.153 *** AbstractTool.java 17 Nov 2009 13:43:59 -0000 1.152 --- AbstractTool.java 22 Dec 2009 13:51:51 -0000 1.153 *************** *** 244,247 **** --- 244,254 ---- editor.setTip(tip); } + + /** + * Clears the tip-panel + */ + public void clearTip() { + editor.setTip(""); + } /** *************** *** 264,273 **** /** ! * Clears the tip-panel */ ! public void clearTip() { ! editor.setTip(""); } /** * See if surface has become a hole in a surface in --- 271,283 ---- /** ! * Sets the label for the parameter ! * @param label Label */ ! public void setLabel(String label) { ! editor.setLengthLabel(label); } + + /** * See if surface has become a hole in a surface in *************** *** 688,692 **** */ public void prepare() { ! } --- 698,702 ---- */ public void prepare() { ! setLabel(">"); } Index: ArcTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ArcTool.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** ArcTool.java 13 Dec 2007 08:21:40 -0000 1.25 --- ArcTool.java 22 Dec 2009 13:51:51 -0000 1.26 *************** *** 240,243 **** --- 240,244 ---- public void prepare() { Selection.primary().clear(); + setLabel("Length:"); } Index: ExtendTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtendTool.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ExtendTool.java 25 Jun 2009 22:17:40 -0000 1.5 --- ExtendTool.java 22 Dec 2009 13:51:51 -0000 1.6 *************** *** 15,19 **** import java.util.Map; - import org.apache.log4j.Logger; import net.sourceforge.bprocessor.gl.Editor; --- 15,18 ---- *************** *** 35,39 **** */ public class ExtendTool extends AbstractPencil { - private static Logger log = Logger.getLogger(ExtendTool.class); private HashSet<Surface> extrusion; private Map<Vertex, Direction> v2dir; --- 34,37 ---- *************** *** 261,268 **** @Override public void prepare() { ! super.prepare(); ! if (!getSelection().isEmpty()) { ! Selection.primary().clear(); ! } } --- 259,264 ---- @Override public void prepare() { ! Selection.primary().clear(); ! setLabel("Length:"); } Index: FinalMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** FinalMoveTool.java 26 Jun 2009 20:41:55 -0000 1.54 --- FinalMoveTool.java 22 Dec 2009 13:51:51 -0000 1.55 *************** *** 594,597 **** --- 594,605 ---- } + + /** + * {@inheritDoc} + */ + public void prepare() { + setLabel("Length:"); + } + /** * Tip on how to set the first click Index: EraserTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/EraserTool.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** EraserTool.java 7 Dec 2007 12:48:31 -0000 1.13 --- EraserTool.java 22 Dec 2009 13:51:51 -0000 1.14 *************** *** 86,89 **** --- 86,90 ---- public void prepare() { Selection.primary().clear(); + setLabel("#"); } Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.110 retrieving revision 1.111 diff -C2 -d -r1.110 -r1.111 *** AbstractPencil.java 18 Sep 2009 09:09:09 -0000 1.110 --- AbstractPencil.java 22 Dec 2009 13:51:51 -0000 1.111 *************** *** 782,785 **** --- 782,792 ---- * {@inheritDoc} */ + public void prepare() { + setLabel("# "); + } + + /** + * {@inheritDoc} + */ public Object evaluate(String value) { Stack stack = evaluateString("echo (" + value + ")"); Index: Pencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Pencil.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Pencil.java 7 Dec 2007 12:48:31 -0000 1.23 --- Pencil.java 22 Dec 2009 13:51:51 -0000 1.24 *************** *** 121,124 **** --- 121,125 ---- public void prepare() { Selection.primary().clear(); + setLabel("Length:"); } --- MoveTool.java DELETED --- --- AltMoveTool.java DELETED --- Index: Protractor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Protractor.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Protractor.java 22 Nov 2007 10:25:57 -0000 1.20 --- Protractor.java 22 Dec 2009 13:51:51 -0000 1.21 *************** *** 241,244 **** --- 241,245 ---- public void prepare() { Selection.primary().clear(); + setLabel("Angle:"); } Index: RotationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RotationTool.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** RotationTool.java 13 Dec 2007 08:21:40 -0000 1.34 --- RotationTool.java 22 Dec 2009 13:51:51 -0000 1.35 *************** *** 263,266 **** --- 263,273 ---- updateFeedback(); } + + /** + * {@inheritDoc} + */ + public void prepare() { + setLabel("Angle:"); + } /** |
From: Michael L. <he...@us...> - 2009-12-22 13:52:03
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv26364/src/net/sourceforge/bprocessor/gl Modified Files: Editor.java Log Message: length label Index: Editor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/Editor.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Editor.java 14 Sep 2009 16:22:59 -0000 1.15 --- Editor.java 22 Dec 2009 13:51:52 -0000 1.16 *************** *** 81,84 **** --- 81,85 ---- /** the length parameter */ private LengthField lengthField; + private JLabel label; private Box controlarea; *************** *** 182,186 **** lengtharea.add(controlarea); ! lengtharea.add(new JLabel("Length:")); lengtharea.add(Box.createHorizontalStrut(3)); lengthField = new LengthField(); --- 183,189 ---- lengtharea.add(controlarea); ! label = new JLabel("<blank>:"); ! ! lengtharea.add(label); lengtharea.add(Box.createHorizontalStrut(3)); lengthField = new LengthField(); *************** *** 461,464 **** --- 464,475 ---- /** + * Set the parameter label + * @param value new value + */ + public void setLengthLabel(String value) { + label.setText(value); + } + + /** * Sets the tip in the tip-panel * @param tip the tip to be displayed |
From: Michael L. <he...@us...> - 2009-11-27 13:35:45
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9026/src/net/sourceforge/bprocessor/model Modified Files: Material.java Camera.java Project.java Log Message: Export to XML Index: Material.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Material.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Material.java 23 Jun 2009 12:08:45 -0000 1.16 --- Material.java 27 Nov 2009 13:35:26 -0000 1.17 *************** *** 311,313 **** --- 311,329 ---- printer.println("illum " + (int) illumination); } + + /** + * + * @param printer PrintStream + */ + public void exportXml(PrintStream printer) { + String value = "<Material" + + " id=\"" + getId() + "\"" + + " name=\"" + name + "\"" + + " red=\"" + diffuseColor[0] + "\"" + + " green=\"" + diffuseColor[1] + "\"" + + " blue=\"" + diffuseColor[2] + "\"" + + ">"; + printer.println(" " + value); + printer.println(" </Material>"); + } } Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** Camera.java 9 Sep 2009 10:31:00 -0000 1.60 --- Camera.java 27 Nov 2009 13:35:26 -0000 1.61 *************** *** 8,11 **** --- 8,12 ---- import java.awt.Toolkit; + import java.io.PrintStream; import java.util.ArrayList; import java.util.Collection; *************** *** 750,752 **** --- 751,792 ---- hiddenGeometrics.add(g); } + + /** + * + * @param printer PrintStream + */ + public void exportXml(PrintStream printer) { + String value = "<Camera" + + " id=\"" + getId() + "\"" + + " name=\"" + name + "\"" + + " focalwidth=\"" + focalwidth + "\"" + + ">"; + printer.println(" " + value); + { + String str = " <position" + + " x=\"" + camera[0] + "\"" + + " y=\"" + camera[1] + "\"" + + " z=\"" + camera[2] + "\"" + + "/>"; + printer.println(str); + } + { + String str = " <lookat" + + " x=\"" + center[0] + "\"" + + " y=\"" + center[1] + "\"" + + " z=\"" + center[2] + "\"" + + "/>"; + printer.println(str); + } + { + String str = " <roll" + + " x=\"" + roll[0] + "\"" + + " y=\"" + roll[1] + "\"" + + " z=\"" + roll[2] + "\"" + + "/>"; + printer.println(str); + } + printer.println(" </Camera>"); + } + } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.182 retrieving revision 1.183 diff -C2 -d -r1.182 -r1.183 *** Project.java 14 Sep 2009 16:22:55 -0000 1.182 --- Project.java 27 Nov 2009 13:35:26 -0000 1.183 *************** *** 11,15 **** import java.io.ByteArrayOutputStream; import java.io.File; - import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; --- 11,14 ---- *************** *** 802,807 **** * @return The cameras */ ! public Collection getCameras() { ! return new HashSet(cameras.values()); } --- 801,806 ---- * @return The cameras */ ! public Collection<Camera> getCameras() { ! return cameras.values(); } *************** *** 833,836 **** --- 832,836 ---- public void run() { export(); + isExporting = false; } } *************** *** 1867,1898 **** */ public void export() { - System.out.println("export to " + getExportPath() + ".obj"); - String objname = getExportPath() + ".obj"; - String mtlname = getExportPath() + ".mtl"; try { ! { ! OutputStream out = new FileOutputStream(new File(mtlname)); ! for (Material current : getMaterials()) { ! current.export(out); ! } ! out.close(); ! } ! { ! OutputStream out = new FileOutputStream(new File(objname)); ! PrintStream printer = new PrintStream(out); ! printer.println("mtllib " + mtlname); ! exportOBJ(out); ! out.close(); ! } ! } catch (FileNotFoundException e) { ! // TODO Auto-generated catch block ! System.out.println("cannot export to " + objname); } catch (IOException e) { // TODO Auto-generated catch block ! System.out.println("cannot export to " + objname); } - isExporting = false; } /** * --- 1867,1962 ---- */ public void export() { try { ! export(getExportPath()); } catch (IOException e) { // TODO Auto-generated catch block ! e.printStackTrace(); ! } ! } ! ! /** ! * Export to the given path ! * @param path String ! * @throws IOException Error ! */ ! public void export(String path) throws IOException { ! exportXml(path); ! } ! ! /** ! * ! * @param path String ! * @throws IOException Exception ! */ ! public void exportXml(String path) throws IOException { ! System.out.println("export to " + path + ".xml"); ! String xmlname = path + ".xml"; ! OutputStream out = new FileOutputStream(new File(xmlname)); ! PrintStream printer = new PrintStream(out); ! printer.println("<Scene>"); ! ! for (Material current : getMaterials()) { ! current.exportXml(printer); ! } ! ! for (Camera current : getCameras()) { ! current.exportXml(printer); ! } ! ! List<Space> spaces = world.collectSpaces(); ! ! List<Space> constructs = new LinkedList(); ! for (Space current : spaces) { ! if (!current.isVoid() && current.isConstructionSpace()) { ! constructs.add(current); ! } ! } ! List<Space> containers = new LinkedList(); ! for (Space current : constructs) { ! Space tesselation = current.tesselate(); ! List<Space> single = new LinkedList(); ! single.add(tesselation); ! Material material = current.getMaterial(); ! if (material == null) { ! material = Defaults.getConstructionMaterial(); ! } ! String header = "<Object" ! + " name=\"" + current.getName() + "\"" ! + " material=\"" + material.getName() + "\"" ! + ">"; ! printer.println(header); ! Space.export(single, printer); ! printer.println("</Object>"); ! } ! printer.println("</Scene"); ! out.close(); ! } ! ! /** ! * Export object file to given path ! * @param path String ! * @throws IOException Exception ! */ ! public void exportObj(String path) throws IOException { ! System.out.println("export to " + path + ".obj"); ! String objname = path + ".obj"; ! String mtlname = path + ".mtl"; ! { ! OutputStream out = new FileOutputStream(new File(mtlname)); ! for (Material current : getMaterials()) { ! current.export(out); ! } ! out.close(); ! } ! { ! OutputStream out = new FileOutputStream(new File(objname)); ! PrintStream printer = new PrintStream(out); ! printer.println("mtllib " + mtlname); ! exportOBJ(out); ! out.close(); } } + /** * |
From: Michael L. <he...@us...> - 2009-11-17 13:44:13
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14966/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java SelectStrategy.java Strategy.java OrbitStrategy.java PanStrategy.java Log Message: Index: SelectStrategy.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectStrategy.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** SelectStrategy.java 25 Jun 2009 23:28:49 -0000 1.34 --- SelectStrategy.java 17 Nov 2009 13:44:00 -0000 1.35 *************** *** 12,19 **** import java.util.List; import java.util.Set; - - - import org.apache.log4j.Logger; - import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gl.model.GlCamera; --- 12,15 ---- *************** *** 33,38 **** */ public class SelectStrategy implements Strategy { - /** The logger */ - private static Logger log = Logger.getLogger(SelectStrategy.class); --- 29,32 ---- *************** *** 42,55 **** private Editor editor; ! /** Tempoary edges for multiple selection */ protected Edge e1; ! ! /** Tempoary edges for multiple selection */ protected Edge e2; ! ! /** Tempoary edges for multiple selection */ protected Edge e3; ! ! /** Tempoary edges for multiple selection */ protected Edge e4; --- 36,46 ---- private Editor editor; ! /** Temporary edges for multiple selection */ protected Edge e1; ! /** Temporary edges for multiple selection */ protected Edge e2; ! /** Temporary edges for multiple selection */ protected Edge e3; ! /** Temporary edges for multiple selection */ protected Edge e4; *************** *** 106,110 **** */ public void pressed(MouseEvent e) { - log.debug("pressed"); Transformation t = editor.getView().transformation(); Vertex first = t.unProject(new Vertex(e.getX(), View.getHeight() - e.getY(), 0.001)); --- 97,100 ---- *************** *** 197,201 **** */ public void dragged(MouseEvent e) { - log.debug("dragged"); if (activated) { multipleSelection = true; --- 187,190 ---- *************** *** 274,278 **** */ public void released(MouseEvent e) { - log.debug("released with event:" + e.toString()); if (activated) { if (multipleSelection) { --- 263,266 ---- *************** *** 321,326 **** selection.remove(g); } - } else { - log.error("Tried to insert something different from Geometric in selection"); } } else if (target instanceof GlCamera) { --- 309,312 ---- *************** *** 332,337 **** selection.set((Geometric)target); } - } else { - log.warn("Target weren't a Geometric"); } } --- 318,321 ---- *************** *** 342,344 **** --- 326,336 ---- activated = false; } + + /** + * {@inheritDoc} + */ + public void prepare() { + // TODO Auto-generated method stub + + } } Index: OrbitStrategy.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OrbitStrategy.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** OrbitStrategy.java 12 Dec 2007 15:07:01 -0000 1.6 --- OrbitStrategy.java 17 Nov 2009 13:44:00 -0000 1.7 *************** *** 17,21 **** /** ! * The rotationtool */ public class OrbitStrategy implements Strategy { --- 17,21 ---- /** ! * The orbit tool */ public class OrbitStrategy implements Strategy { *************** *** 38,41 **** --- 38,44 ---- private int y; + + private boolean initial; + /** * KeyListener for the GL Canvas *************** *** 63,87 **** */ public void dragged(MouseEvent e) { ! Camera c = Project.getInstance().getCurrentCamera(); ! if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == ! MouseEvent.BUTTON1_DOWN_MASK || e.getButton() == MouseEvent.BUTTON1) { ! double angleX = ((double)(e.getX() - x) / 360) * Math.PI; ! double angleY = ((double)(e.getY() - y) / 360) * Math.PI; ! ! if (e.isShiftDown()) { ! // roll camera ! Camera.rollCamera(c, (angleY + angleX) / 2); ! } else if (e.isAltDown()) { ! // rotate camera about itself ! Camera.rotateHorizontallyEye(c, -angleX); ! Camera.rotateVerticallyEye(c, angleY); ! } else { ! // rotate camera about point of view ! double[] pivot = c.getCenter(); ! Camera.rotateHorizontally(c, -angleX, pivot); ! Camera.rotateVertically(c, angleY, pivot); ! } x = e.getX(); y = e.getY(); } } --- 66,96 ---- */ public void dragged(MouseEvent e) { ! if (initial) { x = e.getX(); y = e.getY(); + initial = false; + } else { + Camera c = Project.getInstance().getCurrentCamera(); + if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == + MouseEvent.BUTTON1_DOWN_MASK || e.getButton() == MouseEvent.BUTTON1) { + double angleX = ((double)(e.getX() - x) / 360) * Math.PI; + double angleY = ((double)(e.getY() - y) / 360) * Math.PI; + + if (e.isShiftDown()) { + // roll camera + Camera.rollCamera(c, (angleY + angleX) / 2); + } else if (e.isAltDown()) { + // rotate camera about itself + Camera.rotateHorizontallyEye(c, -angleX); + Camera.rotateVerticallyEye(c, angleY); + } else { + // rotate camera about point of view + double[] pivot = c.getCenter(); + Camera.rotateHorizontally(c, -angleX, pivot); + Camera.rotateVertically(c, angleY, pivot); + } + x = e.getX(); + y = e.getY(); + } } } *************** *** 101,104 **** --- 110,114 ---- x = e.getX(); y = e.getY(); + initial = false; } /** *************** *** 108,110 **** --- 118,127 ---- public void released(MouseEvent e) { } + + /** + * {@inheritDoc} + */ + public void prepare() { + initial = true; + } } Index: PanStrategy.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PanStrategy.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PanStrategy.java 18 Nov 2007 21:30:17 -0000 1.5 --- PanStrategy.java 17 Nov 2009 13:44:00 -0000 1.6 *************** *** 93,96 **** --- 93,104 ---- public void released(MouseEvent e) { } + + /** + * {@inheritDoc} + */ + public void prepare() { + // TODO Auto-generated method stub + + } } Index: Strategy.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Strategy.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Strategy.java 21 Jun 2006 10:26:33 -0000 1.1 --- Strategy.java 17 Nov 2009 13:44:00 -0000 1.2 *************** *** 15,18 **** --- 15,24 ---- public interface Strategy { + /** + * Invoked when this Strategy is activated. + */ + abstract void prepare(); + + /** * Invoked when the mouse cursor has been moved Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.151 retrieving revision 1.152 diff -C2 -d -r1.151 -r1.152 *** AbstractTool.java 22 Sep 2009 11:16:57 -0000 1.151 --- AbstractTool.java 17 Nov 2009 13:43:59 -0000 1.152 *************** *** 187,196 **** Tool tool = null; ToolFactory factory = ToolFactory.getFactory(editor); ! if (which == AbstractTool.pan) { ! tool = factory.get(Tool.PAN_TOOL); ! } else if (which == AbstractTool.orbit) { ! tool = factory.get(Tool.CAMERA_TOOL); ! } else if (which == AbstractTool.select) { ! tool = factory.get(Tool.SELECT_TOOL); } else { if (activeStrategy == AbstractTool.select) { --- 187,200 ---- Tool tool = null; ToolFactory factory = ToolFactory.getFactory(editor); ! ! if (which != null) { ! which.prepare(); ! if (which == AbstractTool.pan) { ! tool = factory.get(Tool.PAN_TOOL); ! } else if (which == AbstractTool.orbit) { ! tool = factory.get(Tool.CAMERA_TOOL); ! } else if (which == AbstractTool.select) { ! tool = factory.get(Tool.SELECT_TOOL); ! } } else { if (activeStrategy == AbstractTool.select) { |
From: Michael L. <he...@us...> - 2009-11-17 09:57:07
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20232/src/net/sourceforge/bprocessor/gui/actions Modified Files: ImportFileReader.java FileImportActionListener.java Log Message: Index: FileImportActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileImportActionListener.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** FileImportActionListener.java 29 Jun 2009 08:37:40 -0000 1.27 --- FileImportActionListener.java 17 Nov 2009 09:56:55 -0000 1.28 *************** *** 192,196 **** this.add(basis); this.add(new JLabel("Scale")); ! scale = new JTextField("1:100", 5); scale.addActionListener(this); this.add(scale); --- 192,196 ---- this.add(basis); this.add(new JLabel("Scale")); ! scale = new JTextField("0.0254", 5); scale.addActionListener(this); this.add(scale); *************** *** 216,220 **** */ public double getScale() { ! return 1.0 / Integer.parseInt(scale.getText().substring(2)); } --- 216,222 ---- */ public double getScale() { ! String txt = scale.getText(); ! double value = Double.valueOf(txt); ! return value; } Index: ImportFileReader.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/ImportFileReader.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ImportFileReader.java 25 Jun 2009 23:28:46 -0000 1.22 --- ImportFileReader.java 17 Nov 2009 09:56:55 -0000 1.23 *************** *** 28,31 **** --- 28,32 ---- import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.Item; import net.sourceforge.bprocessor.model.Material; import net.sourceforge.bprocessor.model.Project; *************** *** 35,39 **** /** ! * A singleton class with stitic methods for loading different file formats into the model */ public class ImportFileReader { --- 36,40 ---- /** ! * A singleton class with static methods for loading different file formats into the model */ public class ImportFileReader { *************** *** 87,91 **** List<Space> groups = new LinkedList<Space>(); Map<String, Material> materialMap = new HashMap<String, Material>(); ! Space currentGroup = into.createConstructionSpace("Object"); Material currentMaterial = null; boolean missNormals = false; --- 88,92 ---- List<Space> groups = new LinkedList<Space>(); Map<String, Material> materialMap = new HashMap<String, Material>(); ! Space currentGroup = Item.createConstructionSpace("Object"); Material currentMaterial = null; boolean missNormals = false; *************** *** 166,169 **** --- 167,173 ---- edge.add(findEdge(prev, first, v2es)); Surface s = new Surface(edge); + if (currentGroup.getMaterial() == null) { + currentGroup.setMaterial(currentMaterial); + } s.setBackDomain(currentGroup); if (!normals.isEmpty()) { *************** *** 173,184 **** } surfaces.add(s); ! if (currentMaterial == null) { ! currentMaterial = new Material("Object", new float[]{0.9f, 0.9f, 0.9f}); ! materialMap.put("default", currentMaterial); } - s.setFrontMaterial(currentMaterial); edges.addAll(edge); } else if (lineContent[0].equals("g")) { ! currentGroup = into.createConstructionSpace(lineContent[1]); groups.add(currentGroup); } else if (lineContent[0].equals("usemtl")) { --- 177,186 ---- } surfaces.add(s); ! if (currentGroup.getMaterial() != currentMaterial) { ! s.setBackMaterial(currentMaterial); } edges.addAll(edge); } else if (lineContent[0].equals("g")) { ! currentGroup = Item.createConstructionSpace(lineContent[1]); groups.add(currentGroup); } else if (lineContent[0].equals("usemtl")) { *************** *** 192,198 **** name += " " + lineContent[i]; } ! loadMaterials(new File(f.getParent() + "\\" + name), materialMap); } else if (lineContent[0].equals("") || lineContent[0].equals("#")) { ! //Just comments continue; } else { --- 194,201 ---- name += " " + lineContent[i]; } ! ! loadMaterials(new File(f.getParent(), name), materialMap); } else if (lineContent[0].equals("") || lineContent[0].equals("#")) { ! // Just comments continue; } else { *************** *** 262,265 **** --- 265,269 ---- private static void loadMaterials(File file, Map<String, Material> materialMap) throws FileNotFoundException, IOException { + if (file.exists() && file.canRead()) { FileInputStream stream = new FileInputStream(file); *************** *** 269,276 **** --- 273,282 ---- while (br.ready()) { String line = br.readLine().trim(); + String[] content = line.split("\\s"); if (content[0].equals("newmtl")) { currentMaterial = new Material(); currentMaterial.setName(content[1]); + materialMap.put(currentMaterial.getName(), currentMaterial); } else { |
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26112/src/net/sourceforge/bprocessor/gui/actions Modified Files: FileSaveActionListener.java FileLoadActionListener.java FileActionListener.java FileSaveAsActionListener.java Log Message: Index: FileSaveActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileSaveActionListener.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** FileSaveActionListener.java 12 Nov 2009 15:27:24 -0000 1.7 --- FileSaveActionListener.java 13 Nov 2009 08:17:10 -0000 1.8 *************** *** 14,18 **** import java.io.File; - import javax.swing.JFileChooser; import org.apache.log4j.Logger; --- 14,17 ---- *************** *** 49,53 **** } } catch (Exception exception) { ! } } --- 48,52 ---- } } catch (Exception exception) { ! // nothing } } Index: FileLoadActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileLoadActionListener.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** FileLoadActionListener.java 12 Nov 2009 15:27:24 -0000 1.8 --- FileLoadActionListener.java 13 Nov 2009 08:17:10 -0000 1.9 *************** *** 17,21 **** */ public class FileLoadActionListener extends FileActionListener { ! /** * FileLoadActionListener --- 17,21 ---- */ public class FileLoadActionListener extends FileActionListener { ! /** * FileLoadActionListener *************** *** 23,27 **** public FileLoadActionListener() { } ! /** * The action to perform after the standard file action --- 23,27 ---- public FileLoadActionListener() { } ! /** * The action to perform after the standard file action *************** *** 34,37 **** --- 34,38 ---- Project.getInstance().load(file); } catch (Exception exception) { + // nothing } } Index: FileSaveAsActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileSaveAsActionListener.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FileSaveAsActionListener.java 12 Nov 2009 15:27:24 -0000 1.6 --- FileSaveAsActionListener.java 13 Nov 2009 08:17:10 -0000 1.7 *************** *** 14,28 **** import java.io.File; - import javax.swing.JFileChooser; - - import org.apache.log4j.Logger; - /** * The file->save as action listener */ public class FileSaveAsActionListener implements ActionListener { ! /** The logger */ ! private static Logger log = Logger.getLogger(FileSaveAsActionListener.class); ! /** * FileSavAseActionListener --- 14,22 ---- import java.io.File; /** * The file->save as action listener */ public class FileSaveAsActionListener implements ActionListener { ! /** * FileSavAseActionListener *************** *** 45,48 **** --- 39,43 ---- } } catch (Exception exception) { + // nothing } } Index: FileActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileActionListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FileActionListener.java 12 Nov 2009 15:27:24 -0000 1.2 --- FileActionListener.java 13 Nov 2009 08:17:10 -0000 1.3 *************** *** 34,40 **** } } catch (Exception exception) { } } ! /** * The action to perform when the project is closed --- 34,41 ---- } } catch (Exception exception) { + // nothing } } ! /** * The action to perform when the project is closed |
From: Michael L. <he...@us...> - 2009-11-13 08:17:22
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26112/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.114 retrieving revision 1.115 diff -C2 -d -r1.114 -r1.115 *** GUI.java 12 Nov 2009 15:27:24 -0000 1.114 --- GUI.java 13 Nov 2009 08:17:10 -0000 1.115 *************** *** 165,168 **** --- 165,173 ---- } + /** + * + * @param message String + * @return result + */ public static int confirm(String message) { Component parent = getInstance(); *************** *** 174,177 **** --- 179,187 ---- return result; } + + /** + * + * @return result + */ public static int confirmSave() { String message = "Do you want to save the changes you made in project \"" *************** *** 181,184 **** --- 191,199 ---- } + /** + * + * @param message String + * @return result + */ public static File chooseFile(String message) { String path = Project.getInstance().getDefaultPath(); *************** *** 193,196 **** --- 208,216 ---- } + /** + * + * @return result + * @throws Exception Exception + */ public static boolean userSave() throws Exception { if (Project.getInstance().getSavePath() == null) { *************** *** 202,205 **** --- 222,230 ---- } + /** + * + * @return result + * @throws Exception Exception + */ public static boolean userSaveAs() throws Exception { File file = GUI.chooseFile("Save"); *************** *** 217,220 **** --- 242,250 ---- } + /** + * + * @return result + * @throws Exception Exception + */ public static boolean userClose() throws Exception { if (Project.getInstance().isDirty()) { *************** *** 812,816 **** } ! public void doNew() { --- 842,848 ---- } ! /** ! * ! */ public void doNew() { |
From: Michael L. <he...@us...> - 2009-11-12 15:27:35
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv30841/src/net/sourceforge/bprocessor/gui/actions Modified Files: FileSaveActionListener.java FileNewActionListener.java FileLoadActionListener.java FileCloseActionListener.java FileActionListener.java FileSaveAsActionListener.java Added Files: BProcessorFileFilter.java Removed Files: MyFileFilter.java Log Message: Refactoring Index: FileLoadActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileLoadActionListener.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** FileLoadActionListener.java 21 Nov 2006 17:29:34 -0000 1.7 --- FileLoadActionListener.java 12 Nov 2009 15:27:24 -0000 1.8 *************** *** 7,10 **** --- 7,11 ---- package net.sourceforge.bprocessor.gui.actions; + import net.sourceforge.bprocessor.gui.GUI; import net.sourceforge.bprocessor.model.Project; *************** *** 12,25 **** import java.io.File; - import javax.swing.JFileChooser; - - import org.apache.log4j.Logger; - /** * The file->load action listener */ public class FileLoadActionListener extends FileActionListener { - /** The logger */ - private static Logger log = Logger.getLogger(FileLoadActionListener.class); /** --- 13,20 ---- *************** *** 34,47 **** */ public void additionalAction(ActionEvent e) { ! JFileChooser loadChooser = new JFileChooser(Project.getInstance().getDefaultPath()); ! loadChooser.addChoosableFileFilter(new MyFileFilter()); ! int lstate = loadChooser.showOpenDialog(null); ! File lfile = loadChooser.getSelectedFile(); ! if (lfile != null && ! lstate == JFileChooser.APPROVE_OPTION) { try { ! Project.getInstance().load(lfile); ! } catch (Exception ex) { ! log.error("Could not open file: " + lfile, ex); } } --- 29,37 ---- */ public void additionalAction(ActionEvent e) { ! File file = GUI.chooseFile("Open"); ! if (file != null) { try { ! Project.getInstance().load(file); ! } catch (Exception exception) { } } Index: FileCloseActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileCloseActionListener.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** FileCloseActionListener.java 21 Nov 2006 17:29:34 -0000 1.7 --- FileCloseActionListener.java 12 Nov 2009 15:27:24 -0000 1.8 *************** *** 10,19 **** import java.awt.event.ActionEvent; - import net.sourceforge.bprocessor.model.Project; - /** * The FileCloseActionListener */ - public class FileCloseActionListener extends FileActionListener { /** --- 10,16 ---- *************** *** 29,33 **** */ public void additionalAction(ActionEvent e) { - Project.getInstance().close(); } } --- 26,29 ---- Index: FileNewActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileNewActionListener.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** FileNewActionListener.java 2 Jan 2007 18:30:51 -0000 1.10 --- FileNewActionListener.java 12 Nov 2009 15:27:24 -0000 1.11 *************** *** 9,15 **** import java.awt.event.ActionEvent; - - import net.sourceforge.bprocessor.model.Project; - /** * The FileNewActionListener --- 9,12 ---- *************** *** 30,36 **** */ public void additionalAction(ActionEvent e) { - Project.getInstance().close(); - Project.getInstance().changed(Project.getInstance()); - Project.getInstance().makeClean(); } } --- 27,30 ---- --- MyFileFilter.java DELETED --- Index: FileSaveAsActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileSaveAsActionListener.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FileSaveAsActionListener.java 21 Nov 2006 17:29:34 -0000 1.5 --- FileSaveAsActionListener.java 12 Nov 2009 15:27:24 -0000 1.6 *************** *** 7,10 **** --- 7,11 ---- package net.sourceforge.bprocessor.gui.actions; + import net.sourceforge.bprocessor.gui.GUI; import net.sourceforge.bprocessor.model.Project; *************** *** 35,46 **** */ public void actionPerformed(ActionEvent e) { ! JFileChooser chooser = new JFileChooser(Project.getInstance().getDefaultPath()); ! chooser.addChoosableFileFilter(new MyFileFilter()); ! int state = chooser.showSaveDialog(null); ! File file = chooser.getSelectedFile(); ! if (file != null && ! state == JFileChooser.APPROVE_OPTION) { try { - if (file.getName().lastIndexOf('.') != -1) { Project.getInstance().saveAs(file); --- 36,42 ---- */ public void actionPerformed(ActionEvent e) { ! File file = GUI.chooseFile("Save"); ! if (file != null) { try { if (file.getName().lastIndexOf('.') != -1) { Project.getInstance().saveAs(file); *************** *** 48,53 **** Project.getInstance().saveAs(new File(file.getCanonicalFile() + ".bp")); } ! } catch (Exception ex) { ! log.error("Could not save to file: " + file, ex); } } --- 44,48 ---- Project.getInstance().saveAs(new File(file.getCanonicalFile() + ".bp")); } ! } catch (Exception exception) { } } Index: FileSaveActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileSaveActionListener.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FileSaveActionListener.java 21 Mar 2006 12:24:13 -0000 1.6 --- FileSaveActionListener.java 12 Nov 2009 15:27:24 -0000 1.7 *************** *** 7,10 **** --- 7,11 ---- package net.sourceforge.bprocessor.gui.actions; + import net.sourceforge.bprocessor.gui.GUI; import net.sourceforge.bprocessor.model.Project; *************** *** 37,47 **** if (Project.getInstance().getSavePath() == null) { - JFileChooser chooser = new JFileChooser(Project.getInstance().getDefaultPath()); - chooser.addChoosableFileFilter(new MyFileFilter()); - int state = chooser.showSaveDialog(null); - File file = chooser.getSelectedFile(); ! if (file != null && ! state == JFileChooser.APPROVE_OPTION) { try { if (file.getName().lastIndexOf('.') != -1) { --- 38,45 ---- if (Project.getInstance().getSavePath() == null) { ! File file = GUI.chooseFile("Save"); ! ! if (file != null) { try { if (file.getName().lastIndexOf('.') != -1) { *************** *** 50,55 **** Project.getInstance().saveAs(new File(file.getCanonicalFile() + ".bp")); } ! } catch (Exception ex) { ! log.error("Could not save to file: " + file, ex); } } --- 48,53 ---- Project.getInstance().saveAs(new File(file.getCanonicalFile() + ".bp")); } ! } catch (Exception exception) { ! } } --- NEW FILE: BProcessorFileFilter.java --- //--------------------------------------------------------------------------------- // $Id: BProcessorFileFilter.java,v 1.1 2009/11/12 15:27:24 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.actions; import java.io.File; import javax.swing.filechooser.FileFilter; /** * */ public class BProcessorFileFilter extends FileFilter { /** * @param file the file the filter is checking * @return false, if not a ".bp" file or a directory. */ public boolean accept(File file) { if (file.isDirectory()) { return true; } String name = file.getName(); return name.endsWith(".bp"); } /** * @return the description of the filter */ public String getDescription() { return "bprocessor files"; } } Index: FileActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileActionListener.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FileActionListener.java 21 Nov 2006 17:29:34 -0000 1.1 --- FileActionListener.java 12 Nov 2009 15:27:24 -0000 1.2 *************** *** 10,21 **** import java.awt.event.ActionEvent; import java.awt.event.ActionListener; ! import java.io.File; ! ! import javax.swing.JFileChooser; ! import javax.swing.JOptionPane; ! ! import org.apache.log4j.Logger; ! ! import net.sourceforge.bprocessor.model.Project; /** --- 10,14 ---- import java.awt.event.ActionEvent; import java.awt.event.ActionListener; ! import net.sourceforge.bprocessor.gui.GUI; /** *************** *** 24,31 **** public abstract class FileActionListener implements ActionListener { - - /** The logger */ - private static Logger log = Logger.getLogger(FileActionListener.class); - /** * Constructs the FileCloseActionListner --- 17,20 ---- *************** *** 40,91 **** */ public void actionPerformed(ActionEvent event) { ! if (Project.getInstance().isDirty()) { ! int n = JOptionPane.showConfirmDialog( ! null, ! "Do you want to save the changes?", ! "Project has been changed", ! JOptionPane.YES_NO_CANCEL_OPTION); ! if (n == 0) { ! if (Project.getInstance().getSavePath() == null) { ! String path = Project.getInstance().getDefaultPath(); ! JFileChooser chooser = new JFileChooser(path); ! chooser.addChoosableFileFilter(new MyFileFilter()); ! int state = chooser.showSaveDialog(null); ! File file = chooser.getSelectedFile(); ! if (file != null && ! state == JFileChooser.APPROVE_OPTION) { ! try { ! ! if (file.getName().lastIndexOf('.') != -1) { ! Project.getInstance().saveAs(file); ! } else { ! Project.getInstance().saveAs(new File(file.getCanonicalFile() + ".bp")); ! } ! Project.getInstance().close(); ! } catch (Exception ex) { ! log.error("Could not save to file: " + file, ex); ! } ! } ! } else { ! try { ! Project.getInstance().save(); ! Project.getInstance().close(); ! } catch (Exception ex) { ! log.error("Could not save to file: " + ! new File(Project.getInstance().getSavePath()), ex); ! } ! } ! } ! ! if (n == 1) { additionalAction(event); } ! } else { ! additionalAction(event); } } /** ! * The action to perform when the file is saved or save is cancled * @param e The action event */ --- 29,42 ---- */ public void actionPerformed(ActionEvent event) { ! try { ! if (GUI.userClose()) { additionalAction(event); } ! } catch (Exception exception) { } } /** ! * The action to perform when the project is closed * @param e The action event */ |
From: Michael L. <he...@us...> - 2009-11-12 15:27:35
|
Update of /cvsroot/bprocessor/gui/src/gfx In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv30841/src/gfx Added Files: folder.png Log Message: Refactoring --- NEW FILE: folder.png --- (This appears to be a binary file; contents omitted.) |
From: Michael L. <he...@us...> - 2009-11-12 15:27:33
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv30841/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Refactoring Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.113 retrieving revision 1.114 diff -C2 -d -r1.113 -r1.114 *** GUI.java 14 Sep 2009 16:22:52 -0000 1.113 --- GUI.java 12 Nov 2009 15:27:24 -0000 1.114 *************** *** 8,11 **** --- 8,12 ---- import net.sourceforge.bprocessor.gui.actions.AboutActionListener; + import net.sourceforge.bprocessor.gui.actions.BProcessorFileFilter; import net.sourceforge.bprocessor.gui.actions.EditMenuListener; import net.sourceforge.bprocessor.gui.actions.FileCloseActionListener; *************** *** 26,30 **** import net.sourceforge.bprocessor.gui.treeview.SpaceTreeView; import net.sourceforge.bprocessor.model.Geometric; - import net.sourceforge.bprocessor.model.Persistence; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; --- 27,30 ---- *************** *** 63,66 **** --- 63,67 ---- import javax.swing.JMenu; import javax.swing.JMenuItem; + import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; *************** *** 164,167 **** --- 165,241 ---- } + public static int confirm(String message) { + Component parent = getInstance(); + int type = JOptionPane.YES_NO_CANCEL_OPTION; + System.out.println("Confirm Dialog."); + int result = JOptionPane.showConfirmDialog(parent, message, "", type); + System.out.println("Result from the dialog."); + + return result; + } + public static int confirmSave() { + String message = "Do you want to save the changes you made in project \"" + + Project.getInstance().getName() + + "\"?"; + return GUI.confirm(message); + } + + public static File chooseFile(String message) { + String path = Project.getInstance().getDefaultPath(); + JFileChooser chooser = new JFileChooser(path); + chooser.addChoosableFileFilter(new BProcessorFileFilter()); + int state = chooser.showDialog(GUI.getInstance(), message); + if (state == JFileChooser.APPROVE_OPTION) { + return chooser.getSelectedFile(); + } else { + return null; + } + } + + public static boolean userSave() throws Exception { + if (Project.getInstance().getSavePath() == null) { + return userSaveAs(); + } else { + Project.getInstance().save(); + } + return true; + } + + public static boolean userSaveAs() throws Exception { + File file = GUI.chooseFile("Save"); + + if (file != null) { + if (file.getName().lastIndexOf('.') != -1) { + Project.getInstance().saveAs(file); + } else { + Project.getInstance().saveAs(new File(file.getCanonicalFile() + ".bp")); + } + return true; + } else { + return false; + } + } + + public static boolean userClose() throws Exception { + if (Project.getInstance().isDirty()) { + int result = GUI.confirmSave(); + + if (result == JOptionPane.YES_OPTION) { + if (userSave()) { + Project.getInstance().close(); + } else { + return false; + } + } else if (result == JOptionPane.CANCEL_OPTION) { + return false; + } else { + Project.getInstance().close(); + } + } else { + Project.getInstance().close(); + } + return true; + } + /** * *************** *** 505,523 **** fileSaveAs.setEnabled(true); file.add(fileSaveAs); - - JMenuItem saveDBK = new JMenuItem("Save DBK"); - saveDBK.addActionListener(new AbstractAction() { - public void actionPerformed(ActionEvent e) { - try { - Persistence.saveDBK(Project.getConstructionClas(), - Project.getFunctionalClas(), Project.getClassificationTypes(), - new File("Classification.xml")); - } catch (Exception e1) { - log.error("Error when saving DBK : " + e1.getMessage()); - } - } - }); - saveDBK.setEnabled(true); - file.add(saveDBK); file.addSeparator(); --- 579,582 ---- *************** *** 752,755 **** --- 811,822 ---- menu.registerMenu(extraMenu); } + + + public void doNew() { + + } + + + /** |
From: Michael L. <he...@us...> - 2009-10-05 10:50:42
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9454/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Display.java Log Message: Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** Display.java 23 Sep 2009 07:50:24 -0000 1.98 --- Display.java 5 Oct 2009 10:50:24 -0000 1.99 *************** *** 677,689 **** Line yaxis = new Line(origin, j, system.isActive(), system.isEditable()); Line zaxis = new Line(origin, n, system.isActive(), system.isEditable()); ! if (system.isActive()) { ! paint(xaxis, red); ! paint(yaxis, green); ! paint(zaxis, blue); ! } else { ! paint(xaxis, darkgrey); ! paint(yaxis, darkgrey); ! paint(zaxis, darkgrey); ! } if (system.showPlane()) { gl.glDepthMask(false); --- 677,683 ---- Line yaxis = new Line(origin, j, system.isActive(), system.isEditable()); Line zaxis = new Line(origin, n, system.isActive(), system.isEditable()); ! paint(xaxis, red); ! paint(yaxis, green); ! paint(zaxis, blue); if (system.showPlane()) { gl.glDepthMask(false); Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.291 retrieving revision 1.292 diff -C2 -d -r1.291 -r1.292 *** View.java 14 Sep 2009 16:22:59 -0000 1.291 --- View.java 5 Oct 2009 10:50:24 -0000 1.292 *************** *** 950,967 **** boolean first = true; for (Space space : path) { labels.add(new SpaceBox(space)); - labels.add(new Label("/")); } ! Selection selection = Selection.primary(); ! ! if (selection.size() == 1) { ! Geometric geometric = selection.iterator().next(); ! if (geometric instanceof Space) { ! Space container = (Space) geometric; ! labels.add(new SpaceBox(container)); ! labels.add(new Label(">>")); ! } ! } { --- 950,972 ---- boolean first = true; for (Space space : path) { + if (first) { + first = false; + } else { + labels.add(new Label("/")); + } labels.add(new SpaceBox(space)); } ! ! // Selection selection = Selection.primary(); ! // ! // if (selection.size() == 1) { ! // Geometric geometric = selection.iterator().next(); ! // if (geometric instanceof Space) { ! // Space container = (Space) geometric; ! // labels.add(new SpaceBox(container)); ! // labels.add(new Label(">>")); ! // } ! // } { |
From: Michael L. <he...@us...> - 2009-10-05 10:50:39
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9443/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.246 retrieving revision 1.247 diff -C2 -d -r1.246 -r1.247 *** Space.java 23 Sep 2009 07:50:21 -0000 1.246 --- Space.java 5 Oct 2009 10:50:21 -0000 1.247 *************** *** 26,29 **** --- 26,32 ---- public class Space extends Item { + private static final boolean COPY_ON_EDIT = false; + + /** The elements (a list of spaces) */ protected HashMap<Long, Item> elements; *************** *** 1545,1584 **** */ public void edit() { ! int ns = getSurfaces().size(); ! ! if (ns == 0) { ! Collection<Surface> surfaces = new LinkedList(); ! Collection<Surface> originals = new HashSet(); ! ! Map map = new HashMap(); ! for (Surface current : envelope) { ! originals.add(current); ! originals.addAll(current.getHoles()); ! } ! for (Surface current : originals) { ! surfaces.add((Surface) current.copy(map)); ! } ! for (Surface current : originals) { ! Surface surface = (Surface) map.get(current); ! if (current.getExterior() != null) { ! Surface exterior = (Surface) map.get(current.getExterior()); ! if (exterior != null) { ! exterior.addHole(surface); } } ! } ! Collection<Edge> edges = Surface.edges(surfaces); ! Collection<Vertex> vertices = Edge.vertices(edges); ! for (Vertex current : vertices) { ! add(current); ! } ! for (Edge current : edges) { ! add(current); ! } ! for (Surface current : surfaces) { ! add(current); } } - Project.getInstance().setActiveSpace((Space) this); Selection.primary().clear(); --- 1548,1588 ---- */ public void edit() { ! if (COPY_ON_EDIT) { ! int ns = getSurfaces().size(); ! ! if (ns == 0) { ! Collection<Surface> surfaces = new LinkedList(); ! Collection<Surface> originals = new HashSet(); ! ! Map map = new HashMap(); ! for (Surface current : envelope) { ! originals.add(current); ! originals.addAll(current.getHoles()); ! } ! for (Surface current : originals) { ! surfaces.add((Surface) current.copy(map)); ! } ! for (Surface current : originals) { ! Surface surface = (Surface) map.get(current); ! if (current.getExterior() != null) { ! Surface exterior = (Surface) map.get(current.getExterior()); ! if (exterior != null) { ! exterior.addHole(surface); ! } } } ! Collection<Edge> edges = Surface.edges(surfaces); ! Collection<Vertex> vertices = Edge.vertices(edges); ! for (Vertex current : vertices) { ! add(current); ! } ! for (Edge current : edges) { ! add(current); ! } ! for (Surface current : surfaces) { ! add(current); ! } } } Project.getInstance().setActiveSpace((Space) this); Selection.primary().clear(); |
From: Michael L. <he...@us...> - 2009-09-23 08:49:57
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27073/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: Grid Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** Display.java 14 Sep 2009 16:22:59 -0000 1.97 --- Display.java 23 Sep 2009 07:50:24 -0000 1.98 *************** *** 1328,1334 **** --- 1328,1344 ---- //Collection<Edge> guides = grid.guides(grid.getWidth() / 2); Collection<Edge> guides = grid.guides(system); + Collection<Edge> stippled = new LinkedList(); for (Edge edge : guides) { + if (edge.getStrippled()) { + stippled.add(edge); + } else { + draw(edge); + } + } + gl.glEnable(GL.GL_LINE_STIPPLE); + for (Edge edge : stippled) { draw(edge); } + gl.glDisable(GL.GL_LINE_STIPPLE); } |
From: Michael L. <he...@us...> - 2009-09-23 07:50:38
|
Update of /cvsroot/bprocessor/bprocessor/components/basic In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27085/components/basic Modified Files: house.bp Log Message: Grid Index: house.bp =================================================================== RCS file: /cvsroot/bprocessor/bprocessor/components/basic/house.bp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** house.bp 28 Aug 2009 12:58:42 -0000 1.2 --- house.bp 23 Sep 2009 07:50:29 -0000 1.3 *************** *** 1,29 **** <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <bmodel> <active>1</active> ! <cs>2263</cs> <name>New Project</name> ! <space transparent="true" voidref="2" name="World" type="1" union="false" net="false" progid="0" id="1"> <description/> <Classification>unassigned</Classification> ! <constructor xsi:type="CoordinateSystemType" onlyplane="false" active="true" editable="true" progid="1" id="2263" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> ! <vertex z="0.0" y="0.0" x="0.0" id="2264"/> [...19734 lines suppressed...] + <vertex y="0.8" z="0.0" x="0.0" progid="1" id="4668"/> + <vertex y="0.8" z="-0.07" x="0.6" progid="2" id="4669"/> + <vertex y="0.035" z="0.0" x="0.565" progid="3" id="4670"/> + <vertex y="0.0" z="0.0" x="0.6" progid="4" id="4671"/> + <vertex y="0.0" z="-0.07" x="0.0" progid="5" id="4672"/> + <vertex y="0.035" z="-0.07" x="0.035" progid="6" id="4673"/> + <vertex y="0.035" z="-0.07" x="0.565" progid="7" id="4674"/> + <vertex y="0.035" z="0.0" x="0.035" progid="8" id="4675"/> + <vertex y="0.765" z="0.0" x="0.035" progid="9" id="4676"/> + <vertex y="0.765" z="-0.07" x="0.565" progid="10" id="4677"/> + <vertex y="0.765" z="-0.07" x="0.035" progid="11" id="4678"/> + <vertex y="0.8" z="-0.07" x="0.0" progid="12" id="4679"/> + <vertex y="0.8" z="0.0" x="0.6" progid="13" id="4680"/> + <vertex y="0.765" z="0.0" x="0.565" progid="14" id="4681"/> + <vertex y="0.0" z="0.0" x="0.0" progid="15" id="4682"/> + <vertex y="0.0" z="-0.07" x="0.6" progid="16" id="4683"/> + </space> + </catalogObjects> </bmodel> |
From: Michael L. <he...@us...> - 2009-09-23 07:50:38
|
Update of /cvsroot/bprocessor/bprocessor In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27085 Modified Files: b-processor-export.obj Added Files: smallhouse.mtl smallhouse.obj Log Message: Grid --- NEW FILE: smallhouse.obj --- mtllib smallhouse.mtl v 6.5286648759 0.99 -7.2464823383 v 7.05 2.07 -7.65 v 0.07 0.905 -5.3675 v 6.465025271 2.02 -7.3949747646 v 4.15 2.07 -9.8 v 7.65 0.08 -9.8 v 6.95 0.08 -5.5 v 8.4 0.07 -3.55 v 1.95 0.08 -8.55 v 8.95 2.02 -5.3 v 8.4 2.07 -8.05 v 6.3149999999999995 0.9737289259456099 -10.320682247471293 v 7.6 2.07 -9.8 v 1.156335119 1.01 -10.4479036945 v 0.0 1.6875 -5.3675 v 6.6559441011 0.99 -5.9737615543 v 5.8325 1.6875 -10.0 v 1.3825 1.6875 -0.0 [...3550 lines suppressed...] f 762 631 979 f 979 631 325 f 631 313 325 f 313 1053 174 f 325 313 174 f 1053 979 392 f 174 1053 392 f 264 979 325 f 979 1053 762 f 631 809 313 f 264 325 1173 f 392 1147 789 f 631 394 809 f 1053 809 61 f 392 789 174 f 1053 952 762 f 1053 313 809 f 325 174 789 f 1053 61 952 f 325 789 1173 Index: b-processor-export.obj =================================================================== RCS file: /cvsroot/bprocessor/bprocessor/b-processor-export.obj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** b-processor-export.obj 28 Aug 2009 12:58:43 -0000 1.1 --- b-processor-export.obj 23 Sep 2009 07:50:29 -0000 1.2 *************** *** 1,1904 **** mtllib b-processor-export.mtl ! v 2.5561879594 1.01 -8.8186648744 ! v 7.6 0.07 -10.0 ! v 9.04 0.08 -6.0 ! v 7.05 0.0 -0.2 ! v 6.95 0.07 -6.25 ! v 8.3075735931 2.02 -3.5024264069 ! v 8.95 2.07 -5.25 ! v 1.1916904618 1.92 -10.3418376786 ! v 2.4571930085 0.99 -8.8893755504 [...5462 lines suppressed...] ! f 962 103 15 ! f 15 103 445 ! f 103 1102 445 ! f 1114 902 445 ! f 1102 103 256 ! f 885 563 640 ! f 1114 445 1102 ! f 563 166 640 ! f 885 962 563 ! f 640 166 1065 ! f 563 256 166 ! f 166 926 1114 ! f 1065 1114 166 ! f 926 885 902 ! f 1114 926 902 ! f 885 1065 767 ! f 902 885 767 ! f 767 1065 987 ! f 1065 885 640 ! f 767 987 15 --- NEW FILE: smallhouse.mtl --- newmtl Functional Ka 0.2 0.2 0.2 Kd 0.9 0.9 0.9 Ks 1.0 1.0 1.0 d 1.0 Ns 0.0 illum 0 newmtl Construction Ka 0.2 0.2 0.2 Kd 0.96 0.87 0.7 Ks 1.0 1.0 1.0 d 1.0 Ns 0.0 illum 0 newmtl Void Ka 0.2 0.2 0.2 Kd 0.91071427 0.8142857 0.8035714 Ks 1.0 1.0 1.0 d 1.0 Ns 0.0 illum 0 newmtl Floor Ka 0.2 0.2 0.2 Kd 0.84705883 0.827451 0.8039216 Ks 1.0 1.0 1.0 d 1.0 Ns 0.0 illum 0 newmtl Wall Ka 0.2 0.2 0.2 Kd 0.8235294 0.60784316 0.1254902 Ks 1.0 1.0 1.0 d 1.0 Ns 0.0 illum 0 newmtl Frame Ka 0.2 0.2 0.2 Kd 0.46666667 0.101960786 0.0 Ks 1.0 1.0 1.0 d 1.0 Ns 0.0 illum 0 newmtl DoorA Ka 0.2 0.2 0.2 Kd 0.7058824 0.25490198 0.0 Ks 1.0 1.0 1.0 d 1.0 Ns 0.0 illum 0 newmtl Paint Ka 0.2 0.2 0.2 Kd 0.84705883 0.827451 0.8039216 Ks 1.0 1.0 1.0 d 1.0 Ns 0.0 illum 0 newmtl Glass Ka 0.2 0.2 0.2 Kd 0.8 0.8 0.8 Ks 1.0 1.0 1.0 d 1.0 Ns 0.0 illum 0 newmtl Metal Ka 0.2 0.2 0.2 Kd 0.8 0.8 0.8 Ks 1.0 1.0 1.0 d 1.0 Ns 0.0 illum 0 |
From: Michael L. <he...@us...> - 2009-09-23 07:50:35
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27060/src/net/sourceforge/bprocessor/model Modified Files: Grid.java Space.java Log Message: Grid Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.245 retrieving revision 1.246 diff -C2 -d -r1.245 -r1.246 *** Space.java 21 Sep 2009 11:00:46 -0000 1.245 --- Space.java 23 Sep 2009 07:50:21 -0000 1.246 *************** *** 1593,1596 **** --- 1593,1598 ---- */ public void orient(Surface leader) { + + if (leader.getFrontDomain() == this) { leader.flip(); *************** *** 1598,1601 **** --- 1600,1606 ---- List<Surface> envelope = new LinkedList(getEnvelope()); + + + Command.Inverse inv = new Command.Inverse(envelope); Set<Surface> mark = new HashSet(); Index: Grid.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Grid.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Grid.java 18 Sep 2009 10:16:21 -0000 1.11 --- Grid.java 23 Sep 2009 07:50:21 -0000 1.12 *************** *** 18,21 **** --- 18,22 ---- private double height; private double distance; + private int subdivisions; /** *************** *** 28,31 **** --- 29,33 ---- width = 12 * distance; height = 8 * distance; + subdivisions = 2; } *************** *** 90,93 **** --- 92,96 ---- attributes.add(new Attribute("Height", new Double(height))); attributes.add(new Attribute("Distance", new Double(distance))); + attributes.add(new Attribute("Subdivisions", new Integer(subdivisions))); return attributes; } *************** *** 102,148 **** } else if (current.getName().equals("Distance")) { distance = (Double)(current.getValue()); } } } - - - /** - * - * @return lines - */ - public Collection<Line> lines() { - - double size = getWidth(); - double delta = getDistance(); - CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); - Vertex origin = system.getOrigin(); - Vertex v = system.getI(); - Vertex u = system.getJ(); - int n = (int) Math.round((size / 2) / delta); - - Collection<Line> lines = new LinkedList(); - - for (int i = 0; i < n; i++) { - Vertex o = origin.add(u.scale(i * delta)); - Line line = new Line(o, v); - lines.add(line); - } - for (int i = 1; i < n; i++) { - Vertex o = origin.add(u.scale(-i * delta)); - Line line = new Line(o, v); - lines.add(line); - } - for (int i = 0; i < n; i++) { - Vertex o = origin.add(v.scale(i * delta)); - Line line = new Line(o, u); - lines.add(line); - } - for (int i = 1; i < n; i++) { - Vertex o = origin.add(v.scale(-i * delta)); - Line line = new Line(o, u); - lines.add(line); - } - return lines; - } /** --- 105,113 ---- } else if (current.getName().equals("Distance")) { distance = (Double)(current.getValue()); + } else if (current.getName().equals("Subdivisions")) { + subdivisions = (Integer)(current.getValue()); } } } /** *************** *** 151,159 **** public Collection<Edge> guides(double length) { Collection<Edge> guides = super.guides(length); - Collection<Line> lines = lines(); - for (Line line : lines) { - Edge edge = line.edge(length); - guides.add(edge); - } return guides; } --- 116,119 ---- *************** *** 181,184 **** --- 141,157 ---- Edge edge = new Edge(from, to); guides.add(edge); + if (subdivisions > 1 && (k < n)) { + { + Vertex f = from.copy(); + double e = d / subdivisions; + for (int s = 0; s < (subdivisions - 1); s++) { + f = f.add(i.scale(e)); + Vertex t = f.add(j.scale(h)); + Edge l = new Edge(f, t); + l.setStrippled(true); + guides.add(l); + } + } + } from = from.add(i.scale(d)); } *************** *** 188,191 **** --- 161,180 ---- Edge edge = new Edge(from, to); guides.add(edge); + + if (subdivisions > 1 && (k < m)) { + { + Vertex f = from.copy(); + double e = d / subdivisions; + for (int s = 0; s < (subdivisions - 1); s++) { + f = f.add(j.scale(e)); + Vertex t = f.add(i.scale(w)); + Edge l = new Edge(f, t); + l.setStrippled(true); + guides.add(l); + } + } + } + + from = from.add(j.scale(d)); } |
From: Michael L. <he...@us...> - 2009-09-22 11:17:07
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7611/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java Log Message: Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.150 retrieving revision 1.151 diff -C2 -d -r1.150 -r1.151 *** AbstractTool.java 25 Jun 2009 23:28:49 -0000 1.150 --- AbstractTool.java 22 Sep 2009 11:16:57 -0000 1.151 *************** *** 43,46 **** --- 43,47 ---- import java.io.Reader; import java.io.StringReader; + import java.text.DecimalFormat; import java.util.HashMap; import java.util.HashSet; *************** *** 245,250 **** */ public void setLength(double value) { ! int mm = (int) (value * 1000.0); ! editor.setLengthValue(Integer.toString(mm)); typing = false; } --- 246,252 ---- */ public void setLength(double value) { ! double mm = value * 1000.0; ! DecimalFormat format = new DecimalFormat("0.#"); ! editor.setLengthValue(format.format(mm)); typing = false; } |
From: Michael L. <he...@us...> - 2009-09-21 11:00:57
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv22956/src/net/sourceforge/bprocessor/model Modified Files: Instance.java Space.java Log Message: Instance Index: Instance.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Instance.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Instance.java 29 Jun 2009 08:37:37 -0000 1.11 --- Instance.java 21 Sep 2009 11:00:46 -0000 1.12 *************** *** 60,64 **** proto = space; if (anchor == null) { ! this.anchor = Project.getInstance().getActiveCoordinateSystem().copy(); } } --- 60,71 ---- proto = space; if (anchor == null) { ! Collection<CoordinateSystem> anchors = space.getCoordinateSystems(); ! if (anchors.size() > 0) { ! anchor = anchors.iterator().next().copy(); ! } else { ! CoordinateSystem system ! = (CoordinateSystem) Project.getInstance().world().getConstructor(1); ! anchor = system.copy(); ! } } } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.244 retrieving revision 1.245 diff -C2 -d -r1.244 -r1.245 *** Space.java 9 Sep 2009 10:31:00 -0000 1.244 --- Space.java 21 Sep 2009 11:00:46 -0000 1.245 *************** *** 498,501 **** --- 498,510 ---- /** + * + * @param id id + * @return constructor + */ + public Constructor getConstructor(long id) { + return constructors.get(id); + } + + /** * Set the set of connstructors in the map to the given map * @param constructors the constructors |
From: Michael L. <he...@us...> - 2009-09-18 10:16:32
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15412/src/net/sourceforge/bprocessor/gui/attrview Modified Files: ClassificationTextAttribute.java Log Message: grid Index: ClassificationTextAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/ClassificationTextAttribute.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ClassificationTextAttribute.java 25 Jun 2009 22:17:33 -0000 1.12 --- ClassificationTextAttribute.java 18 Sep 2009 10:16:18 -0000 1.13 *************** *** 284,287 **** --- 284,289 ---- if (e.getSource() instanceof MyMenuItem) { MyMenuItem source = (MyMenuItem)(e.getSource()); + System.out.println("menu selected " + source); + attribute.setValue(source.getClassification()); component.remove(0); |