bprocessor-commit Mailing List for B-processor (Page 13)
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-02-12 14:36:52
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9738/src/net/sourceforge/bprocessor/model Modified Files: Instance.java Item.java Log Message: Index: Item.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Item.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Item.java 12 Feb 2010 11:44:28 -0000 1.4 --- Item.java 12 Feb 2010 14:36:40 -0000 1.5 *************** *** 608,619 **** res.add(new Attribute("ID", getId() != null ? getId().toString() : "", false)); res.add(new Attribute("Owner", getOwner(), false)); ! if (isConstructionSpace() || isFunctionalSpace()) { ! if (isTransparent()) { ! res.add(new Attribute("Transparent", Boolean.TRUE)); ! } else { ! res.add(new Attribute("Transparent", Boolean.FALSE)); } } - res.add(new Attribute("Material", new Reference(material(), materials))); res.add(new Attribute("Description", getDescription())); if (getModellor() != null) { --- 608,621 ---- res.add(new Attribute("ID", getId() != null ? getId().toString() : "", false)); res.add(new Attribute("Owner", getOwner(), false)); ! if (!(isUnion() || isNet() || isInstance())) { ! if (isConstructionSpace() || isFunctionalSpace()) { ! if (isTransparent()) { ! res.add(new Attribute("Transparent", Boolean.TRUE)); ! } else { ! res.add(new Attribute("Transparent", Boolean.FALSE)); ! } } + res.add(new Attribute("Material", new Reference(material(), materials))); } res.add(new Attribute("Description", getDescription())); if (getModellor() != null) { *************** *** 632,638 **** /** {@inheritDoc} */ public String title() { - if (isInstance()) { - return "Instance"; - } if (isUnion()) { return "Union"; --- 634,637 ---- Index: Instance.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Instance.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Instance.java 13 Jan 2010 10:58:34 -0000 1.13 --- Instance.java 12 Feb 2010 14:36:40 -0000 1.14 *************** *** 174,176 **** --- 174,181 ---- } + + /** {@inheritDoc} */ + public String title() { + return proto.getName(); + } } |
From: Michael L. <he...@us...> - 2010-02-12 13:04:28
|
Update of /cvsroot/bprocessor/model/src/etc In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv28852/src/etc Modified Files: bprocessor.xsd Log Message: Index: bprocessor.xsd =================================================================== RCS file: /cvsroot/bprocessor/model/src/etc/bprocessor.xsd,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** bprocessor.xsd 18 Sep 2009 10:16:21 -0000 1.47 --- bprocessor.xsd 12 Feb 2010 13:04:18 -0000 1.48 *************** *** 89,92 **** --- 89,94 ---- <xsd:element name="transforms" type="TransformType" maxOccurs="unbounded" minOccurs="0"/> <xsd:element name="anchor" type="CoordinateSystemType" maxOccurs="1" minOccurs="0"/> + <xsd:element name="attributes" type="MapElementType" maxOccurs="unbounded" minOccurs="0"/> + <xsd:element ref="space" maxOccurs="unbounded" minOccurs="0"/> <xsd:element ref="surface" maxOccurs="unbounded" minOccurs="0"/> |
From: Michael L. <he...@us...> - 2010-02-12 13:04:27
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv28852/src/net/sourceforge/bprocessor/model Modified Files: Persistence.java Log Message: Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** Persistence.java 5 Feb 2010 13:32:50 -0000 1.86 --- Persistence.java 12 Feb 2010 13:04:18 -0000 1.87 *************** *** 323,327 **** Map mapper, Collection xmls) { - String name = xml.getName(); int type = xml.getType(); --- 323,326 ---- *************** *** 431,434 **** --- 430,443 ---- } + private static ParameterBlock internalizeParameterBlock(List<MapElementType> xmls, Map map) { + List<Attribute> attributes = new LinkedList(); + for (MapElementType current : xmls) { + attributes.add(internalizeKeyValue(current, map)); + } + ParameterBlock block = new ParameterBlock(); + block.setAttributes(attributes); + return block; + } + private static ClassificationType internalizeClassificationType(String string, int type) { if (type == Space.CONSTRUCTION) { *************** *** 493,498 **** try { java.lang.reflect.Constructor<Modellor> c = model.getConstructor(new Class[0]); ! Modellor m = c.newInstance(new Object[0]); ! m.setId(new Long(xml.getProgid())); List<MapElementType> attributes = xml.getAttribute(); HashMap<String, Object> content = new HashMap(); --- 502,508 ---- try { java.lang.reflect.Constructor<Modellor> c = model.getConstructor(new Class[0]); ! Modellor modellor = c.newInstance(new Object[0]); ! modellor.setId(new Long(xml.getProgid())); ! List<MapElementType> attributes = xml.getAttribute(); HashMap<String, Object> content = new HashMap(); *************** *** 501,506 **** content.put(a.getName(), a.getValue()); } ! m.setContent(content); ! return m; } catch (Exception e) { log.error(e); --- 511,517 ---- content.put(a.getName(), a.getValue()); } ! ! modellor.setContent(content); ! return modellor; } catch (Exception e) { log.error(e); *************** *** 513,516 **** --- 524,529 ---- } + + private static Attribute internalizeKeyValue(MapElementType elem, Map map) { Object val = elem.getValue(); *************** *** 817,820 **** --- 830,836 ---- object.setModellor(m); } + if (!xml.getAttributes().isEmpty()) { + object.setParameters(internalizeParameterBlock(xml.getAttributes(), map)); + } } *************** *** 827,830 **** --- 843,849 ---- private static void internalizeReferences(Instance object, SpaceType xml, Map map) { object.setProto((Space) get(xml.getProtoref(), map)); + if (!xml.getAttributes().isEmpty()) { + object.setParameters(internalizeParameterBlock(xml.getAttributes(), map)); + } } *************** *** 1042,1045 **** --- 1061,1065 ---- xml = externalizeInstance((Instance) space, map); } + return xml; } *************** *** 1157,1160 **** --- 1177,1190 ---- } + private static List<MapElementType> externalizeParameterBlock(ParameterBlock block, Map map) { + List<MapElementType> result = new LinkedList(); + for (Attribute current : block.getAttributes()) { + String key = current.getName(); + Object value = current.getValue(); + result.add(externalizeKeyValue(key, value, map)); + } + return result; + } + /** *************** *** 1475,1478 **** --- 1505,1511 ---- } xml.getBoundary().addAll(ids(map, sorted(object.getEnvelope()))); + if (object.getParameters() != null) { + xml.getAttributes().addAll(externalizeParameterBlock(object.getParameters(), map)); + } } *************** *** 1490,1493 **** --- 1523,1529 ---- xml.setProtoref(id(map, object.getProto())); } + if (object.getParameters() != null) { + xml.getAttributes().addAll(externalizeParameterBlock(object.getParameters(), map)); + } } |
From: Michael L. <he...@us...> - 2010-02-12 11:44:39
|
Update of /cvsroot/bprocessor/bprocessor/components/basic In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv28075/components/basic Added Files: table.bp shelves.bp Log Message: --- NEW FILE: shelves.bp --- <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <bmodel> <units>meter</units> <active>1</active> <cs>6</cs> <name>New Project</name> <space type="1" union="false" voidref="2" name="World" transparent="true" net="false" progid="0" id="1"> <description/> <Classification>unassigned</Classification> <constructor xsi:type="CoordinateSystemType" onlyplane="false" editable="true" active="true" progid="1" id="6" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <vertex x="0.0" y="0.0" z="0.0" id="7"/> <ijn> <vertex x="1.0" y="0.0" z="0.0" id="3"/> <vertex x="0.0" y="1.0" z="0.0" id="4"/> <vertex x="0.0" y="0.0" z="1.0" id="5"/> </ijn> </constructor> <constructor xsi:type="GridType" width="28.799999237060547" height="19.200000762939453" distance="2.4000000953674316" editable="true" active="false" progid="2" id="8" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <vertex x="0.0" y="0.0" z="0.0" id="9"/> [...1245 lines suppressed...] <from>254</from> <to>251</to> </edge> <edge smooth="false" constructor="false" progid="12" id="247"> <from>248</from> <to>253</to> </edge> <vertex x="1.81" y="0.0" z="0.4" progid="1" id="248"/> <vertex x="1.81" y="0.3" z="0.4" progid="2" id="249"/> <vertex x="1.81" y="0.3" z="0.42" progid="3" id="250"/> <vertex x="0.91" y="0.0" z="0.42" progid="4" id="251"/> <vertex x="0.91" y="0.3" z="0.4" progid="5" id="252"/> <vertex x="0.91" y="0.0" z="0.4" progid="6" id="253"/> <vertex x="1.81" y="0.0" z="0.42" progid="7" id="254"/> <vertex x="0.91" y="0.3" z="0.42" progid="8" id="255"/> </space> </space> </catalogObjects> </bmodel> --- NEW FILE: table.bp --- <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <bmodel> <units>meter</units> <active>1</active> <cs>6</cs> <name>New Project</name> <space type="1" union="false" voidref="2" name="World" transparent="true" net="false" progid="0" id="1"> <description/> <Classification>unassigned</Classification> <constructor xsi:type="CoordinateSystemType" onlyplane="false" editable="true" active="true" progid="1" id="6" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <vertex x="0.0" y="0.0" z="0.0" id="7"/> <ijn> <vertex x="1.0" y="0.0" z="0.0" id="3"/> <vertex x="0.0" y="1.0" z="0.0" id="4"/> <vertex x="0.0" y="0.0" z="1.0" id="5"/> </ijn> </constructor> <constructor xsi:type="GridType" width="28.799999237060547" height="19.200000762939453" distance="2.4000000953674316" editable="true" active="false" progid="2" id="8" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <vertex x="0.0" y="0.0" z="0.0" id="9"/> [...2928 lines suppressed...] <vertex x="0.012633222" y="1.5631" z="0.8983926" progid="140" id="552"/> <vertex x="-0.03181682" y="1.5631" z="0.8983926" progid="141" id="553"/> <vertex x="0.02152318" y="1.76757" z="0.8983926" progid="142" id="554"/> <vertex x="0.02152318" y="1.55421" z="0.8983926" progid="143" id="555"/> <vertex x="0.012633222" y="1.570338" z="0.7109928" progid="144" id="556"/> <vertex x="0.012633222" y="1.765918" z="0.7109928" progid="145" id="557"/> <vertex x="-0.03181682" y="1.765918" z="0.7109928" progid="146" id="558"/> <vertex x="-0.03181682" y="1.561448" z="0.7109928" progid="147" id="559"/> <vertex x="0.012633222" y="1.765918" z="0.7198828" progid="148" id="560"/> <vertex x="0.012633222" y="1.570338" z="0.7198828" progid="149" id="561"/> <vertex x="-0.03181682" y="1.570338" z="0.7198828" progid="150" id="562"/> <vertex x="-0.03181682" y="1.561448" z="0.7198828" progid="151" id="563"/> <vertex x="0.02152318" y="1.774808" z="0.7109928" progid="152" id="564"/> <vertex x="0.02152318" y="1.561448" z="0.7109928" progid="153" id="565"/> <vertex x="-0.03181682" y="1.774808" z="0.7109928" progid="154" id="566"/> <vertex x="-0.03181682" y="1.570338" z="0.7109928" progid="155" id="567"/> </space> </catalogObjects> </bmodel> |
From: Michael L. <he...@us...> - 2010-02-12 11:44:36
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/brunata/io In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv28029/src/net/sourceforge/bprocessor/model/brunata/io Added Files: XMLDocument.java Atom.java DocumentParser.java Element.java BPersistence.java Property.java Data.java Properties.java Log Message: --- NEW FILE: DocumentParser.java --- //--------------------------------------------------------------------------------- // $Id: DocumentParser.java,v 1.1 2010/02/12 11:44:28 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model.brunata.io; import java.io.IOException; import java.io.InputStream; import java.util.LinkedList; import java.util.List; import java.util.Stack; import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; import org.xml.sax.helpers.DefaultHandler; import org.xml.sax.helpers.XMLReaderFactory; public class DocumentParser { public XMLDocument parse(InputStream input) throws SAXException, IOException { XMLReader reader = XMLReaderFactory.createXMLReader(); DocumentHandler handler = new DocumentHandler(); reader.setContentHandler(handler); reader.setErrorHandler(handler); InputSource source = new InputSource(input); source.setEncoding("UTF8"); reader.parse(source); return document; } XMLDocument document; private class DocumentHandler extends DefaultHandler { Stack<Element> stack; Element root; private Properties asProperties(Attributes attributes) { List<Property> content = new LinkedList(); for (int i = 0; i < attributes.getLength(); i++) { String name = attributes.getLocalName(i); String value = attributes.getValue(i); Property property = new Property(name, value); content.add(property); } Properties properties = new Properties(content); return properties; } public void startDocument() { stack = new Stack(); } public void endDocument() { document = new XMLDocument(root); } public void startElement(String uri, String name, String cue, Attributes attributes) { Properties properties = asProperties(attributes); Element element = new Element(name, properties); stack.push(element); } public void endElement(String uri, String name, String cue) { Element element = stack.pop(); if (!stack.isEmpty()) { Element top = stack.peek(); top.add(element); } else { root = element; } } } } --- NEW FILE: Properties.java --- //--------------------------------------------------------------------------------- // $Id: Properties.java,v 1.1 2010/02/12 11:44:28 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model.brunata.io; import java.util.List; public class Properties { List<Property> content; public Properties(List<Property> content) { this.content = content; } public String getValue(String key) { for (Property current : content) { if (current.key.equals(key)) { return current.value; } } return null; } public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append(" | "); for (Property current : content) { buffer.append(current.key + "=" + "\"" + current.value + "\""); buffer.append(" "); } return buffer.toString(); } } --- NEW FILE: XMLDocument.java --- //--------------------------------------------------------------------------------- // $Id: XMLDocument.java,v 1.1 2010/02/12 11:44:28 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model.brunata.io; import java.io.PrintStream; public class XMLDocument { Element root; public XMLDocument(Element root) { this.root = root; } public Element getRoot() { return root; } public void display(PrintStream out) { root.display(out, 0); } } --- NEW FILE: Data.java --- //--------------------------------------------------------------------------------- // $Id: Data.java,v 1.1 2010/02/12 11:44:28 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model.brunata.io; public class Data extends Atom { String value; public Data(String value) { this.value = value; } } --- NEW FILE: BPersistence.java --- //--------------------------------------------------------------------------------- // $Id: BPersistence.java,v 1.1 2010/02/12 11:44:28 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model.brunata.io; import java.util.LinkedList; import java.util.List; public class BPersistence { private class Internalizer { private XMLDocument document; public Internalizer(XMLDocument document) { this.document = document; } public List<Serie> internalize() { return internalizeDataseries(document.getRoot()); } public List<Serie> internalizeDataseries(Element xml) { List<Serie> series = new LinkedList(); for (Atom atom : xml.getChildren()) { if (atom instanceof Element) { Element element = (Element) atom; series.add(internalizeDataserie(element)); } } return series; } private Serie internalizeDataserie(Element xml) { Serie serie = new Serie(xml.getValue("regType")); for (Atom atom : xml.getChildren()) { if (atom instanceof Element) { Element element = (Element) atom; serie.add(internalizeDataitem(element)); } } return serie; } private DataItem internalizeDataitem(Element xml) { DataItem item = new DataItem(); item.timestamp = Long.valueOf(xml.getValue("timestamp")); item.value = Double.valueOf(xml.getValue("value")); return item; } } public class Serie { String type; List<DataItem> items; public Serie(String t) { type = t; items = new LinkedList(); } public void add(DataItem item) { items.add(item); } public List<DataItem> items() { return items; } public int size() { return items.size(); } public String getType() { return type; } } public class DataItem { public double value; public long timestamp; } public List<Serie> internalize(XMLDocument document) { Internalizer internalizer = new Internalizer(document); return internalizer.internalize(); } } --- NEW FILE: Property.java --- //--------------------------------------------------------------------------------- // $Id: Property.java,v 1.1 2010/02/12 11:44:28 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model.brunata.io; public class Property { String key; String value; public Property(String key, String value) { this.key = key; this.value = value; } } --- NEW FILE: Element.java --- //--------------------------------------------------------------------------------- // $Id: Element.java,v 1.1 2010/02/12 11:44:28 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model.brunata.io; import java.io.PrintStream; import java.util.LinkedList; import java.util.List; public class Element extends Atom { String tag; List<Atom> children; Properties properties; public Element(String tag, Properties properties) { this.tag = tag; this.properties = properties; } public void add(Element element) { if (children == null) { children = new LinkedList(); } children.add(element); } public String getTag() { return tag; } public List<Atom> getChildren() { return children; } public String getValue(String key) { return properties.getValue(key); } public void display(PrintStream out, int level) { for (int i = 0; i < level; i++) { System.out.print(" "); } out.print(tag); out.println(properties); if (children != null) { for (Atom current : children) { current.display(out, level + 1); } } } } --- NEW FILE: Atom.java --- //--------------------------------------------------------------------------------- // $Id: Atom.java,v 1.1 2010/02/12 11:44:28 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model.brunata.io; import java.io.PrintStream; public class Atom { public void display(PrintStream out, int i) { // nothing } } |
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv28029/src/net/sourceforge/bprocessor/model Modified Files: Item.java Command.java Project.java Component.java ParameterBlock.java Attribute.java Log Message: Index: Attribute.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Attribute.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Attribute.java 3 Sep 2009 08:18:12 -0000 1.27 --- Attribute.java 12 Feb 2010 11:44:28 -0000 1.28 *************** *** 198,200 **** --- 198,208 ---- } } + + /** + * + * @return copy of this attribute + */ + public Attribute copy() { + return new Attribute(name, value); + } } Index: Component.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Component.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Component.java 26 Jun 2009 15:39:10 -0000 1.9 --- Component.java 12 Feb 2010 11:44:28 -0000 1.10 *************** *** 114,117 **** --- 114,121 ---- Instance instance = new Instance(space.getName() + " instance "); instance.setProto(space); + ParameterBlock block = space.getParameters(); + if (block != null) { + instance.setParameters(block.copy()); + } return instance; } Index: ParameterBlock.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ParameterBlock.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ParameterBlock.java 9 Sep 2009 12:51:32 -0000 1.18 --- ParameterBlock.java 12 Feb 2010 11:44:28 -0000 1.19 *************** *** 215,217 **** --- 215,229 ---- return buffer.toString(); } + + /** + * + * @return copy of this parameterblock + */ + public ParameterBlock copy() { + ParameterBlock copy = new ParameterBlock(); + for (Attribute current : parameters) { + copy.add(current.copy()); + } + return copy; + } } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.184 retrieving revision 1.185 diff -C2 -d -r1.184 -r1.185 *** Project.java 5 Feb 2010 13:32:50 -0000 1.184 --- Project.java 12 Feb 2010 11:44:28 -0000 1.185 *************** *** 21,24 **** --- 21,26 ---- import java.net.Socket; import java.net.SocketAddress; + import java.net.URL; + import java.net.URLConnection; import java.text.DecimalFormat; import java.util.ArrayList; *************** *** 44,47 **** --- 46,52 ---- import net.sourceforge.bprocessor.model.bridge.Serializer; import net.sourceforge.bprocessor.model.bridge.UnSerializer; + import net.sourceforge.bprocessor.model.brunata.io.BPersistence; + import net.sourceforge.bprocessor.model.brunata.io.XMLDocument; + import net.sourceforge.bprocessor.model.brunata.io.DocumentParser; import net.sourceforge.bprocessor.model.modellor.InnerWallModellor; import net.sourceforge.bprocessor.model.modellor.ModelBathModellor2; *************** *** 81,84 **** --- 86,91 ---- private static final int PORT = 8800; + private static boolean brunata; + private Tesselator tesselator; *************** *** 176,180 **** public void setMeasures(List<SensorItem> data) { measures = data; - index = 0; } --- 183,186 ---- *************** *** 235,240 **** String h = format.format(data.humimdity()); String info = "Temperatur: " + t + " C\n" + "Relativ luftfugtighed: " + h + "ä\n"; ! sensor.setDescription(info); if (data.temperature() < 18 && data.humimdity() > 70) { --- 241,261 ---- String h = format.format(data.humimdity()); + String id = ""; + if (data.id().equals("2501858")) { + id = "3134"; + } else if (data.id().equals("2501861")) { + id = "3132"; + } else if (data.id().equals("2501863")) { + id = "3119"; + } else if (data.id().equals("2501864")) { + id = "3138"; + } else if (data.id().equals("2501865")) { + id = "3127"; + } + + String header = "Internal ID: " + data.id() + "\nExternal ID: " + id + "\n"; + String info = "Temperatur: " + t + " C\n" + "Relativ luftfugtighed: " + h + "ä\n"; ! sensor.setDescription(header + info); if (data.temperature() < 18 && data.humimdity() > 70) { *************** *** 1139,1143 **** } else if (a.getName().equals("Export Path")) { setExportPath((String)a.getValue()); ! } } changed(this); --- 1160,1166 ---- } else if (a.getName().equals("Export Path")) { setExportPath((String)a.getValue()); ! } else if (a.getName().equals("Brunata Server")) { ! brunata = ((Boolean) a.getValue()).booleanValue(); ! } } changed(this); *************** *** 1156,1159 **** --- 1179,1183 ---- res.add(new Attribute("Export", Boolean.valueOf(doExport))); res.add(new Attribute("Export Path", getExportPath())); + res.add(new Attribute("Brunata Server", Boolean.valueOf(brunata))); res.add(new Attribute("Script", script)); return res; *************** *** 2014,2018 **** */ public void updateSensors() { ! sensor.update(); } } --- 2038,2144 ---- */ public void updateSensors() { ! if (SENSE) { ! sensor.update(); ! } ! if (brunata) { ! fetch(); ! } ! } ! ! private void fetch() { ! try { ! List<SensorItem> items1 = process(2501858); ! List<SensorItem> items2 = process(2501861); ! List<SensorItem> items3 = process(2501863); ! List<SensorItem> items4 = process(2501864); ! List<SensorItem> items5 = process(2501865); ! ! List<SensorItem> result = new LinkedList(); ! ! Iterator<SensorItem> iter1 = items1.iterator(); ! Iterator<SensorItem> iter2 = items2.iterator(); ! Iterator<SensorItem> iter3 = items3.iterator(); ! Iterator<SensorItem> iter4 = items4.iterator(); ! Iterator<SensorItem> iter5 = items5.iterator(); ! for (int i = 0; i < items1.size(); i++) { ! if (iter1.hasNext()) { ! result.add(iter1.next()); ! } ! if (iter2.hasNext()) { ! result.add(iter2.next()); ! } ! if (iter3.hasNext()) { ! result.add(iter3.next()); ! } ! if (iter4.hasNext()) { ! result.add(iter4.next()); ! } ! if (iter5.hasNext()) { ! result.add(iter5.next()); ! } ! } ! setMeasures(result); ! } catch (Exception e) { ! // TODO Auto-generated catch block ! e.printStackTrace(); ! } ! } ! ! /** ! * ! * @param url URL ! * @return XMLDocument ! * @throws Exception Error ! */ ! public static XMLDocument fetch(URL url) throws Exception { ! URLConnection connection = url.openConnection(); ! DocumentParser parser = new DocumentParser(); ! InputStream input = connection.getInputStream(); ! XMLDocument document = parser.parse(input); ! input.close(); ! return document; } + + private URL address(long id) throws Exception { + String www = "https://ext.brunata.com/ws-webmon/v1/da/"; + String login = "040985:b35c52662aee64d6b12faa2a2eb7013a/"; + String what = "meters/"; + String type = ":(DEWPOINT,HUMIDITY,TEMPERATURE).xml"; + String address = www + login + what + id + type; + return new URL(address); + } + + private List<SensorItem> process(long id) throws Exception { + URL url = address(id); + XMLDocument document = fetch(url); + BPersistence persistence = new BPersistence(); + List<BPersistence.Serie> series = persistence.internalize(document); + BPersistence.Serie leader = series.get(0); + List<SensorItem> items = new ArrayList(); + for (int i = 0; i < leader.size(); i++) { + SensorItem item = new SensorItem(); + item.setId(String.valueOf(id)); + items.add(item); + } + for (BPersistence.Serie current : series) { + String type = current.getType(); + int i = 0; + for (BPersistence.DataItem data : current.items()) { + SensorItem item = items.get(i); + if (type.equals("TEMPERATURE")) { + item.setTemparature(data.value); + item.setTime(data.timestamp); + } else if (type.equals("HUMIDITY")) { + item.setHumidity(data.value); + } + i++; + } + } + for (SensorItem current : items) { + System.out.println(current); + } + return items; + } + } + Index: Item.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Item.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Item.java 18 Sep 2009 09:09:06 -0000 1.3 --- Item.java 12 Feb 2010 11:44:28 -0000 1.4 *************** *** 616,620 **** } res.add(new Attribute("Material", new Reference(material(), materials))); - res.add(new Attribute("Closed", Boolean.valueOf(closed()))); res.add(new Attribute("Description", getDescription())); if (getModellor() != null) { --- 616,619 ---- Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** Command.java 9 Sep 2009 12:51:32 -0000 1.80 --- Command.java 12 Feb 2010 11:44:28 -0000 1.81 *************** *** 130,133 **** --- 130,166 ---- + + /** + * + * + */ + public static class PropertyCommand extends Command { + private Geometric target; + + /** + * + * @param target Geometric + */ + public PropertyCommand(Geometric target) { + this.target = target; + parameters.put("name", ""); + } + + /** + * {@inheritDoc} + */ + public void evaluate() { + ParameterBlock block = target.getParameters(); + if (block == null) { + block = new ParameterBlock(); + target.setParameters(block); + } + String name = (String) parameters.get("name"); + if (name.length() > 0) { + block.put(name, ""); + } + } + + } /** * |
From: Michael L. <he...@us...> - 2010-02-12 11:44:36
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv28029/src/net/sourceforge/bprocessor/model/sense Modified Files: SensorItem.java Log Message: Index: SensorItem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/SensorItem.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SensorItem.java 14 Sep 2009 16:22:55 -0000 1.1 --- SensorItem.java 12 Feb 2010 11:44:28 -0000 1.2 *************** *** 37,40 **** --- 37,46 ---- /** * + */ + public SensorItem() { + } + + /** + * * @return date */ *************** *** 45,48 **** --- 51,62 ---- /** * + * @param t long + */ + public void setTime(long t) { + time = t; + } + + /** + * * @return id */ *************** *** 53,56 **** --- 67,78 ---- /** * + * @param value String + */ + public void setId(String value) { + id = value; + } + + /** + * * @return temperature */ *************** *** 61,64 **** --- 83,94 ---- /** * + * @param value double + */ + public void setTemparature(double value) { + temperature = value; + } + + /** + * * @return humidity */ *************** *** 68,71 **** --- 98,109 ---- /** + * + * @param value double + */ + public void setHumidity(double value) { + humidity = value; + } + + /** * {@inheritDoc} */ |
From: Michael L. <he...@us...> - 2010-02-12 11:44:36
|
Update of /cvsroot/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv28029 Modified Files: build.xml Log Message: Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/model/build.xml,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** build.xml 12 Feb 2009 12:35:19 -0000 1.20 --- build.xml 12 Feb 2010 11:44:28 -0000 1.21 *************** *** 135,139 **** failOnViolation="true"> <fileset dir="${src.dir}" ! includes="**/*.java"/> </checkstyle> </target> --- 135,140 ---- failOnViolation="true"> <fileset dir="${src.dir}" ! includes="**/*.java" ! excludes="**/brunata/io/*.java"/> </checkstyle> </target> |
From: Michael L. <he...@us...> - 2010-02-12 11:44:34
|
Update of /cvsroot/bprocessor/gl/src/gfx In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv27987/src/gfx Added Files: twoicon.png twoicon.gif oneicon.png oneicon.gif onwicon.png Log Message: --- NEW FILE: twoicon.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: twoicon.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: oneicon.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: oneicon.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: onwicon.png --- (This appears to be a binary file; contents omitted.) |
From: Michael L. <he...@us...> - 2010-02-12 11:44:34
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv27987/src/net/sourceforge/bprocessor/gl/tool Modified Files: RotationToolB.java AbstractPencil.java Log Message: Index: RotationToolB.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RotationToolB.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RotationToolB.java 5 Feb 2010 15:00:31 -0000 1.3 --- RotationToolB.java 12 Feb 2010 11:44:24 -0000 1.4 *************** *** 9,13 **** --- 9,16 ---- import java.awt.Cursor; + import java.awt.Insets; + import java.awt.event.ActionEvent; import java.awt.event.MouseEvent; + import java.net.URL; import java.util.Collection; import java.util.Collections; *************** *** 16,19 **** --- 19,29 ---- import java.util.List; + import javax.swing.AbstractAction; + import javax.swing.Action; + import javax.swing.ButtonGroup; + import javax.swing.ImageIcon; + import javax.swing.JComponent; + import javax.swing.JToggleButton; + import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.model.CoordinateSystem; *************** *** 83,103 **** } ! private void rotate(double angle) { ! if (!Double.isNaN(angle)) { ! Vertex center = center(); ! Vertex n = normal(); ! double x = n.getX(); ! double y = n.getY(); ! double z = n.getZ(); ! reset(); ! for (Vertex current : vertices) { ! Geometry.rotate(angle, x, y, z, current, center); ! } ! for (Vertex current : vertices) { ! current.update(); ! } ! } } private void finish() { base = null; --- 93,117 ---- } ! ! private void rotateIt(Vertex center, Vertex axis, double angle, Vertex vertex) { ! Geometry.rotate(angle, axis.getX(), axis.getY(), axis.getZ(), vertex, center); ! } ! ! private Vertex rotate(Vertex axis, double angle, Vertex vector) { ! Vertex u = vector.copy(); ! Vertex zero = new Vertex(0, 0, 0); ! rotateIt(zero, axis, angle, u); ! return u; } + private void rotateIt(Vertex center, Vertex axis, double angle, Collection<Vertex> vertices) { + for (Vertex current : vertices) { + rotateIt(center, axis, angle, current); + } + for (Vertex current : vertices) { + current.update(); + } + } + private void finish() { base = null; *************** *** 107,111 **** excluded(Collections.EMPTY_LIST); } ! /** * {@inheritDoc} --- 121,125 ---- excluded(Collections.EMPTY_LIST); } ! /** * {@inheritDoc} *************** *** 122,133 **** if (system != null) { if (base != null) { ! if (mode == ONE) { ! double angle = angle(); ! if (!Double.isNaN(angle)) { ! rotate(angle); ! } ! } else { ! System.out.println("handle case two"); ! } } } --- 136,140 ---- if (system != null) { if (base != null) { ! process(); } } *************** *** 152,168 **** if (system != null) { if (base == null) { ! if (mode == ONE) { ! base = direction(); ! } else { ! System.out.println("handle case two"); ! } } else { ! if (mode == ONE) { ! double angle = angle(); ! rotate(angle); ! finish(); ! } else { ! System.out.println("handle case two"); ! } } } else { --- 159,166 ---- if (system != null) { if (base == null) { ! base = current.vertex().copy(); } else { ! process(); ! finish(); } } else { *************** *** 185,191 **** } ! private Vertex direction() { Plane plane = system.plane(); ! Vertex vertex = plane.projection(current.vertex()); Vertex u = vertex.minus(system.getOrigin()); u.normalize(); --- 183,223 ---- } ! ! ! ! private void process() { ! Vertex center = system.getOrigin(); ! Vertex up = system.getN(); ! Vertex from = base; ! Vertex to = current.vertex(); ! ! Vertex u = from.minus(center); ! u.normalize(); ! Vertex v = to.minus(center); ! v.normalize(); ! ! double alpha = angle(up, u, v); ! ! if (mode == ONE) { ! if (!Double.isNaN(alpha)) { ! reset(); ! rotateIt(center, up, alpha, vertices); ! } ! } else if (mode == TWO) { ! u = rotate(up, alpha, u); ! Vertex axis = up.cross(u); ! double beta = angle(axis, u, v); ! ! if (!Double.isNaN(alpha) && !Double.isNaN(beta)) { ! reset(); ! rotateIt(center, up, alpha, vertices); ! rotateIt(center, axis, beta, vertices); ! } ! } ! } ! ! private Vertex direction(Vertex original) { Plane plane = system.plane(); ! Vertex vertex = plane.projection(original); Vertex u = vertex.minus(system.getOrigin()); u.normalize(); *************** *** 193,207 **** } - private Vertex center() { - return system.getOrigin(); - } - - private Vertex normal() { - return system.getN(); - } - private Vertex base() { if (base != null) { ! return base; } else { return system.getI(); --- 225,232 ---- } private Vertex base() { if (base != null) { ! return direction(base); ! } else { return system.getI(); *************** *** 209,219 **** } ! private double angle() { ! Vertex i = base(); ! Vertex u = direction(); ! if (u.isZero()) { ! return Double.NaN; ! } ! if (i.cross(u).isZero()) { return 0; --- 234,249 ---- } ! ! private Vertex project(Vertex normal, Vertex vector) { ! Vertex n = normal.copy(); ! double t = vector.dot(normal); ! n.scaleIt(t / n.length()); ! vector = vector.minus(n); ! return vector; ! } ! ! private double angle(Vertex normal, Vertex v1, Vertex v2) { ! Vertex i = project(normal, v1); ! Vertex u = project(normal, v2); if (i.cross(u).isZero()) { return 0; *************** *** 222,226 **** double angle = i.angle(u); ! double box = i.cross(u).dot(system.getN()); if (box < 0) { angle = -angle; --- 252,256 ---- double angle = i.angle(u); ! double box = i.cross(u).dot(normal); if (box < 0) { angle = -angle; *************** *** 230,233 **** --- 260,294 ---- } + private Vertex vector(Vertex point) { + Vertex v = point.minus(system.getOrigin()); + if (!v.isZero()) { + v.normalize(); + } + return v; + } + + + private Vertex axis() { + Vertex up = system.getN(); + Vertex forward; + if (base == null) { + forward = system.getI(); + } else { + forward = vector(base); + } + Vertex axis = up.cross(forward); + return axis; + } + + private double angle(Vertex axis) { + Vertex v1; + if (base == null) { + v1 = system.getI(); + } else { + v1 = vector(base); + } + return angle(axis, v1, vector(current.vertex())); + } + /** * {@inheritDoc} *************** *** 235,239 **** protected void updateLength() { if (system != null) { ! double angle = angle() * 180 / Math.PI; setLength(angle / 1000); } else { --- 296,300 ---- protected void updateLength() { if (system != null) { ! double angle = angle(system.getN()) * 180 / Math.PI; setLength(angle / 1000); } else { *************** *** 259,265 **** Vertex center = system.getOrigin(); Vertex i = base(); ! Vertex j = normal().cross(i); protract = new Protract(center, i, j, true); editor.getView().addGlObjects3D(protract); } else { showConstructors = true; --- 320,336 ---- Vertex center = system.getOrigin(); Vertex i = base(); ! Vertex j = system.getN().cross(i); protract = new Protract(center, i, j, true); editor.getView().addGlObjects3D(protract); + + + if (base != null) { + Edge e1 = new Edge(center, base); + e1.setStrippled(true); + edges.add(e1); + Edge e2 = new Edge(center, current.vertex()); + e2.setStrippled(true); + edges.add(e2); + } } else { showConstructors = true; *************** *** 288,292 **** if (protract != null) { double angle = (value * 1000) * Math.PI / 180; ! rotate(angle); finish(); } --- 359,363 ---- if (protract != null) { double angle = (value * 1000) * Math.PI / 180; ! rotateIt(system.getOrigin(), system.getN(), angle, vertices); finish(); } *************** *** 349,351 **** --- 420,471 ---- affected = null; } + + class OptionAction extends AbstractAction { + private int mode; + + /** + * Constructs option action + * @param iconname String + */ + public OptionAction(String iconname, int mode) { + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + URL url = cl.getResource(iconname); + ImageIcon im = new ImageIcon(url); + putValue(Action.SMALL_ICON, im); + this.mode = mode; + }; + + /** {@inheritDoc} */ + public void actionPerformed(ActionEvent event) { + RotationToolB.this.mode = mode; + System.out.println("mode is " + mode); + } + } + + + /** + * {@inheritDoc} + */ + public List<JComponent> controls() { + List<JComponent> controls = super.controls(); + ButtonGroup group = new ButtonGroup(); + + { + JToggleButton button = new JToggleButton(new OptionAction("oneicon.gif", ONE)); + button.setMargin(new Insets(1, 1, 1, 1)); + button.setMaximumSize(button.getMinimumSize()); + button.setSelected(Editor.isMulti()); + controls.add(button); + group.add(button); + } + { + JToggleButton button = new JToggleButton(new OptionAction("twoicon.gif", TWO)); + button.setMargin(new Insets(1, 1, 1, 1)); + button.setMaximumSize(button.getMinimumSize()); + button.setSelected(Editor.isMulti()); + controls.add(button); + group.add(button); + } + return controls; + } } Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.113 retrieving revision 1.114 diff -C2 -d -r1.113 -r1.114 *** AbstractPencil.java 5 Feb 2010 13:32:59 -0000 1.113 --- AbstractPencil.java 12 Feb 2010 11:44:24 -0000 1.114 *************** *** 271,276 **** } - // Round off - intersection.roundIt(); return intersection; } --- 271,274 ---- |
From: Michael L. <he...@us...> - 2010-02-12 11:44:33
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv27987/src/net/sourceforge/bprocessor/gl/model Modified Files: Intersection.java Log Message: Index: Intersection.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model/Intersection.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Intersection.java 9 Sep 2009 10:31:04 -0000 1.7 --- Intersection.java 12 Feb 2010 11:44:24 -0000 1.8 *************** *** 162,170 **** return vertex.equalEps(other.vertex()); } - - /** - * Round it - */ - public void roundIt() { - } } --- 162,164 ---- |
From: Michael L. <he...@us...> - 2010-02-12 11:44:33
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv27987/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.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** PopupMenu.java 5 Feb 2010 13:32:59 -0000 1.38 --- PopupMenu.java 12 Feb 2010 11:44:24 -0000 1.39 *************** *** 747,751 **** menu.add(action); } ! return menu; } --- 747,763 ---- menu.add(action); } ! { ! { ! AbstractAction action = new GeometricMenuAction(arguments, "New Property...") { ! public void actionPerformed(ActionEvent event) { ! Geometric geometric = entities.iterator().next(); ! Command command = new Command.PropertyCommand(geometric); ! AttributeView.instance().display(command); ! } ! }; ! menu.add(action); ! } ! ! } return menu; } |
From: Michael L. <he...@us...> - 2010-02-12 11:44:29
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv27977/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.115 retrieving revision 1.116 diff -C2 -d -r1.115 -r1.116 *** GUI.java 13 Nov 2009 08:17:10 -0000 1.115 --- GUI.java 12 Feb 2010 11:44:21 -0000 1.116 *************** *** 930,941 **** Project.getInstance().checkpoint(); Project.getInstance().changed(Project.getInstance()); ! if (Project.SENSE) { ! Timer timer = new Timer (300, new ActionListener() { ! public void actionPerformed(ActionEvent e) { ! Project.getInstance().updateSensors(); ! } ! }); ! timer.start(); ! } } /** --- 930,939 ---- Project.getInstance().checkpoint(); Project.getInstance().changed(Project.getInstance()); ! Timer timer = new Timer (2000, new ActionListener() { ! public void actionPerformed(ActionEvent e) { ! Project.getInstance().updateSensors(); ! } ! }); ! timer.start(); } /** |
From: Michael L. <he...@us...> - 2010-02-12 11:44:26
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/brunata/io In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv27949/src/net/sourceforge/bprocessor/model/brunata/io Log Message: Directory /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/brunata/io added to the repository |
From: Michael L. <he...@us...> - 2010-02-12 11:44:26
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/brunata In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv27949/src/net/sourceforge/bprocessor/model/brunata Log Message: Directory /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/brunata added to the repository |
From: Michael L. <he...@us...> - 2010-02-05 15:00:44
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv28755/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.293 retrieving revision 1.294 diff -C2 -d -r1.293 -r1.294 *** View.java 5 Feb 2010 13:32:59 -0000 1.293 --- View.java 5 Feb 2010 15:00:31 -0000 1.294 *************** *** 1588,1612 **** } - { - System.out.println("-- process select --"); - if (surface != null) { - System.out.println(" surface: " + surface.getLastInPath()); - } else { - System.out.println(" surface: null"); - } - if (vertex != null) { - System.out.println(" vertex: " + vertex.getLastInPath()); - } else { - System.out.println(" vertex: null"); - } - if (edge != null) { - System.out.println(" edge: " + edge.getLastInPath()); - } else { - System.out.println(" edge: null"); - } - System.out.println(" glo: " + glo); - - } - if (surface != null) { if (unWantedEntities.contains(surface.getLastInPath())) { --- 1588,1591 ---- *************** *** 1620,1624 **** if (nearestSurface < nearestVertex) { if (plane != null && !plane.contains((Vertex)vertex.getLastInPath())) { - System.out.println(" surface kills vertex"); vertex = null; } --- 1599,1602 ---- *************** *** 1638,1642 **** if (!((Edge)edge.getLastInPath()).intersects((Vertex)vertex.getLastInPath())) { vertex = null; - System.out.println(" edge kills vertex"); } else { edge = null; --- 1616,1619 ---- *************** *** 1691,1696 **** if (!glo.contains((Vertex) vertex.getLastInPath())) { vertex = null; - } else { - System.out.println(" its a keeper"); } } --- 1668,1671 ---- *************** *** 1698,1721 **** } if (intersections) { - { - System.out.println("-- intersect --"); - if (surface != null) { - System.out.println(" surface: " + surface.getLastInPath()); - } - if (vertex != null) { - System.out.println(" vertex: " + vertex.getLastInPath()); - } - if (edge != null) { - System.out.println(" edge: " + edge.getLastInPath()); - } - if (glo != null) { - System.out.println(" glo: " + glo); - } - } - Intersection intersection = findIntersected(unWantedEntities, xy, surface, vertex, edge, glo, object, edges); - System.out.println(" intersection: " + intersection); - return intersection; } else { --- 1673,1678 ---- |
From: Michael L. <he...@us...> - 2010-02-05 15:00:40
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv28755/src/net/sourceforge/bprocessor/gl/tool Modified Files: RotationToolB.java Log Message: Index: RotationToolB.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RotationToolB.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RotationToolB.java 5 Feb 2010 13:32:59 -0000 1.2 --- RotationToolB.java 5 Feb 2010 15:00:31 -0000 1.3 *************** *** 38,43 **** --- 38,51 ---- private Protract protract; private Vertex base; + private int mode; + /** */ + public static final int ONE = 1; + /** */ + public static final int TWO = 2; + + /** */ + public static final int THREE = 3; *************** *** 50,53 **** --- 58,62 ---- super(editor, cursor); showConstructors = false; + mode = ONE; } /** *************** *** 113,119 **** if (system != null) { if (base != null) { ! double angle = angle(); ! if (!Double.isNaN(angle)) { ! rotate(angle); } } --- 122,132 ---- if (system != null) { if (base != null) { ! if (mode == ONE) { ! double angle = angle(); ! if (!Double.isNaN(angle)) { ! rotate(angle); ! } ! } else { ! System.out.println("handle case two"); } } *************** *** 139,147 **** if (system != null) { if (base == null) { ! base = direction(); } else { ! double angle = angle(); ! rotate(angle); ! finish(); } } else { --- 152,168 ---- if (system != null) { if (base == null) { ! if (mode == ONE) { ! base = direction(); ! } else { ! System.out.println("handle case two"); ! } } else { ! if (mode == ONE) { ! double angle = angle(); ! rotate(angle); ! finish(); ! } else { ! System.out.println("handle case two"); ! } } } else { |
From: Michael L. <he...@us...> - 2010-02-05 13:52:43
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4409/src/net/sourceforge/bprocessor/facade/modellor Modified Files: NetFacadeModellor.java Log Message: Index: NetFacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/NetFacadeModellor.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** NetFacadeModellor.java 25 Jun 2009 23:28:38 -0000 1.49 --- NetFacadeModellor.java 5 Feb 2010 13:32:46 -0000 1.50 *************** *** 769,773 **** CoordinateSystem cs = new CoordinateSystem(i, out, firstDir, unCommon); List<Edge> cutEdges = cut.getEdges(); ! Geometry.unTranslateGeometry(Geometry.collect(cutEdges), cs); Edge current = first; --- 769,773 ---- CoordinateSystem cs = new CoordinateSystem(i, out, firstDir, unCommon); List<Edge> cutEdges = cut.getEdges(); ! Geometry.unTranslateGeometry(Geometric.collect(cutEdges), cs); Edge current = first; *************** *** 984,988 **** } surfaces.addAll(tops); ! Set<Vertex> verts = Geometry.collect(surfaces); for (Vertex v : verts) { v.move(0, 0, length / 2); --- 984,988 ---- } surfaces.addAll(tops); ! Set<Vertex> verts = Geometric.collect(surfaces); for (Vertex v : verts) { v.move(0, 0, length / 2); |
From: Michael L. <he...@us...> - 2010-02-05 13:52:31
|
Update of /cvsroot/bprocessor/bprocessor In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4456 Added Files: hus-eksport.xml zanzibar.xml chuck.xml b-processor-export.obj.xml Log Message: --- NEW FILE: zanzibar.xml --- <Scene> <Material id="0" name="Functional" red="0.9" green="0.9" blue="0.9"> </Material> <Material id="1" name="Construction" red="0.96" green="0.87" blue="0.7"> </Material> <Material id="2" name="Void" red="0.91071427" green="0.8142857" blue="0.8035714"> </Material> <Material id="3" name="Floor" red="0.84705883" green="0.827451" blue="0.8039216"> </Material> <Material id="4" name="Wall" red="0.8235294" green="0.60784316" blue="0.1254902"> </Material> <Material id="5" name="Frame" red="0.46666667" green="0.101960786" blue="0.0"> </Material> <Material id="6" name="DoorA" red="0.7058824" green="0.25490198" blue="0.0"> </Material> <Material id="7" name="Paint" red="0.84705883" green="0.827451" blue="0.8039216"> </Material> <Material id="8" name="Glass" red="0.8" green="0.8" blue="0.8"> </Material> [...3634 lines suppressed...] f 2 4 6 f 16 2 6 f 4 14 13 f 6 4 13 f 14 16 3 f 13 14 3 f 7 16 6 f 16 14 8 f 14 5 8 f 7 6 15 f 6 13 1 f 14 9 5 f 3 16 7 f 6 1 15 f 3 7 11 </Object> <Light id="26" name="Light 1"> <position x="6.949999999999999" y="4.798200187272332" z="2.144402855332123"/> </Light> </Scene --- NEW FILE: hus-eksport.xml --- <Scene> <Material id="0" name="Functional" red="0.9" green="0.9" blue="0.9"> </Material> <Material id="1" name="Construction" red="0.96" green="0.87" blue="0.7"> </Material> <Material id="2" name="Void" red="0.91071427" green="0.8142857" blue="0.8035714"> </Material> <Material id="3" name="Floor" red="0.84705883" green="0.827451" blue="0.8039216"> </Material> <Material id="4" name="Wall" red="0.8235294" green="0.60784316" blue="0.1254902"> </Material> <Material id="5" name="Frame" red="0.46666667" green="0.101960786" blue="0.0"> </Material> <Material id="6" name="DoorA" red="0.7058824" green="0.25490198" blue="0.0"> </Material> <Material id="7" name="Paint" red="0.84705883" green="0.827451" blue="0.8039216"> </Material> <Material id="8" name="Glass" red="0.8" green="0.8" blue="0.8"> </Material> [...3637 lines suppressed...] f 10 1 13 f 11 2 15 f 13 11 15 f 2 10 12 f 15 2 12 f 9 1 4 f 10 2 6 f 9 2 11 f 9 11 1 f 3 15 12 f 9 5 2 f 3 12 7 </Object> <Light id="27" name="Lys 1"> <position x="6.95" y="8.587571300624143" z="2.0667120826219607"/> </Light> <Light id="26" name="Lys 2"> <position x="5.515612508797714" y="6.55" z="1.8598405632664194"/> </Light> </Scene --- NEW FILE: chuck.xml --- <Scene> <Material id="0" name="Functional" red="0.9" green="0.9" blue="0.9"> </Material> <Material id="1" name="Construction" red="0.96" green="0.87" blue="0.7"> </Material> <Material id="2" name="Void" red="0.91071427" green="0.8142857" blue="0.8035714"> </Material> <Material id="3" name="Floor" red="0.84705883" green="0.827451" blue="0.8039216"> </Material> <Material id="4" name="Wall" red="0.8235294" green="0.60784316" blue="0.1254902"> </Material> <Material id="5" name="Frame" red="0.46666667" green="0.101960786" blue="0.0"> </Material> <Material id="6" name="DoorA" red="0.7058824" green="0.25490198" blue="0.0"> </Material> <Material id="7" name="Paint" red="0.84705883" green="0.827451" blue="0.8039216"> </Material> <Material id="8" name="Glass" red="0.8" green="0.8" blue="0.8"> </Material> [...3637 lines suppressed...] f 8 6 14 f 1 3 8 f 11 1 10 f 7 9 12 f 1 8 14 f 13 16 4 f 7 15 9 f 13 7 12 f 13 2 16 f 9 16 2 f 13 4 7 f 9 15 16 </Object> <Light id="27" name="Light instance "> <position x="4.2016140957606" y="0.17555533236380128" z="1.3665832085421137"/> </Light> <Light id="26" name="Light instance "> <position x="4.8246976958160825" y="4.423221792013522" z="0.07000000000000028"/> </Light> </Scene --- NEW FILE: b-processor-export.obj.xml --- <Scene> <Material id="0" name="Functional" red="0.9" green="0.9" blue="0.9"> </Material> <Material id="1" name="Construction" red="0.96" green="0.87" blue="0.7"> </Material> <Material id="2" name="Void" red="0.91071427" green="0.8142857" blue="0.8035714"> </Material> <Material id="3" name="Floor" red="0.84705883" green="0.827451" blue="0.8039216"> </Material> <Material id="4" name="Wall" red="0.8235294" green="0.60784316" blue="0.1254902"> </Material> <Material id="5" name="Frame" red="0.46666667" green="0.101960786" blue="0.0"> </Material> <Material id="6" name="DoorA" red="0.7058824" green="0.25490198" blue="0.0"> </Material> <Material id="7" name="Paint" red="0.84705883" green="0.827451" blue="0.8039216"> </Material> <Material id="8" name="Glass" red="0.8" green="0.8" blue="0.8"> </Material> [...3637 lines suppressed...] f 15 2 3 f 14 3 10 f 13 16 15 f 3 1 11 f 10 3 11 f 1 13 12 f 11 1 12 f 13 10 6 f 12 13 6 f 6 10 8 f 10 13 14 f 6 8 9 </Object> <Light id="27" name="Lys 1"> <position x="6.95" y="8.5875713006" z="2.0667120826"/> </Light> <Light id="26" name="Lys 2"> <position x="5.5156125088" y="6.55" z="1.8598405633"/> </Light> </Scene |
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4483/src/net/sourceforge/bprocessor/gl/tool Modified Files: RotationToolB.java ExtrusionTool.java RotationTool.java FinalMoveTool.java AbstractPencil.java Protract.java Log Message: Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** ExtrusionTool.java 22 Dec 2009 13:51:51 -0000 1.77 --- ExtrusionTool.java 5 Feb 2010 13:32:59 -0000 1.78 *************** *** 25,29 **** import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometric; - import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Line; import net.sourceforge.bprocessor.model.Mesh; --- 25,28 ---- *************** *** 254,258 **** ignore.addAll(extrusion); ignore.addAll(Surface.edges(extrusion)); ! ignore.addAll(Geometry.collect(extrusion)); } excluded(ignore); --- 253,257 ---- ignore.addAll(extrusion); ignore.addAll(Surface.edges(extrusion)); ! ignore.addAll(Geometric.collect(extrusion)); } excluded(ignore); Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.112 retrieving revision 1.113 diff -C2 -d -r1.112 -r1.113 *** AbstractPencil.java 13 Jan 2010 10:58:30 -0000 1.112 --- AbstractPencil.java 5 Feb 2010 13:32:59 -0000 1.113 *************** *** 861,865 **** HashSet affected = new HashSet(); ! Set vertices = Geometry.collect(moveElements); Set edges = Vertex.edges(vertices); Set surfaces = Edge.surfaces(edges); --- 861,865 ---- HashSet affected = new HashSet(); ! Set vertices = Geometric.collect(moveElements); Set edges = Vertex.edges(vertices); Set surfaces = Edge.surfaces(edges); Index: Protract.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Protract.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Protract.java 22 Dec 2009 14:54:34 -0000 1.1 --- Protract.java 5 Feb 2010 13:32:59 -0000 1.2 *************** *** 63,71 **** drawNormal(gl); } /** {@inheritDoc} */ public Intersection intersection(Edge e) { ! Vertex n = u.cross(v); ! Plane plane = new Plane(n, origin); Vertex vertex = plane.intersection(e); return new Intersection(vertex, Intersection.PLANE_INTERSECTION, plane); --- 63,76 ---- drawNormal(gl); } + + private Plane plane() { + Vertex n = u.cross(v); + Plane plane = new Plane(n, origin); + return plane; + } /** {@inheritDoc} */ public Intersection intersection(Edge e) { ! Plane plane = plane(); Vertex vertex = plane.intersection(e); return new Intersection(vertex, Intersection.PLANE_INTERSECTION, plane); *************** *** 152,154 **** --- 157,165 ---- return handles; } + + /** {@inheritDoc} */ + public boolean contains(Vertex v) { + Plane plane = plane(); + return plane.contains(v); + } } Index: FinalMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** FinalMoveTool.java 13 Jan 2010 10:58:30 -0000 1.56 --- FinalMoveTool.java 5 Feb 2010 13:32:59 -0000 1.57 *************** *** 29,33 **** import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometric; - import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Instance; import net.sourceforge.bprocessor.model.Mesh; --- 29,32 ---- *************** *** 464,468 **** v.scaleIt(i); Mesh copy = mesh.copy(new HashMap()); ! for (Vertex current : Geometry.collect(copy.geometrics())) { current.setX(current.getX() + v.getX()); current.setY(current.getY() + v.getY()); --- 463,467 ---- v.scaleIt(i); Mesh copy = mesh.copy(new HashMap()); ! for (Vertex current : Geometric.collect(copy.geometrics())) { current.setX(current.getX() + v.getX()); current.setY(current.getY() + v.getY()); *************** *** 479,483 **** v.scaleIt(d / v.length()); Mesh copy = mesh.copy(new HashMap()); ! for (Vertex current : Geometry.collect(copy.geometrics())) { current.setX(current.getX() + v.getX()); current.setY(current.getY() + v.getY()); --- 478,482 ---- v.scaleIt(d / v.length()); Mesh copy = mesh.copy(new HashMap()); ! for (Vertex current : Geometric.collect(copy.geometrics())) { current.setX(current.getX() + v.getX()); current.setY(current.getY() + v.getY()); *************** *** 661,665 **** } ! vertices = Geometry.collect(geometrics); mover = new VectorMove(vertices); --- 660,664 ---- } ! vertices = Geometric.collect(geometrics); mover = new VectorMove(vertices); Index: RotationToolB.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RotationToolB.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RotationToolB.java 13 Jan 2010 10:58:30 -0000 1.1 --- RotationToolB.java 5 Feb 2010 13:32:59 -0000 1.2 *************** *** 10,13 **** --- 10,15 ---- import java.awt.Cursor; import java.awt.event.MouseEvent; + import java.util.Collection; + import java.util.Collections; import java.util.Iterator; import java.util.LinkedList; *************** *** 19,23 **** import net.sourceforge.bprocessor.model.Geometric; import net.sourceforge.bprocessor.model.Geometry; - import net.sourceforge.bprocessor.model.Instance; import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Project; --- 21,24 ---- *************** *** 29,37 **** */ public class RotationToolB extends AbstractPencil { private CoordinateSystem system; private Protract protract; private Vertex base; ! private List<Vertex> vertices; ! private List<Vertex> originals; /** --- 30,44 ---- */ public class RotationToolB extends AbstractPencil { + private List<Vertex> vertices; + private List<Vertex> originals; + + private Collection<Geometric> affected; + private CoordinateSystem system; private Protract protract; private Vertex base; ! ! ! /** *************** *** 89,92 **** --- 96,100 ---- Project.getInstance().changed(vertices); cache(); + excluded(Collections.EMPTY_LIST); } *************** *** 95,110 **** */ protected void moved(MouseEvent e) { ! current = findIntersection(e); ! if (current != null) { ! if (system != null) { ! if (base != null) { ! double angle = angle(); ! if (!Double.isNaN(angle)) { ! rotate(angle); } } } - updateFeedback(); } } /** --- 103,125 ---- */ protected void moved(MouseEvent e) { ! if (vertices == null) { ! findTarget(e); ! } else { ! if (affected != null && base != null) { ! excluded(affected); ! } ! current = findIntersection(e); ! if (current != null) { ! if (system != null) { ! if (base != null) { ! double angle = angle(); ! if (!Double.isNaN(angle)) { ! rotate(angle); ! } } } } } + updateFeedback(); } /** *************** *** 112,140 **** */ protected void pressed(MouseEvent e) { ! current = findIntersection(e); ! if (current != null) { ! if (system != null) { ! if (base == null) { ! base = direction(); ! } else { ! double angle = angle(); ! rotate(angle); ! finish(); ! } ! } else { ! if (start == null) { ! start = current; } else { ! Vertex origin = start.vertex(); ! Vertex to = current.vertex(); ! Vertex n = to.minus(origin); ! if (!n.isZero()) { ! n.normalize(); ! system = CoordinateSystem.systemFor(origin, n); ! start = null; } } } - updateFeedback(); } } --- 127,164 ---- */ protected void pressed(MouseEvent e) { ! if (vertices == null) { ! if (target != null) { ! activate((Geometric) target); ! } ! } else { ! if (affected != null && base != null) { ! excluded(affected); ! } ! current = findIntersection(e); ! if (current != null) { ! if (system != null) { ! if (base == null) { ! base = direction(); ! } else { ! double angle = angle(); ! rotate(angle); ! finish(); ! } } else { ! if (start == null) { ! start = current; ! } else { ! Vertex origin = start.vertex(); ! Vertex to = current.vertex(); ! Vertex n = to.minus(origin); ! if (!n.isZero()) { ! n.normalize(); ! system = CoordinateSystem.systemFor(origin, n); ! start = null; ! } } } + updateFeedback(); } } } *************** *** 207,229 **** List<Edge> edges = new LinkedList(); ! if (current != null) { ! if (system != null) { ! showConstructors = false; ! Vertex center = system.getOrigin(); ! Vertex i = base(); ! Vertex j = normal().cross(i); ! protract = new Protract(center, i, j, true); ! editor.getView().addGlObjects3D(protract); ! } else { ! showConstructors = true; ! if (start != null) { ! Vertex origin = start.vertex(); ! Vertex to = current.vertex(); ! Edge axis = new Edge(origin, to); ! axis.setStrippled(true); ! edges.add(axis); } } } feedback(edges); makeTarget(current); --- 231,259 ---- List<Edge> edges = new LinkedList(); ! ! if (vertices != null) { ! if (current != null) { ! if (system != null) { ! showConstructors = false; ! Vertex center = system.getOrigin(); ! Vertex i = base(); ! Vertex j = normal().cross(i); ! protract = new Protract(center, i, j, true); ! editor.getView().addGlObjects3D(protract); ! } else { ! showConstructors = true; ! if (start != null) { ! Vertex origin = start.vertex(); ! Vertex to = current.vertex(); ! Edge axis = new Edge(origin, to); ! axis.setStrippled(true); ! edges.add(axis); ! } } } + } else { + editor.getView().makeTarget(target); } + feedback(edges); makeTarget(current); *************** *** 247,270 **** public void prepare() { setLabel("Angle:"); ! if (Selection.primary().size() == 1) { ! Geometric geometric = Selection.primary().iterator().next(); ! system = systemFor(geometric); ! if (system != null) { ! system = system.copy(); ! } } - vertices = new LinkedList(Selection.primary().collect()); - cache(); } ! private CoordinateSystem systemFor(Geometric geometric) { ! if (geometric instanceof Instance) { ! return systemFor((Instance) geometric); } - return null; } ! private CoordinateSystem systemFor(Instance instance) { ! return instance.getAnchor(); } --- 277,308 ---- public void prepare() { setLabel("Angle:"); ! System.out.println("rotation-prepare " + System.currentTimeMillis()); ! if (!Selection.primary().isEmpty()) { ! activate(Selection.primary()); } } ! ! /** ! * ! * @param geometric Geometric ! */ ! public void activate(Geometric geometric) { ! Collection<Geometric> geometrics = new LinkedList(); ! activate(geometrics); ! system = CoordinateSystem.systemFor(geometric); ! if (system != null) { ! system = system.copy(); } } ! /** ! * ! * @param geometrics Geometrics ! */ ! public void activate(Collection<Geometric> geometrics) { ! vertices = new LinkedList(Geometric.collect(geometrics)); ! cache(); ! affected = getAffected(geometrics); } *************** *** 287,290 **** --- 325,330 ---- base = null; system = null; + vertices = null; + affected = null; } } Index: RotationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RotationTool.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** RotationTool.java 13 Jan 2010 10:58:30 -0000 1.36 --- RotationTool.java 5 Feb 2010 13:32:59 -0000 1.37 *************** *** 432,435 **** --- 432,442 ---- return plane; } + + /** + * @inheritDoc + */ + public boolean contains(Vertex v) { + return getPlane().contains(v); + } } |
From: Michael L. <he...@us...> - 2010-02-05 13:33:07
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4483/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Display.java PopupMenu.java Log Message: Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** Display.java 13 Jan 2010 10:58:30 -0000 1.100 --- Display.java 5 Feb 2010 13:32:59 -0000 1.101 *************** *** 928,932 **** paint(space.getAnchor()); } else { ! paint(space.getAnchor()); } translateToCoordinatesystem(space); --- 928,932 ---- paint(space.getAnchor()); } else { ! // paint(space.getAnchor()); } translateToCoordinatesystem(space); Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/PopupMenu.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** PopupMenu.java 9 Sep 2009 10:31:03 -0000 1.37 --- PopupMenu.java 5 Feb 2010 13:32:59 -0000 1.38 *************** *** 521,574 **** return pm; } - - private CoordinateSystem systemFor(Geometric geometric) { - if (geometric instanceof Vertex) { - return systemFor((Vertex) geometric); - } else if (geometric instanceof Surface) { - return systemFor((Surface) geometric); - } else if (geometric instanceof CoordinateSystem) { - return (CoordinateSystem) geometric; - } else { - CoordinateSystem active = Project.getInstance().getActiveCoordinateSystem(); - return active.copy(geometric.center()); - } - } - - private CoordinateSystem systemFor(Vertex vertex) { - Collection<Edge> edges = vertex.getEdges(); - if (edges.size() == 0) { - CoordinateSystem active = Project.getInstance().getActiveCoordinateSystem(); - return active.copy(vertex.copy()); - } else { - double x = 0; - double y = 0; - double z = 0; - for (Edge current : edges) { - Vertex other = current.otherVertex(vertex); - Vertex v = other.minus(vertex); - x += v.getX(); - y += v.getY(); - z += v.getZ(); - } - x /= edges.size(); - y /= edges.size(); - z /= edges.size(); - Vertex n = new Vertex(-x, -y, -z); - Edge edge = edges.iterator().next(); - Vertex other = edge.otherVertex(vertex); - - Vertex v = other.minus(vertex); - Vertex i = n.cross(v); - Vertex j = n.cross(i); - Vertex o = vertex.copy(); - return new CoordinateSystem(i, j, n, o); - } - } - - private CoordinateSystem systemFor(Surface surface) { - Vertex normal = surface.normal(); - Vertex origin = surface.center(); - return CoordinateSystem.systemFor(origin, normal); - } /** --- 521,524 ---- *************** *** 586,590 **** Project.getInstance().changed(current); } ! Project.getInstance().changed(Geometry.collect(entities)); Project.getInstance().checkpoint(); --- 536,540 ---- Project.getInstance().changed(current); } ! Project.getInstance().changed(Geometric.collect(entities)); Project.getInstance().checkpoint(); *************** *** 673,677 **** if (entities.size() == 1) { Geometric geometric = entities.iterator().next(); ! Project.getInstance().setActiveCoordinateSystem(systemFor(geometric)); Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); --- 623,627 ---- if (entities.size() == 1) { Geometric geometric = entities.iterator().next(); ! Project.getInstance().setActiveCoordinateSystem(CoordinateSystem.systemFor(geometric)); Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); *************** *** 684,688 **** AbstractAction action = new GeometricMenuAction(arguments, "Scale...") { public void actionPerformed(ActionEvent event) { ! Set<Vertex> vertices = Geometry.collect(entities); Vertex center = null; --- 634,638 ---- AbstractAction action = new GeometricMenuAction(arguments, "Scale...") { public void actionPerformed(ActionEvent event) { ! Set<Vertex> vertices = Geometric.collect(entities); Vertex center = null; *************** *** 712,716 **** AbstractAction action = new GeometricMenuAction(arguments, "Translate...") { public void actionPerformed(ActionEvent event) { ! Set<Vertex> vertices = Geometry.collect(entities); Vertex center = null; --- 662,666 ---- AbstractAction action = new GeometricMenuAction(arguments, "Translate...") { public void actionPerformed(ActionEvent event) { ! Set<Vertex> vertices = Geometric.collect(entities); Vertex center = null; *************** *** 741,745 **** AbstractAction action = new GeometricMenuAction(arguments, "Rotate...") { public void actionPerformed(ActionEvent event) { ! Set<Vertex> vertices = Geometry.collect(entities); Vertex center = null; --- 691,695 ---- AbstractAction action = new GeometricMenuAction(arguments, "Rotate...") { public void actionPerformed(ActionEvent event) { ! Set<Vertex> vertices = Geometric.collect(entities); Vertex center = null; *************** *** 770,774 **** AbstractAction action = new GeometricMenuAction(arguments, "Transform In") { public void actionPerformed(ActionEvent event) { ! List<Vertex> vertices = new ArrayList(Geometry.collect(entities)); CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); system.unTranslateIt(vertices); --- 720,724 ---- AbstractAction action = new GeometricMenuAction(arguments, "Transform In") { public void actionPerformed(ActionEvent event) { ! List<Vertex> vertices = new ArrayList(Geometric.collect(entities)); CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); system.unTranslateIt(vertices); *************** *** 785,789 **** AbstractAction action = new GeometricMenuAction(arguments, "Transform Out") { public void actionPerformed(ActionEvent event) { ! List<Vertex> vertices = new ArrayList(Geometry.collect(entities)); CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); system.translateIt(vertices); --- 735,739 ---- AbstractAction action = new GeometricMenuAction(arguments, "Transform Out") { public void actionPerformed(ActionEvent event) { ! List<Vertex> vertices = new ArrayList(Geometric.collect(entities)); CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); system.translateIt(vertices); Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.292 retrieving revision 1.293 diff -C2 -d -r1.292 -r1.293 *** View.java 5 Oct 2009 10:50:24 -0000 1.292 --- View.java 5 Feb 2010 13:32:59 -0000 1.293 *************** *** 1587,1590 **** --- 1587,1612 ---- } } + + { + System.out.println("-- process select --"); + if (surface != null) { + System.out.println(" surface: " + surface.getLastInPath()); + } else { + System.out.println(" surface: null"); + } + if (vertex != null) { + System.out.println(" vertex: " + vertex.getLastInPath()); + } else { + System.out.println(" vertex: null"); + } + if (edge != null) { + System.out.println(" edge: " + edge.getLastInPath()); + } else { + System.out.println(" edge: null"); + } + System.out.println(" glo: " + glo); + + } + if (surface != null) { if (unWantedEntities.contains(surface.getLastInPath())) { *************** *** 1598,1601 **** --- 1620,1624 ---- if (nearestSurface < nearestVertex) { if (plane != null && !plane.contains((Vertex)vertex.getLastInPath())) { + System.out.println(" surface kills vertex"); vertex = null; } *************** *** 1615,1618 **** --- 1638,1642 ---- if (!((Edge)edge.getLastInPath()).intersects((Vertex)vertex.getLastInPath())) { vertex = null; + System.out.println(" edge kills vertex"); } else { edge = null; *************** *** 1663,1671 **** surface = null; edge = null; ! vertex = null; } if (intersections) { ! return findIntersected(unWantedEntities, xy, surface, vertex, edge, ! glo, object, edges); } else { if (object != null) { --- 1687,1722 ---- surface = null; edge = null; ! ! if (vertex != null) { ! if (!glo.contains((Vertex) vertex.getLastInPath())) { ! vertex = null; ! } else { ! System.out.println(" its a keeper"); ! } ! } ! } if (intersections) { ! { ! System.out.println("-- intersect --"); ! if (surface != null) { ! System.out.println(" surface: " + surface.getLastInPath()); ! } ! if (vertex != null) { ! System.out.println(" vertex: " + vertex.getLastInPath()); ! } ! if (edge != null) { ! System.out.println(" edge: " + edge.getLastInPath()); ! } ! if (glo != null) { ! System.out.println(" glo: " + glo); ! } ! } ! ! Intersection intersection = findIntersected(unWantedEntities, xy, surface, vertex, edge, ! glo, object, edges); ! System.out.println(" intersection: " + intersection); ! ! return intersection; } else { if (object != null) { |
From: Michael L. <he...@us...> - 2010-02-05 13:33:07
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4483/src/net/sourceforge/bprocessor/gl/model Modified Files: GlCamera.java GlObject.java Log Message: Index: GlObject.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model/GlObject.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** GlObject.java 15 Nov 2007 13:07:41 -0000 1.8 --- GlObject.java 5 Feb 2010 13:32:59 -0000 1.9 *************** *** 43,45 **** --- 43,52 ---- */ public Intersection intersection(Edge e); + + /** + * Returns true if vertex is contained in this GLObject + * @param v Vertex + * @return true if contained + */ + public boolean contains(Vertex v); } Index: GlCamera.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/model/GlCamera.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GlCamera.java 15 Nov 2007 13:07:41 -0000 1.4 --- GlCamera.java 5 Feb 2010 13:32:59 -0000 1.5 *************** *** 101,103 **** --- 101,108 ---- return new LinkedList(); } + + /** {@inheritDoc} */ + public boolean contains(Vertex v) { + return false; + } } |
From: Michael L. <he...@us...> - 2010-02-05 13:33:03
|
Update of /cvsroot/bprocessor/bprocessor/components/basic In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4456/components/basic Added Files: light.bp Log Message: --- NEW FILE: light.bp --- <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <bmodel> <units>meter</units> <active>1</active> <cs>6</cs> <name>New Project</name> <space type="1" transparent="true" union="false" net="false" name="World" voidref="2" progid="0" id="1"> <description/> <Classification>unassigned</Classification> <constructor xsi:type="CoordinateSystemType" onlyplane="false" editable="true" active="true" progid="1" id="6" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <vertex z="0.0" y="0.0" x="0.0" id="7"/> <ijn> <vertex z="0.0" y="0.0" x="1.0" id="3"/> <vertex z="0.0" y="1.0" x="0.0" id="4"/> <vertex z="1.0" y="0.0" x="0.0" id="5"/> </ijn> </constructor> <constructor xsi:type="GridType" distance="2.4000000953674316" width="28.799999237060547" height="19.200000762939453" editable="true" active="false" progid="2" id="8" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <vertex z="0.0" y="0.0" x="0.0" id="9"/> </constructor> <space type="1" transparent="true" union="false" net="false" name="Void" progid="1" id="2"> <description/> <Classification>unassigned</Classification> </space> </space> <material name="Functional" R="0.9" B="0.9" G="0.9" id="10"/> <material name="Construction" R="0.96" B="0.7" G="0.87" id="11"/> <material name="Void" R="0.91071427" B="0.8035714" G="0.8142857" id="12"/> <material name="Yellow" R="1.0" B="0.0" G="0.8" id="13"/> <view name="(Current)" id="45"> <scalefactor>0</scalefactor> <camera z="1.338154240206769" y="-2.0855050897531884" x="1.4813214444265284"/> <center z="0.2" y="0.0" x="0.0"/> <roll z="0.9483236552062009" y="-0.2586889298375406" x="0.18374515655075654"/> <focalwidth>35.0</focalwidth> <type>6</type> </view> <global> <key>pi</key> <value xsi:type="DoubleType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <double>3.141592653589793</double> </value> </global> <global> <key>wall</key> <value xsi:type="DoubleType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <double>0.15</double> </value> </global> <global> <key>isolation</key> <value xsi:type="DoubleType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <double>0.1</double> </value> </global> <global> <key>brick</key> <value xsi:type="DoubleType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <double>0.12</double> </value> </global> <global> <key>roof</key> <value xsi:type="DoubleType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <double>0.07</double> </value> </global> <catalogObjects version="n/a" author="n/a" useableLevels="0" locked="false" name="Light" progid="1" id="14"> <space type="0" transparent="false" union="true" net="false" name="Light" voidref="16" id="15"> <description/> <Classification>unassigned</Classification> <space type="1" transparent="true" union="false" net="false" name="Void" progid="1" id="16"> <description/> <Classification>unassigned</Classification> <boundary>19</boundary> <boundary>20</boundary> <boundary>21</boundary> <boundary>22</boundary> <boundary>23</boundary> <boundary>24</boundary> <boundary>25</boundary> <boundary>26</boundary> </space> <space type="0" transparent="false" insideMaterial="13" union="false" net="false" name="Inside" voidref="18" progid="2" id="17"> <description/> <Classification>unassigned</Classification> <boundary>19</boundary> <boundary>20</boundary> <boundary>21</boundary> <boundary>22</boundary> <boundary>23</boundary> <boundary>24</boundary> <boundary>25</boundary> <boundary>26</boundary> <space type="1" transparent="true" union="false" net="false" name="Void" progid="1" id="18"> <description/> <Classification>unassigned</Classification> </space> </space> <surface progid="1" id="19"> <edgeref>31</edgeref> <edgeref>29</edgeref> <edgeref>30</edgeref> <back>16</back> <front>17</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="2" id="20"> <edgeref>30</edgeref> <edgeref>28</edgeref> <edgeref>33</edgeref> <back>16</back> <front>17</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="3" id="21"> <edgeref>33</edgeref> <edgeref>37</edgeref> <edgeref>27</edgeref> <back>16</back> <front>17</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="4" id="22"> <edgeref>27</edgeref> <edgeref>36</edgeref> <edgeref>31</edgeref> <back>16</back> <front>17</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="5" id="23"> <edgeref>35</edgeref> <edgeref>29</edgeref> <edgeref>34</edgeref> <back>17</back> <front>16</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="6" id="24"> <edgeref>34</edgeref> <edgeref>28</edgeref> <edgeref>38</edgeref> <back>17</back> <front>16</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="7" id="25"> <edgeref>38</edgeref> <edgeref>37</edgeref> <edgeref>32</edgeref> <back>17</back> <front>16</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <surface progid="8" id="26"> <edgeref>32</edgeref> <edgeref>36</edgeref> <edgeref>35</edgeref> <back>17</back> <front>16</front> <exterior>0</exterior> <frontMaterial>0</frontMaterial> <backMaterial>0</backMaterial> </surface> <edge constructor="false" smooth="false" progid="1" id="27"> <from>44</from> <to>43</to> </edge> <edge constructor="false" smooth="false" progid="2" id="28"> <from>40</from> <to>42</to> </edge> <edge constructor="false" smooth="false" progid="3" id="29"> <from>39</from> <to>40</to> </edge> <edge constructor="false" smooth="false" progid="4" id="30"> <from>40</from> <to>43</to> </edge> <edge constructor="false" smooth="false" progid="5" id="31"> <from>39</from> <to>43</to> </edge> <edge constructor="false" smooth="false" progid="6" id="32"> <from>44</from> <to>41</to> </edge> <edge constructor="false" smooth="false" progid="7" id="33"> <from>42</from> <to>43</to> </edge> <edge constructor="false" smooth="false" progid="8" id="34"> <from>40</from> <to>41</to> </edge> <edge constructor="false" smooth="false" progid="9" id="35"> <from>39</from> <to>41</to> </edge> <edge constructor="false" smooth="false" progid="10" id="36"> <from>44</from> <to>39</to> </edge> <edge constructor="false" smooth="false" progid="11" id="37"> <from>42</from> <to>44</to> </edge> <edge constructor="false" smooth="false" progid="12" id="38"> <from>42</from> <to>41</to> </edge> <vertex z="0.2666666667" y="-0.1" x="-0.1" progid="1" id="39"/> <vertex z="0.2666666667" y="-0.1" x="0.1" progid="2" id="40"/> <vertex z="0.4" y="0.0" x="0.0" progid="3" id="41"/> <vertex z="0.2666666667" y="0.1" x="0.1" progid="4" id="42"/> <vertex z="0.0" y="0.0" x="0.0" progid="5" id="43"/> <vertex z="0.2666666667" y="0.1" x="-0.1" progid="6" id="44"/> </space> </catalogObjects> </bmodel> |
From: Michael L. <he...@us...> - 2010-02-05 13:32:59
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4431/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Geometry.java Line.java Camera.java Geometric.java Project.java Persistence.java CoordinateSystem.java Log Message: Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** CoordinateSystem.java 25 Jun 2009 22:17:30 -0000 1.77 --- CoordinateSystem.java 5 Feb 2010 13:32:50 -0000 1.78 *************** *** 102,119 **** */ public static CoordinateSystem systemFor(Geometric geometric) { ! if (geometric instanceof Surface) { return systemFor((Surface) geometric); } else { ! return new CoordinateSystem(geometric.center().copy()); } } ! /** ! * Returns a CoordinateSystem for the given surface. ! * @param surface The surface to return a CoordinateSystem for. ! * @return A CoordinateSystem for the given surface. ! */ ! public static CoordinateSystem systemFor(Surface surface) { ! return surface.coordinateSystem(); } --- 102,155 ---- */ public static CoordinateSystem systemFor(Geometric geometric) { ! if (geometric instanceof Vertex) { ! return systemFor((Vertex) geometric); ! } else if (geometric instanceof Surface) { return systemFor((Surface) geometric); + } else if (geometric instanceof CoordinateSystem) { + return (CoordinateSystem) geometric; + } else if (geometric instanceof Instance) { + Instance instance = (Instance) geometric; + return instance.getAnchor(); } else { ! CoordinateSystem active = Project.getInstance().getActiveCoordinateSystem(); ! return active.copy(geometric.center()); } } ! private static CoordinateSystem systemFor(Vertex vertex) { ! Collection<Edge> edges = vertex.getEdges(); ! if (edges.size() == 0) { ! CoordinateSystem active = Project.getInstance().getActiveCoordinateSystem(); ! return active.copy(vertex.copy()); ! } else { ! double x = 0; ! double y = 0; ! double z = 0; ! for (Edge current : edges) { ! Vertex other = current.otherVertex(vertex); ! Vertex v = other.minus(vertex); ! x += v.getX(); ! y += v.getY(); ! z += v.getZ(); ! } ! x /= edges.size(); ! y /= edges.size(); ! z /= edges.size(); ! Vertex n = new Vertex(-x, -y, -z); ! Edge edge = edges.iterator().next(); ! Vertex other = edge.otherVertex(vertex); ! ! Vertex v = other.minus(vertex); ! Vertex i = n.cross(v); ! Vertex j = n.cross(i); ! Vertex o = vertex.copy(); ! return new CoordinateSystem(i, j, n, o); ! } ! } ! ! private static CoordinateSystem systemFor(Surface surface) { ! Vertex normal = surface.normal(); ! Vertex origin = surface.center(); ! return CoordinateSystem.systemFor(origin, normal); } Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** Persistence.java 13 Jan 2010 10:58:34 -0000 1.85 --- Persistence.java 5 Feb 2010 13:32:50 -0000 1.86 *************** *** 788,792 **** Iterator iter = ids.iterator(); while (iter.hasNext()) { ! set.add(map.get((Long) iter.next())); } return set; --- 788,798 ---- Iterator iter = ids.iterator(); while (iter.hasNext()) { ! Long id = (Long) iter.next(); ! Object object = map.get(id); ! if (object != null) { ! set.add(object); ! } else { ! System.out.println("surface " + id + " not found"); ! } } return set; Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** Edge.java 25 Jun 2009 22:17:30 -0000 1.111 --- Edge.java 5 Feb 2010 13:32:50 -0000 1.112 *************** *** 1106,1110 **** Map<Vertex, Edge> sideMap = new HashMap<Vertex, Edge>(); Map<Edge, Edge> topMap = new HashMap<Edge, Edge>(); ! Set<Vertex> vertexes = Geometry.collect(edges); // generate new vertexes and edges to them --- 1106,1110 ---- Map<Vertex, Edge> sideMap = new HashMap<Vertex, Edge>(); Map<Edge, Edge> topMap = new HashMap<Edge, Edge>(); ! Set<Vertex> vertexes = Geometric.collect(edges); // generate new vertexes and edges to them Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.183 retrieving revision 1.184 diff -C2 -d -r1.183 -r1.184 *** Project.java 27 Nov 2009 13:35:26 -0000 1.183 --- Project.java 5 Feb 2010 13:32:50 -0000 1.184 *************** *** 1929,1932 **** --- 1929,1955 ---- printer.println("</Object>"); } + + for (Item current : world.getElements()) { + if (current instanceof Instance) { + Instance instance = (Instance) current; + Space proto = instance.getProto(); + if (proto.getName().equals("Light")) { + String value = "<Light" + + " id=\"" + instance.getId() + "\"" + + " name=\"" + instance.getName() + "\"" + + ">"; + printer.println(value); + Vertex origin = instance.getAnchor().getOrigin(); + String str = " <position" + + " x=\"" + origin.getX() + "\"" + + " y=\"" + origin.getY() + "\"" + + " z=\"" + origin.getZ() + "\"" + + "/>"; + printer.println(str); + printer.println("</Light>"); + } + } + } + printer.println("</Scene"); out.close(); Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** Camera.java 27 Nov 2009 13:35:26 -0000 1.61 --- Camera.java 5 Feb 2010 13:32:50 -0000 1.62 *************** *** 457,461 **** */ public void zoomOn(Collection<? extends Geometric> c, double aspect, double d) { ! Set<Vertex> all = Geometry.collect(c); if (!all.isEmpty()) { --- 457,461 ---- */ public void zoomOn(Collection<? extends Geometric> c, double aspect, double d) { ! Set<Vertex> all = Geometric.collect(c); if (!all.isEmpty()) { Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** Geometry.java 25 Jun 2009 22:17:29 -0000 1.73 --- Geometry.java 5 Feb 2010 13:32:50 -0000 1.74 *************** *** 355,413 **** return insertEdges(space, edges); } - - /** - * Collect all vertices from a collection of geometrics - * @param geometrics Collection of objects - * @return Set of vertices - */ - public static Set<Vertex> collect(Collection geometrics) { - Iterator it = geometrics.iterator(); - Set<Vertex> result = new HashSet<Vertex>(); - while (it.hasNext()) { - Object o = it.next(); - if (o instanceof Geometric) { - result.addAll(((Geometric)o).collect()); - } - } - return result; - } - - /** - * Collect all vertices from a collection of objects - * @param objects Collection of objects - * @param vertices Set of vertices - */ - public static void collect(Collection objects, Set vertices) { - Iterator iter = objects.iterator(); - while (iter.hasNext()) { - Object current = iter.next(); - collect(current, vertices); - } - } - - /** - * Collect vertices from object - * @param o The object - * @param vertices The vertices - */ - public static void collect(Object o, Set vertices) { - if (o instanceof Vertex) { - vertices.add(o); - } else if (o instanceof Edge) { - Edge edge = (Edge) o; - vertices.add(edge.getFrom()); - vertices.add(edge.getTo()); - } else if (o instanceof Surface) { - Surface surface = (Surface) o; - vertices.addAll(surface.getVertices()); - for (Surface current : surface.getHoles()) { - collect(current, vertices); - } - } else if (o instanceof ClippingPlane) { - ClippingPlane plane = (ClippingPlane) o; - vertices.add(plane.center()); - } - } - /** --- 355,358 ---- *************** *** 536,540 **** edges.addAll(s.getEdges()); } ! vertices.addAll(Geometry.collect(edges)); allPossibleCollapses(vertices); allEdgeCollapses(edges); --- 481,485 ---- edges.addAll(s.getEdges()); } ! vertices.addAll(Geometric.collect(edges)); allPossibleCollapses(vertices); allEdgeCollapses(edges); *************** *** 810,814 **** * @return a set of extendable edges */ ! private static List<Edge> firstExtendList(Set<Edge> edges) { List<Edge> extendable = new LinkedList<Edge>(); for (Edge e : edges) { --- 755,759 ---- * @return a set of extendable edges */ ! private static List<Edge> firstExtendList(Set<Edge> edges) { List<Edge> extendable = new LinkedList<Edge>(); for (Edge e : edges) { *************** *** 894,898 **** public static void unTranslateGeometry(Collection<? extends Geometric> geometry, CoordinateSystem system) { ! system.unTranslateIt(collect(geometry)); } --- 839,843 ---- public static void unTranslateGeometry(Collection<? extends Geometric> geometry, CoordinateSystem system) { ! system.unTranslateIt(Geometric.collect(geometry)); } Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** Line.java 17 Dec 2007 13:09:15 -0000 1.39 --- Line.java 5 Feb 2010 13:32:50 -0000 1.40 *************** *** 11,14 **** --- 11,15 ---- import java.util.LinkedList; import java.util.List; + import java.util.Set; import org.apache.log4j.Logger; *************** *** 76,79 **** --- 77,89 ---- this.direction = dir; } + + /** + * {@inheritDoc} + */ + public Set<Vertex> collect() { + Set<Vertex> result = super.collect(); + result.addAll(handles(1.0)); + return result; + } /** {@inheritDoc} */ Index: Geometric.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometric.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Geometric.java 25 Jun 2009 22:17:30 -0000 1.24 --- Geometric.java 5 Feb 2010 13:32:50 -0000 1.25 *************** *** 59,62 **** --- 59,77 ---- /** + * Collect all vertices from a collection of geometrics + * @param geometrics Collection of objects + * @return Set of vertices + */ + public static Set<Vertex> collect(Collection<? extends Geometric> geometrics) { + Set<Vertex> result = new HashSet<Vertex>(); + for (Geometric current : geometrics) { + result.addAll((current).collect()); + } + return result; + } + + + + /** * Get the space * @return The space |
From: Michael L. <he...@us...> - 2010-01-13 10:58:45
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv15671/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: new rotation tool Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.145 retrieving revision 1.146 diff -C2 -d -r1.145 -r1.146 *** GenericTreeView.java 25 Jun 2009 22:17:33 -0000 1.145 --- GenericTreeView.java 13 Jan 2010 10:58:37 -0000 1.146 *************** *** 680,684 **** SpaceNode proto = new ContainerNode(space.getProto()); add(proto); ! CoordinateSystem cs = space.getInstanceAnchor(); if (cs != null) { add(new ConstructorNode(cs)); --- 680,684 ---- SpaceNode proto = new ContainerNode(space.getProto()); add(proto); ! CoordinateSystem cs = space.getTransformation(); if (cs != null) { add(new ConstructorNode(cs)); *************** *** 696,700 **** ((GenericNode)getChildAt(0)).update(instance.getEnvelope()); ((GenericNode)getChildAt(1)).update(instance.getProto()); ! ((GenericNode)getChildAt(2)).update(instance.getInstanceAnchor()); } else { removeAllChildren(); --- 696,700 ---- ((GenericNode)getChildAt(0)).update(instance.getEnvelope()); ((GenericNode)getChildAt(1)).update(instance.getProto()); ! ((GenericNode)getChildAt(2)).update(instance.getTransformation()); } else { removeAllChildren(); |