bprocessor-commit Mailing List for B-processor (Page 11)
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-05-21 07:29:09
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18772/src/net/sourceforge/bprocessor/gl/view Modified Files: PopupMenu.java Log Message: Added scripts to spaces Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/PopupMenu.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** PopupMenu.java 20 May 2010 10:58:51 -0000 1.44 --- PopupMenu.java 21 May 2010 07:29:01 -0000 1.45 *************** *** 821,824 **** --- 821,826 ---- Command command = new Command.Cube(); AttributeView.instance().display(command); + Project.getInstance().getActiveSpace().add(command); + Project.getInstance().changed(); } }; *************** *** 829,833 **** --- 831,837 ---- public void actionPerformed(ActionEvent event) { Command command = new Command.Sphere(); + Project.getInstance().getActiveSpace().add(command); AttributeView.instance().display(command); + Project.getInstance().changed(); } }; *************** *** 838,842 **** --- 842,848 ---- public void actionPerformed(ActionEvent event) { Command command = new Command.Cylinder(); + Project.getInstance().getActiveSpace().add(command); AttributeView.instance().display(command); + Project.getInstance().changed(); } }; *************** *** 847,851 **** --- 853,859 ---- public void actionPerformed(ActionEvent event) { Command command = new Command.Pyramid(); + Project.getInstance().getActiveSpace().add(command); AttributeView.instance().display(command); + Project.getInstance().changed(); } }; *************** *** 856,860 **** --- 864,870 ---- public void actionPerformed(ActionEvent event) { Command command = new Command.Mark(); + Project.getInstance().getActiveSpace().add(command); AttributeView.instance().display(command); + Project.getInstance().changed(); } }; |
From: Michael L. <he...@us...> - 2010-05-21 07:29:05
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18762/src/net/sourceforge/bprocessor/model Modified Files: Space.java Command.java Log Message: Added scripts to spaces Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.253 retrieving revision 1.254 diff -C2 -d -r1.253 -r1.254 *** Space.java 20 May 2010 10:58:45 -0000 1.253 --- Space.java 21 May 2010 07:28:57 -0000 1.254 *************** *** 56,59 **** --- 56,64 ---- protected long nextConstructorId; + + /** The scripts */ + protected List<Command> scripts; + + /** * *************** *** 139,142 **** --- 144,149 ---- constructors = new HashMap<Long, Constructor>(); nextConstructorId = 1; + + scripts = new LinkedList(); } *************** *** 544,547 **** --- 551,571 ---- } + + /** + * Add a script command + * @param command the command to add as a script + */ + public void add(Command command) { + scripts.add(command); + } + + /** + * + * @return scripts of this space + */ + public List<Command> getScripts() { + return new LinkedList(scripts); + } + /** * Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** Command.java 20 May 2010 10:58:45 -0000 1.84 --- Command.java 21 May 2010 07:28:57 -0000 1.85 *************** *** 47,50 **** --- 47,55 ---- return "Modellor"; } + + /** {@inheritDoc} */ + public String getName() { + return title(); + } /** {@inheritDoc} */ |
From: Michael L. <he...@us...> - 2010-05-21 07:29:02
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18752/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java SpaceTreeView.java Log Message: Added scripts to spaces Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.149 retrieving revision 1.150 diff -C2 -d -r1.149 -r1.150 *** GenericTreeView.java 20 May 2010 10:58:39 -0000 1.149 --- GenericTreeView.java 21 May 2010 07:28:54 -0000 1.150 *************** *** 38,41 **** --- 38,42 ---- import org.apache.log4j.Logger; + import net.sourceforge.bprocessor.model.Command; import net.sourceforge.bprocessor.model.Item; import net.sourceforge.bprocessor.model.Attribute; *************** *** 728,731 **** --- 729,733 ---- CompositeNode cn = new ConstructorContainer("Constructors", space.getConstructors()); add(cn); + add(new ScriptContainer("Scripts", space.getScripts(), false)); if (Project.doDisplayGeometry()) { add(new GeometryNode("Geometry", space)); *************** *** 750,753 **** --- 752,756 ---- ((GenericNode)getChildAt(inx++)).update(space); } + ((GenericNode)getChildAt(inx++)).update(space.getScripts()); int placement = inx; *************** *** 981,984 **** --- 984,1028 ---- /** + * Script container + */ + public class ScriptContainer extends CompositeNode { + /** + * Constructor for ScriptContainer + * @param name The name + * @param scripts The scripts + * @param sort boolean + */ + public ScriptContainer(String name, Collection scripts, boolean sort) { + super(name, scripts, sort); + } + + /** {@inheritDoc} */ + public EntityNode nodeFor(Object entity) { + return new ScriptNode((Command) entity); + } + + /** + * Return icon + * @return Icon + */ + public ImageIcon icon() { + return surfacegroupicon; + } + } + + /** + * ScriptNode + */ + public class ScriptNode extends EntityNode { + /** + * Constructor for ScriptNode + * @param command The command + */ + public ScriptNode(Command command) { + super(command); + } + } + + /** * SurfaceContainer */ Index: SpaceTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/SpaceTreeView.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** SpaceTreeView.java 26 Apr 2010 09:30:33 -0000 1.35 --- SpaceTreeView.java 21 May 2010 07:28:54 -0000 1.36 *************** *** 35,38 **** --- 35,39 ---- root.add(new ProjectNode(p)); root.add(new ConstructorContainer("Constructors", p.getConstructors())); + root.add(new ScriptContainer("Scripts", p.world().getScripts(), false)); root.add(new ComponentContainer("Catalog", p.getCatalogObjects())); if (Project.SENSE) { *************** *** 54,60 **** ((GenericNode)root.getChildAt(0)).update(p); ((GenericNode)root.getChildAt(1)).update(p.getConstructors()); ! ((GenericNode)root.getChildAt(2)).update(p.getCatalogObjects()); if (Project.SENSE) { ! ((GenericNode)root.getChildAt(3)).update(p.sensor()); } } catch (ArrayIndexOutOfBoundsException e) { --- 55,62 ---- ((GenericNode)root.getChildAt(0)).update(p); ((GenericNode)root.getChildAt(1)).update(p.getConstructors()); ! ((GenericNode)root.getChildAt(2)).update(p.world().getScripts()); ! ((GenericNode)root.getChildAt(3)).update(p.getCatalogObjects()); if (Project.SENSE) { ! ((GenericNode)root.getChildAt(4)).update(p.sensor()); } } catch (ArrayIndexOutOfBoundsException e) { |
From: Michael L. <he...@us...> - 2010-05-21 06:43:03
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv12734/src/net/sourceforge/bprocessor/facade/modellor Modified Files: NetFacadeModellor.java Log Message: Index: NetFacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/NetFacadeModellor.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** NetFacadeModellor.java 5 Mar 2010 10:43:34 -0000 1.51 --- NetFacadeModellor.java 21 May 2010 06:42:54 -0000 1.52 *************** *** 41,48 **** private static final double FRAME_DEPTH = 0.05; private static final String EXTERIOR = "-1.-80"; - private static final String FRAME = "-1.-205.02.01.01"; private static final String GLASS = "-1.-205.02.01.02"; ! private static final long serialVersionUID = 1L; private Space space; private Space frame; --- 41,48 ---- private static final double FRAME_DEPTH = 0.05; private static final String EXTERIOR = "-1.-80"; private static final String FRAME = "-1.-205.02.01.01"; private static final String GLASS = "-1.-205.02.01.02"; ! ! private Space space; private Space frame; *************** *** 64,75 **** * {@inheritDoc} */ ! public void getSubContent(Map<String, Object> m) { ! m.put("space", space); ! m.put("net", net); ! m.put("depth", new Double(depth)); ! m.put("frameWidth", new Double(frameWidth)); ! m.put("front", front); ! m.put("single", Boolean.valueOf(single)); ! m.put("frame", frame); } --- 64,77 ---- * {@inheritDoc} */ ! public Map<String, Object> getContent() { ! Map<String, Object> content = super.getContent(); ! content.put("space", space); ! content.put("net", net); ! content.put("depth", new Double(depth)); ! content.put("frameWidth", new Double(frameWidth)); ! content.put("front", front); ! content.put("single", Boolean.valueOf(single)); ! content.put("frame", frame); ! return content; } *************** *** 77,88 **** * {@inheritDoc} */ ! public void setSubContent(Map<String, Object> m) { ! space = (Space)m.get("space"); ! net = (Space)m.get("net"); ! depth = ((Double)m.get("depth")).doubleValue(); ! frameWidth = ((Double)m.get("frameWidth")).doubleValue(); ! front = (Surface)m.get("front"); ! single = ((Boolean)m.get("single")).booleanValue(); ! frame = (Space)m.get("frame"); Project.getInstance().addObserver(this); } --- 79,91 ---- * {@inheritDoc} */ ! public void setContent(Map<String, Object> map) { ! super.setContent(map); ! space = (Space)map.get("space"); ! net = (Space)map.get("net"); ! depth = ((Double)map.get("depth")).doubleValue(); ! frameWidth = ((Double)map.get("frameWidth")).doubleValue(); ! front = (Surface)map.get("front"); ! single = ((Boolean)map.get("single")).booleanValue(); ! frame = (Space)map.get("frame"); Project.getInstance().addObserver(this); } |
From: Michael L. <he...@us...> - 2010-05-21 06:42:59
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv12713/src/net/sourceforge/bprocessor/model/modellor Modified Files: Modellor.java Log Message: Index: Modellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/Modellor.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Modellor.java 25 Jun 2009 22:17:30 -0000 1.17 --- Modellor.java 21 May 2010 06:42:51 -0000 1.18 *************** *** 171,175 **** public void setContent(Map<String, Object> map) { active = ((Boolean)map.get("active")).booleanValue(); - setSubContent(map); } --- 171,174 ---- *************** *** 181,199 **** Map<String, Object> content = new HashMap<String, Object>(); content.put("active", Boolean.valueOf(active)); - this.getSubContent(content); return content; } - - /** - * Abstract method for getting the implementing modellors content - * @param map the map to put the content in - */ - public abstract void getSubContent(Map<String, Object> map); - - /** - * Abstact method for setting the content in extending classes - * @param map The map containing the object setting - */ - public abstract void setSubContent(Map<String, Object> map); /** --- 180,185 ---- |
From: Michael L. <he...@us...> - 2010-05-20 14:20:14
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv26281/src/net/sourceforge/bprocessor/model Modified Files: Persistence.java Log Message: Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** Persistence.java 18 May 2010 13:38:07 -0000 1.89 --- Persistence.java 20 May 2010 14:20:04 -0000 1.90 *************** *** 830,835 **** object.setModellor(m); } ! if (!xml.getAttributes().isEmpty()) { ! object.setParameters(internalizeParameterBlock(xml.getAttributes(), map)); } } --- 830,835 ---- object.setModellor(m); } ! if (!xml.getAttribute().isEmpty()) { ! object.setParameters(internalizeParameterBlock(xml.getAttribute(), map)); } } *************** *** 843,848 **** private static void internalizeReferences(Instance object, SpaceType xml, Map map) { object.setProto((Space) get(xml.getProtoref(), map)); ! if (!xml.getAttributes().isEmpty()) { ! object.setParameters(internalizeParameterBlock(xml.getAttributes(), map)); } } --- 843,848 ---- private static void internalizeReferences(Instance object, SpaceType xml, Map map) { object.setProto((Space) get(xml.getProtoref(), map)); ! if (!xml.getAttribute().isEmpty()) { ! object.setParameters(internalizeParameterBlock(xml.getAttribute(), map)); } } *************** *** 1506,1510 **** xml.getBoundary().addAll(ids(map, sorted(object.getEnvelope()))); if (object.getParameters() != null) { ! xml.getAttributes().addAll(externalizeParameterBlock(object.getParameters(), map)); } } --- 1506,1510 ---- xml.getBoundary().addAll(ids(map, sorted(object.getEnvelope()))); if (object.getParameters() != null) { ! xml.getAttribute().addAll(externalizeParameterBlock(object.getParameters(), map)); } } *************** *** 1524,1528 **** } if (object.getParameters() != null) { ! xml.getAttributes().addAll(externalizeParameterBlock(object.getParameters(), map)); } } --- 1524,1528 ---- } if (object.getParameters() != null) { ! xml.getAttribute().addAll(externalizeParameterBlock(object.getParameters(), map)); } } |
From: Michael L. <he...@us...> - 2010-05-20 12:02:15
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9273/src/net/sourceforge/bprocessor/gl/tool Modified Files: ToolFactory.java RotationTool.java Removed Files: RotationToolB.java Log Message: Removed original RotationTool Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** ToolFactory.java 13 Jan 2010 10:58:30 -0000 1.107 --- ToolFactory.java 20 May 2010 12:02:06 -0000 1.108 *************** *** 75,79 **** private AbstractTool protractor; private FinalMoveTool moving; ! private RotationToolB rotation; private OffsetTool offset; private ExtrusionTool extrude; --- 75,79 ---- private AbstractTool protractor; private FinalMoveTool moving; ! private RotationTool rotation; private OffsetTool offset; private ExtrusionTool extrude; *************** *** 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); --- 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); --- RotationToolB.java DELETED --- Index: RotationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RotationTool.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** RotationTool.java 5 Feb 2010 13:32:59 -0000 1.37 --- RotationTool.java 20 May 2010 12:02:06 -0000 1.38 *************** *** 5,265 **** // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- - package net.sourceforge.bprocessor.gl.tool; - - import net.sourceforge.bprocessor.gl.Editor; - import net.sourceforge.bprocessor.gl.model.GlObject; - import net.sourceforge.bprocessor.gl.model.Intersection; - import net.sourceforge.bprocessor.gui.GUI; ! import net.sourceforge.bprocessor.model.Camera; ! import net.sourceforge.bprocessor.model.Edge; ! import net.sourceforge.bprocessor.model.Geometry; ! import net.sourceforge.bprocessor.model.Line; ! import net.sourceforge.bprocessor.model.Plane; ! import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Surface; ! import net.sourceforge.bprocessor.model.Vertex; import java.awt.Cursor; import java.awt.event.MouseEvent; ! ! import java.text.MessageFormat; ! import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; - import java.util.Set; ! import javax.media.opengl.GL; ! import javax.media.opengl.glu.GLU; ! import org.apache.log4j.Logger; /** ! * The rotation tool */ public class RotationTool extends AbstractPencil { ! /** The logger */ ! private static Logger log = Logger.getLogger(RotationTool.class); ! ! /** The vertexes to rotate */ ! private Set<Vertex> vertices = new HashSet(); ! /** The first pressed point */ ! private Vertex p1; ! /** The secondly pressed point*/ ! private Vertex p2; ! /** The starting rotation point*/ ! private Vertex from; ! /** 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 */ ! private GlProtractor pro; ! /** The total rotation angle */ ! private double totalAngle; ! /** The set of object not to hit */ ! private Set nothits = new HashSet(); ! /** ! * The Constructor ! * @param editor The 3D canvas ! * @param cursor The cursor */ public RotationTool(Editor editor, Cursor cursor) { super(editor, cursor); } - - /** - * Invoked when a mouse button has been pressed on a component. - * @param e The MouseEvent object - */ - protected void pressed(MouseEvent e) { - process(e); - } - /** ! * @param e MouseEvent */ ! protected void moved(MouseEvent e) { ! current = findIntersection(e); ! if (current != null) { ! if (previous != null) { ! //find the angle to rotate ! Vertex to = onto.projection(current.vertex()); ! double angle = (previous.minus(p1).angle(to.minus(p1))); ! if ((previous.minus(p1).cross(to.minus(p1))).angle(p2.minus(p1)) > 0) { ! angle *= -1; ! } ! if (!(new Double(angle).isNaN())) { ! totalAngle = (totalAngle + angle) % (2 * Math.PI); ! rotate(angle); ! } ! previous = to; ! } } - updateFeedback(); } ! /** ! * Invoked when a mouse button has been released on a component. ! * @param e The MouseEvent ! */ ! protected void released(MouseEvent e) { ! } ! /** ! * Update the length field ! */ ! protected void updateLength() { ! double angle = 0; ! if (p1 != null && p2 != null && from != null && current != null) { ! angle = Math.toDegrees(totalAngle); ! editor.setLengthValue(MessageFormat.format("{0,number,###.##}", ! new Object[]{new Double(Math.round(angle * 100.0) / 100.0)})); } } ! /** ! * On Vertex ! */ ! public void onVertex() { ! process(null); } /** ! * Process click ! * @param e MouseEvent */ ! private void process(MouseEvent e) { ! if (Selection.primary().isEmpty()) { ! GUI.getInstance().alert("There is no selection to rotate"); } else { ! vertices = Selection.primary().collect(); ! if (p1 == null) { ! if (current.type() == Intersection.EDGE) { ! p1 = current.vertex(); ! p2 = p1.add(((Edge)current.object()).getDirection()); ! initDisk(); ! active = false; ! } else if (current.type() == Intersection.SURFACE) { ! p1 = current.vertex(); ! p2 = p1.add(((Surface)(current.object())).normal()); ! initDisk(); ! active = false; ! } else { ! p1 = current.vertex(); ! start = current; ! totalAngle = 0; ! active = true; ! setTip(secondClickTip()); } - } else if (p2 == null) { - p2 = current.vertex(); - start = null; - initDisk(); - active = false; - } else if (from == null) { - current = findIntersection(e); - from = onto.projection(current.vertex()); - previous = from; - pro.setStart(from); - nothits = getAffected(vertices); - setTip(fourthClickTip()); - } else { - finish(); } - updateFeedback(); } } - /** ! * Initialize the gldisk */ ! private void initDisk() { ! Vertex v = p2.minus(p1); ! v.normalize(); ! onto = new Plane(v.getX(), v.getY(), v.getZ(), p1); ! log.info("Disk were: " + onto); ! pro = new GlProtractor(onto, p1); ! editor.getView().addGlObjects3D(pro); ! setTip(thirdClickTip()); } ! /** ! * Finish off the tool ! */ ! private void finish() { ! Project.getInstance().checkpoint(); ! Project.getInstance().changed(vertices); ! active = false; ! clear(); } ! ! /** ! * Escape ! */ ! public void escape() { ! if (totalAngle != 0) { ! rotate(-totalAngle); } - cleanUp(); } /** ! * Apply current tool with specified length value ! * @param length The lengthfield value */ ! public void apply(double length) { ! int sign = 1; ! if (totalAngle < 0) { ! sign = -1; } - rotate(sign * (Math.toRadians(length * 1000) - Math.abs(totalAngle))); - finish(); } ! /** ! * Update the feedback */ ! private void updateFeedback() { ! List<Vertex> points = new LinkedList<Vertex>(); ! List edges = new LinkedList(); ! if (p1 != null) { ! points.add(p1); ! if (p2 != null) { ! Line l = new Line(p1, p2.minus(p1)); ! l.setActive(true); ! edges.add(l); ! edges.add(onto); ! if (from != null) { ! edges.addAll(Selection.primary()); } - } else { - Line l = new Line(p1, current.vertex().minus(p1)); - l.setActive(true); - edges.add(l); } } ! List temp = new LinkedList(); ! temp.addAll(nothits); ! temp.addAll(edges); ! temp.addAll(points); ! excluded(temp); ! points(points); feedback(edges); makeTarget(current); updateConstructors(); } ! /** ! * Remove tool specific things at tool change */ ! public void cleanUp() { ! super.cleanUp(); ! clear(); ! updateFeedback(); } --- 5,365 ---- // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- ! package net.sourceforge.bprocessor.gl.tool; import java.awt.Cursor; + import java.awt.Insets; + import java.awt.event.ActionEvent; import java.awt.event.MouseEvent; ! import java.net.URL; ! import java.util.Collection; ! import java.util.Collections; import java.util.Iterator; import java.util.LinkedList; import java.util.List; ! import javax.swing.AbstractAction; ! import javax.swing.Action; ! import javax.swing.ButtonGroup; ! import javax.swing.ImageIcon; ! import javax.swing.JComponent; ! import javax.swing.JToggleButton; ! 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.Plane; ! import net.sourceforge.bprocessor.model.Project; ! import net.sourceforge.bprocessor.model.Selection; ! import net.sourceforge.bprocessor.model.Vertex; /** ! * */ public class RotationTool extends AbstractPencil { ! private List<Vertex> vertices; ! private List<Vertex> originals; ! ! private Collection<Geometric> affected; ! ! private CoordinateSystem system; ! private Protract protract; ! private Vertex base; ! private int mode; ! ! /** */ ! public static final int ONE = 1; ! ! /** */ ! public static final int TWO = 2; ! ! /** */ ! public static final int THREE = 3; ! ! /** ! * ! * @param editor Editor ! * @param cursor Cursor */ public RotationTool(Editor editor, Cursor cursor) { super(editor, cursor); + showConstructors = false; + mode = ONE; } /** ! * */ ! 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 rotateIt(Vertex center, Vertex axis, double angle, Vertex vertex) { ! Geometry.rotate(angle, axis.getX(), axis.getY(), axis.getZ(), vertex, center); } ! private Vertex rotate(Vertex axis, double angle, Vertex vector) { ! Vertex u = vector.copy(); ! Vertex zero = new Vertex(0, 0, 0); ! rotateIt(zero, axis, angle, u); ! return u; ! } ! ! private void rotateIt(Vertex center, Vertex axis, double angle, Collection<Vertex> vertices) { ! for (Vertex current : vertices) { ! rotateIt(center, axis, angle, current); ! } ! for (Vertex current : vertices) { ! current.update(); } } ! private void finish() { ! base = null; ! Project.getInstance().checkpoint(); ! Project.getInstance().changed(vertices); ! cache(); ! excluded(Collections.EMPTY_LIST); } /** ! * {@inheritDoc} */ ! protected void moved(MouseEvent e) { ! if (vertices == null) { ! findTarget(e); } else { ! if (affected != null && base != null) { ! excluded(affected); ! } ! current = findIntersection(e); ! if (current != null) { ! if (system != null) { ! if (base != null) { ! process(); ! } } } } + updateFeedback(); } /** ! * {@inheritDoc} */ ! protected void pressed(MouseEvent e) { ! if (vertices == null) { ! if (target != null) { ! activate((Geometric) target); ! } ! } else { ! if (affected != null && base != null) { ! excluded(affected); ! } ! current = findIntersection(e); ! if (current != null) { ! if (system != null) { ! if (base == null) { ! base = current.vertex().copy(); ! } else { ! process(); ! 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 void process() { + Vertex center = system.getOrigin(); + Vertex up = system.getN(); + Vertex from = base; + Vertex to = current.vertex(); + + Vertex u = from.minus(center); + u.normalize(); + Vertex v = to.minus(center); + v.normalize(); + + double alpha = angle(up, u, v); + + if (mode == ONE) { + if (!Double.isNaN(alpha)) { + reset(); + rotateIt(center, up, alpha, vertices); + } + } else if (mode == TWO) { + u = rotate(up, alpha, u); + Vertex axis = up.cross(u); + double beta = angle(axis, u, v); ! if (!Double.isNaN(alpha) && !Double.isNaN(beta)) { ! reset(); ! rotateIt(center, up, alpha, vertices); ! rotateIt(center, axis, beta, vertices); ! } ! } } ! ! private Vertex direction(Vertex original) { ! Plane plane = system.plane(); ! Vertex vertex = plane.projection(original); ! Vertex u = vertex.minus(system.getOrigin()); ! u.normalize(); ! return u; ! } ! ! private Vertex base() { ! if (base != null) { ! return direction(base); ! ! } else { ! return system.getI(); } } + + + private Vertex project(Vertex normal, Vertex vector) { + Vertex n = normal.copy(); + double t = vector.dot(normal); + n.scaleIt(t / n.length()); + vector = vector.minus(n); + return vector; + } + + private double angle(Vertex normal, Vertex v1, Vertex v2) { + Vertex i = project(normal, v1); + Vertex u = project(normal, v2); + if (i.cross(u).isZero()) { + return 0; + } else { + + double angle = i.angle(u); + double box = i.cross(u).dot(normal); + if (box < 0) { + angle = -angle; + } + return angle; + } + } + + private Vertex vector(Vertex point) { + Vertex v = point.minus(system.getOrigin()); + if (!v.isZero()) { + v.normalize(); + } + return v; + } + + + private Vertex axis() { + Vertex up = system.getN(); + Vertex forward; + if (base == null) { + forward = system.getI(); + } else { + forward = vector(base); + } + Vertex axis = up.cross(forward); + return axis; + } + + private double angle(Vertex axis) { + Vertex v1; + if (base == null) { + v1 = system.getI(); + } else { + v1 = vector(base); + } + return angle(axis, v1, vector(current.vertex())); + } + /** ! * {@inheritDoc} */ ! protected void updateLength() { ! if (system != null) { ! double angle = angle(system.getN()) * 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 (vertices != null) { ! if (current != null) { ! if (system != null) { ! showConstructors = false; ! Vertex center = system.getOrigin(); ! Vertex i = base(); ! Vertex j = system.getN().cross(i); ! protract = new Protract(center, i, j, true); ! editor.getView().addGlObjects3D(protract); ! ! ! if (base != null) { ! Edge e1 = new Edge(center, base); ! e1.setStrippled(true); ! edges.add(e1); ! Edge e2 = new Edge(center, current.vertex()); ! e2.setStrippled(true); ! edges.add(e2); ! } ! } 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); ! } } } + } else { + editor.getView().makeTarget(target); } ! feedback(edges); makeTarget(current); updateConstructors(); } ! /** ! * {@inheritDoc} */ ! public void apply(double value) { ! if (protract != null) { ! double angle = (value * 1000) * Math.PI / 180; ! rotateIt(system.getOrigin(), system.getN(), angle, vertices); ! finish(); ! } } *************** *** 269,479 **** public void prepare() { setLabel("Angle:"); } ! ! /** ! * Remove all internal stuff ! */ ! private void clear() { ! vertices.clear(); ! totalAngle = 0; ! p1 = null; ! p2 = null; ! start = null; ! current = null; ! incident = null; ! from = null; ! onto = null; ! editor.getView().removeGlObjects3D(pro); ! pro = null; ! previous = null; ! nothits.clear(); ! } ! /** ! * Do the rotation of the vertices ! * @param angle the angle to rotate in degrees */ ! 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(); } } ! /** ! * A GlObject that draw a protactor on the gl */ ! class GlProtractor implements GlObject { ! /** The location for the protractor */ ! private Plane plane; ! /** The center of the protractor */ ! private Vertex origin; ! /** The vertex the rotation starts from */ ! private Vertex start; ! /** The preset angles to intersect with */ ! private LinkedList < Line > edges; ! /** The magnification factor */ ! private double factor; ! ! /** ! * The construtor for the protractor ! * @param p The location for the protractor ! * @param origin The center for the protractor ! */ ! public GlProtractor(Plane p, Vertex origin) { ! plane = p; ! this.origin = origin; ! edges = new LinkedList < Line > (); ! } ! ! /** ! * Setter for the start vertex ! * @param start the first vertex in the rotation ! */ ! public void setStart(Vertex start) { ! this.start = start; ! double i = 0; ! double increment = Math.PI / 12; ! while (i < Math.PI) { ! Vertex to = start.copy(); ! Vertex n = plane.normal(); ! Geometry.rotate(i, n.getX(), n.getY(), n.getZ(), to, origin); ! Edge e = new Edge(origin, to); ! edges.add(new Line(origin, e.getDirection())); ! i += increment; ! } ! } ! ! /** ! * @inheritDoc ! */ ! public void draw(GL gl) { ! double angle = Math.toDegrees(totalAngle); ! Camera cam = Project.getInstance().getCurrentCamera(); ! Vertex camorig = new Vertex(cam.getCamera()); ! double dist = camorig.distance(plane.origin()); ! factor = dist / 20; ! GLU glu = new GLU(); ! // translate ! Vertex z = plane.normal(); ! Vertex y = new Vertex(0, 1, 0); ! if (y.cross(z).length() < 0.00001) { ! y = new Vertex(1, 0, 0); ! } ! ! // place the axis right ! if (start != null) { ! y = start.minus(origin); ! y.normalize(); ! } ! Vertex x = y.cross(z); ! x.normalize(); ! y = z.cross(x); ! double[] m = new double[]{x.getX(), x.getY(), x.getZ(), 0, ! y.getX(), y.getY(), y.getZ(), 0, ! z.getX(), z.getY(), z.getZ(), 0, ! origin.getX(), origin.getY(), origin.getZ(), 1}; ! gl.glPushMatrix(); ! gl.glMultMatrixd(m, 0); ! //draw ! ! gl.glColor4fv(new float[] {0.5f, 0.5f, 0.5f, 0.6f}, 0); ! int sign = 1; ! if (angle < 0) { ! sign = -1; ! } ! glu.gluPartialDisk( ! glu.gluNewQuadric(), 0, 2 * factor, 360, 1, 0, sign * (360 - Math.abs(angle))); ! gl.glColor4fv(new float[] {0.0f, 0.0f, 1.0f, 1.0f}, 0); ! glu.gluPartialDisk(glu.gluNewQuadric(), 0, 2.2 * factor, 360, 1, 0, -angle); ! //restore matrix ! gl.glPopMatrix(); ! } ! ! /** {@inheritDoc} */ ! public void select(GL gl) { ! draw(gl); ! } ! ! /** {@inheritDoc} */ ! public List<Vertex> handles() { ! return new LinkedList(); ! } ! ! /** ! * @inheritDoc ! */ ! public Intersection intersection(Edge e) { ! Vertex i = plane.intersection(e); ! Iterator<Line> iter = edges.iterator(); ! double p1 = -2.5 * factor; ! double p2 = 2.5 * factor; ! while (iter.hasNext()) { ! Line l = iter.next(); ! Edge tmp = new Edge(l.getPointAt(p1), l.getPointAt(p2)); ! Edge con = e.shortestEdge(tmp); ! if (con.getLength() < 0.1) { ! if (tmp.coincides(con.getFrom())) { ! i = con.getFrom(); ! } else if (tmp.coincides(con.getTo())) { ! i = con.getTo(); ! } ! } ! } ! return new Intersection(i, Intersection.PLANE_INTERSECTION, plane); ! } ! ! /** ! * @inheritDoc ! */ ! public Plane getPlane() { ! return plane; ! } ! ! /** ! * @inheritDoc ! */ ! public boolean contains(Vertex v) { ! return getPlane().contains(v); ! } } /** ! * Tip on how to set the first click ! * @return short describtion of what to do */ public String initialTip() { ! return "Use select tool to select object(s) to rotate," + ! " then pick a center point for the rotation"; } /** ! * Tip on how to set the second click ! * @return short describtion of what to do */ ! private String secondClickTip() { ! return "Set an axis to rotate around." + ! " Press Escape to cancel rotation."; } ! /** ! * Tip on how to set the third click ! * @return short describtion of what to do ! */ ! private String thirdClickTip() { ! return "Pick a start point of a rotation on the grey disc." + ! " Press Escape to cancel rotation."; } /** ! * Tip on how to set the fourth click ! * @return short describtion of what to do */ ! private String fourthClickTip() { ! return "Pick an end point of a rotation on the grey disc." + ! " Use \"length\" to type a specific number of degrees to rotate" + ! " Press Escape to cancel rotation."; } } --- 369,471 ---- public void prepare() { setLabel("Angle:"); + System.out.println("rotation-prepare " + System.currentTimeMillis()); + if (!Selection.primary().isEmpty()) { + activate(Selection.primary()); + } } ! ! /** ! * ! * @param geometric Geometric */ ! public void activate(Geometric geometric) { ! Collection<Geometric> geometrics = new LinkedList(); ! activate(geometrics); ! system = CoordinateSystem.systemFor(geometric); ! if (system != null) { ! system = system.copy(); } } ! /** ! * ! * @param geometrics Geometrics */ ! public void activate(Collection<Geometric> geometrics) { ! vertices = new LinkedList(Geometric.collect(geometrics)); ! cache(); ! affected = getAffected(geometrics); } /** ! * {@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; ! vertices = null; ! affected = null; } ! class OptionAction extends AbstractAction { ! private int mode; ! ! /** ! * Constructs option action ! * @param iconname String ! */ ! public OptionAction(String iconname, int mode) { ! ClassLoader cl = Thread.currentThread().getContextClassLoader(); ! URL url = cl.getResource(iconname); ! ImageIcon im = new ImageIcon(url); ! putValue(Action.SMALL_ICON, im); ! this.mode = mode; ! }; ! ! /** {@inheritDoc} */ ! public void actionPerformed(ActionEvent event) { ! RotationTool.this.mode = mode; ! System.out.println("mode is " + mode); ! } } + /** ! * {@inheritDoc} */ ! public List<JComponent> controls() { ! List<JComponent> controls = super.controls(); ! ButtonGroup group = new ButtonGroup(); ! ! { ! JToggleButton button = new JToggleButton(new OptionAction("oneicon.gif", ONE)); ! button.setMargin(new Insets(1, 1, 1, 1)); ! button.setMaximumSize(button.getMinimumSize()); ! button.setSelected(Editor.isMulti()); ! controls.add(button); ! group.add(button); ! } ! { ! JToggleButton button = new JToggleButton(new OptionAction("twoicon.gif", TWO)); ! button.setMargin(new Insets(1, 1, 1, 1)); ! button.setMaximumSize(button.getMinimumSize()); ! button.setSelected(Editor.isMulti()); ! controls.add(button); ! group.add(button); ! } ! return controls; } } |
From: Michael L. <he...@us...> - 2010-05-20 12:02:12
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9234/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: Removed original RotationTool Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.193 retrieving revision 1.194 diff -C2 -d -r1.193 -r1.194 *** Project.java 20 May 2010 10:58:46 -0000 1.193 --- Project.java 20 May 2010 12:02:03 -0000 1.194 *************** *** 81,86 **** private static Project instance; - private Set<Class> bunch; - /** */ public static final boolean SENSE = false; --- 81,84 ---- *************** *** 495,499 **** observers = new LinkedList(); - bunch = new HashSet(); scheduledObservers = new LinkedList(); --- 493,496 ---- |
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv32587/src/net/sourceforge/bprocessor/gl/tool Modified Files: PasteActionListener.java Pencil.java ArcTool.java EraserTool.java OffsetTool.java TapeMeasure.java CameraWalkTool.java RectTool.java ShiftActionListener.java RelationTool.java CreateSpaceActionListener.java CameraFlyTool.java AbstractTool.java ExtrusionTool.java ClipplaneTool.java ConstructorTool.java DomainPopupListener.java ExtendTool.java Log Message: Changed a lot of calls to changed() Index: CreateSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CreateSpaceActionListener.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** CreateSpaceActionListener.java 25 Jun 2009 22:17:40 -0000 1.25 --- CreateSpaceActionListener.java 20 May 2010 10:58:51 -0000 1.26 *************** *** 59,65 **** surface.assignBack(space, Editor.isMulti()); } - surface.changed(); AttributeView.instance().display(space); ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); } --- 59,64 ---- surface.assignBack(space, Editor.isMulti()); } AttributeView.instance().display(space); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } Index: RelationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RelationTool.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RelationTool.java 18 Nov 2007 21:30:17 -0000 1.7 --- RelationTool.java 20 May 2010 10:58:51 -0000 1.8 *************** *** 117,121 **** CoordinateSystem.relate(geometrics); } ! Project.getInstance().changed(source); Project.getInstance().checkpoint(); cleanUp(); --- 117,121 ---- CoordinateSystem.relate(geometrics); } ! Project.getInstance().changed(); Project.getInstance().checkpoint(); cleanUp(); Index: PasteActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PasteActionListener.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PasteActionListener.java 25 Jun 2009 22:17:39 -0000 1.6 --- PasteActionListener.java 20 May 2010 10:58:51 -0000 1.7 *************** *** 10,13 **** --- 10,14 ---- import java.awt.event.ActionListener; import net.sourceforge.bprocessor.gl.view.View; + import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; *************** *** 56,68 **** surface.setFrontDomain(nonFacing); } - surface.changed(); if (facing != null) { facing.addSurface(surface); - facing.changed(); } if (nonFacing != null) { nonFacing.addSurface(surface); ! nonFacing.changed(); ! } } } --- 57,67 ---- surface.setFrontDomain(nonFacing); } if (facing != null) { facing.addSurface(surface); } if (nonFacing != null) { nonFacing.addSurface(surface); ! } ! Project.getInstance().changed(); } } Index: OffsetTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OffsetTool.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** OffsetTool.java 22 Dec 2009 13:51:51 -0000 1.28 --- OffsetTool.java 20 May 2010 10:58:51 -0000 1.29 *************** *** 291,295 **** private void endOffset() { Geometry.insertEdges(contour); ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); cleanUp(); --- 291,295 ---- private void endOffset() { Geometry.insertEdges(contour); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); cleanUp(); Index: ClipplaneTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ClipplaneTool.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ClipplaneTool.java 11 Dec 2007 14:49:11 -0000 1.16 --- ClipplaneTool.java 20 May 2010 10:58:51 -0000 1.17 *************** *** 67,71 **** editor.getView().getMaxClipPlanes()) { Project.getInstance().getCurrentCamera().addClipplane(cp); ! Project.getInstance().changed(Project.getInstance().getCurrentCamera()); } --- 67,71 ---- editor.getView().getMaxClipPlanes()) { Project.getInstance().getCurrentCamera().addClipplane(cp); ! Project.getInstance().changed(); } Index: ConstructorTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ConstructorTool.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ConstructorTool.java 22 Dec 2009 13:51:51 -0000 1.20 --- ConstructorTool.java 20 May 2010 10:58:51 -0000 1.21 *************** *** 50,54 **** Project.getInstance().getActiveSpace().add(point); Project.getInstance().checkpoint(); ! Project.getInstance().changed(Project.getInstance()); } --- 50,54 ---- Project.getInstance().getActiveSpace().add(point); Project.getInstance().checkpoint(); ! Project.getInstance().changed(); } *************** *** 62,66 **** Project.getInstance().getActiveSpace().add(line); Project.getInstance().checkpoint(); ! Project.getInstance().changed(Project.getInstance()); } --- 62,66 ---- Project.getInstance().getActiveSpace().add(line); Project.getInstance().checkpoint(); ! Project.getInstance().changed(); } *************** *** 79,83 **** Project.getInstance().getActiveSpace().add(cs); Project.getInstance().checkpoint(); ! Project.getInstance().changed(Project.getInstance()); } --- 79,83 ---- Project.getInstance().getActiveSpace().add(cs); Project.getInstance().checkpoint(); ! Project.getInstance().changed(); } Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** ExtrusionTool.java 5 Feb 2010 13:32:59 -0000 1.78 --- ExtrusionTool.java 20 May 2010 10:58:51 -0000 1.79 *************** *** 92,96 **** Mesh mesh = new Mesh(extrusion, edges, vertices); space.insert(mesh); ! space.changed(); } --- 92,96 ---- Mesh mesh = new Mesh(extrusion, edges, vertices); space.insert(mesh); ! Project.getInstance().changed(); } Index: TapeMeasure.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/TapeMeasure.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** TapeMeasure.java 22 Dec 2009 14:33:34 -0000 1.13 --- TapeMeasure.java 20 May 2010 10:58:51 -0000 1.14 *************** *** 108,112 **** private void insert(Line line) { Geometry.insertConstructor(line); ! Project.getInstance().changed(line); Project.getInstance().checkpoint(); } --- 108,112 ---- private void insert(Line line) { Geometry.insertConstructor(line); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.153 retrieving revision 1.154 diff -C2 -d -r1.153 -r1.154 *** AbstractTool.java 22 Dec 2009 13:51:51 -0000 1.153 --- AbstractTool.java 20 May 2010 10:58:51 -0000 1.154 *************** *** 628,632 **** Selection.primary().clear(); editor.getView().makeTarget(null); ! Project.getInstance().changed(Project.getInstance().getActiveSpace()); Project.getInstance().checkpoint(); } --- 628,632 ---- Selection.primary().clear(); editor.getView().makeTarget(null); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } *************** *** 650,654 **** Project p = Project.getInstance(); p.setActiveSpace(p.world()); ! p.changed(p); editor.repaint(); } --- 650,654 ---- Project p = Project.getInstance(); p.setActiveSpace(p.world()); ! p.changed(); editor.repaint(); } *************** *** 916,920 **** Project.getInstance().getGlobals().define(globals); ! Project.getInstance().changed(Project.getInstance().getGlobals()); return stack; --- 916,920 ---- Project.getInstance().getGlobals().define(globals); ! Project.getInstance().changed(); return stack; Index: ArcTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ArcTool.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** ArcTool.java 22 Dec 2009 13:51:51 -0000 1.26 --- ArcTool.java 20 May 2010 10:58:51 -0000 1.27 *************** *** 191,195 **** public void onVertex() { Geometry.insertEdges(createArc(first.vertex(), current.vertex(), end.vertex(), false)); ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); first = null; --- 191,195 ---- public void onVertex() { Geometry.insertEdges(createArc(first.vertex(), current.vertex(), end.vertex(), false)); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); first = null; Index: CameraWalkTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CameraWalkTool.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CameraWalkTool.java 11 Dec 2007 14:49:11 -0000 1.12 --- CameraWalkTool.java 20 May 2010 10:58:51 -0000 1.13 *************** *** 54,58 **** Camera.rotateHorizontallyEye(c, -angleX); Camera.rotateVerticallyEye(c, angleY); ! Project.getInstance().changed(c); } } --- 54,58 ---- Camera.rotateHorizontallyEye(c, -angleX); Camera.rotateVerticallyEye(c, angleY); ! Project.getInstance().changed(); } } *************** *** 98,102 **** super.keyPressed(e); } ! Project.getInstance().changed(c); } --- 98,102 ---- super.keyPressed(e); } ! Project.getInstance().changed(); } Index: CameraFlyTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CameraFlyTool.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** CameraFlyTool.java 11 Dec 2007 14:49:11 -0000 1.14 --- CameraFlyTool.java 20 May 2010 10:58:51 -0000 1.15 *************** *** 54,58 **** Camera.rotateHorizontallyEye(c, -angleX); Camera.rotateVerticallyEye(c, angleY); ! Project.getInstance().changed(c); } } --- 54,58 ---- Camera.rotateHorizontallyEye(c, -angleX); Camera.rotateVerticallyEye(c, angleY); ! Project.getInstance().changed(); } } *************** *** 99,103 **** super.keyPressed(e); } ! Project.getInstance().changed(c); } --- 99,103 ---- super.keyPressed(e); } ! Project.getInstance().changed(); } Index: ExtendTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtendTool.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ExtendTool.java 22 Dec 2009 13:51:51 -0000 1.6 --- ExtendTool.java 20 May 2010 10:58:51 -0000 1.7 *************** *** 250,254 **** } } ! owner.changed(); Project.getInstance().checkpoint(); } --- 250,254 ---- } } ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } Index: ShiftActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ShiftActionListener.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ShiftActionListener.java 25 Jun 2009 22:17:40 -0000 1.6 --- ShiftActionListener.java 20 May 2010 10:58:51 -0000 1.7 *************** *** 10,13 **** --- 10,14 ---- import java.awt.event.ActionListener; + import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; *************** *** 48,60 **** surface.setBackDomain(front); - surface.changed(); if (back != null) { back.addSurface(surface); - back.changed(); } if (front != null) { front.addSurface(surface); - front.changed(); } } --- 49,59 ---- surface.setBackDomain(front); if (back != null) { back.addSurface(surface); } if (front != null) { front.addSurface(surface); } + Project.getInstance().changed(); } Index: Pencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Pencil.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Pencil.java 22 Dec 2009 13:51:51 -0000 1.24 --- Pencil.java 20 May 2010 10:58:51 -0000 1.25 *************** *** 82,86 **** if (start.vertex().equalEps(current.vertex())) { Project.getInstance().getActiveSpace().insert(current.vertex()); ! Project.getInstance().changed(Project.getInstance().getActiveSpace()); Project.getInstance().checkpoint(); cleanUp(); --- 82,86 ---- if (start.vertex().equalEps(current.vertex())) { Project.getInstance().getActiveSpace().insert(current.vertex()); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); cleanUp(); *************** *** 101,105 **** boolean finish = !Geometry.insertEdges(edges).isEmpty() || exsGeometry; ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); --- 101,105 ---- boolean finish = !Geometry.insertEdges(edges).isEmpty() || exsGeometry; ! Project.getInstance().changed(); Project.getInstance().checkpoint(); Index: EraserTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/EraserTool.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** EraserTool.java 22 Dec 2009 13:51:51 -0000 1.14 --- EraserTool.java 20 May 2010 10:58:51 -0000 1.15 *************** *** 62,66 **** if (relevant(target)) { ((Geometric) target).erase(); ! Project.getInstance().changed(target); target = null; editor.getView().makeTarget(null); --- 62,66 ---- if (relevant(target)) { ((Geometric) target).erase(); ! Project.getInstance().changed(); target = null; editor.getView().makeTarget(null); Index: RectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RectTool.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** RectTool.java 22 Dec 2009 13:51:51 -0000 1.30 --- RectTool.java 20 May 2010 10:58:51 -0000 1.31 *************** *** 103,107 **** movingEdge.move(direction.getX(), direction.getY(), direction.getZ()); Geometry.insertEdges(rectangle); ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); cleanUp(); --- 103,107 ---- movingEdge.move(direction.getX(), direction.getY(), direction.getZ()); Geometry.insertEdges(rectangle); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); cleanUp(); *************** *** 189,193 **** } } ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); } --- 189,193 ---- } } ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } Index: DomainPopupListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/DomainPopupListener.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** DomainPopupListener.java 25 Jun 2009 22:17:40 -0000 1.10 --- DomainPopupListener.java 20 May 2010 10:58:51 -0000 1.11 *************** *** 48,67 **** public void actionPerformed(ActionEvent arg0) { if (front) { - Space oldFront = surface.getFrontDomain(); surface.assignFront(domain, Editor.isMulti()); - if (oldFront != null) { - oldFront.changed(); - } } else { - Space oldBack = surface.getBackDomain(); surface.assignBack(domain, Editor.isMulti()); - if (oldBack != null) { - oldBack.changed(); - } - } - if (domain != null) { - domain.changed(); } ! surface.changed(); Project.getInstance().checkpoint(); } --- 48,56 ---- public void actionPerformed(ActionEvent arg0) { if (front) { surface.assignFront(domain, Editor.isMulti()); } else { surface.assignBack(domain, Editor.isMulti()); } ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } |
From: Michael L. <he...@us...> - 2010-05-20 10:58:59
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv32587/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java PopupMenu.java Log Message: Changed a lot of calls to changed() Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/PopupMenu.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** PopupMenu.java 19 May 2010 15:45:42 -0000 1.43 --- PopupMenu.java 20 May 2010 10:58:51 -0000 1.44 *************** *** 313,317 **** } } ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); } --- 313,317 ---- } } ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } *************** *** 333,337 **** public void actionPerformed(ActionEvent event) { space.reduce(); ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); } --- 333,337 ---- public void actionPerformed(ActionEvent event) { space.reduce(); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } *************** *** 343,347 **** public void actionPerformed(ActionEvent event) { space.clear(); ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); } --- 343,347 ---- public void actionPerformed(ActionEvent event) { space.clear(); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } *************** *** 420,424 **** } Project.getInstance().world().add(union); ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); } --- 420,424 ---- } Project.getInstance().world().add(union); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } *************** *** 437,441 **** Project.getInstance().addCalalogObject(component); Selection.primary().clear(); ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); } --- 437,441 ---- Project.getInstance().addCalalogObject(component); Selection.primary().clear(); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } *************** *** 512,516 **** System.out.println("detail " + modellor); Modellor detailer = modellor.newInstance(space); ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().addObserver(detailer); } --- 512,516 ---- System.out.println("detail " + modellor); Modellor detailer = modellor.newInstance(space); ! Project.getInstance().changed(); Project.getInstance().addObserver(detailer); } *************** *** 544,548 **** Project p = Project.getInstance(); p.getGlobals().remove(attribute); ! p.changed(p); p.checkpoint(); } --- 544,548 ---- Project p = Project.getInstance(); p.getGlobals().remove(attribute); ! p.changed(); p.checkpoint(); } *************** *** 564,568 **** for (Geometric current : entities) { current.erase(); ! Project.getInstance().changed(current); } Project.getInstance().changed(Geometric.collect(entities)); --- 564,568 ---- for (Geometric current : entities) { current.erase(); ! Project.getInstance().changed(); } Project.getInstance().changed(Geometric.collect(entities)); *************** *** 642,646 **** Selection.primary().clear(); Project.getInstance().getActiveSpace().add(union); ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); } --- 642,646 ---- Selection.primary().clear(); Project.getInstance().getActiveSpace().add(union); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } *************** *** 654,658 **** Geometric geometric = entities.iterator().next(); Project.getInstance().setActiveCoordinateSystem(CoordinateSystem.systemFor(geometric)); ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); } --- 654,658 ---- Geometric geometric = entities.iterator().next(); Project.getInstance().setActiveCoordinateSystem(CoordinateSystem.systemFor(geometric)); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } *************** *** 756,760 **** current.update(); } ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); } --- 756,760 ---- current.update(); } ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } *************** *** 771,775 **** current.update(); } ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); } --- 771,775 ---- current.update(); } ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } *************** *** 810,814 **** } } ! project.changed(project); project.checkpoint(); } --- 810,814 ---- } } ! project.changed(); project.checkpoint(); } *************** *** 914,918 **** public void actionPerformed(ActionEvent event) { Project.getInstance().world().reduce(); ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); } --- 914,918 ---- public void actionPerformed(ActionEvent event) { Project.getInstance().world().reduce(); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } *************** *** 941,945 **** space.insert(current); } ! Project.getInstance().changed(space); Project.getInstance().checkpoint(); } --- 941,945 ---- space.insert(current); } ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } *************** *** 951,955 **** SurfaceAnalysis analysis = new SurfaceAnalysis(); analysis.clearPlanes(space); ! Project.getInstance().changed(space); Project.getInstance().checkpoint(); } --- 951,955 ---- SurfaceAnalysis analysis = new SurfaceAnalysis(); analysis.clearPlanes(space); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } *************** *** 961,965 **** SurfaceAnalysis analysis = new SurfaceAnalysis(); analysis.surfaceAnalysis(space); ! Project.getInstance().changed(space); Project.getInstance().checkpoint(); } --- 961,965 ---- SurfaceAnalysis analysis = new SurfaceAnalysis(); analysis.surfaceAnalysis(space); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } *************** *** 971,975 **** SurfaceAnalysis analysis = new SurfaceAnalysis(); analysis.clearSurfaces(space); ! Project.getInstance().changed(space); Project.getInstance().checkpoint(); } --- 971,975 ---- SurfaceAnalysis analysis = new SurfaceAnalysis(); analysis.clearSurfaces(space); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } *************** *** 999,1003 **** tool.activate(instance); } ! project.changed(world); project.checkpoint(); }; --- 999,1003 ---- tool.activate(instance); } ! project.changed(); project.checkpoint(); }; *************** *** 1016,1020 **** tool.activate(space); } ! project.changed(world); project.checkpoint(); }; --- 1016,1020 ---- tool.activate(space); } ! project.changed(); project.checkpoint(); }; Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.294 retrieving revision 1.295 diff -C2 -d -r1.294 -r1.295 *** View.java 5 Feb 2010 15:00:31 -0000 1.294 --- View.java 20 May 2010 10:58:51 -0000 1.295 *************** *** 594,598 **** } Selection.primary().clear(); ! Project.getInstance().changed(Project.getInstance()); } --- 594,598 ---- } Selection.primary().clear(); ! Project.getInstance().changed(); } |
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv32550/src/net/sourceforge/bprocessor/model Modified Files: Space.java CoordinateSystem.java Entity.java Command.java Item.java Project.java Log Message: Changed a lot of calls to changed() Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** CoordinateSystem.java 5 Feb 2010 13:32:50 -0000 1.78 --- CoordinateSystem.java 20 May 2010 10:58:45 -0000 1.79 *************** *** 68,72 **** } Project.getInstance().world().add(system); ! Project.getInstance().changed(Project.getInstance().world()); } } --- 68,72 ---- } Project.getInstance().world().add(system); ! Project.getInstance().changed(); } } Index: Entity.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Entity.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Entity.java 25 Jun 2009 20:29:33 -0000 1.24 --- Entity.java 20 May 2010 10:58:45 -0000 1.25 *************** *** 126,136 **** /** - * Tell observers that this entity has changed - */ - public void changed() { - Project.getInstance().changed(this); - } - - /** * Deletes this Entity from the model by removing * it from the owning object and clearing all --- 126,129 ---- Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.192 retrieving revision 1.193 diff -C2 -d -r1.192 -r1.193 *** Project.java 18 May 2010 14:32:37 -0000 1.192 --- Project.java 20 May 2010 10:58:46 -0000 1.193 *************** *** 81,84 **** --- 81,86 ---- private static Project instance; + private Set<Class> bunch; + /** */ public static final boolean SENSE = false; *************** *** 269,273 **** sensor.setMaterial(findMaterial("Green")); } ! changed(sensor); } } --- 271,275 ---- sensor.setMaterial(findMaterial("Green")); } ! changed(); } } *************** *** 493,496 **** --- 495,499 ---- observers = new LinkedList(); + bunch = new HashSet(); scheduledObservers = new LinkedList(); *************** *** 672,681 **** /** * Tell observers to update because an entity has changed * @param entity The changed entity */ public void changed(Object entity) { - log.debug("-------Changed(" + entity + ")----------"); - // FIXME: temporary hack. There should be better handling of the observers List allObservers = new LinkedList(observers); allObservers.addAll(staticObservers); --- 675,689 ---- /** + * + */ + public void changed() { + changed(this); + } + + /** * Tell observers to update because an entity has changed * @param entity The changed entity */ public void changed(Object entity) { List allObservers = new LinkedList(observers); allObservers.addAll(staticObservers); *************** *** 724,732 **** edges.addAll(current.getEdges()); } - // THE CASE WHERE THERE ARE ONLY ONE I WOULD LIKE TO KNOW IT HAS CHANGED - if (vertices.size() == 1) { - Iterator it = vertices.iterator(); - changed(it.next()); - } } { --- 732,735 ---- *************** *** 905,909 **** public void setCurrentCamera(Camera camera) { currentCamera.copyfrom(camera); ! changed(this); } --- 908,912 ---- public void setCurrentCamera(Camera camera) { currentCamera.copyfrom(camera); ! changed(); } *************** *** 1053,1057 **** } } ! changed(this); } --- 1056,1060 ---- } } ! changed(); } *************** *** 1179,1183 **** } } ! changed(this); } --- 1182,1186 ---- } } ! changed(); } *************** *** 2219,2223 **** stamp = System.currentTimeMillis(); initialized = true; ! Project.getInstance().changed(Project.getInstance()); } } --- 2222,2226 ---- stamp = System.currentTimeMillis(); initialized = true; ! Project.getInstance().changed(); } } *************** *** 2357,2361 **** } ! Project.getInstance().changed(Project.getInstance()); } } --- 2360,2364 ---- } ! Project.getInstance().changed(); } } Index: Item.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Item.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Item.java 9 Mar 2010 13:02:00 -0000 1.6 --- Item.java 20 May 2010 10:58:46 -0000 1.7 *************** *** 501,514 **** /** - * Notify that this Space has changed - * FIXME: Make the change-update mechanism general - */ - @Override - public void changed() { - update(this); - super.changed(); - } - - /** * Update this Space * @param entity Changed entity --- 501,504 ---- Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.252 retrieving revision 1.253 diff -C2 -d -r1.252 -r1.253 *** Space.java 18 May 2010 13:38:07 -0000 1.252 --- Space.java 20 May 2010 10:58:45 -0000 1.253 *************** *** 1465,1469 **** } } ! Project.getInstance().changed(Project.getInstance()); } --- 1465,1469 ---- } } ! Project.getInstance().changed(); } *************** *** 1662,1666 **** Project.getInstance().setActiveSpace((Space) this); Selection.primary().clear(); ! Project.getInstance().changed(Project.getInstance()); } --- 1662,1666 ---- Project.getInstance().setActiveSpace((Space) this); Selection.primary().clear(); ! Project.getInstance().changed(); } Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** Command.java 19 May 2010 15:45:39 -0000 1.83 --- Command.java 20 May 2010 10:58:45 -0000 1.84 *************** *** 876,880 **** } ! Project.getInstance().changed(Project.getInstance()); } } --- 876,880 ---- } ! Project.getInstance().changed(); } } *************** *** 1478,1482 **** current.update(); } ! Project.getInstance().changed(Project.getInstance()); } } --- 1478,1482 ---- current.update(); } ! Project.getInstance().changed(); } } *************** *** 1524,1528 **** current.update(); } ! Project.getInstance().changed(Project.getInstance()); } } --- 1524,1528 ---- current.update(); } ! Project.getInstance().changed(); } } |
From: Michael L. <he...@us...> - 2010-05-20 10:58:54
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/bridge In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv32550/src/net/sourceforge/bprocessor/model/bridge Modified Files: Sensor.java Log Message: Changed a lot of calls to changed() Index: Sensor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/bridge/Sensor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Sensor.java 25 May 2009 12:00:46 -0000 1.4 --- Sensor.java 20 May 2010 10:58:46 -0000 1.5 *************** *** 79,83 **** } } ! Project.getInstance().changed(this); } } --- 79,83 ---- } } ! Project.getInstance().changed(); } } |
From: Michael L. <he...@us...> - 2010-05-20 10:58:48
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv32493/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Changed a lot of calls to changed() Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.148 retrieving revision 1.149 diff -C2 -d -r1.148 -r1.149 *** GenericTreeView.java 7 May 2010 13:35:55 -0000 1.148 --- GenericTreeView.java 20 May 2010 10:58:39 -0000 1.149 *************** *** 1149,1153 **** Project.getInstance().add(m); AttributeView.instance().display(m); ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); } --- 1149,1153 ---- Project.getInstance().add(m); AttributeView.instance().display(m); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } *************** *** 1472,1476 **** pb.putDouble("new global", 0); AttributeView.instance().display(pb.getAttributes().get(pb.getAttributes().size() - 1)); ! Project.getInstance().changed(pb); Project.getInstance().checkpoint(); } --- 1472,1476 ---- pb.putDouble("new global", 0); AttributeView.instance().display(pb.getAttributes().get(pb.getAttributes().size() - 1)); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } *************** *** 1616,1620 **** camera.addHiddenGeometric(geometric); } ! Project.getInstance().changed(Project.getInstance()); } } --- 1616,1620 ---- camera.addHiddenGeometric(geometric); } ! Project.getInstance().changed(); } } |
From: Michael L. <he...@us...> - 2010-05-20 10:58:48
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv32493/src/net/sourceforge/bprocessor/gui Modified Files: MaterialView.java CameraView.java GUI.java Log Message: Changed a lot of calls to changed() Index: MaterialView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/MaterialView.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MaterialView.java 25 Jun 2009 20:29:36 -0000 1.3 --- MaterialView.java 20 May 2010 10:58:40 -0000 1.4 *************** *** 68,72 **** Project.getInstance().add(m); AttributeView.instance().display(m); ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); } else if (which == remove) { --- 68,72 ---- Project.getInstance().add(m); AttributeView.instance().display(m); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } else if (which == remove) { *************** *** 78,82 **** Material material = (Material) node.getUserObject(); Project.getInstance().remove(material); ! Project.getInstance().changed(Project.getInstance()); } } --- 78,82 ---- Material material = (Material) node.getUserObject(); Project.getInstance().remove(material); ! Project.getInstance().changed(); } } Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.118 retrieving revision 1.119 diff -C2 -d -r1.118 -r1.119 *** GUI.java 26 Apr 2010 09:30:35 -0000 1.118 --- GUI.java 20 May 2010 10:58:40 -0000 1.119 *************** *** 386,390 **** AttributeView.instance().display(space); Project.getInstance().checkpoint(); ! Project.getInstance().changed(owner); } }; --- 386,390 ---- AttributeView.instance().display(space); Project.getInstance().checkpoint(); ! Project.getInstance().changed(); } }; *************** *** 400,404 **** AttributeView.instance().display(space); Project.getInstance().checkpoint(); ! Project.getInstance().changed(owner); } }; --- 400,404 ---- AttributeView.instance().display(space); Project.getInstance().checkpoint(); ! Project.getInstance().changed(); } }; *************** *** 415,419 **** AttributeView.instance().display(net); Project.getInstance().checkpoint(); ! Project.getInstance().changed(active); } }; --- 415,419 ---- AttributeView.instance().display(net); Project.getInstance().checkpoint(); ! Project.getInstance().changed(); } }; *************** *** 429,433 **** AttributeView.instance().display(union); Project.getInstance().checkpoint(); ! Project.getInstance().changed(Project.getInstance()); } }; --- 429,433 ---- AttributeView.instance().display(union); Project.getInstance().checkpoint(); ! Project.getInstance().changed(); } }; *************** *** 442,446 **** Space space = modellor.createSpace(); Project.getInstance().world().add(space); ! Project.getInstance().changed(Project.getInstance()); } }; --- 442,446 ---- Space space = modellor.createSpace(); Project.getInstance().world().add(space); ! Project.getInstance().changed(); } }; *************** *** 971,975 **** presented = true; Project.getInstance().checkpoint(); ! Project.getInstance().changed(Project.getInstance()); Timer timer = new Timer (2000, new ActionListener() { public void actionPerformed(ActionEvent e) { --- 971,975 ---- presented = true; Project.getInstance().checkpoint(); ! Project.getInstance().changed(); Timer timer = new Timer (2000, new ActionListener() { public void actionPerformed(ActionEvent e) { Index: CameraView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/CameraView.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CameraView.java 23 Apr 2007 14:47:03 -0000 1.10 --- CameraView.java 20 May 2010 10:58:40 -0000 1.11 *************** *** 67,71 **** p.add(c); c.setName("View " + c.getId()); ! p.changed(c); } else if (which == remove) { TreePath tp = ctv.getSelectionPath(); --- 67,71 ---- p.add(c); c.setName("View " + c.getId()); ! p.changed(); } else if (which == remove) { TreePath tp = ctv.getSelectionPath(); *************** *** 74,78 **** if (node instanceof CameraNode && node != p.getCurrentCamera()) { p.remove((Camera)((CameraNode)node).getUserObject()); ! p.changed(p); } } --- 74,78 ---- if (node instanceof CameraNode && node != p.getCurrentCamera()) { p.remove((Camera)((CameraNode)node).getUserObject()); ! p.changed(); } } |
From: Michael L. <he...@us...> - 2010-05-20 10:58:48
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv32493/src/net/sourceforge/bprocessor/gui/actions Modified Files: FileImportActionListener.java ModellorMenuAction.java ImportFileReader.java Log Message: Changed a lot of calls to changed() Index: FileImportActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileImportActionListener.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** FileImportActionListener.java 9 Mar 2010 13:01:57 -0000 1.29 --- FileImportActionListener.java 20 May 2010 10:58:39 -0000 1.30 *************** *** 131,135 **** ImportFileReader.importCsvFile(lfile, Project.getInstance().getActiveSpace(), info.getSelectedFloor()); ! Project.getInstance().changed(Project.getInstance().getActiveSpace()); Project.getInstance().checkpoint(); } catch (Exception ex) { --- 131,135 ---- ImportFileReader.importCsvFile(lfile, Project.getInstance().getActiveSpace(), info.getSelectedFloor()); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } catch (Exception ex) { *************** *** 144,148 **** Component lo = new Component(lfile, s); Project.getInstance().addCalalogObject(lo); ! Project.getInstance().changed(s); Project.getInstance().checkpoint(); } catch (Exception ex) { --- 144,148 ---- Component lo = new Component(lfile, s); Project.getInstance().addCalalogObject(lo); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } catch (Exception ex) { *************** *** 162,166 **** } ! Project.getInstance().changed(Project.getInstance()); } catch (Exception ex) { log.error("Could not open file: " + lfile, ex); --- 162,166 ---- } ! Project.getInstance().changed(); } catch (Exception ex) { log.error("Could not open file: " + lfile, ex); *************** *** 170,174 **** Space result = ImportFileReader.importDgnFormat(lfile); Project.getInstance().world().add(result); ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); } catch (Exception ex) { --- 170,174 ---- Space result = ImportFileReader.importDgnFormat(lfile); Project.getInstance().world().add(result); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } catch (Exception ex) { Index: ModellorMenuAction.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/ModellorMenuAction.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ModellorMenuAction.java 25 Jun 2009 22:17:33 -0000 1.5 --- ModellorMenuAction.java 20 May 2010 10:58:39 -0000 1.6 *************** *** 51,55 **** space.setModellor(created); AttributeView.instance().display(created); ! space.changed(); Project.getInstance().checkpoint(); } else { --- 51,55 ---- space.setModellor(created); AttributeView.instance().display(created); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } else { Index: ImportFileReader.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/ImportFileReader.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ImportFileReader.java 17 Nov 2009 09:56:55 -0000 1.23 --- ImportFileReader.java 20 May 2010 10:58:39 -0000 1.24 *************** *** 223,227 **** into.add(s); } - into.changed(); stream.close(); br.close(); --- 223,226 ---- |
From: Michael L. <he...@us...> - 2010-05-20 10:58:48
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv32493/src/net/sourceforge/bprocessor/gui/attrview Modified Files: OperationAttribute.java AttributeView.java GenericPanel.java Log Message: Changed a lot of calls to changed() Index: OperationAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/OperationAttribute.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OperationAttribute.java 9 Nov 2007 09:45:29 -0000 1.2 --- OperationAttribute.java 20 May 2010 10:58:39 -0000 1.3 *************** *** 143,147 **** Operation operation = (Operation) attribute.getValue(); operation.perform(); ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); } --- 143,147 ---- Operation operation = (Operation) attribute.getValue(); operation.perform(); ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** GenericPanel.java 25 Feb 2010 14:43:55 -0000 1.56 --- GenericPanel.java 20 May 2010 10:58:39 -0000 1.57 *************** *** 26,30 **** import net.sourceforge.bprocessor.model.Attribute; - import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Component; import net.sourceforge.bprocessor.model.Description; --- 26,29 ---- *************** *** 103,111 **** if (obj instanceof Entity) { simpleUpdate = true; ! ((Entity)obj).changed(); ! } else if (obj instanceof Camera) { ! Project.getInstance().changed((Camera)obj); ! } ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); } --- 102,107 ---- if (obj instanceof Entity) { simpleUpdate = true; ! } ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } *************** *** 173,181 **** if (obj instanceof Entity) { obj.setAttributes(attributes); - ((Entity)obj).changed(); - } else if (obj instanceof Camera) { - Project.getInstance().changed((Camera)obj); } ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); } --- 169,174 ---- if (obj instanceof Entity) { obj.setAttributes(attributes); } ! Project.getInstance().changed(); Project.getInstance().checkpoint(); } Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** AttributeView.java 27 Dec 2007 23:14:30 -0000 1.44 --- AttributeView.java 20 May 2010 10:58:39 -0000 1.45 *************** *** 85,89 **** */ public void update(Object object) { - Selection selection = Selection.primary(); if (object == selection) { --- 85,88 ---- |
From: Sebastian G. <sg...@us...> - 2010-05-19 15:45:53
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv15024/src/net/sourceforge/bprocessor/gl/view Modified Files: PopupMenu.java Log Message: Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/PopupMenu.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** PopupMenu.java 9 Mar 2010 13:01:53 -0000 1.42 --- PopupMenu.java 19 May 2010 15:45:42 -0000 1.43 *************** *** 67,75 **** /** The logger */ private static Logger log = Logger.getLogger(PopupMenu.class); ! private static final boolean CHECKS = false; private Editor editor; ! /** * The popupMenu constructor --- 67,75 ---- /** The logger */ private static Logger log = Logger.getLogger(PopupMenu.class); ! private static final boolean CHECKS = false; private Editor editor; ! /** * The popupMenu constructor *************** *** 79,83 **** this.editor = editor; } ! /** * Make a popupmenu for a list of surfaces --- 79,83 ---- this.editor = editor; } ! /** * Make a popupmenu for a list of surfaces *************** *** 110,114 **** }; menu.add(flip); ! { AbstractAction action = new EntityMenuAction(s, "Assign from Neighbours") { --- 110,114 ---- }; menu.add(flip); ! { AbstractAction action = new EntityMenuAction(s, "Assign from Neighbours") { *************** *** 122,126 **** menu.add(action); } ! { AbstractAction action = new GeometricMenuAction(surfaces, "Smooth...") { --- 122,126 ---- menu.add(action); } ! { AbstractAction action = new GeometricMenuAction(surfaces, "Smooth...") { *************** *** 194,198 **** return menu; } ! /** * --- 194,198 ---- return menu; } ! /** * *************** *** 232,236 **** return menu; } ! /** * --- 232,236 ---- return menu; } ! /** * *************** *** 242,250 **** return menu; } ! private abstract class ModellorAction extends AbstractAction { protected Modellor modellor; protected Space space; ! public ModellorAction(Modellor modellor, Space space) { super(modellor.title()); --- 242,250 ---- return menu; } ! private abstract class ModellorAction extends AbstractAction { protected Modellor modellor; protected Space space; ! public ModellorAction(Modellor modellor, Space space) { super(modellor.title()); *************** *** 253,257 **** } } ! /** * A popup generator for a collection of space --- 253,257 ---- } } ! /** * A popup generator for a collection of space *************** *** 261,267 **** private JPopupMenu getSpaceMenu(Collection s) { JPopupMenu menu = getGeometricMenu(s); ! menu.addSeparator(); ! { AbstractAction action = new CollectionMenuAction(s, "Explode") { --- 261,267 ---- private JPopupMenu getSpaceMenu(Collection s) { JPopupMenu menu = getGeometricMenu(s); ! menu.addSeparator(); ! { AbstractAction action = new CollectionMenuAction(s, "Explode") { *************** *** 272,276 **** Collection<Edge> edges = new LinkedList(space.getEdges()); Collection<Surface> surfaces = new LinkedList(space.getSurfaces()); ! for (Vertex current : vertices) { space.remove(current); --- 272,276 ---- Collection<Edge> edges = new LinkedList(space.getEdges()); Collection<Surface> surfaces = new LinkedList(space.getSurfaces()); ! for (Vertex current : vertices) { space.remove(current); *************** *** 285,289 **** space.getOwner().insert(current); } ! for (Surface current : surfaces) { space.remove(current); --- 285,289 ---- space.getOwner().insert(current); } ! for (Surface current : surfaces) { space.remove(current); *************** *** 294,298 **** space.getOwner().insert(current); } ! } } --- 294,298 ---- space.getOwner().insert(current); } ! } } *************** *** 322,326 **** // Some options do only apply to one space Space sp = (Space)s.iterator().next(); ! AbstractAction edit = new SpaceMenuAction(sp, "Edit") { public void actionPerformed(ActionEvent arg0) { --- 322,326 ---- // Some options do only apply to one space Space sp = (Space)s.iterator().next(); ! AbstractAction edit = new SpaceMenuAction(sp, "Edit") { public void actionPerformed(ActionEvent arg0) { *************** *** 349,354 **** menu.add(action); } ! ! { AbstractAction action = new SpaceMenuAction(sp, "Subdivide...") { --- 349,354 ---- menu.add(action); } ! ! { AbstractAction action = new SpaceMenuAction(sp, "Subdivide...") { *************** *** 370,373 **** --- 370,400 ---- } { + AbstractAction action = new SpaceMenuAction(sp, "Hyperbolic Paraboloid..") { + public void actionPerformed(ActionEvent event) { + Command command = new Command.Hyperbolicparaboloid(space); + AttributeView.instance().display(command); + } + }; + menu.add(action); + } + { + AbstractAction action = new SpaceMenuAction(sp, "Uniform Nonrational B-Spline..") { + public void actionPerformed(ActionEvent event) { + Command command = new Command.UniformNonrationalBSpline(space); + AttributeView.instance().display(command); + } + }; + menu.add(action); + } + { + AbstractAction action = new SpaceMenuAction(sp, "Nonuniform Nonrational B-Spline..") { + public void actionPerformed(ActionEvent event) { + Command command = new Command.NonuniformNonrationalBSpline(space); + AttributeView.instance().display(command); + } + }; + menu.add(action); + } + { AbstractAction action = new SpaceMenuAction(sp, "Offset..") { public void actionPerformed(ActionEvent event) { *************** *** 445,449 **** menu.add(action); } ! AbstractAction item = new SpaceMenuAction(sp, "Consistency Check") { public void actionPerformed(ActionEvent arg0) { --- 472,476 ---- menu.add(action); } ! AbstractAction item = new SpaceMenuAction(sp, "Consistency Check") { public void actionPerformed(ActionEvent arg0) { *************** *** 452,456 **** }; menu.add(item); ! if (CHECKS) { AbstractAction check = new SpaceMenuAction(sp, "Consistency Check") { --- 479,483 ---- }; menu.add(item); ! if (CHECKS) { AbstractAction check = new SpaceMenuAction(sp, "Consistency Check") { *************** *** 553,557 **** }; menu.add(allConnected); ! AbstractAction simplify = new GeometricMenuAction(arguments, "Simplify Geometry") { public void actionPerformed(ActionEvent arg0) { --- 580,584 ---- }; menu.add(allConnected); ! AbstractAction simplify = new GeometricMenuAction(arguments, "Simplify Geometry") { public void actionPerformed(ActionEvent arg0) { *************** *** 560,564 **** }; menu.add(simplify); ! { AbstractAction action = new GeometricMenuAction(arguments, "Make Union") { --- 587,591 ---- }; menu.add(simplify); ! { AbstractAction action = new GeometricMenuAction(arguments, "Make Union") { *************** *** 570,574 **** Set<Edge> edges = new HashSet(); Set<Vertex> vertices = new HashSet(); ! for (Geometric current : entities) { if (current instanceof Item) { --- 597,601 ---- Set<Edge> edges = new HashSet(); Set<Vertex> vertices = new HashSet(); ! for (Geometric current : entities) { if (current instanceof Item) { *************** *** 593,597 **** geometrics.addAll(vertices); } ! Mesh mesh = new Mesh(geometrics); HashMap map = new HashMap(); --- 620,624 ---- geometrics.addAll(vertices); } ! Mesh mesh = new Mesh(geometrics); HashMap map = new HashMap(); *************** *** 638,644 **** public void actionPerformed(ActionEvent event) { Set<Vertex> vertices = Geometric.collect(entities); ! Vertex center = null; ! if (entities.size() == 1) { Geometric geometric = entities.iterator().next(); --- 665,671 ---- public void actionPerformed(ActionEvent event) { Set<Vertex> vertices = Geometric.collect(entities); ! Vertex center = null; ! if (entities.size() == 1) { Geometric geometric = entities.iterator().next(); *************** *** 648,656 **** } } ! if (center == null) { center = Vertex.center(vertices); } ! CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); system = system.copy(); --- 675,683 ---- } } ! if (center == null) { center = Vertex.center(vertices); } ! CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); system = system.copy(); *************** *** 666,672 **** public void actionPerformed(ActionEvent event) { Set<Vertex> vertices = Geometric.collect(entities); ! Vertex center = null; ! if (entities.size() == 1) { Geometric geometric = entities.iterator().next(); --- 693,699 ---- public void actionPerformed(ActionEvent event) { Set<Vertex> vertices = Geometric.collect(entities); ! Vertex center = null; ! if (entities.size() == 1) { Geometric geometric = entities.iterator().next(); *************** *** 676,688 **** } } ! if (center == null) { center = Vertex.center(vertices); } ! CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); system = system.copy(); system.setOrigin(center); ! Command command = new Command.Translate(vertices, system); AttributeView.instance().display(command); --- 703,715 ---- } } ! if (center == null) { center = Vertex.center(vertices); } ! CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); system = system.copy(); system.setOrigin(center); ! Command command = new Command.Translate(vertices, system); AttributeView.instance().display(command); *************** *** 695,701 **** public void actionPerformed(ActionEvent event) { Set<Vertex> vertices = Geometric.collect(entities); ! Vertex center = null; ! if (entities.size() == 1) { Geometric geometric = entities.iterator().next(); --- 722,728 ---- public void actionPerformed(ActionEvent event) { Set<Vertex> vertices = Geometric.collect(entities); ! Vertex center = null; ! if (entities.size() == 1) { Geometric geometric = entities.iterator().next(); *************** *** 705,717 **** } } ! if (center == null) { center = Vertex.center(vertices); } ! CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); system = system.copy(); system.setOrigin(center); ! Command command = new Command.Rotate(vertices, system); AttributeView.instance().display(command); --- 732,744 ---- } } ! if (center == null) { center = Vertex.center(vertices); } ! CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); system = system.copy(); system.setOrigin(center); ! Command command = new Command.Rotate(vertices, system); AttributeView.instance().display(command); *************** *** 761,769 **** menu.add(action); } ! } return menu; } ! /** * Get background menu --- 788,796 ---- menu.add(action); } ! } return menu; } ! /** * Get background menu *************** *** 896,900 **** return menu; } ! /** * --- 923,927 ---- return menu; } ! /** * *************** *** 995,1000 **** return menu; } ! ! /** * --- 1022,1027 ---- return menu; } ! ! /** * *************** *** 1016,1023 **** return menu; } ! /** {@inheritDoc} */ public JPopupMenu menuFor(Collection<? extends Entity> geometrics) { ! if (geometrics.isEmpty()) { return getBackgroundMenu(); --- 1043,1050 ---- return menu; } ! /** {@inheritDoc} */ public JPopupMenu menuFor(Collection<? extends Entity> geometrics) { ! if (geometrics.isEmpty()) { return getBackgroundMenu(); |
From: Sebastian G. <sg...@us...> - 2010-05-19 15:45:50
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv15006/src/net/sourceforge/bprocessor/model Modified Files: Command.java Log Message: Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** Command.java 25 Feb 2010 14:43:48 -0000 1.82 --- Command.java 19 May 2010 15:45:39 -0000 1.83 *************** *** 18,22 **** import java.util.Set; - /** * Command --- 18,21 ---- *************** *** 29,32 **** --- 28,32 ---- public Command() { parameters = new ParameterBlock(); + // Comment } *************** *** 130,134 **** ! /** * --- 130,134 ---- ! /** * *************** *** 137,141 **** public static class PropertyCommand extends Command { private Geometric target; ! /** * --- 137,141 ---- public static class PropertyCommand extends Command { private Geometric target; ! /** * *************** *** 146,150 **** parameters.put("name", ""); } ! /** * {@inheritDoc} --- 146,150 ---- parameters.put("name", ""); } ! /** * {@inheritDoc} *************** *** 161,165 **** } } ! } /** --- 161,165 ---- } } ! } /** *************** *** 1637,1653 **** boolean working = true; while (working) { ! search: ! for (Edge current : edges) { ! working = false; ! if (!mark.contains(current)) { ! if (current.contains(to)) { ! ordered.addLast(current); ! mark.add(current); ! to = current.otherVertex(to); ! working = true; ! break search; } } - } } } --- 1637,1653 ---- boolean working = true; while (working) { ! search: ! for (Edge current : edges) { ! working = false; ! if (!mark.contains(current)) { ! if (current.contains(to)) { ! ordered.addLast(current); ! mark.add(current); ! to = current.otherVertex(to); ! working = true; ! break search; ! } } } } } *************** *** 1656,1672 **** boolean working = true; while (working) { ! search: ! for (Edge current : edges) { ! working = false; ! if (!mark.contains(current)) { ! if (current.contains(from)) { ! ordered.addFirst(current); ! mark.add(current); ! from = current.otherVertex(from); ! working = true; ! break search; } } - } } } --- 1656,1672 ---- boolean working = true; while (working) { ! search: ! for (Edge current : edges) { ! working = false; ! if (!mark.contains(current)) { ! if (current.contains(from)) { ! ordered.addFirst(current); ! mark.add(current); ! from = current.otherVertex(from); ! working = true; ! break search; ! } } } } } *************** *** 1964,1968 **** } ! /** * Layer */ --- 1964,2353 ---- } ! ! ! /** new command start ........................................................................................ ! * ! */ ! public static class Hyperbolicparaboloid extends Command { ! private Space net; ! ! /** ! * Constructs a frame command ! * @param net Space ! */ ! public Hyperbolicparaboloid(Space net) { ! this.net = net; ! parameters.put("height", 1.0); ! parameters.put("subdivisions", 5); ! ! parameters.put("HP name", "Hyperbolic Paraboloid"); ! } ! ! /** ! * {@inheritDoc} ! */ ! public String title() { ! return "Hyperbolicparaboloid"; ! } ! ! // not used... ! private List<Edge> simplify(List<Edge> edges) { ! if (edges.size() > 3) { ! List<Edge> result = new LinkedList(); ! List<Vertex> vertices = Offset.vertices(edges); ! LinkedList<Vertex> live = new LinkedList(); ! { ! int n = vertices.size(); ! Vertex previous = vertices.get(n - 1); ! Vertex current = vertices.get(0); ! Vertex next = null; ! for (int i = 0; i < n; i++) { ! next = vertices.get((i + 1) % n); ! Vertex u = current.minus(previous); ! Vertex v = next.minus(current); ! Vertex cross = u.cross(v); ! if (!cross.isZero()) { ! live.add(current); ! } ! previous = current; ! current = next; ! } ! } ! Vertex previous = live.getLast(); ! for (Vertex current : live) { ! result.add(new Edge(previous, current)); ! previous = current; ! } ! return result; ! } else { ! return edges; ! } ! } ! ! ! /** {@inheritDoc} */ ! @Override ! public void evaluate() { ! double height = parameters.getDouble("height"); ! int subdiv = parameters.getInteger("subdivisions"); ! String HPname = (String) parameters.get("HP name"); ! List<Surface> surfaces = new ArrayList(net.getSurfaces()); ! if (surfaces.size()==1) { ! Surface surface = surfaces.get(0); ! List<Vertex> vertices = surface.getVertices(); //returns vertices in order. ! if (vertices.size()==4) { ! List<Vertex> nVertices = new LinkedList(); ! for (Vertex current : vertices) { ! nVertices.add(current.copy()); ! } ! double trans = height/2; ! for (Vertex current : nVertices) { ! current.z = current.z + trans; ! trans = -trans; ! } ! Space result = Space.createUnion(HPname); ! ! Vertex[] dir = new Vertex[3]; ! Vertex[][] HPvertices = new Vertex[subdiv][subdiv]; ! // add grid points ! for (int u = 0; u < subdiv; u++) { ! for (int v = 0; v < subdiv; v++) { ! double vFactor = ((double) v)/(subdiv-1); ! double uFactor = ((double) u)/(subdiv-1); ! dir[0] = nVertices.get(1).minus(nVertices.get(0)).scale(uFactor).add(nVertices.get(0)); ! dir[1] = nVertices.get(2).minus(nVertices.get(3)).scale(uFactor).add(nVertices.get(3)); ! dir[2] = dir[1].minus(dir[0]).scale(vFactor).add(dir[0]); ! HPvertices[u][v] = dir[2]; ! result.add(HPvertices[u][v]); ! } ! } ! // add edges ! for (int u = 0; u < subdiv; u++) { ! for (int v = 0; v < subdiv; v++) { ! if (u>0) {result.add(new Edge(HPvertices[u][v],HPvertices[u-1][v]));} ! if (v>0) {result.add(new Edge(HPvertices[u][v],HPvertices[u][v-1]));} ! } ! } ! //add surfaces ! for (int u = 1; u < subdiv; u++) { ! for (int v = 1; v < subdiv; v++) { ! List<Edge> edges = new LinkedList(); ! edges.add(new Edge(HPvertices[u-1][v-1],HPvertices[u][v-1])); ! edges.add(new Edge(HPvertices[u][v-1],HPvertices[u][v])); ! edges.add(new Edge(HPvertices[u][v],HPvertices[u-1][v])); ! edges.add(new Edge(HPvertices[u-1][v],HPvertices[u-1][v-1])); ! result.add(new Surface(edges)); ! } ! } ! net.getOwner().add(result); ! } ! } ! } ! } ! ! /** new command end ......................................................................................... ! * ! * /** new command start ........................................................................................ ! * ! */ ! public static class UniformNonrationalBSpline extends Command { ! private Space net; ! ! /** ! * Constructs a frame command ! * @param net Space ! */ ! public UniformNonrationalBSpline(Space net) { ! this.net = net; ! parameters.put("subdivisions", 5.0); ! parameters.put("UNRBSname", "Unifrom Nonrational BSpline"); ! } ! ! /** ! * {@inheritDoc} ! */ ! public String title() { ! return "Unifrom Nonrational BSpline"; ! } ! ! //bring edges in order ! public static List<Edge> order(List<Edge> edges) { ! LinkedList<Edge> ordered = new LinkedList(); ! if (edges.size() > 0) { ! Edge first = edges.get(0); ! ordered.add(first); ! edges.remove(0); ! while (edges.size()>0) { ! for (int i = 0; i < edges.size(); i++) { ! search: ! if (edges.get(i).contains(ordered.get(ordered.size()-1).to)) { ! //check direction ! if (!edges.get(i).from.equals(ordered.get(ordered.size()-1).to)) { ! Vertex temp = edges.get(i).to; ! edges.get(i).to = edges.get(i).from; ! edges.get(i).from = temp; ! } ! //add at end of Linked list ! ordered.add(edges.get(i)); ! edges.remove(i); ! break search; ! } else if (edges.get(i).contains(ordered.get(0).from)) { ! //check direction ! if (!edges.get(i).to.equals(ordered.get(ordered.size()-1).from)) { ! Vertex temp = edges.get(i).to; ! edges.get(i).to = edges.get(i).from; ! edges.get(i).from = temp; ! } ! // add at beginning of Linked List ! ordered.add(0, edges.get(i)); ! edges.remove(i); ! break search; ! } ! } ! } ! } ! return ordered; ! } ! ! public Vertex unrbsCalc(List<Vertex> gConst, double t) { ! Vertex blend = new Vertex(0,0,0); ! if (gConst.size()==4) { ! double[] tempCalc = new double[4]; ! tempCalc[0] = ((1-t)*(1-t)*(1-t))/6; ! tempCalc[1] = (3*t*t*t-6*t*t+4)/6; ! tempCalc[2] = (-3*t*t*t+3*t*t+3*t+1)/6; ! tempCalc[3] = (t*t*t)/6; ! for (int i=0; i<=3; i++) { ! blend.x = blend.x + tempCalc[i]*gConst.get(i).x; ! blend.y = blend.y + tempCalc[i]*gConst.get(i).y; ! blend.z = blend.z + tempCalc[i]*gConst.get(i).z; ! } ! System.out.println(blend.x); ! } ! return blend; ! } ! ! /** {@inheritDoc} */ ! @Override ! public void evaluate() { ! String UNRBSname = (String) parameters.get("UNRBSname"); ! double subdiv = parameters.getDouble("subdivisions"); ! ! List<Vertex> vertices = new ArrayList(net.getVertices()); ! List<Edge> edges = new ArrayList(net.getEdges()); ! List<Vertex> orderPoints = new ArrayList(); ! List<Vertex> curvePoints = new LinkedList(); ! if (vertices.size()>=3) { ! LinkedList<Edge> nEdges = new LinkedList(); ! nEdges = (LinkedList) order(edges); ! // write into List ! for (int i=0; i<nEdges.size(); i++) { ! orderPoints.add(nEdges.get(i).from); ! } ! orderPoints.add(nEdges.get(nEdges.size()-1).to); ! // make Spline go through endpoints ! for (int i=0; i<=2; i++) { ! orderPoints.add(orderPoints.get(orderPoints.size()-1)); ! orderPoints.add(0,orderPoints.get(0)); ! } ! ! // create space object to draw new elements ! Space result = Space.createUnion(UNRBSname); ! ! // calculate Uniform Nonrational Spline Curve ! for (int i=3; i<= orderPoints.size()-2; i++) { ! for (int t=0; t<subdiv; t++) { ! curvePoints.add(unrbsCalc(orderPoints.subList(i-3, i+1),t/subdiv)); ! } ! } ! // draw Spline Curve ! for (int i=1;i<curvePoints.size()-1;i++) { ! result.add(new Edge(curvePoints.get(i-1),curvePoints.get(i))); ! } ! ! ! net.getOwner().add(result); ! } ! } ! } ! ! /** new command end ......................................................................................... ! * ! /** new command start ........................................................................................ ! * ! */ ! public static class NonuniformNonrationalBSpline extends Command { ! private Space net; ! ! /** ! * Constructs a frame command ! * @param net Space ! */ ! public NonuniformNonrationalBSpline(Space net) { ! this.net = net; ! parameters.put("subdivisions", 5.0); ! parameters.put("UNRBSname", "Nonunifrom Nonrational BSpline"); ! double val = 0; ! for (int i=0; i<net.getVertices().size()+4; i++) { ! if ((i>=4) && (i<=net.getVertices().size())) { ! val++; ! } ! parameters.put("knot value " + i, val); ! } ! } ! ! /** ! * {@inheritDoc} ! */ ! public String title() { ! return "Nonunifrom Nonrational BSpline"; ! } ! ! //bring edges in order ! public static List<Edge> order(List<Edge> edges) { ! LinkedList<Edge> ordered = new LinkedList(); ! if (edges.size() > 0) { ! Edge first = edges.get(0); ! ordered.add(first); ! edges.remove(0); ! while (edges.size()>0) { ! for (int i = 0; i < edges.size(); i++) { ! search: ! if (edges.get(i).contains(ordered.get(ordered.size()-1).to)) { ! //check direction ! if (!edges.get(i).from.equals(ordered.get(ordered.size()-1).to)) { ! Vertex temp = edges.get(i).to; ! edges.get(i).to = edges.get(i).from; ! edges.get(i).from = temp; ! } ! //add at end of Linked list ! ordered.add(edges.get(i)); ! edges.remove(i); ! break search; ! } else if (edges.get(i).contains(ordered.get(0).from)) { ! //check direction ! if (!edges.get(i).to.equals(ordered.get(ordered.size()-1).from)) { ! Vertex temp = edges.get(i).to; ! edges.get(i).to = edges.get(i).from; ! edges.get(i).from = temp; ! } ! // add at beginning of Linked List ! ordered.add(0, edges.get(i)); ! edges.remove(i); ! break search; ! } ! } ! } ! } ! return ordered; ! } ! ! private Vertex nunrbsCalc(List<Vertex> gConst, List<Double> t, double cT) { ! // gConst Control Points P(i), P(i+1), P(i+2), P(i+3) ! // t relevant knot values t(i), t(i+1). t(i+2), t(i+3) ! // cT current t, t(i)<=cT<t(i+1) ! Vertex blend = new Vertex(0, 0, 0); ! if ((gConst.size() == 4) && (t.size() == 4)) { ! double[] tempCalc = new double[4]; ! if ((cT >= t.get(0)) && (cT < t.get(1))) { ! tempCalc[0] = 1; ! } else { ! tempCalc[0] = 0; ! } ! ! tempCalc[1] = ((cT - t.get(0)) / (t.get(1) - t.get(0))) * tempCalc[0]; ! tempCalc[1] = tempCalc[1] + ((t.get(2) - cT) / (t.get(2) - t.get(1))) * cT; ! ! ! } ! return blend; ! } ! ! /** {@inheritDoc} */ ! @Override ! public void evaluate() { ! String zUNRBSname = (String) parameters.get("UNRBSname"); ! double subdiv = parameters.getDouble("subdivisions"); ! ! List<Vertex> vertices = new ArrayList(net.getVertices()); ! List<Edge> edges = new ArrayList(net.getEdges()); ! List<Vertex> orderPoints = new ArrayList(); ! List<Vertex> curvePoints = new LinkedList(); ! if (vertices.size() >= 3) { ! LinkedList<Edge> nEdges = new LinkedList(); ! nEdges = (LinkedList) order(edges); ! // write into List ! for (int i = 0; i < nEdges.size(); i++) { ! orderPoints.add(nEdges.get(i).from); ! } ! orderPoints.add(nEdges.get(nEdges.size() - 1).to); ! // make Spline go through endpoints ! for (int i = 0; i <= 2; i++) { ! orderPoints.add(orderPoints.get(orderPoints.size() - 1)); ! orderPoints.add(0, orderPoints.get(0)); ! } ! ! // create space object to draw new elements ! Space result = Space.createUnion(zUNRBSname); ! ! // calculate Uniform Nonrational Spline Curve ! for (int i = 3; i <= orderPoints.size() - 2; i++) { ! for (int t = 0; t < subdiv; t++) { ! //curvePoints.add(nunrbsCalc(orderPoints.subList(i-3, i+1),t/subdiv)); ! } ! } ! // draw Spline Curve ! for (int i = 1; i < curvePoints.size() - 1; i++) { ! result.add(new Edge(curvePoints.get(i - 1), curvePoints.get(i))); ! } ! ! net.getOwner().add(result); ! } ! } ! } ! ! /** new command end ! * ! * * Layer */ |
From: Sebastian G. <sg...@us...> - 2010-05-19 15:45:47
|
Update of /cvsroot/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv15006 Modified Files: build.xml Log Message: Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/model/build.xml,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** build.xml 12 Feb 2010 11:44:28 -0000 1.21 --- build.xml 19 May 2010 15:45:39 -0000 1.22 *************** *** 140,144 **** </target> ! <target name="compile" depends="checkstyle,copylib,compile-grammar,compile-xml"> <ant dir="src" target="compile"/> </target> --- 140,144 ---- </target> ! <target name="compile" depends="copylib,compile-grammar,compile-xml"> <ant dir="src" target="compile"/> </target> |
From: Michael L. <he...@us...> - 2010-05-18 14:32:47
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv31645/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.191 retrieving revision 1.192 diff -C2 -d -r1.191 -r1.192 *** Project.java 18 May 2010 13:38:07 -0000 1.191 --- Project.java 18 May 2010 14:32:37 -0000 1.192 *************** *** 11,15 **** import java.io.ByteArrayOutputStream; import java.io.File; - import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; --- 11,14 ---- *************** *** 85,90 **** public static final boolean SENSE = false; - private static final boolean DBK_FILE = false; - /** */ public static final boolean BRUN = false; --- 84,87 ---- *************** *** 448,466 **** instance = new Project(); try { ! InputStream input = null; ! File file = new File("Classification.xml"); ! if (file.exists() && DBK_FILE) { ! input = new FileInputStream(file); ! } else { ! ! ClassLoader cl = Thread.currentThread().getContextClassLoader(); ! URL url = cl.getResource("Classification.xml"); ! input = url.openStream(); ! if (input != null) { ! System.out.println("found classification file"); ! } } Object[] loaded = Persistence.loadDBK(input); constructionClas = (Classification)loaded[0]; --- 445,460 ---- instance = new Project(); try { ! String name = "/Classification.xml"; ! URL url = Project.class.getResource(name); ! if (url != null) { ! System.out.println("url: " + url); } + InputStream input = url.openStream(); + if (input != null) { + System.out.println("found classification file"); + } + Object[] loaded = Persistence.loadDBK(input); constructionClas = (Classification)loaded[0]; |
From: Michael L. <he...@us...> - 2010-05-18 13:38:21
|
Update of /cvsroot/bprocessor/bprocessor In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv22855 Removed Files: Classification.xml Log Message: --- Classification.xml DELETED --- |
From: Michael L. <he...@us...> - 2010-05-18 13:38:16
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv22842/src/net/sourceforge/bprocessor/model Modified Files: Space.java Project.java ClassificationFileReader.java Persistence.java Log Message: Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** Persistence.java 9 Mar 2010 13:02:00 -0000 1.88 --- Persistence.java 18 May 2010 13:38:07 -0000 1.89 *************** *** 1749,1759 **** /** * Load the DBK XML file into the project ! * @param file The file to load * @return A array of size two with the Constructional classification as the first and * Functional classification as the second * @throws Exception Either an file read exception or some exception from the JAXB framework */ ! public static Object[] loadDBK(File file) throws Exception { ! FileInputStream input = new FileInputStream(file); DBK xml = (DBK)loadFile(input); XMLSpecificTypeType rootType = xml.getXMLSpecificType(); --- 1749,1758 ---- /** * Load the DBK XML file into the project ! * @param input The file to load * @return A array of size two with the Constructional classification as the first and * Functional classification as the second * @throws Exception Either an file read exception or some exception from the JAXB framework */ ! public static Object[] loadDBK(InputStream input) throws Exception { DBK xml = (DBK)loadFile(input); XMLSpecificTypeType rootType = xml.getXMLSpecificType(); Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.251 retrieving revision 1.252 diff -C2 -d -r1.251 -r1.252 *** Space.java 7 May 2010 13:35:58 -0000 1.251 --- Space.java 18 May 2010 13:38:07 -0000 1.252 *************** *** 9,12 **** --- 9,13 ---- import java.io.PrintStream; + import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Collection; *************** *** 61,64 **** --- 62,66 ---- */ public static void export(List<Space> containers, PrintStream out) { + DecimalFormat format = new DecimalFormat("0.####"); List<Surface> surfaces = new LinkedList(); for (Space container : containers) { *************** *** 72,77 **** for (Vertex current : vertices) { vmap.put(current, count++); ! out.println("v " + current.getX() + ! " " + current.getZ() + " " + (-current.getY())); } for (Space container : containers) { --- 74,81 ---- for (Vertex current : vertices) { vmap.put(current, count++); ! ! ! out.println("v " + format.format(current.getX()) + ! " " + format.format(current.getZ()) + " " + format.format((-current.getY()))); } for (Space container : containers) { Index: ClassificationFileReader.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClassificationFileReader.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ClassificationFileReader.java 25 Jun 2009 22:17:30 -0000 1.6 --- ClassificationFileReader.java 18 May 2010 13:38:07 -0000 1.7 *************** *** 45,49 **** new File(args[0] + "Classification.xml")); log.info("Wrote XML"); ! Object[] loaded = Persistence.loadDBK(new File(args[0] + "Classification.xml")); construction = (Classification)loaded[0]; functional = (Classification)loaded[1]; --- 45,50 ---- new File(args[0] + "Classification.xml")); log.info("Wrote XML"); ! Object[] loaded ! = Persistence.loadDBK(new FileInputStream(new File(args[0] + "Classification.xml"))); construction = (Classification)loaded[0]; functional = (Classification)loaded[1]; Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.190 retrieving revision 1.191 diff -C2 -d -r1.190 -r1.191 *** Project.java 7 May 2010 13:35:58 -0000 1.190 --- Project.java 18 May 2010 13:38:07 -0000 1.191 *************** *** 11,14 **** --- 11,15 ---- import java.io.ByteArrayOutputStream; import java.io.File; + import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; *************** *** 84,87 **** --- 85,90 ---- public static final boolean SENSE = false; + private static final boolean DBK_FILE = false; + /** */ public static final boolean BRUN = false; *************** *** 445,449 **** instance = new Project(); try { ! Object[] loaded = Persistence.loadDBK(new File("Classification.xml")); constructionClas = (Classification)loaded[0]; functionalClas = (Classification)loaded[1]; --- 448,467 ---- instance = new Project(); try { ! InputStream input = null; ! ! File file = new File("Classification.xml"); ! if (file.exists() && DBK_FILE) { ! input = new FileInputStream(file); ! } else { ! ! ClassLoader cl = Thread.currentThread().getContextClassLoader(); ! URL url = cl.getResource("Classification.xml"); ! input = url.openStream(); ! if (input != null) { ! System.out.println("found classification file"); ! } ! } ! ! Object[] loaded = Persistence.loadDBK(input); constructionClas = (Classification)loaded[0]; functionalClas = (Classification)loaded[1]; *************** *** 1928,1940 **** printer.println("<Scene>"); ! for (Material current : getMaterials()) { ! current.exportXml(printer); } for (Camera current : getCameras()) { current.exportXml(printer); } - for (String current : names) { Space construct = map.get(current); --- 1946,1973 ---- printer.println("<Scene>"); ! { ! String header = "<SceneDescription" ! + " name=\"" + "Koldinghus_scene" + "\"" ! + " scale=\"0.35\"" ! + "/>"; ! printer.println(header); } + { + String header = "<MTLfile " + + " filename=\"" + "materials.mtl" + "\"" + + "/>"; + printer.println(header); + } + + // + // for (Material current : getMaterials()) { + // current.exportXml(printer); + // } + for (Camera current : getCameras()) { current.exportXml(printer); } for (String current : names) { Space construct = map.get(current); *************** *** 1944,1948 **** material = Defaults.getConstructionMaterial(); } ! String header = "<Object" + " name=\"" + current + "\"" + " material=\"" + material.getName() + "\"" --- 1977,1981 ---- material = Defaults.getConstructionMaterial(); } ! String header = "<ObjectFile" + " name=\"" + current + "\"" + " material=\"" + material.getName() + "\"" |
From: Michael L. <he...@us...> - 2010-05-18 13:38:12
|
Update of /cvsroot/bprocessor/gui/src/gfx In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv22782/src/gfx Added Files: Classification.xml Log Message: --- NEW FILE: Classification.xml --- (This appears to be a binary file; contents omitted.) |
From: Michael L. <he...@us...> - 2010-05-07 13:36:12
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4772/src/net/sourceforge/bprocessor/model/sense Modified Files: SensorItem.java Added Files: SensorStorage.java Log Message: Index: SensorItem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/SensorItem.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SensorItem.java 12 Feb 2010 11:44:28 -0000 1.2 --- SensorItem.java 7 May 2010 13:35:58 -0000 1.3 *************** *** 11,19 **** import java.text.DecimalFormat; import java.util.Date; /** * */ ! public class SensorItem { private String id; private long time; --- 11,24 ---- import java.text.DecimalFormat; import java.util.Date; + import java.util.List; + + import net.sourceforge.bprocessor.model.Attribute; + import net.sourceforge.bprocessor.model.Entity; + import net.sourceforge.bprocessor.model.Parametric; /** * */ ! public class SensorItem extends Entity implements Parametric { private String id; private long time; *************** *** 59,62 **** --- 64,75 ---- /** * + * @return time + */ + public long getTime() { + return time; + } + + /** + * * @return id */ *************** *** 116,118 **** --- 129,170 ---- + format.format(humidity) + "%" + "}"; } + + /** + * {@inheritDoc} + */ + public void delete() { + // TODO Auto-generated method stub + + } + + /** + * {@inheritDoc} + */ + public List<Attribute> getAttributes() { + // TODO Auto-generated method stub + return null; + } + + /** + * {@inheritDoc} + */ + public void setAttributes(List<Attribute> attributes) { + // TODO Auto-generated method stub + + } + + /** + * {@inheritDoc} + */ + public String title() { + // TODO Auto-generated method stub + return toString(); + } + + /** + * {@inheritDoc} + */ + public String getName() { + return title(); + } } --- NEW FILE: SensorStorage.java --- //--------------------------------------------------------------------------------- // $Id: SensorStorage.java,v 1.1 2010/05/07 13:35:58 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.model.sense; import java.util.LinkedList; import java.util.List; import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Parametric; /** * */ public class SensorStorage extends Entity implements Parametric { private List<SensorItem> items; private long time; private long id; /** * @param id id */ public SensorStorage(long id) { this.id = id; items = new LinkedList(); time = 0; } /** * * @param delta delta */ public void update(List<SensorItem> delta) { for (SensorItem current : delta) { if (current.getTime() > time) { items.add(current); time = current.getTime(); } } } /** * {@inheritDoc} */ public void delete() { } /** * {@inheritDoc} */ public List<Attribute> getAttributes() { // TODO Auto-generated method stub return null; } /** * {@inheritDoc} */ public void setAttributes(List<Attribute> attributes) { // TODO Auto-generated method stub } /** * {@inheritDoc} */ public List<SensorItem> getItems() { return items; } /** * {@inheritDoc} */ public String title() { return "Sensor Data"; } /** * * @return id */ public long getid() { return id; } } |
From: Michael L. <he...@us...> - 2010-05-07 13:36:11
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4759/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.147 retrieving revision 1.148 diff -C2 -d -r1.147 -r1.148 *** GenericTreeView.java 9 Mar 2010 13:01:56 -0000 1.147 --- GenericTreeView.java 7 May 2010 13:35:55 -0000 1.148 *************** *** 62,65 **** --- 62,67 ---- import net.sourceforge.bprocessor.model.bridge.Sensor; import net.sourceforge.bprocessor.model.modellor.Modellor; + import net.sourceforge.bprocessor.model.sense.SensorItem; + import net.sourceforge.bprocessor.model.sense.SensorStorage; import net.sourceforge.bprocessor.gui.GUI; import net.sourceforge.bprocessor.gui.attrview.AttributeView; *************** *** 680,683 **** --- 682,689 ---- add(new ConstructorNode(cs)); } + if (space.getStorage() != null) { + SensorStorage storage = (SensorStorage) space.getStorage(); + add(new SensorStorageContainer("Data", storage.getItems())); + } } *************** *** 689,700 **** if (o instanceof Instance) { Instance instance = (Instance) o; ! if (this.getChildCount() == 2) { ! ((GenericNode)getChildAt(0)).update(instance.getEnvelope()); ! ((GenericNode)getChildAt(1)).update(instance.getTransformation()); ! } else { ! removeAllChildren(); ! makeInstanceContent(instance); ! model.nodeStructureChanged(this); ! } userObject = instance; model.nodeChanged(this); --- 695,701 ---- if (o instanceof Instance) { Instance instance = (Instance) o; ! removeAllChildren(); ! makeInstanceContent(instance); ! model.nodeStructureChanged(this); userObject = instance; model.nodeChanged(this); *************** *** 1300,1303 **** --- 1301,1319 ---- } + + /** + * + */ + public class SensorStorageContainer extends CompositeNode { + /** + * + * @param name String + * @param content data items + */ + public SensorStorageContainer(String name, Collection<SensorItem> content) { + super(name, content, false); + } + } + /** * |