bprocessor-commit Mailing List for B-processor (Page 10)
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-08-31 13:48:10
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/monitor In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv20218/src/net/sourceforge/bprocessor/model/sense/monitor Log Message: Directory /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/monitor added to the repository |
From: Michael L. <he...@us...> - 2010-08-31 13:48:10
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/core In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv20256/src/net/sourceforge/bprocessor/model/sense/core Added Files: History.java Target.java package.html Sensor.java Provider.java Consumer.java Producer.java Measurement.java Log Message: --- NEW FILE: Producer.java --- package net.sourceforge.bprocessor.model.sense.core; import java.util.LinkedList; import java.util.List; public class Producer { private List<Consumer> consumers; public Producer() { consumers = new LinkedList<Consumer>(); } public void add(Consumer consumer) { consumers.add(consumer); } public void remove(Consumer consumer) { consumers.remove(consumer); } public void consume(Measurement value) { for (Consumer current : consumers) { current.consume(value); } } } --- NEW FILE: Measurement.java --- package net.sourceforge.bprocessor.model.sense.core; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Measurement { private long time; private String value; public Measurement() { } public Measurement(long time, String value) { this.time = time; this.value = value; } public void setTime(long value) { time = value; } public long getTime() { return time; } public void setValue(String string) { value = string; } public String getValue() { return value; } public String toString() { DateFormat format = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss"); String str = format.format(new Date(time)); return "(" + str + " | " + value + ")"; } } --- NEW FILE: History.java --- package net.sourceforge.bprocessor.model.sense.core; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; public abstract class History { public abstract List<Measurement> fetch(Target target, Sensor sensor, Date from); public abstract List<Measurement> fetch(Target target, Sensor sensor, Date from, Date to); public Map<Sensor, List<Measurement>> fetch(Target target, Date from) { Map<Sensor, List<Measurement>> result = new HashMap<Sensor, List<Measurement>>(); for (Sensor current : target.getSensors()) { result.put(current, fetch(target, current, from)); } return result; } public Map<Sensor, List<Measurement>> fetch(Target target, Date from, Date to) { Map<Sensor, List<Measurement>> result = new HashMap<Sensor, List<Measurement>>(); for (Sensor current : target.getSensors()) { result.put(current, fetch(target, current, from, to)); } return result; } } --- NEW FILE: Sensor.java --- package net.sourceforge.bprocessor.model.sense.core; public class Sensor { private String id; private String type; public Sensor() { } public Sensor(String id, String type) { this.id = id; this.type = type; } public void setId(String value) { id = value; } public String getId() { return id; } public void setType(String value) { type = value; } public String getType() { return type; } } --- NEW FILE: Target.java --- package net.sourceforge.bprocessor.model.sense.core; import java.util.LinkedList; import java.util.List; public class Target { private String id; List<Sensor> sensors; public Target() { } public Target(String id) { this.id = id; sensors = new LinkedList<Sensor>(); } public void setId(String value) { id = value; } public String getId() { return id; } public void setSensors(List<Sensor> value) { sensors = value; } public List<Sensor> getSensors() { return sensors; } } --- NEW FILE: package.html --- <body> Defines the package that contains the model </body> --- NEW FILE: Provider.java --- package net.sourceforge.bprocessor.model.sense.core; public class Provider { } --- NEW FILE: Consumer.java --- package net.sourceforge.bprocessor.model.sense.core; public abstract class Consumer { public abstract void consume(Measurement value); } |
From: Michael L. <he...@us...> - 2010-08-31 13:48:08
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/brunata In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv20218/src/net/sourceforge/bprocessor/model/sense/brunata Log Message: Directory /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/brunata added to the repository |
From: Michael L. <he...@us...> - 2010-08-31 13:48:07
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/core In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv20218/src/net/sourceforge/bprocessor/model/sense/core Log Message: Directory /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/core added to the repository |
From: Michael L. <he...@us...> - 2010-08-31 13:48:06
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/brunata/xml In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv20218/src/net/sourceforge/bprocessor/model/sense/brunata/xml Log Message: Directory /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/brunata/xml added to the repository |
From: Sebastian G. <sg...@us...> - 2010-07-17 21:19:40
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv1012/src/net/sourceforge/bprocessor/model Modified Files: Command.java Log Message: Questions to Michael as comments Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** Command.java 13 Jul 2010 12:33:52 -0000 1.94 --- Command.java 17 Jul 2010 21:19:32 -0000 1.95 *************** *** 1810,1813 **** --- 1810,1814 ---- */ public Frame(Space net) { + // Space net is the B-Net which is part of the construction space, it is saved as the parameter "net" parameters.put("net", net); parameters.put("frame-width", 0.035); *************** *** 1824,1831 **** --- 1825,1834 ---- */ public String title() { + // this is the title shown on top of the parameters section return "Frame Net"; } private List<Edge> simplify(List<Edge> edges) { + // what exactly do you simplify here and why? if (edges.size() > 3) { List<Edge> result = new LinkedList(); *************** *** 1838,1846 **** 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); } --- 1841,1849 ---- Vertex next = null; for (int i = 0; i < n; i++) { ! next = vertices.get((i + 1) % n); // the reuslt is always i+1, only if i is already the last edge in the list, the operation will return 0 Vertex u = current.minus(previous); Vertex v = next.minus(current); Vertex cross = u.cross(v); ! if (!cross.isZero()) { //this excludes parallel vectors and vectors of length 0 live.add(current); } *************** *** 1876,1880 **** HashMap map = new HashMap(); for (Surface current : net.getSurfaces()) { ! surfaces.add((Surface) current.copy(map)); } } --- 1879,1883 ---- HashMap map = new HashMap(); for (Surface current : net.getSurfaces()) { ! surfaces.add((Surface) current.copy(map)); //what happens here? } } *************** *** 1882,1900 **** { ! Inverse inv = new Inverse(surfaces); for (Edge current : inv.edges()) { Collection<Surface> adjacant = inv.surfaces(current); ! if (adjacant.size() == 1) { boundary.add(current); } } ! boundary = Offset.order(boundary); } Offset.offsetIt(boundary, -inside + (delta / 2)); ! Space union = (Space) net.getOwner().find("Frame"); if (union == null) { --- 1885,1903 ---- { ! Inverse inv = new Inverse(surfaces); // inverse? for (Edge current : inv.edges()) { Collection<Surface> adjacant = inv.surfaces(current); ! if (adjacant.size() == 1) { // if an edge only is adjacent to 1 surface it is a border edge boundary.add(current); } } ! boundary = Offset.order(boundary); //order? does offset basically create a copy here? } Offset.offsetIt(boundary, -inside + (delta / 2)); ! Space union = (Space) net.getOwner().find("Frame"); //check if the frame is created or redrawn... if (union == null) { *************** *** 1907,1918 **** Collection<Surface> inserted = new LinkedList(); ! List<Edge> offset = Offset.offset(boundary, inside - (delta / 2)); Surface exterior = new Surface(simplify(offset)); inserted.add(exterior); ! List<Surface> interior = new LinkedList(); for (Surface current : surfaces) { ! List<Edge> curve = Offset.offset(current.getEdges(), -delta / 2); interior.add(new Surface(simplify(curve))); } --- 1910,1921 ---- Collection<Surface> inserted = new LinkedList(); ! List<Edge> offset = Offset.offset(boundary, inside - (delta / 2)); //offset the boundary to the inside by the frame width minus half the interior width Surface exterior = new Surface(simplify(offset)); inserted.add(exterior); ! //does this mean that the boundary edges are now basically moved inside and the next step is to move all edges inside? List<Surface> interior = new LinkedList(); for (Surface current : surfaces) { ! List<Edge> curve = Offset.offset(current.getEdges(), -delta / 2); //offset all surfaces by half the interior width interior.add(new Surface(simplify(curve))); } *************** *** 1934,1942 **** } ! Shape.addSurfacesTo(union, inserted); { Space ext = Item.createFunctionalSpace(exteriorName); Space frame = Item.createConstructionSpace(frameName); if (depth > 0) { exterior.assignBack(ext, true); --- 1937,1946 ---- } ! Shape.addSurfacesTo(union, inserted); //add geometry to the space { Space ext = Item.createFunctionalSpace(exteriorName); Space frame = Item.createConstructionSpace(frameName); + // ?????????????? What happens here? Do you assign the surface sides to the adjacent spaces? These are named in the paramters, right? if (depth > 0) { exterior.assignBack(ext, true); *************** *** 1955,1958 **** --- 1959,1963 ---- double sign; if (n1.dot(n2) < 0) { + //what does the dot product of two vectors tell me? sign = -depth; } else { |
From: Michael L. <he...@us...> - 2010-07-13 12:34:03
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11530/src/net/sourceforge/bprocessor/model Modified Files: Command.java Project.java Log Message: Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** Command.java 13 Jul 2010 09:32:43 -0000 1.93 --- Command.java 13 Jul 2010 12:33:52 -0000 1.94 *************** *** 28,32 **** public Command() { parameters = new ParameterBlock(); - // Comment } --- 28,31 ---- *************** *** 74,77 **** --- 73,92 ---- */ public abstract void evaluate(); + + /** + * Return true if this command depends on the specified geometric + * @param geometric Geometric to test dependence on + * @return true if this command depends on the geometric + */ + public boolean depends(Geometric geometric) { + if (parameters != null) { + for (Attribute current : parameters.getAttributes()) { + if (geometric == current.getValue()) { + return true; + } + } + } + return false; + } /** {@inheritDoc} */ *************** *** 151,155 **** parameters.put("name", ""); } ! /** * {@inheritDoc} --- 166,170 ---- parameters.put("name", ""); } ! /** * {@inheritDoc} *************** *** 1790,1795 **** */ public static class Frame extends Command { - private Space net; - /** * Constructs a frame command --- 1805,1808 ---- *************** *** 1797,1801 **** */ public Frame(Space net) { ! this.net = net; parameters.put("frame-width", 0.035); parameters.put("interior-width", 0.035); --- 1810,1814 ---- */ public Frame(Space net) { ! parameters.put("net", net); parameters.put("frame-width", 0.035); parameters.put("interior-width", 0.035); *************** *** 1851,1854 **** --- 1864,1868 ---- @Override public void evaluate() { + Space net = (Space) parameters.get("net"); double inside = parameters.getDouble("frame-width"); double delta = parameters.getDouble("interior-width"); *************** *** 1882,1886 **** Offset.offsetIt(boundary, -inside + (delta / 2)); ! Space union = Item.createUnion("Frame"); Collection<Surface> inserted = new LinkedList(); --- 1896,1907 ---- Offset.offsetIt(boundary, -inside + (delta / 2)); ! Space union = (Space) net.getOwner().find("Frame"); ! ! if (union == null) { ! union = Item.createUnion("Frame"); ! net.getOwner().add(union); ! } else { ! union.clear(); ! } Collection<Surface> inserted = new LinkedList(); *************** *** 1966,1972 **** } } - - - net.getOwner().add(union); } } --- 1987,1990 ---- Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.194 retrieving revision 1.195 diff -C2 -d -r1.194 -r1.195 *** Project.java 20 May 2010 12:02:03 -0000 1.194 --- Project.java 13 Jul 2010 12:33:52 -0000 1.195 *************** *** 696,699 **** --- 696,716 ---- } + /** + * Propagate changes by evaluating scripts in the owner of the specified geometric that depends + * on it. + * @param geometric Geometric that changed + */ + public void propagate(Geometric geometric) { + Space owner = geometric.getOwner(); + if (owner != null) { + for (Command current : owner.getScripts()) { + if (current.depends(geometric)) { + current.evaluate(); + } + } + } + } + + /** |
From: Michael L. <he...@us...> - 2010-07-13 12:34:03
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11548/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.150 retrieving revision 1.151 diff -C2 -d -r1.150 -r1.151 *** GenericTreeView.java 21 May 2010 07:28:54 -0000 1.150 --- GenericTreeView.java 13 Jul 2010 12:33:55 -0000 1.151 *************** *** 42,46 **** import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Camera; - import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; --- 42,45 ---- *************** *** 707,710 **** --- 706,718 ---- } + + private Collection<Geometric> constructorsOf(Space owner) { + return (Collection) owner.getConstructors(); + } + + private Collection<Item> elementsOf(Space owner) { + return owner.getElements(); + } + /** * *************** *** 726,731 **** add(new EnvelopeContainer("Envelope", space)); String lvlstr = Space.levelToString(space.getLevel() + 1); ! add(new ElementContainer(lvlstr + "s", space.getElements())); ! CompositeNode cn = new ConstructorContainer("Constructors", space.getConstructors()); add(cn); add(new ScriptContainer("Scripts", space.getScripts(), false)); --- 734,739 ---- add(new EnvelopeContainer("Envelope", space)); String lvlstr = Space.levelToString(space.getLevel() + 1); ! add(new ElementContainer(lvlstr + "s", elementsOf(space))); ! CompositeNode cn = new ConstructorContainer("Constructors", constructorsOf(space)); add(cn); add(new ScriptContainer("Scripts", space.getScripts(), false)); *************** *** 885,889 **** * @param constructor The constructor */ ! public ConstructorNode(Constructor constructor) { super(constructor); if (constructor instanceof CoordinateSystem) { --- 893,897 ---- * @param constructor The constructor */ ! public ConstructorNode(Geometric constructor) { super(constructor); if (constructor instanceof CoordinateSystem) { *************** *** 1211,1215 **** * @param constructors The constructors */ ! public ConstructorContainer(String name, Collection<Constructor> constructors) { super(name, constructors, true); } --- 1219,1223 ---- * @param constructors The constructors */ ! public ConstructorContainer(String name, Collection<Geometric> constructors) { super(name, constructors, true); } *************** *** 1217,1221 **** /** {@inheritDoc} */ public EntityNode nodeFor(Object entity) { ! return new ConstructorNode((Constructor) entity); } } --- 1225,1229 ---- /** {@inheritDoc} */ public EntityNode nodeFor(Object entity) { ! return new ConstructorNode((Geometric) entity); } } |
From: Michael L. <he...@us...> - 2010-07-13 12:33:57
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11501/src/net/sourceforge/bprocessor/gl/tool Modified Files: FinalMoveTool.java Pencil.java Log Message: Index: Pencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Pencil.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Pencil.java 20 May 2010 10:58:51 -0000 1.25 --- Pencil.java 13 Jul 2010 12:33:48 -0000 1.26 *************** *** 82,85 **** --- 82,86 ---- if (start.vertex().equalEps(current.vertex())) { Project.getInstance().getActiveSpace().insert(current.vertex()); + Project.getInstance().propagate(Project.getInstance().getActiveSpace()); Project.getInstance().changed(); Project.getInstance().checkpoint(); *************** *** 101,104 **** --- 102,107 ---- boolean finish = !Geometry.insertEdges(edges).isEmpty() || exsGeometry; + Project.getInstance().propagate(Project.getInstance().getActiveSpace()); + Project.getInstance().changed(); Project.getInstance().checkpoint(); Index: FinalMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** FinalMoveTool.java 5 Feb 2010 13:32:59 -0000 1.57 --- FinalMoveTool.java 13 Jul 2010 12:33:48 -0000 1.58 *************** *** 161,164 **** --- 161,165 ---- private Collection<Vertex> vertices; private Map<Vertex, Vertex> originals; + private Set<Geometric> owners; /** *************** *** 172,175 **** --- 173,180 ---- originals.put(current, current.copy()); } + owners = new HashSet(); + for (Vertex current : vertices) { + owners.add(current.getOwner()); + } } *************** *** 186,189 **** --- 191,197 ---- } } + for (Geometric current : owners) { + Project.getInstance().propagate(current); + } } |
From: Michael L. <he...@us...> - 2010-07-13 12:33:56
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11501/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.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** PopupMenu.java 13 Jul 2010 09:32:39 -0000 1.47 --- PopupMenu.java 13 Jul 2010 12:33:48 -0000 1.48 *************** *** 352,355 **** --- 352,356 ---- Command command = new Command.Frame(space); AttributeView.instance().display(command); + space.getOwner().add(command); } }; |
From: Michael L. <he...@us...> - 2010-07-13 09:32:58
|
Update of /cvsroot/bprocessor/facade In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv12846 Modified Files: .classpath Log Message: Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/facade/.classpath,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** .classpath 3 Dec 2006 17:45:31 -0000 1.7 --- .classpath 13 Jul 2010 09:32:46 -0000 1.8 *************** *** 4,8 **** <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="lib" path="/tools/log4j/log4j.jar"/> - <classpathentry combineaccessrules="false" kind="src" path="/gl"/> <classpathentry combineaccessrules="false" kind="src" path="/gui"/> <classpathentry combineaccessrules="false" exported="true" kind="src" path="/model"/> --- 4,7 ---- |
From: Michael L. <he...@us...> - 2010-07-13 09:32:56
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/command In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv12846/src/net/sourceforge/bprocessor/facade/command Added Files: Facade.java package.html Log Message: --- NEW FILE: package.html --- <body> Defines the package that contains the facade module </body> --- NEW FILE: Facade.java --- //--------------------------------------------------------------------------------- // $Id: Facade.java,v 1.1 2010/07/13 09:32:46 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.facade.command; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Command; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.ParameterBlock; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selector; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; /** * */ public class Facade extends Command { /** * {@inheritDoc} */ public String title() { return "Facade"; } /** * Constructor * @param net Net */ public Facade(Space net) { parameters.put("net", net); parameters.put("frame-width", 0.045); parameters.put("depth", 0.12); } /** * {@inheritDoc} */ public void evaluate() { HashMap<String, Object> env = parameters.evaluate(new HashMap()); Space net = (Space) env.get("net"); double frameWidth = (Double) env.get("frame-width"); double depth = (Double) env.get("depth"); Space owner = net.getOwner(); Space union = (Space) owner.find("Interior"); if (union == null) { union = Space.createUnion("Interior"); owner.add(union); } union.clear(); prepareNet(net, frameWidth); createSingleFacade(net, union, depth); Project.getInstance().changed(); } private void prepareNet(Space n, double frameWidth) { Collection<Edge> edges = n.getEdges(); for (Edge e : edges) { ParameterBlock parameters = e.getParameters(); if (parameters == null) { parameters = new ParameterBlock(); e.setParameters(parameters); } Map env = parameters.environment(); if (env.get("width") == null) { parameters.putDouble("width", frameWidth); } } for (Surface s : n.getSurfaces()) { ParameterBlock parameters = s.getParameters(); if (parameters == null) { parameters = new ParameterBlock(); s.setParameters(parameters); } Map env = parameters.environment(); if (env.get("type") == null) { List options = new LinkedList(); options.add("Glass"); options.add("Window"); options.add("Door"); Selector sel = new Selector(options); sel.setCurrentValue("Glass"); parameters.put(new Attribute("type", sel)); } } } private void createSingleFacade(Space net, Space space, double depth) { Space frame = Space.createConstructionSpace("Frame"); space.add(frame); if (net != null) { List<Edge> outline = netOutline(net); List<Edge> outlineCopies = new LinkedList<Edge>(); for (Edge e : outline) { outlineCopies.add(e.copy()); } if (!outlineCopies.isEmpty()) { /* make the shell of the facade */ Surface frameSurface = new Surface(outlineCopies); frameSurface = space.insert(frameSurface); //Geometry.assignSame(front, frameSurface, space, frame); Set sides1 = new HashSet(); Surface frameSurfEx = extrudeIntoSpace(space, frameSurface, depth, sides1); Geometry.holeAnalysis(frameSurfEx); for (Surface field : net.getSurfaces()) { Map<Edge, Double> offsetMap = new HashMap<Edge, Double>(); Map envF = field.getParameters().environment(); for (Edge e : field.getEdges()) { Map envE = e.getParameters().environment(); double width = ((Double)envE.get("width")).doubleValue(); if (outline.contains(e)) { offsetMap.put(e, -width); } else { offsetMap.put(e, -(width / 2)); } } Surface hole = new Surface(Edge.placeOffset(field.getEdges(), field, offsetMap)); hole = space.insert(hole); Space holeSpace = Space.createFunctionalSpace("Facade Hole"); space.add(holeSpace); //Geometry.assignSame(front, hole, space, holeSpace); Geometry.holeAnalysis(hole); Set sides2 = new HashSet(); Surface holeEx = space.insert(extrudeIntoSpace(space, hole, depth, sides2)); //assignOpposite(front, holeEx, space, holeSpace); Geometry.holeAnalysis(holeEx); //detailField(envF, hole, holeSpace); } } } } private Surface extrudeIntoSpace(Space space, Surface s, double delta, Set<Surface> sides) { int deltaCorrection = 1; // if (s.normal().dot(front.normal()) < 0) { // deltaCorrection *= -1; // } // if (front.getFrontDomain() != space) { // deltaCorrection *= -1; // } Set<Surface> tops = new HashSet<Surface>(); Surface top = s.extrusionall(delta * deltaCorrection, sides, tops); tops.addAll(sides); for (Surface surface : tops) { for (Edge edge : surface.getEdges()) { space.add(edge.getTo()); space.add(edge.getFrom()); space.add(edge); } space.add(surface); } return top; } private List<Edge> netOutline(Space net) { /*Find outer edges*/ Set<Edge> outer = new HashSet<Edge>(); for (Edge current : net.getEdges()) { if (current.getSurfaces().size() == 1) { outer.add(current); } } /*If there are outer edges sort them in order*/ if (!outer.isEmpty()) { LinkedList<Edge> outline = new LinkedList<Edge>(); Edge first = (Edge)outer.iterator().next(); outline.add(first); outer.remove(first); Vertex nextVertex = first.getTo(); boolean doneAll = false; while (!doneAll) { Edge next = null; for (Edge e : nextVertex.getEdges()) { if (outer.contains(e)) { next = (Edge)e; break; } } if (next != null) { outer.remove(next); nextVertex = next.otherVertex(nextVertex); outline.add(next); } else { doneAll = true; } } /*If all outer edges are in the outline, * and the last edge is connected to the first, * return the outline */ if (outer.isEmpty() && first.getFrom().getEdges().contains(outline.getLast())) { return outline; } } return new LinkedList<Edge>(); } } |
From: Michael L. <he...@us...> - 2010-07-13 09:32:51
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv12833/src/net/sourceforge/bprocessor/model Modified Files: ParameterBlock.java Command.java Item.java Log Message: Index: Item.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Item.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Item.java 20 May 2010 10:58:46 -0000 1.7 --- Item.java 13 Jul 2010 09:32:43 -0000 1.8 *************** *** 612,615 **** --- 612,622 ---- res.add(new Attribute("Modellor", getModellor())); } + res.add(new Attribute("Edit " + getKindName(), new Operation() { + @Override + public void perform() { + Space self = (Space) Item.this; + self.edit(); + } + })); return res; } Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** Command.java 21 May 2010 13:15:42 -0000 1.92 --- Command.java 13 Jul 2010 09:32:43 -0000 1.93 *************** *** 172,176 **** */ public static class OffsetNormal extends Command { - private Surface surface; /** * --- 172,175 ---- *************** *** 178,183 **** */ public OffsetNormal(Surface surface) { ! this.surface = surface; ! parameters.put("surface", surface); parameters.put("distance", 1.0); parameters.put("direction", ""); --- 177,183 ---- */ public OffsetNormal(Surface surface) { ! Space owner = surface.getOwner(); ! Reference reference = new Reference(surface, new LinkedList(owner.getSurfaces())); ! parameters.put("surface", reference); parameters.put("distance", 1.0); parameters.put("direction", ""); *************** *** 273,282 **** @Override public void evaluate() { ! Object value = parameters.get("surface"); ! System.out.println("value : " + value); Space owner = surface.getOwner(); ! double distance = parameters.getDouble("distance"); ! Space space = (Space) owner.find((String)parameters.get("direction")); boolean front = true; if (space != null) { --- 273,283 ---- @Override public void evaluate() { ! HashMap<String, Object> env = parameters.evaluate(new HashMap()); ! ! Surface surface = (Surface) env.get("surface"); Space owner = surface.getOwner(); ! double distance = (Double) env.get("distance"); ! Space space = (Space) owner.find((String)env.get("direction")); boolean front = true; if (space != null) { *************** *** 289,294 **** } ! boolean controlled = parameters.getBoolean("controlled"); ! boolean holes = parameters.getBoolean("holes"); System.out.println("offset " + distance + " in direction of " + space); --- 290,295 ---- } ! boolean controlled = (Boolean) env.get("controlled"); ! boolean holes = (Boolean) env.get("holes"); System.out.println("offset " + distance + " in direction of " + space); *************** *** 297,301 **** if (controlled) { - copy = offset(surface, space, distance); if (holes) { --- 298,301 ---- Index: ParameterBlock.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ParameterBlock.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ParameterBlock.java 12 Feb 2010 11:44:28 -0000 1.19 --- ParameterBlock.java 13 Jul 2010 09:32:43 -0000 1.20 *************** *** 170,173 **** --- 170,192 ---- return env; } + + /** + * Evaluate this ParamterBlock + * @param env the environment for the evaluation + * @return A HashMap + */ + public HashMap<String, Object> evaluate(HashMap<String, Object> env) { + HashMap<String, Object> result = new HashMap(env); + for (Attribute current : parameters) { + String key = current.getName(); + Object value = current.getValue(); + if (value instanceof Parameter) { + Parameter parameter = (Parameter) value; + value = parameter.evaluate(env); + } + result.put(key, value); + } + return result; + } /** |
From: Michael L. <he...@us...> - 2010-07-13 09:32:48
|
Update of /cvsroot/bprocessor/gl In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv12813 Modified Files: .classpath Log Message: Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/gl/.classpath,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** .classpath 25 May 2009 10:15:42 -0000 1.5 --- .classpath 13 Jul 2010 09:32:39 -0000 1.6 *************** *** 8,11 **** --- 8,12 ---- <classpathentry combineaccessrules="false" kind="src" path="/bscript"/> <classpathentry kind="lib" path="/tools/jogl/gluegen-rt.jar"/> + <classpathentry combineaccessrules="false" kind="src" path="/facade"/> <classpathentry kind="output" path="build"/> </classpath> |
From: Michael L. <he...@us...> - 2010-07-13 09:32:48
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv12813/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.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** PopupMenu.java 21 May 2010 13:14:36 -0000 1.46 --- PopupMenu.java 13 Jul 2010 09:32:39 -0000 1.47 *************** *** 357,360 **** --- 357,371 ---- } { + AbstractAction action = new SpaceMenuAction(sp, "Facade..") { + public void actionPerformed(ActionEvent event) { + // Command command = new Facade(space); + // AttributeView.instance().display(command); + // space.getOwner().add(command); + // Project.getInstance().changed(); + } + }; + menu.add(action); + } + { AbstractAction action = new SpaceMenuAction(sp, "Hyperbolic Paraboloid..") { public void actionPerformed(ActionEvent event) { |
From: Michael L. <he...@us...> - 2010-07-13 09:32:47
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/command In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv12798/src/net/sourceforge/bprocessor/facade/command Log Message: Directory /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/command added to the repository |
From: Michael L. <he...@us...> - 2010-05-21 13:15:50
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv1598/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.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** Command.java 21 May 2010 08:27:52 -0000 1.91 --- Command.java 21 May 2010 13:15:42 -0000 1.92 *************** *** 273,276 **** --- 273,279 ---- @Override public void evaluate() { + Object value = parameters.get("surface"); + System.out.println("value : " + value); + Space owner = surface.getOwner(); double distance = parameters.getDouble("distance"); |
From: Michael L. <he...@us...> - 2010-05-21 13:14:45
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv1470/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.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** PopupMenu.java 21 May 2010 07:29:01 -0000 1.45 --- PopupMenu.java 21 May 2010 13:14:36 -0000 1.46 *************** *** 124,136 **** { - AbstractAction action = new GeometricMenuAction(surfaces, "Smooth...") { - public void actionPerformed(ActionEvent event) { - Command command = new Command.Smooth((Surface) entities.iterator().next()); - AttributeView.instance().display(command); - } - }; - menu.add(action); - } - { AbstractAction action = new GeometricMenuAction(surfaces, "Offset Planar...") { public void actionPerformed(ActionEvent event) { --- 124,127 ---- *************** *** 138,141 **** --- 129,134 ---- Command command = new Command.Offset(surface.getEdges()); AttributeView.instance().display(command); + Project.getInstance().getActiveSpace().add(command); + Project.getInstance().changed(); } }; *************** *** 148,151 **** --- 141,146 ---- Command command = new Command.OffsetNormal(surface); AttributeView.instance().display(command); + Project.getInstance().getActiveSpace().add(command); + Project.getInstance().changed(); } }; *************** *** 158,161 **** --- 153,158 ---- Command command = new Command.Extrude(surface); AttributeView.instance().display(command); + Project.getInstance().getActiveSpace().add(command); + Project.getInstance().changed(); } }; *************** *** 173,186 **** } { - AbstractAction action = new GeometricMenuAction(surfaces, "Insert Frame...") { - public void actionPerformed(ActionEvent event) { - Surface surface = (Surface) entities.iterator().next(); - Command command = new Command.InsertFrame(surface); - AttributeView.instance().display(command); - } - }; - menu.add(action); - } - { AbstractAction action = new GeometricMenuAction(surfaces, "Tesselate") { public void actionPerformed(ActionEvent event) { --- 170,173 ---- |
From: Sebastian G. <sg...@us...> - 2010-05-21 08:28:03
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv26696/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.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** Command.java 21 May 2010 08:24:41 -0000 1.90 --- Command.java 21 May 2010 08:27:52 -0000 1.91 *************** *** 2844,2856 **** } - public static class SameSameByMichael extends Command { - - @Override - public void evaluate() { - // TODO Auto-generated method stub - - } - - } /** --- 2844,2847 ---- |
From: Michael L. <he...@us...> - 2010-05-21 08:24:49
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv26296/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.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** Command.java 21 May 2010 08:22:21 -0000 1.89 --- Command.java 21 May 2010 08:24:41 -0000 1.90 *************** *** 2844,2848 **** } ! public static class SomeCommandMichael extends Command { @Override --- 2844,2848 ---- } ! public static class SameSameByMichael extends Command { @Override |
From: Michael L. <he...@us...> - 2010-05-21 08:22:29
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv25937/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.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** Command.java 21 May 2010 08:20:37 -0000 1.88 --- Command.java 21 May 2010 08:22:21 -0000 1.89 *************** *** 2843,2847 **** --- 2843,2856 ---- } } + + public static class SomeCommandMichael extends Command { + @Override + public void evaluate() { + // TODO Auto-generated method stub + + } + + } /** |
From: Sebastian G. <sg...@us...> - 2010-05-21 08:20:45
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv25644/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.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** Command.java 21 May 2010 08:17:15 -0000 1.87 --- Command.java 21 May 2010 08:20:37 -0000 1.88 *************** *** 2351,2355 **** } } ! /** new command end * --- 2351,2355 ---- } } ! /** new command end * *************** *** 2844,2854 **** } - /** - * - */ - public static class OldCommandByMichael extends Command { - public void evaluate() { - } - } /** --- 2844,2847 ---- |
From: Michael L. <he...@us...> - 2010-05-21 08:17:23
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv25100/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.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** Command.java 21 May 2010 08:14:26 -0000 1.86 --- Command.java 21 May 2010 08:17:15 -0000 1.87 *************** *** 2847,2851 **** * */ ! public static class NewCommandByMichael extends Command { public void evaluate() { } --- 2847,2851 ---- * */ ! public static class OldCommandByMichael extends Command { public void evaluate() { } |
From: Michael L. <he...@us...> - 2010-05-21 08:14:34
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv24640/src/net/sourceforge/bprocessor/model Modified Files: Command.java Log Message: new command Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** Command.java 21 May 2010 07:28:57 -0000 1.85 --- Command.java 21 May 2010 08:14:26 -0000 1.86 *************** *** 2844,2847 **** --- 2844,2854 ---- } + /** + * + */ + public static class NewCommandByMichael extends Command { + public void evaluate() { + } + } /** |
From: Michael L. <he...@us...> - 2010-05-21 07:32:03
|
Update of /cvsroot/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv19204 Modified Files: build.xml Log Message: Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/model/build.xml,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** build.xml 19 May 2010 15:45:39 -0000 1.22 --- build.xml 21 May 2010 07:31:55 -0000 1.23 *************** *** 133,137 **** <checkstyle config="${tools.dir}/checkstyle/checkstyle.xml" ! failOnViolation="true"> <fileset dir="${src.dir}" includes="**/*.java" --- 133,137 ---- <checkstyle config="${tools.dir}/checkstyle/checkstyle.xml" ! failOnViolation="false"> <fileset dir="${src.dir}" includes="**/*.java" *************** *** 140,144 **** </target> ! <target name="compile" depends="copylib,compile-grammar,compile-xml"> <ant dir="src" target="compile"/> </target> --- 140,144 ---- </target> ! <target name="compile" depends="checkstyle,copylib,compile-grammar,compile-xml"> <ant dir="src" target="compile"/> </target> |