[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Space.java,1.17,1.18 LayerModellor.ja
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2006-02-08 10:10:25
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20100/src/net/sourceforge/bprocessor/model Modified Files: Space.java LayerModellor.java Project.java Attribute.java Log Message: Added Modellor to Space in D-View Implemented Parametric in LayerModellor Index: Attribute.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Attribute.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Attribute.java 2 Feb 2006 10:55:14 -0000 1.5 --- Attribute.java 8 Feb 2006 10:10:14 -0000 1.6 *************** *** 88,90 **** --- 88,98 ---- this.value = value; } + + /** + * Return string + * @return String + */ + public String toString() { + return (name + "[" + value) + "]"; + } } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Space.java 6 Feb 2006 07:41:23 -0000 1.17 --- Space.java 8 Feb 2006 10:10:14 -0000 1.18 *************** *** 34,37 **** --- 34,39 ---- /** The interior mesh */ private Mesh interior; + /** The modellor */ + private Modellor modellor; *************** *** 145,148 **** --- 147,165 ---- } + /** + * Get the modellor + * @return The modellor + */ + public Modellor getModellor() { + return modellor; + } + + /** + * Set the modellor + * @param modellor The modellor + */ + public void setModellor(Modellor modellor) { + this.modellor = modellor; + } /** *************** *** 248,250 **** --- 265,286 ---- return null; } + + /** + * Notify that this Space has changed + * FIXME: Make the change-update mechanism general + */ + public void changed() { + update(this); + super.changed(); + } + + /** + * Update this Space + * @param entity Changed entity + */ + public void update(Object entity) { + if (modellor != null) { + modellor.update(entity); + } + } } Index: LayerModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/LayerModellor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LayerModellor.java 7 Feb 2006 08:32:16 -0000 1.2 --- LayerModellor.java 8 Feb 2006 10:10:14 -0000 1.3 *************** *** 9,12 **** --- 9,15 ---- import java.util.HashSet; + import java.util.Iterator; + import java.util.LinkedList; + import java.util.List; import java.util.Set; *************** *** 14,18 **** * Modellor */ ! public class LayerModellor extends Modellor { /** The space */ --- 17,21 ---- * Modellor */ ! public class LayerModellor extends Modellor implements Parametric { /** The space */ *************** *** 58,60 **** --- 61,105 ---- return null; } + + /** + * Return name + * @return Name + */ + public String getName() { + return "Layer Modellor"; + } + + /** + * Set attributes + * @param attributes The attributes + */ + public void setAttributes(List attributes) { + Iterator iter = attributes.iterator(); + while (iter.hasNext()) { + Attribute current = (Attribute) iter.next(); + if (current.getName().equals("Layer Thickness")) { + Double thickness = (Double) current.getValue(); + distance = thickness.doubleValue(); + space.changed(); + } + } + } + + /** + * Get attributes + * @return The attributes + */ + public List getAttributes() { + LinkedList attributes = new LinkedList(); + attributes.add(new Attribute("Element Name", "Layer 1")); + attributes.add(new Attribute("Element Classification", "????")); + attributes.add(new Attribute("Element Specification", "????")); + attributes.add(new Attribute("Surface", surface.getName())); + attributes.add(new Attribute("Layer Thickness", new Double(distance))); + attributes.add(new Attribute("Layer Top Offset", new Double(0))); + attributes.add(new Attribute("Layer Bottom Offset", new Double(0))); + attributes.add(new Attribute("Next Layer", "NONE")); + attributes.add(new Attribute("Relation", "????")); + return attributes; + } } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Project.java 7 Feb 2006 12:49:59 -0000 1.35 --- Project.java 8 Feb 2006 10:10:14 -0000 1.36 *************** *** 205,208 **** --- 205,209 ---- HashSet edges = new HashSet(); HashSet surfaces = new HashSet(); + HashSet spaces = new HashSet(); { Iterator iter = vertices.iterator(); *************** *** 219,226 **** } } ! Iterator iter = surfaces.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! updateConstraints(current); } } --- 220,248 ---- } } ! { ! Iterator iter = surfaces.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! if (current.getBackDomain() != null) { ! spaces.add(current.getBackDomain()); ! } ! if (current.getFrontDomain() != null) { ! spaces.add(current.getFrontDomain()); ! } ! } ! } ! { ! Iterator iter = surfaces.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! updateConstraints(current); ! } ! } ! { ! Iterator iter = spaces.iterator(); ! while (iter.hasNext()) { ! Space current = (Space) iter.next(); ! current.update(current); ! } } } |