bprocessor-commit Mailing List for B-processor (Page 79)
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: Nordholt <nor...@us...> - 2007-01-29 18:10:55
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3258/src/net/sourceforge/bprocessor/gui/attrview Modified Files: BooleanAttribute.java GenericPanel.java Added Files: SelectorAttribute.java Log Message: added a GUI attribute for the selectors Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** GenericPanel.java 6 Jan 2007 21:10:46 -0000 1.31 --- GenericPanel.java 29 Jan 2007 18:10:46 -0000 1.32 *************** *** 34,37 **** --- 34,38 ---- import net.sourceforge.bprocessor.model.Parametric; import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Selector; /** *************** *** 210,214 **** } }); ! genAttributes.add(catext);; where.add(new AttributeRow(catext)); if (a.getClassification() != null && --- 211,215 ---- } }); ! genAttributes.add(catext); where.add(new AttributeRow(catext)); if (a.getClassification() != null && *************** *** 231,234 **** --- 232,238 ---- where.add(new AttributeRow(caid)); } + } else if (a.getValue() instanceof Selector) { + Selector sel = (Selector)a.getValue(); + where.add(new AttributeRow(new SelectorAttribute(a))); } else { log.info("[GenericPanel] Something were not implemented"); Index: BooleanAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/BooleanAttribute.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BooleanAttribute.java 4 Nov 2006 16:54:53 -0000 1.2 --- BooleanAttribute.java 29 Jan 2007 18:10:46 -0000 1.3 *************** *** 29,32 **** --- 29,37 ---- implements ItemListener { + /** + * Default serial version UID + */ + private static final long serialVersionUID = 1L; + /** The listeners */ private List listeners; --- NEW FILE: SelectorAttribute.java --- //--------------------------------------------------------------------------------- // $Id: SelectorAttribute.java,v 1.1 2007/01/29 18:10:46 nordholt Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.attrview; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.List; import javax.swing.BoxLayout; import javax.swing.JComboBox; import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Selector; /** * GUI attribute for the selector attributes * */ public class SelectorAttribute extends GenericAttribute { /** */ private static final long serialVersionUID = 1L; /** The attribute of this gui attribute */ private Attribute att; /** The selector of the attribute */ private Selector sel = null; /** * Constructor sets the selector attribute. * @param a the attribute */ public SelectorAttribute(Attribute a) { super(BoxLayout.X_AXIS); att = a; if (att.getValue() instanceof Selector) { sel = (Selector)att.getValue(); List options = sel.getOptions(); JComboBox cb = new JComboBox(); for (Object o : options) { cb.addItem(o); } cb.setSelectedItem(sel.getCurrentValue()); cb.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == e.SELECTED) { sel.setCurrentValue(e.getItem()); } } }); this.add(cb); } } /** * * @return the attribute of the gui attribute */ public Attribute attribute() { return att; } /** * Cancel editing */ public void cancelEditing() { } /** * start editing */ public void startEditing() { } /** * stop editing */ public void stopEditing() { } } |
|
From: Nordholt <nor...@us...> - 2007-01-29 18:09:37
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2793/src/net/sourceforge/bprocessor/model Modified Files: ParameterBlock.java Log Message: parameter blocks can now hold all sorts of attributes Index: ParameterBlock.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ParameterBlock.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ParameterBlock.java 30 Dec 2006 15:29:38 -0000 1.4 --- ParameterBlock.java 29 Jan 2007 18:09:32 -0000 1.5 *************** *** 68,71 **** --- 68,79 ---- /** + * Put a general attribute in the paramters + * @param a the attribute + */ + public void put(Attribute a) { + parameters.add(a); + } + + /** * Get as environment * @return HashMap *************** *** 78,85 **** String key = current.getName(); Object value = current.getValue(); ! if (value instanceof Double || ! value instanceof Boolean) { ! env.put(key, value); ! } } return env; --- 86,90 ---- String key = current.getName(); Object value = current.getValue(); ! env.put(key, value); } return env; |
|
From: Nordholt <nor...@us...> - 2007-01-29 18:09:02
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2364/src/net/sourceforge/bprocessor/model Modified Files: EnergyCalc.java Parametric.java Added Files: Selector.java Log Message: Added an selector, this is for attributes that have a list of options from which the value should be choosen. Index: EnergyCalc.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/EnergyCalc.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EnergyCalc.java 24 Jan 2007 10:23:11 -0000 1.4 --- EnergyCalc.java 29 Jan 2007 18:08:45 -0000 1.5 *************** *** 57,63 **** boolean first = true; if (isrelevant(classification, current)) { ! Iterator it = classification.getElements().iterator(); ! ! while (it.hasNext()) { Space elemcheck = (Space) it.next(); --- 57,61 ---- boolean first = true; if (isrelevant(classification, current)) { ! Iterator it = classification.getElements().iterator(); while (it.hasNext()) { Space elemcheck = (Space) it.next(); Index: Parametric.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Parametric.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Parametric.java 11 Feb 2006 15:02:21 -0000 1.2 --- Parametric.java 29 Jan 2007 18:08:45 -0000 1.3 *************** *** 25,29 **** */ public List getAttributes(); ! /** * Return the general name of the object --- 25,29 ---- */ public List getAttributes(); ! /** * Return the general name of the object --- NEW FILE: Selector.java --- //--------------------------------------------------------------------------------- // $Id: Selector.java,v 1.1 2007/01/29 18:08:45 nordholt 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; import java.util.List; import org.apache.log4j.Logger; /** * A list of possible values for an attribute. */ public class Selector { /** The logger */ private static Logger log = Logger.getLogger(Selector.class); /** The options to choose from */ private List options; /** The choice of the options */ private Object currentValue; /** * Constructor for the selector * @param options initial options */ public Selector(List options) { log.info("new selector"); this.options = options; } /** * Gets the currently choosen option * @return the current value */ public Object getCurrentValue() { log.info("Getting current: " + currentValue); return currentValue; } /** * Sets the current value to an other value, given the this * value is an option. * @param value a new value */ public void setCurrentValue(Object value) { if (options.contains(value)) { log.info("managed to chance the value to: " + value); this.currentValue = value; } } /** * Gets the list of options * @return the options */ public List getOptions() { return options; } } |
|
From: rimestad <rim...@us...> - 2007-01-29 15:47:21
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8404/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Made changes to the tree to get better update and correct space - element - part structures Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** GenericTreeView.java 2 Jan 2007 17:47:50 -0000 1.68 --- GenericTreeView.java 29 Jan 2007 15:47:20 -0000 1.69 *************** *** 493,497 **** * @return the menu */ ! public JPopupMenu menu() { JPopupMenu pm = null; Object object = this.getUserObject(); --- 493,497 ---- * @return the menu */ ! public JPopupMenu menu() { JPopupMenu pm = null; Object object = this.getUserObject(); *************** *** 520,530 **** public SpaceNode(Space space) { super(space); Set surfaces = space.getEnvelope(); ! add(new SurfaceContainer("Surfaces", surfaces)); ! add(new ElementContainer("Elements", space.getElements())); add(new GeometryContainer("Geometry", space)); ! if (space.isContainer()) { ! ContainerNode cn = new ConstructorContainer("Constructors", space.getConstructors()); ! add(cn); ContainerNode tc = new TransformationContainer("Transformations", space.getTransformations().stack()); --- 520,548 ---- public SpaceNode(Space space) { super(space); + if (space.isInstance()) { + // Instances + makeInstanceContent(space); + } else if (space.isContainer()) { + // Containers both unions and soforth + makeContainerContent(space); + } else { + // NON-container spaces + Set surfaces = space.getEnvelope(); + add(new SurfaceContainer("Surfaces", surfaces)); + } + } + + /** + * Make the tree content for the space that is a container + * @param space the space + */ + private void makeContainerContent(Space space) { Set surfaces = space.getEnvelope(); ! add(new SurfaceContainer("Envelope", surfaces)); ! add(new ElementContainer(space.getElements())); add(new GeometryContainer("Geometry", space)); ! ContainerNode cn = new ConstructorContainer("Constructors", space.getConstructors()); ! add(cn); ! if (space.isUnion()) { ContainerNode tc = new TransformationContainer("Transformations", space.getTransformations().stack()); *************** *** 536,540 **** } } ! /** * Update the node with the given object --- 554,573 ---- } } ! ! /** ! * Generate the tree content for a space that is a instance ! * @param space The space ! */ ! private void makeInstanceContent(Space space) { ! Set surfaces = space.getEnvelope(); ! add(new SurfaceContainer("Envelope", surfaces)); ! SpaceNode proto = new SpaceNode(space.getProto()); ! add(proto); ! ContainerNode tc = ! new TransformationContainer("Transformations", space.getTransformations().stack()); ! tc.update(space.getTransformations().stack()); ! add(tc); ! } ! /** * Update the node with the given object *************** *** 544,572 **** if (o instanceof Space) { Space s = (Space)o; ! userObject = s; ! if (updated == s) { ! model.nodeChanged(this); ! } ! ((GenericNode)getChildAt(0)).update(s.getEnvelope()); ! ((GenericNode)getChildAt(1)).update(s.getElements()); ! ((GenericNode)getChildAt(2)).update(s); ! if (s.isContainer()) { ! ((GenericNode)getChildAt(3)).update(s.getConstructors()); ! ((GenericNode)getChildAt(4)).update(s.getTransformations().stack()); ! if (s.getModellor() != null) { ! if (getChildCount() == 6) { ! ((GenericNode)getChildAt(5)).update(s.getModellor()); } else { ! add(new ModellorNode(s.getModellor())); ! model.nodesWereInserted(this, new int[]{5}); } } else { ! if (getChildCount() == 6) { ! TreeNode node = getChildAt(5); ! remove(5); ! model.nodesWereRemoved(this, new int[]{5}, new Object[]{node}); ! } } } } } --- 577,635 ---- if (o instanceof Space) { Space s = (Space)o; ! if (s.isInstance()) { ! if (this.getChildCount() == 3) { ! ((GenericNode)getChildAt(0)).update(s.getEnvelope()); ! ((GenericNode)getChildAt(1)).update(s.getProto()); ! ((GenericNode)getChildAt(2)).update(s.getTransformations().stack()); ! } else { ! removeAllChildren(); ! makeInstanceContent(s); ! model.nodeStructureChanged(this); ! } ! } else if (s.isContainer()) { ! if (((Space)userObject).isContainer()) { ! //the old object were a container as well ! ((GenericNode)getChildAt(0)).update(s.getEnvelope()); ! ((GenericNode)getChildAt(1)).update(s.getElements()); ! ((GenericNode)getChildAt(2)).update(s); ! ((GenericNode)getChildAt(3)).update(s.getConstructors()); ! int placement = 4; ! if (s.isUnion()) { ! placement++; ! ((GenericNode)getChildAt(4)).update(s.getTransformations().stack()); ! } ! if (s.getModellor() != null) { ! if (getChildCount() == placement + 1) { ! ((GenericNode)getChildAt(placement)).update(s.getModellor()); ! } else { ! add(new ModellorNode(s.getModellor())); ! model.nodesWereInserted(this, new int[]{5}); ! } } else { ! if (getChildCount() == placement + 1) { ! TreeNode node = getChildAt(placement); ! remove(placement); ! model.nodesWereRemoved(this, new int[]{placement}, new Object[]{node}); ! } } } else { ! removeAllChildren(); ! makeContainerContent(s); ! model.nodeStructureChanged(this); ! } ! } else { ! if (this.getChildCount() == 1) { ! ((GenericNode)getChildAt(0)).update(s.getEnvelope()); ! } else { ! removeAllChildren(); ! add(new SurfaceContainer("Surfaces", s.getEnvelope())); ! model.nodeStructureChanged(this); } } + // Update the user object + userObject = s; + if (updated == s) { + model.nodeChanged(this); + } } } *************** *** 824,832 **** /** * Constructor - * @param name The name * @param elements The elements */ ! public ElementContainer(String name, Collection elements) { ! super(name, elements); insertChildren(elements); } --- 887,900 ---- /** * Constructor * @param elements The elements */ ! public ElementContainer(Collection elements) { ! super("", elements); ! Iterator iter = elements.iterator(); ! setUserObject("Unknown"); ! if (iter.hasNext()) { ! Space s = (Space)iter.next(); ! setUserObject(s.getLevelString()); ! } insertChildren(elements); } |
|
From: rimestad <rim...@us...> - 2007-01-29 15:47:20
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8394/src/net/sourceforge/bprocessor/gl/tool Modified Files: TapeMeasureTool.java TapeMeasure.java Log Message: Made changes to the tree to get better update and correct space - element - part structures Index: TapeMeasureTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/TapeMeasureTool.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** TapeMeasureTool.java 10 Oct 2006 15:03:50 -0000 1.21 --- TapeMeasureTool.java 29 Jan 2007 15:47:15 -0000 1.22 *************** *** 135,138 **** --- 135,139 ---- constructors(new LinkedList()); excluded(new LinkedList()); + Project.getInstance().changed(Project.getInstance().getActiveSpace()); Project.getInstance().checkpoint(); start = null; Index: TapeMeasure.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/TapeMeasure.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TapeMeasure.java 15 Nov 2006 09:53:17 -0000 1.2 --- TapeMeasure.java 29 Jan 2007 15:47:15 -0000 1.3 *************** *** 106,109 **** --- 106,110 ---- private void insert(Line line) { Geometry.insertConstructor(line); + Project.getInstance().changed(line); Project.getInstance().checkpoint(); } |
|
From: rimestad <rim...@us...> - 2007-01-29 15:03:42
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21646/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: added a getlevelstring method to give the string representation of the space level Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.115 retrieving revision 1.116 diff -C2 -d -r1.115 -r1.116 *** Space.java 29 Jan 2007 11:57:04 -0000 1.115 --- Space.java 29 Jan 2007 15:03:36 -0000 1.116 *************** *** 1431,1435 **** */ public String toString() { ! return "[space " + getName() + "]"; } --- 1431,1435 ---- */ public String toString() { ! return "[ " + getLevelString() + getName() + "]"; } *************** *** 2542,2545 **** --- 2542,2547 ---- /** + * The level of the space, is one of the static final values that resemples + * space, element or part * @return Returns the level. */ *************** *** 2633,2636 **** --- 2635,2659 ---- } + /** + * Return the level of the space as a string + * @return The string representation of the space level + */ + public String getLevelString() { + if (getLevel() == Space.PROJECT_LEVEL) { + return "Project"; + } else if (getLevel() == Space.SPACE_LEVEL) { + return "Space"; + } else if (getLevel() == Space.ELEMENT_LEVEL) { + return "Element"; + } else if (getLevel() == Space.PART_LEVEL) { + return "Part"; + } else if (getLevel() == Space.NET_LEVEL) { + return "Net"; + } else { + log.error("Not a valid level"); + return ""; + } + } + } |
|
From: rimestad <rim...@us...> - 2007-01-29 14:56:56
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18666/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: changed close to only clean the model lists AND NOT create a new Project object, otherwise all the observers will be removed as well (that we don't want) Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** Project.java 29 Jan 2007 11:57:04 -0000 1.111 --- Project.java 29 Jan 2007 14:56:50 -0000 1.112 *************** *** 699,703 **** public void close() { Selection.primary().clear(); ! instance = new Project(); } --- 699,703 ---- public void close() { Selection.primary().clear(); ! this.clear(); } |
|
From: Michael L. <he...@us...> - 2007-01-29 11:57:17
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11419/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: Small fixes Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** PopupMenu.java 23 Jan 2007 14:31:33 -0000 1.22 --- PopupMenu.java 29 Jan 2007 11:57:09 -0000 1.23 *************** *** 243,247 **** Selection.primary().clear(); Project p = Project.getInstance(); ! p.setActiveSpace(space); p.changed(p); } --- 243,247 ---- Selection.primary().clear(); Project p = Project.getInstance(); ! space.edit(); p.changed(p); } |
|
From: Michael L. <he...@us...> - 2007-01-29 11:57:12
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11272/src/net/sourceforge/bprocessor/model Modified Files: Space.java Project.java Log Message: Small fixes Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.114 retrieving revision 1.115 diff -C2 -d -r1.114 -r1.115 *** Space.java 29 Jan 2007 09:19:43 -0000 1.114 --- Space.java 29 Jan 2007 11:57:04 -0000 1.115 *************** *** 1675,1679 **** return getClassification().toString() + " - " + res + id; } else { ! if (name.equalsIgnoreCase("Void")) { return name; } else { --- 1675,1681 ---- return getClassification().toString() + " - " + res + id; } else { ! if (getOwner() == null) { ! return Project.getInstance().getName(); ! } else if (name.equalsIgnoreCase("Void")) { return name; } else { *************** *** 2512,2515 **** --- 2514,2529 ---- } } + + /** + * + */ + public void edit() { + Project.getInstance().setActiveSpace(this); + Selection.primary().clear(); + if (surfaces.isEmpty()) { + copyOwnerEnvelope(); + } + Project.getInstance().changed(Project.getInstance()); + } /** Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.110 retrieving revision 1.111 diff -C2 -d -r1.110 -r1.111 *** Project.java 23 Jan 2007 14:31:27 -0000 1.110 --- Project.java 29 Jan 2007 11:57:04 -0000 1.111 *************** *** 138,142 **** observers = new LinkedList(); scheduledObservers = new LinkedList(); ! world = new Space("Project", Space.FUNCTIONAL, Space.PROJECT_LEVEL, true); world.setId(new Long(0)); activeCoordinateSystem = new CoordinateSystem(new Vertex(1, 0, 0), new Vertex(0, 1, 0), --- 138,142 ---- observers = new LinkedList(); scheduledObservers = new LinkedList(); ! world = new Space("World", Space.FUNCTIONAL, Space.PROJECT_LEVEL, true); world.setId(new Long(0)); activeCoordinateSystem = new CoordinateSystem(new Vertex(1, 0, 0), new Vertex(0, 1, 0), |
|
From: Michael L. <he...@us...> - 2007-01-29 11:57:08
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11043/src/net/sourceforge/bprocessor/gl/tool Modified Files: SelectStrategy.java SpaceTool.java Log Message: Small fixes Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** SpaceTool.java 21 Nov 2006 17:44:05 -0000 1.67 --- SpaceTool.java 29 Jan 2007 11:56:59 -0000 1.68 *************** *** 320,324 **** Selection.primary().clear(); glv.getView().makeTarget(null); ! Project.getInstance().setActiveSpace(space); Project.getInstance().changed(Project.getInstance()); } --- 320,324 ---- Selection.primary().clear(); glv.getView().makeTarget(null); ! space.edit(); Project.getInstance().changed(Project.getInstance()); } *************** *** 719,723 **** glv.getView().makeTarget(null); Project p = Project.getInstance(); ! p.setActiveSpace(null); p.changed(p); } --- 719,723 ---- glv.getView().makeTarget(null); Project p = Project.getInstance(); ! p.setActiveSpace(p.world()); p.changed(p); } Index: SelectStrategy.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectStrategy.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SelectStrategy.java 25 Jan 2007 12:23:04 -0000 1.6 --- SelectStrategy.java 29 Jan 2007 11:56:59 -0000 1.7 *************** *** 19,23 **** import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.Edge; - import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Space; --- 19,22 ---- *************** *** 106,110 **** if (target instanceof Space) { Space space = (Space) target; ! Project.getInstance().setActiveSpace(space); } else if (target instanceof Surface) { Surface surface = (Surface) target; --- 105,109 ---- if (target instanceof Space) { Space space = (Space) target; ! space.edit(); } else if (target instanceof Surface) { Surface surface = (Surface) target; |
|
From: Nordholt <nor...@us...> - 2007-01-29 11:18:59
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28109/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: reducing lenght of line Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** GLView.java 29 Jan 2007 09:18:35 -0000 1.51 --- GLView.java 29 Jan 2007 11:18:48 -0000 1.52 *************** *** 321,325 **** label = new JLabel("Scale factor:"); this.add(label); ! items = new String[]{"1:1", "1:2", "1:5", "1:10", "1:20", "1:50", "1:100", "1:200", "1:500", "1:1000"}; choices = new JComboBox(items); choices.setEditable(true); --- 321,326 ---- label = new JLabel("Scale factor:"); this.add(label); ! items = new String[]{"1:1", "1:2", "1:5", "1:10", "1:20", "1:50", ! "1:100", "1:200", "1:500", "1:1000"}; choices = new JComboBox(items); choices.setEditable(true); |
|
From: rimestad <rim...@us...> - 2007-01-29 09:19:55
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11709/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: When a clasification is fetched from a union the clasification is taken from the owner... Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.113 retrieving revision 1.114 diff -C2 -d -r1.113 -r1.114 *** Space.java 24 Jan 2007 12:08:32 -0000 1.113 --- Space.java 29 Jan 2007 09:19:43 -0000 1.114 *************** *** 1130,1134 **** */ public Classification getClassification() { ! return classification; } /** --- 1130,1138 ---- */ public Classification getClassification() { ! if (this.isUnion()) { ! return getOwner().getClassification(); ! } else { ! return classification; ! } } /** |
|
From: rimestad <rim...@us...> - 2007-01-29 09:18:42
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11276/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: added missing default scalefactors Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** GLView.java 20 Jan 2007 21:24:56 -0000 1.50 --- GLView.java 29 Jan 2007 09:18:35 -0000 1.51 *************** *** 321,325 **** label = new JLabel("Scale factor:"); this.add(label); ! items = new String[]{"1:1", "1:2", "1:5", "1:10", "1:50", "1:100", "1:500", "1:1000"}; choices = new JComboBox(items); choices.setEditable(true); --- 321,325 ---- label = new JLabel("Scale factor:"); this.add(label); ! items = new String[]{"1:1", "1:2", "1:5", "1:10", "1:20", "1:50", "1:100", "1:200", "1:500", "1:1000"}; choices = new JComboBox(items); choices.setEditable(true); *************** *** 348,351 **** --- 348,353 ---- Project.getInstance().getCurrentCamera().setFactor(fac); Project.getInstance().changed(Project.getInstance().getCurrentCamera()); + } else { + GUI.getInstance().alert("Wrong scale format, have to be 1:[integer]"); } } |
|
From: Michael L. <he...@us...> - 2007-01-26 14:30:12
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14692/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Refactored 2d overlay drawing Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.176 retrieving revision 1.177 diff -C2 -d -r1.176 -r1.177 *** View.java 26 Jan 2007 14:04:57 -0000 1.176 --- View.java 26 Jan 2007 14:30:03 -0000 1.177 *************** *** 627,650 **** } - if (glv.getTool() instanceof SpaceTool) { - gl.glMatrixMode(GL.GL_PROJECTION); - gl.glPushMatrix(); - gl.glLoadIdentity(); - if (hitdetection) { - int[] viewport = new int[] {0, 0, (int)width, (int)height}; - glu.gluPickMatrix(x, viewport[3] - y, 5, 5, viewport, 0); - } - glu.gluOrtho2D(0, width, 0, height); - gl.glMatrixMode(GL.GL_MODELVIEW); - gl.glPushMatrix(); - gl.glLoadIdentity(); - labelSelection(hitdetection); - gl.glMatrixMode(GL.GL_PROJECTION); - gl.glPopMatrix(); - gl.glMatrixMode(GL.GL_MODELVIEW); - gl.glPopMatrix(); - } - //Drawing the space path gl.glMatrixMode(GL.GL_PROJECTION); gl.glDisable(GL.GL_DEPTH_TEST); --- 627,631 ---- *************** *** 659,662 **** --- 640,649 ---- gl.glPushMatrix(); gl.glLoadIdentity(); + + if (glv.getTool() instanceof SpaceTool) { + labelSelection(hitdetection); + } + + drawSpacePath(hitdetection); |
|
From: Michael L. <he...@us...> - 2007-01-26 14:05:13
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4636/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Widgets are being implemented Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.175 retrieving revision 1.176 diff -C2 -d -r1.175 -r1.176 *** View.java 25 Jan 2007 12:14:30 -0000 1.175 --- View.java 26 Jan 2007 14:04:57 -0000 1.176 *************** *** 8,15 **** import net.sourceforge.bprocessor.gl.GLView; - import net.sourceforge.bprocessor.gl.tool.ClickBox; import net.sourceforge.bprocessor.gl.tool.SpaceTool; import net.sourceforge.bprocessor.gl.model.GlObject; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.gui.Toolbar; --- 8,17 ---- import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.tool.SpaceTool; import net.sourceforge.bprocessor.gl.model.GlObject; import net.sourceforge.bprocessor.gl.model.Intersection; + import net.sourceforge.bprocessor.gl.model.Label; + import net.sourceforge.bprocessor.gl.model.SpaceBox; + import net.sourceforge.bprocessor.gl.model.Widget; import net.sourceforge.bprocessor.gui.Toolbar; *************** *** 360,363 **** --- 362,370 ---- */ private Set glObjects3D; + + /** + * A list of Widget objects displayed on top of the 3d model. + */ + private List<Widget> widgets; /** Max number of clipplanes */ *************** *** 480,484 **** colorMap = new HashMap(); glObjects3D = new HashSet(); ! Toolbar tb = Toolbar.getInstance(); tb.addSeparator(3); --- 487,492 ---- colorMap = new HashMap(); glObjects3D = new HashSet(); ! widgets = new LinkedList<Widget>(); ! Toolbar tb = Toolbar.getInstance(); tb.addSeparator(3); *************** *** 652,655 **** --- 660,668 ---- gl.glLoadIdentity(); drawSpacePath(hitdetection); + + for (Widget widget : widgets) { + widget.display(gl, glu, hitdetection); + } + gl.glMatrixMode(GL.GL_PROJECTION); gl.glPopMatrix(); *************** *** 1033,1036 **** --- 1046,1085 ---- } + private void drawPath(LinkedList<Space> path, boolean selection) { + LinkedList<Label> labels = new LinkedList<Label>(); + Label divider = new Label(">>"); + boolean first = true; + for (Space space : path) { + if (!first) { + labels.add(divider); + } else { + first = false; + } + labels.add(new SpaceBox(space)); + } + + int x = 5; + int y = (int) height - 15; + for (Label label : labels) { + label.setX(x); + label.setY(y); + x += label.width() + 6; + } + + gl.glColor3f(1, 0, 0); + gl.glPushMatrix(); + gl.glTranslated(0, 0, 0.5); + for (Label label : labels) { + if (selection) { + pushName(gl, label); + } + label.display(gl, glu, selection); + if (selection) { + popName(gl); + } + } + gl.glPopMatrix(); + } + /** * Draw the space path *************** *** 1046,1090 **** path.addFirst(active); } ! String name = ""; ! Iterator it = path.iterator(); ! if (it.hasNext()) { ! Space sp = (Space)it.next(); ! if (sp.getClassification() != null) { ! name = sp.getClassification().toString(); ! } else { ! name = sp.getName(); ! } ! int sepLength = glut.glutBitmapLength(GLUT.BITMAP_HELVETICA_12, " >> ");; ! int length = 0; ! int nameLength = glut.glutBitmapLength(GLUT.BITMAP_HELVETICA_12, name); ! if (selection) { ! drawClickBox(5 + length, height - 15, 0.5, ! nameLength, 10, new ClickBox(sp)); ! } ! length = nameLength; ! while (it.hasNext()) { ! sp = (Space)it.next(); ! if (sp.getClassification() != null) { ! name = name + " >> " + sp.getClassification().toString(); ! } else { ! name = name + " >> " + sp.getName(); ! } ! length += sepLength; ! nameLength = glut.glutBitmapLength(GLUT.BITMAP_HELVETICA_12, sp.getName()); ! if (selection) { ! drawClickBox(5 + length, height - 15, 0.5, ! nameLength, 10, new ClickBox(sp)); ! } ! length += nameLength; ! } ! } ! if (!selection) { ! gl.glColor3d(1.0, 0.0, 0.0); ! gl.glPushMatrix(); ! gl.glTranslated(5, height - 15, 0.5); ! gl.glRasterPos2i(0, 0); ! glut.glutBitmapString(GLUT.BITMAP_HELVETICA_12, name); ! gl.glPopMatrix(); ! } } --- 1095,1099 ---- path.addFirst(active); } ! drawPath(path, selection); } *************** *** 3387,3389 **** --- 3396,3414 ---- this.glObjects3D.add(glo); } + + /** + * + * @param widget Widget + */ + public void add(Widget widget) { + widgets.add(widget); + } + + /** + * + * @param widget Widget + */ + public void remove(Widget widget) { + widgets.remove(widget); + } } |
|
From: Michael L. <he...@us...> - 2007-01-26 14:05:11
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4636/src/net/sourceforge/bprocessor/gl/model Added Files: SpaceBox.java Widget.java Label.java Log Message: Widgets are being implemented --- NEW FILE: SpaceBox.java --- //--------------------------------------------------------------------------------- // $Id: SpaceBox.java,v 1.1 2007/01/26 14:04:56 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gl.model; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; /** * */ public class SpaceBox extends Label { private Space space; /** * Create SpaceBox for specified space * @param space Space */ public SpaceBox(Space space) { super(space.getDisplayName()); } /** * Returns the space. * @return the space. */ public Space space() { return space; } /** * {@inheritDoc} */ public void action() { Project.getInstance().setActiveSpace(space); } } --- NEW FILE: Widget.java --- //--------------------------------------------------------------------------------- // $Id: Widget.java,v 1.1 2007/01/26 14:04:56 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gl.model; import javax.media.opengl.GL; import javax.media.opengl.glu.GLU; /** * Widget represents button-like 2d objects, displayed * on top of the 3d model. * * The x y coordinates are the top-left corner. */ public abstract class Widget { private int x; private int y; /** * Sets the x coordinate. * @param x the new x coordinate */ public void setX(int x) { this.x = x; } /** * Sets the y coordinate. * @param y the new y coordinate */ public void setY(int y) { this.y = y; } /** * Returns the x coordinate. * @return the x coordinate */ public int getX() { return x; } /** * Returns the y coordinate. * @return the y coordinate */ public int getY() { return y; } /** * Displays this Widget in the local coordinatesystem of this Widget. * @param gl the GL containing the OpenGL interface. * @param glu the GLU containing the GLU interface. */ public abstract void draw(GL gl, GLU glu); /** * Performs the action for this Widget. */ public void action() { } /** * Displays this Widget for hit detection * in the local coordinatesystem of this Widget. * @param gl the GL containing the OpenGL interface. * @param glut the GLU containing the GLU interface. */ public void drawHit(GL gl, GLU glut) { int width = width(); int height = height(); gl.glBegin(GL.GL_POLYGON); gl.glVertex3d(0, 0, 0); gl.glVertex3d(width, 0, 0); gl.glVertex3d(width, height, 0); gl.glVertex3d(0, height, 0); gl.glEnd(); } /** * Returns the computed width of this Widget. * @return the computed width. */ public abstract int width(); /** * Returns the computed height of this Widget. * @return the computed height. */ public abstract int height(); /** * Displays this Widget in the global coordinatesystem of the window. * @param gl the GL containing the OpenGL interface. * @param glu the GLU containing the GLU interface. * @param selection true if selection-mode is applied */ public void display(GL gl, GLU glu, boolean selection) { gl.glPushMatrix(); gl.glTranslatef(x, y, 0); if (selection) { drawHit(gl, glu); } else { //drawHit(gl, glu); draw(gl, glu); } gl.glPopMatrix(); } } --- NEW FILE: Label.java --- //--------------------------------------------------------------------------------- // $Id: Label.java,v 1.1 2007/01/26 14:04:56 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gl.model; import javax.media.opengl.GL; import javax.media.opengl.glu.GLU; import com.sun.opengl.util.GLUT; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Vertex; /** * */ public class Label extends Widget { private String label; /** * Creates a label. * @param label the label */ public Label(String label) { this.label = label; } /** {@inheritDoc} */ public void draw(GL gl, GLU glu) { GLUT glut = new GLUT(); gl.glRasterPos2i(0, 0); glut.glutBitmapString(GLUT.BITMAP_HELVETICA_12, label); } /** {@inheritDoc} */ @Override public int height() { return 12; } /** {@inheritDoc} */ public int width() { GLUT glut = new GLUT(); return glut.glutBitmapLength(GLUT.BITMAP_HELVETICA_12, label); } /** {@inheritDoc} */ public Plane getPlane() { // TODO Auto-generated method stub return null; } /** {@inheritDoc} */ public Vertex intersection(Edge e) { // TODO Auto-generated method stub return null; } /** * {@inheritDoc} */ public String toString() { return label; } } |
|
From: Michael L. <he...@us...> - 2007-01-26 14:05:06
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4636/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java Log Message: Widgets are being implemented Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** AbstractTool.java 25 Jan 2007 12:29:56 -0000 1.109 --- AbstractTool.java 26 Jan 2007 14:04:57 -0000 1.110 *************** *** 16,19 **** --- 16,20 ---- import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; + import net.sourceforge.bprocessor.gl.model.Widget; import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.gl.GLView; *************** *** 367,371 **** orbit.pressed(e); } else { ! if (o instanceof ClickBox) { ClickBox clickbox = (ClickBox) o; Project.getInstance().setActiveSpace(clickbox.space()); --- 368,375 ---- orbit.pressed(e); } else { ! if (o instanceof Widget) { ! Widget widget = (Widget) o; ! widget.action(); ! } else if (o instanceof ClickBox) { ClickBox clickbox = (ClickBox) o; Project.getInstance().setActiveSpace(clickbox.space()); |
|
From: Michael L. <he...@us...> - 2007-01-25 12:29:59
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv678/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java Log Message: Fixed style-error Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** AbstractTool.java 25 Jan 2007 12:14:26 -0000 1.108 --- AbstractTool.java 25 Jan 2007 12:29:56 -0000 1.109 *************** *** 14,18 **** import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; - import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; --- 14,17 ---- |
|
From: Michael L. <he...@us...> - 2007-01-25 12:23:05
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30691/src/net/sourceforge/bprocessor/gl/tool Modified Files: SelectStrategy.java Log Message: Double-click on union initiates edit Index: SelectStrategy.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectStrategy.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SelectStrategy.java 3 Dec 2006 17:48:17 -0000 1.5 --- SelectStrategy.java 25 Jan 2007 12:23:04 -0000 1.6 *************** *** 19,23 **** --- 19,25 ---- import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; + import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 102,106 **** target = view.getObjectAtPoint(x, y, View.OBJECTS); if (e.getClickCount() >= 2) { ! if (target instanceof Surface) { Surface surface = (Surface) target; if (surface.getBackDomain() != null) { --- 104,111 ---- target = view.getObjectAtPoint(x, y, View.OBJECTS); if (e.getClickCount() >= 2) { ! if (target instanceof Space) { ! Space space = (Space) target; ! Project.getInstance().setActiveSpace(space); ! } else if (target instanceof Surface) { Surface surface = (Surface) target; if (surface.getBackDomain() != null) { |
|
From: Michael L. <he...@us...> - 2007-01-25 12:14:43
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27109/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Refactored ClickBox related code Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.174 retrieving revision 1.175 diff -C2 -d -r1.174 -r1.175 *** View.java 25 Jan 2007 10:20:52 -0000 1.174 --- View.java 25 Jan 2007 12:14:30 -0000 1.175 *************** *** 8,11 **** --- 8,12 ---- import net.sourceforge.bprocessor.gl.GLView; + import net.sourceforge.bprocessor.gl.tool.ClickBox; import net.sourceforge.bprocessor.gl.tool.SpaceTool; import net.sourceforge.bprocessor.gl.model.GlObject; *************** *** 355,359 **** private Set highligts; ! /** GL objects that are in the model */ private Set glObjects3D; --- 356,362 ---- private Set highligts; ! /** GL objects that are in the model ! * FIXME this should be a list to be able to control ordering. ! */ private Set glObjects3D; *************** *** 456,462 **** } } ! ! ! /** * The constructor --- 459,463 ---- } } ! /** * The constructor *************** *** 929,936 **** if (object instanceof Space) { Space space = (Space) object; ! Collection<Surface> envelope = space.getEnvelope(); ! for (Surface surface : envelope) { ! highligts.addAll(surface.getEdges()); ! invisibles.add(surface); } } else { --- 930,947 ---- if (object instanceof Space) { Space space = (Space) object; ! if (space.isUnion()) { ! for (Space element : (Collection<Space>) space.getElements()) { ! Collection<Surface> envelope = element.getEnvelope(); ! for (Surface surface : envelope) { ! highligts.addAll(surface.getEdges()); ! invisibles.add(surface); ! } ! } ! } else { ! Collection<Surface> envelope = space.getEnvelope(); ! for (Surface surface : envelope) { ! highligts.addAll(surface.getEdges()); ! invisibles.add(surface); ! } } } else { *************** *** 1049,1053 **** if (selection) { drawClickBox(5 + length, height - 15, 0.5, ! nameLength, 10, sp); } length = nameLength; --- 1060,1064 ---- if (selection) { drawClickBox(5 + length, height - 15, 0.5, ! nameLength, 10, new ClickBox(sp)); } length = nameLength; *************** *** 1063,1067 **** if (selection) { drawClickBox(5 + length, height - 15, 0.5, ! nameLength, 10, sp); } length += nameLength; --- 1074,1078 ---- if (selection) { drawClickBox(5 + length, height - 15, 0.5, ! nameLength, 10, new ClickBox(sp)); } length += nameLength; |
|
From: Michael L. <he...@us...> - 2007-01-25 12:14:39
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27109/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java Added Files: ClickBox.java Log Message: Refactored ClickBox related code --- NEW FILE: ClickBox.java --- //--------------------------------------------------------------------------------- // $Id: ClickBox.java,v 1.1 2007/01/25 12:14:30 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gl.tool; import net.sourceforge.bprocessor.model.Space; /** * ClickBox represents space-path labels. This class * should be an extension of GLObject. */ public class ClickBox { private Space space; /** * @param space Space */ public ClickBox(Space space) { this.space = space; } /** * @return space */ public Space space() { return space; } } Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** AbstractTool.java 25 Jan 2007 10:20:52 -0000 1.107 --- AbstractTool.java 25 Jan 2007 12:14:26 -0000 1.108 *************** *** 360,363 **** --- 360,364 ---- previousPos[0] = pressPos[0]; previousPos[1] = pressPos[1]; + Object o = glv.getView().getObjectAtPoint(e.getX(), e.getY(), View.OBJECTS); if (e.getButton() == MouseEvent.BUTTON2) { glv.setCursor(dragCursor); *************** *** 367,371 **** orbit.pressed(e); } else { ! pressed(e); } } --- 368,377 ---- orbit.pressed(e); } else { ! if (o instanceof ClickBox) { ! ClickBox clickbox = (ClickBox) o; ! Project.getInstance().setActiveSpace(clickbox.space()); ! } else { ! pressed(e); ! } } } |
|
From: Michael L. <he...@us...> - 2007-01-25 10:21:05
|
Update of /cvsroot/bprocessor/test/input In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11966/input Added Files: surfaces1000.xml Log Message: Hit-detection improved --- NEW FILE: surfaces1000.xml --- <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <bmodel> <active>1</active> <cs>9006</cs> <name>new project</name> <space transparent="false" type="1" level="2" voidref="2" name="Project" progid="0" id="1"> <description/> <Classification>unassigned</Classification> <constructor xsi:type="CoordinateSystemType" onlyplane="false" active="true" editable="true" progid="1" id="9006" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <vertex z="0.0" y="0.0" x="0.0" id="9007"/> <ijn> <vertex z="0.0" y="0.0" x="1.0" id="9003"/> <vertex z="0.0" y="1.0" x="0.0" id="9004"/> <vertex z="1.0" y="0.0" x="0.0" id="9005"/> </ijn> </constructor> <space transparent="false" type="1" level="3" name="Void" progid="1" id="2"> <description/> <Classification>unassigned</Classification> [...31984 lines suppressed...] <vertex z="0.4" y="1.0" x="1.0" progid="4044" id="8986"/> <vertex z="0.3" y="-1.0" x="1.0" progid="4045" id="8987"/> <vertex z="0.3" y="-1.0" x="-1.0" progid="4046" id="8988"/> <vertex z="0.3" y="1.0" x="-1.0" progid="4047" id="8989"/> <vertex z="0.3" y="1.0" x="1.0" progid="4048" id="8990"/> <vertex z="0.2" y="-1.0" x="1.0" progid="4049" id="8991"/> <vertex z="0.2" y="-1.0" x="-1.0" progid="4050" id="8992"/> <vertex z="0.2" y="1.0" x="-1.0" progid="4051" id="8993"/> <vertex z="0.2" y="1.0" x="1.0" progid="4052" id="8994"/> <vertex z="0.1" y="-1.0" x="1.0" progid="4053" id="8995"/> <vertex z="0.1" y="-1.0" x="-1.0" progid="4054" id="8996"/> <vertex z="0.1" y="1.0" x="-1.0" progid="4055" id="8997"/> <vertex z="0.1" y="1.0" x="1.0" progid="4056" id="8998"/> <vertex z="0.0" y="-1.0" x="1.0" progid="4057" id="8999"/> <vertex z="0.0" y="-1.0" x="-1.0" progid="4058" id="9000"/> <vertex z="0.0" y="1.0" x="-1.0" progid="4059" id="9001"/> <vertex z="0.0" y="1.0" x="1.0" progid="4060" id="9002"/> </space> </bmodel> |
|
From: Michael L. <he...@us...> - 2007-01-25 10:21:05
|
Update of /cvsroot/bprocessor/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11966 Added Files: benchmark.sh Log Message: Hit-detection improved --- NEW FILE: benchmark.sh --- #!/bin/sh CLASSPATH="dist/test.jar:lib/model.jar:lib/jaxb.jar:lib/log4j.jar" CLASS="net.sourceforge.bprocessor.test.NormalsBenchmark" echo '-- surfaces 1000 --' java -cp ${CLASSPATH} ${CLASS} input/surfaces1000.xml |
|
From: Michael L. <he...@us...> - 2007-01-25 10:21:05
|
Update of /cvsroot/bprocessor/test/src/net/sourceforge/bprocessor/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11966/src/net/sourceforge/bprocessor/test Modified Files: SurfaceNormal.java Added Files: NormalsBenchmark.java Log Message: Hit-detection improved Index: SurfaceNormal.java =================================================================== RCS file: /cvsroot/bprocessor/test/src/net/sourceforge/bprocessor/test/SurfaceNormal.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SurfaceNormal.java 8 Dec 2006 10:55:20 -0000 1.1 --- SurfaceNormal.java 25 Jan 2007 10:21:04 -0000 1.2 *************** *** 47,51 **** while (iter.hasNext()) { Surface current = (Surface) iter.next(); ! Vertex normal = current.normal(); System.out.println(current.getName() + " normal: " + normal); } --- 47,51 ---- while (iter.hasNext()) { Surface current = (Surface) iter.next(); ! Vertex normal = current.normal0(); System.out.println(current.getName() + " normal: " + normal); } --- NEW FILE: NormalsBenchmark.java --- //--------------------------------------------------------------------------------- // $Id: NormalsBenchmark.java,v 1.1 2007/01/25 10:21:04 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.test; import java.io.File; import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Persistence; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; /** * */ public class NormalsBenchmark { private static int limit = 2000; private static class Benchmark { public void benchmark() { } public String name() { return this.getClass().getName(); } public void run() { System.out.println("running " + name()); long before = System.currentTimeMillis(); long after = before; int iterations = 0; while ((after - before) < limit) { benchmark(); iterations++; after = System.currentTimeMillis(); } double delta = (after - before); double ellapsed = delta / (double) iterations; long value = (long) (1000 * ellapsed); ellapsed = (double) value / 1000.0; System.out.println(" ellapsed " + ellapsed + "ms"); } } private static class Empty extends Benchmark { private Space space; public Empty(Space space) { this.space = space; } public void benchmark() { Collection surfaces = space.getSurfaces(); Iterator iter = surfaces.iterator(); int count = 0; while (iter.hasNext()) { Surface current = (Surface) iter.next(); count++; } } } private static class Count extends Benchmark { private Space space; public Count(Space space) { this.space = space; } public void benchmark() { Collection surfaces = space.getSurfaces(); Surface[] array = (Surface[]) surfaces.toArray(new Surface[0]); int count = 0; while (count < array.length) { Surface current = array[count]; count++; } } } private static class Compute extends Benchmark { private Space space; private Surface[] array; public Compute(Space space) { this.space = space; Collection surfaces = space.getSurfaces(); array = (Surface[]) surfaces.toArray(new Surface[0]); } public void benchmark() { int count = 0; while (count < array.length) { Surface current = array[count]; Vertex normal = current.normal0(); count++; } } } private static class Direction extends Benchmark { private Space space; private Surface[] array; private CoordinateSystem system; public Direction(Space space) { this.space = space; Collection surfaces = space.getSurfaces(); array = (Surface[]) surfaces.toArray(new Surface[0]); system = Project.getInstance().getActiveCoordinateSystem(); } public void benchmark() { int count = 0; while (count < array.length) { Surface current = array[count]; int direction = current.direction(system); count++; } } } private static class ToArray extends Benchmark { private Space space; public ToArray(Space space) { this.space = space; } public void benchmark() { Collection surfaces = space.getSurfaces(); Surface[] array = (Surface[]) surfaces.toArray(new Surface[0]); } } private static class LLToArray extends Benchmark { private Space space; private LinkedList list; public LLToArray(Space space) { this.space = space; Collection surfaces = space.getSurfaces(); list = new LinkedList(surfaces); } public void benchmark() { Surface[] array = (Surface[]) list.toArray(new Surface[0]); } } private static class Normals extends Benchmark { private Space space; public Normals(Space space) { this.space = space; } public void benchmark() { Collection surfaces = space.getSurfaces(); Iterator iter = surfaces.iterator(); while (iter.hasNext()) { Surface current = (Surface) iter.next(); Vertex normal = current.normal(); } } } /** * @param args args */ public static void main(String[] args) { File input = new File(args[0]); try { Persistence.load(input); Benchmark bench = new Normals(Project.getInstance().world()); bench.run(); bench = new Empty(Project.getInstance().world()); bench.run(); bench = new Count(Project.getInstance().world()); bench.run(); bench = new ToArray(Project.getInstance().world()); bench.run(); bench = new LLToArray(Project.getInstance().world()); bench.run(); bench = new Compute(Project.getInstance().world()); bench.run(); bench = new Direction(Project.getInstance().world()); bench.run(); } catch (Exception e) { e.printStackTrace(); } } /** * Prints the normals of the surfaces * @param surfaces collection of Surface whose normals are to be printed */ private static void printNormals(Collection surfaces) { List sorted = new LinkedList(surfaces); Entity.sort(sorted); Iterator iter = sorted.iterator(); while (iter.hasNext()) { Surface current = (Surface) iter.next(); Vertex normal = current.normal(); System.out.println(current.getName() + " normal: " + normal); } } } |
|
From: Michael L. <he...@us...> - 2007-01-25 10:20:56
|
Update of /cvsroot/bprocessor/model/src/etc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11947/src/etc Modified Files: bprocessor.xsd Log Message: Hit-detection improved Index: bprocessor.xsd =================================================================== RCS file: /cvsroot/bprocessor/model/src/etc/bprocessor.xsd,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** bprocessor.xsd 20 Jan 2007 21:24:45 -0000 1.26 --- bprocessor.xsd 25 Jan 2007 10:20:55 -0000 1.27 *************** *** 76,80 **** <xsd:element name="clipplanes" type="ClipplaneType" maxOccurs="unbounded" minOccurs="0"/> </xsd:sequence> ! <xsd:attribute name="name" type="xsd:string" use="required"/> </xsd:extension> </xsd:complexContent> --- 76,80 ---- <xsd:element name="clipplanes" type="ClipplaneType" maxOccurs="unbounded" minOccurs="0"/> </xsd:sequence> ! <xsd:attribute name="name" type="xsd:string" use="required"/> </xsd:extension> </xsd:complexContent> *************** *** 103,106 **** --- 103,107 ---- <xsd:attribute name="transparent" type="xsd:boolean" use="required"/> <xsd:attribute name="level" type="xsd:int" use="required"/> + <xsd:attribute name="union" type="xsd:boolean" use="optional"/> </xsd:extension> </xsd:complexContent> |