bprocessor-commit Mailing List for B-processor (Page 73)
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...> - 2007-03-14 10:22:20
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18112/src/net/sourceforge/bprocessor/model Modified Files: CoordinateSystem.java Log Message: Improved handling of relations Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** CoordinateSystem.java 13 Mar 2007 15:21:24 -0000 1.44 --- CoordinateSystem.java 14 Mar 2007 10:22:13 -0000 1.45 *************** *** 48,54 **** if (geometrics.size() > 0) { Geometric leader = geometrics.iterator().next(); ! CoordinateSystem system = systemFor(leader); for (Geometric geometric : geometrics) { ! system.relate(geometric); } Project.getInstance().world().add(system); --- 48,64 ---- if (geometrics.size() > 0) { Geometric leader = geometrics.iterator().next(); ! CoordinateSystem system = systemOf(leader); ! if (system == null) { ! system = systemFor(leader); ! } for (Geometric geometric : geometrics) { ! CoordinateSystem existing = systemOf(geometric); ! if (existing != null) { ! if (existing != system) { ! system.relate(existing); ! } ! } else { ! system.relate(geometric); ! } } Project.getInstance().world().add(system); *************** *** 80,83 **** --- 90,118 ---- /** + * Returns a CoordinateSystem that the given geometric is related + * to if it exists. + * @param geometric Geometric object of wich to return a related CoordinateSystem + * @return A CoordinateSystem related to the given geometric object. + */ + public static CoordinateSystem systemOf(Geometric geometric) { + Space space = geometric.getOwner(); + List<CoordinateSystem> result = new LinkedList(); + Collection<CoordinateSystem> systems = space.getCoordinateSystems(); + for (CoordinateSystem current : systems) { + Collection<Relation> relations = current.relations(); + for (Relation relation : relations) { + if (relation.geometric() == geometric) { + result.add(current); + } + } + } + if (result.size() > 0) { + return result.get(0); + } else { + return null; + } + } + + /** * Empty constructor for persistence only */ *************** *** 150,154 **** relate((Surface) geometric); } else { ! } } --- 185,192 ---- relate((Surface) geometric); } else { ! Vertex origin = geometric.center(); ! double distance = plane().distance(origin); ! Relation relation = new Relation(geometric, String.valueOf(distance)); ! add(relation); } } |
|
From: Michael L. <he...@us...> - 2007-03-14 10:22:17
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17777/src/net/sourceforge/bprocessor/gl/tool Modified Files: AltMoveTool.java Log Message: Improved handling of relations Index: AltMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AltMoveTool.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AltMoveTool.java 12 Mar 2007 08:32:43 -0000 1.8 --- AltMoveTool.java 14 Mar 2007 10:22:08 -0000 1.9 *************** *** 24,28 **** import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Project; - import net.sourceforge.bprocessor.model.Relation; import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Space; --- 24,27 ---- *************** *** 107,119 **** Space space = surface.getOwner(); ! Collection<CoordinateSystem> systems = space.getCoordinateSystems(); ! for (CoordinateSystem current : systems) { ! Collection<Relation> relations = current.relations(); ! for (Relation relation : relations) { ! if (relation.geometric() == surface) { ! system = current; ! } ! } ! } vertices = surface.collect(); --- 106,110 ---- Space space = surface.getOwner(); ! system = CoordinateSystem.systemOf(surface); vertices = surface.collect(); |
|
From: Michael L. <he...@us...> - 2007-03-13 15:21:41
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12205/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Line.java Point.java CoordinateSystem.java Constructor.java Log Message: Refactored code related to relations Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.140 retrieving revision 1.141 diff -C2 -d -r1.140 -r1.141 *** Surface.java 12 Mar 2007 15:58:01 -0000 1.140 --- Surface.java 13 Mar 2007 15:21:23 -0000 1.141 *************** *** 1530,1534 **** if (j != null) { j.scale(1 / j.length()); ! return new CoordinateSystem(i, j, n, origin); } } --- 1530,1534 ---- if (j != null) { j.scale(1 / j.length()); ! return new CoordinateSystem(i, j, n, origin.copy()); } } Index: Point.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Point.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Point.java 2 Jan 2007 17:48:58 -0000 1.14 --- Point.java 13 Mar 2007 15:21:24 -0000 1.15 *************** *** 36,47 **** return new Vertex(x, y, z); } - - /** - * Return the center for the entity - * @return The center as a vertex - */ - public Vertex center() { - return getOrigin(); - } /** --- 36,39 ---- Index: Constructor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Constructor.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Constructor.java 4 Mar 2007 23:14:45 -0000 1.18 --- Constructor.java 13 Mar 2007 15:21:24 -0000 1.19 *************** *** 115,119 **** /** {@inheritDoc} */ ! public abstract Vertex center(); /** {@inheritDoc} */ --- 115,122 ---- /** {@inheritDoc} */ ! @Override ! public Vertex center() { ! return origin; ! } /** {@inheritDoc} */ Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** CoordinateSystem.java 13 Mar 2007 09:49:05 -0000 1.43 --- CoordinateSystem.java 13 Mar 2007 15:21:24 -0000 1.44 *************** *** 48,71 **** if (geometrics.size() > 0) { Geometric leader = geometrics.iterator().next(); ! if (leader instanceof Surface) { ! Surface surface = (Surface) leader; ! CoordinateSystem system = surface.coordinateSystem(); ! system.setOrigin(system.getOrigin().copy()); ! for (Geometric geometric : geometrics) { ! if (geometric instanceof Surface) { ! Surface current = (Surface) geometric; ! Vertex origin = current.getFirstVertex(); ! double distance = system.plane().distance(origin); ! Relation relation = new Relation(current, String.valueOf(distance)); ! system.add(relation); ! } ! } ! Project.getInstance().world().add(system); ! Project.getInstance().changed(Project.getInstance().world()); } } } /** * Empty constructor for persistence only */ --- 48,83 ---- if (geometrics.size() > 0) { Geometric leader = geometrics.iterator().next(); ! CoordinateSystem system = systemFor(leader); ! for (Geometric geometric : geometrics) { ! system.relate(geometric); } + Project.getInstance().world().add(system); + Project.getInstance().changed(Project.getInstance().world()); + } + } + + /** + * Returns a CoordinateSystem for the given geometric object. + * @param geometric The geometric object to return a CoordinateSystem for + * @return CoordinateSystem for the given geometric object. + */ + 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(); + } + + /** * Empty constructor for persistence only */ *************** *** 130,133 **** --- 142,169 ---- } + /** + * Relate the geometric to this CoordinateSystem. + * @param geometric Geometric object to relate to this CoordinateSystem + */ + public void relate(Geometric geometric) { + if (geometric instanceof Surface) { + relate((Surface) geometric); + } else { + + } + } + + /** + * Relate a surface to this CoordinateSystem + * @param surface Surface to relate to this CoordinateSystem + */ + public void relate(Surface surface) { + Vertex origin = surface.getFirstVertex(); + double distance = plane().distance(origin); + Relation relation = new Relation(surface, String.valueOf(distance)); + add(relation); + } + + /** {@inheritDoc} */ public Vertex canMove(double x, double y, double z, Collection entities) { *************** *** 423,431 **** /** {@inheritDoc} */ - public Vertex center() { - return getOrigin(); - } - - /** {@inheritDoc} */ public void delete() { getOwner().remove(this); --- 459,462 ---- Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Line.java 2 Jan 2007 17:48:58 -0000 1.30 --- Line.java 13 Mar 2007 15:21:24 -0000 1.31 *************** *** 104,115 **** /** - * Return the center for the entity - * @return The center as a vertex - */ - public Vertex center() { - return getOrigin(); - } - - /** * Delete the entity from the model */ --- 104,107 ---- |
|
From: Michael L. <he...@us...> - 2007-03-13 14:37:38
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27024/src/net/sourceforge/bprocessor/gl/tool Modified Files: RelationTool.java Log Message: Removed unnecessary code Index: RelationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RelationTool.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RelationTool.java 12 Mar 2007 08:32:43 -0000 1.3 --- RelationTool.java 13 Mar 2007 14:37:37 -0000 1.4 *************** *** 19,23 **** import net.sourceforge.bprocessor.gl.GLView; - import net.sourceforge.bprocessor.gui.GUI; import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.CoordinateSystem; --- 19,22 ---- *************** *** 32,36 **** public class RelationTool extends AbstractPencil { private Geometric source; - private Constructor constructor; private Edge edge; --- 31,34 ---- *************** *** 58,62 **** edge.setTo(current.vertex()); } else { - // make new feedback edge = new Edge(source.center(), current.vertex()); edge.setStrippled(true); --- 56,59 ---- *************** *** 72,78 **** */ protected void moved(MouseEvent e) { - //First find intersection current = findIntersection(e); - //Then find targer object findTarget(e, elements); glv.getView().makeTarget(target); --- 69,73 ---- *************** *** 97,101 **** super.cleanUp(); edge = null; - constructor = null; source = null; } --- 92,95 ---- *************** *** 108,146 **** if (source == null) { if (target != null) { ! if (target instanceof Geometric) { ! source = (Geometric) target; ! start = current; ! active = true; ! } else { ! GUI.getInstance().alert("Have to start by selecting a Constructor"); ! } ! } else { ! GUI.getInstance().alert("Have to start by selecting a Constructor"); } } else { if (target != null && target != source) { ! if (target instanceof Geometric) { ! Geometric geometric = (Geometric) target; ! if (source instanceof Constructor) { ! constructor = (Constructor) source; ! if (metaPressed) { ! // remove the connection ! constructor.disconnect(geometric); ! } else { ! // add a connection ! constructor.connect(geometric); ! } ! } else { ! Collection<Geometric> geometrics = new LinkedList(); ! geometrics.add(source); ! geometrics.add(geometric); ! CoordinateSystem.relate(geometrics); ! } ! Project.getInstance().changed(source); ! Project.getInstance().checkpoint(); ! cleanUp(); } else { ! GUI.getInstance().alert("The socondly chosen object were not a geometric object"); } } } --- 102,124 ---- if (source == null) { if (target != null) { ! source = (Geometric) target; ! start = current; ! active = true; } } else { if (target != null && target != source) { ! Geometric geometric = (Geometric) target; ! if (source instanceof Constructor) { ! Constructor constructor = (Constructor) source; ! constructor.connect(geometric); } else { ! Collection<Geometric> geometrics = new LinkedList(); ! geometrics.add(source); ! geometrics.add(geometric); ! CoordinateSystem.relate(geometrics); } + Project.getInstance().changed(source); + Project.getInstance().checkpoint(); + cleanUp(); } } |
|
From: Michael L. <he...@us...> - 2007-03-13 10:10:29
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15485/src/net/sourceforge/bprocessor/model Modified Files: ParameterBlock.java Project.java Log Message: Added some default variables Index: ParameterBlock.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ParameterBlock.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ParameterBlock.java 29 Jan 2007 18:09:32 -0000 1.5 --- ParameterBlock.java 13 Mar 2007 10:10:23 -0000 1.6 *************** *** 55,59 **** */ public void put(String key, double value) { ! parameters.add(new Attribute(key, new Double(value))); } --- 55,59 ---- */ public void put(String key, double value) { ! add(new Attribute(key, new Double(value))); } *************** *** 76,79 **** --- 76,88 ---- /** + * + * @param attribute Attribute + */ + public void add(Attribute attribute) { + parameters.add(attribute); + attribute.setId(new Long(parameters.size() + 1)); + } + + /** * Get as environment * @return HashMap Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.115 retrieving revision 1.116 diff -C2 -d -r1.115 -r1.116 *** Project.java 6 Feb 2007 16:16:46 -0000 1.115 --- Project.java 13 Mar 2007 10:10:23 -0000 1.116 *************** *** 150,153 **** --- 150,157 ---- globals = new ParameterBlock(); globals.put("pi", Math.PI); + globals.put("wall", 0.15); + globals.put("isolation", 0.1); + globals.put("brick", 0.12); + globals.put("roof", 0.07); Modellor.registerModellor(new LayerModellor()); try { |
|
From: Michael L. <he...@us...> - 2007-03-13 10:02:35
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12284/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Changed listener to use pressed AND released Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** GenericTreeView.java 13 Mar 2007 08:39:29 -0000 1.86 --- GenericTreeView.java 13 Mar 2007 10:02:34 -0000 1.87 *************** *** 1318,1321 **** --- 1318,1329 ---- react(e); } + + /** + * Mouse released + * @param e MouseEvent + */ + public void mousePressed(MouseEvent e) { + react(e); + } /** |
|
From: Michael L. <he...@us...> - 2007-03-13 09:56:52
|
Update of /cvsroot/bprocessor/model/src/etc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9733/src/etc Modified Files: bprocessor.xsd Log Message: Persistence implemented for relations Index: bprocessor.xsd =================================================================== RCS file: /cvsroot/bprocessor/model/src/etc/bprocessor.xsd,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** bprocessor.xsd 31 Jan 2007 20:51:19 -0000 1.28 --- bprocessor.xsd 13 Mar 2007 09:56:50 -0000 1.29 *************** *** 196,199 **** --- 196,211 ---- </xsd:complexType> + + <xsd:complexType name="RelationType"> + <xsd:complexContent> + <xsd:extension base="Types"> + <xsd:sequence> + </xsd:sequence> + <xsd:attribute name="offset" type="xsd:string"/> + <xsd:attribute name="geometric" type="xsd:long"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + <xsd:complexType name="CoordinateSystemType"> <xsd:complexContent> *************** *** 201,204 **** --- 213,217 ---- <xsd:sequence> <xsd:element ref="ijn" maxOccurs="1" minOccurs="0"/> + <xsd:element ref="relation" maxOccurs="unbounded" minOccurs="0"/> </xsd:sequence> <xsd:attribute name="onlyplane" type="xsd:boolean" use="required"/> *************** *** 346,349 **** --- 359,363 ---- <xsd:element name="direction" type="VertexesType"/> <xsd:element name="ijn" type="VertexesType"/> + <xsd:element name="relation" type="RelationType"/> <!-- Main element --> |
|
From: Michael L. <he...@us...> - 2007-03-13 09:56:52
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9733/src/net/sourceforge/bprocessor/model Modified Files: Relation.java Persistence.java Log Message: Persistence implemented for relations Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Persistence.java 31 Jan 2007 20:52:33 -0000 1.34 --- Persistence.java 13 Mar 2007 09:56:50 -0000 1.35 *************** *** 26,29 **** --- 26,30 ---- import net.sourceforge.bprocessor.model.xml.PointType; import net.sourceforge.bprocessor.model.xml.RefType; + import net.sourceforge.bprocessor.model.xml.RelationType; import net.sourceforge.bprocessor.model.xml.RotateType; import net.sourceforge.bprocessor.model.xml.ScaleType; *************** *** 53,56 **** --- 54,58 ---- import net.sourceforge.bprocessor.model.xml.impl.PointTypeImpl; import net.sourceforge.bprocessor.model.xml.impl.RefTypeImpl; + import net.sourceforge.bprocessor.model.xml.impl.RelationImpl; import net.sourceforge.bprocessor.model.xml.impl.RotateTypeImpl; import net.sourceforge.bprocessor.model.xml.impl.ScaleTypeImpl; *************** *** 585,588 **** --- 587,598 ---- } + + private static Relation internalizeRelation(RelationType xml, Map mapper) { + Relation relation = new Relation(); + relation.setOffset(xml.getOffset()); + relation.setGeometric((Geometric) get(xml.getGeometric(), mapper)); + return relation; + } + /** * *************** *** 617,620 **** --- 627,639 ---- constructor.connect((Geometric)get(((Long)iter.next()).longValue(), map)); } + + if (constructor instanceof CoordinateSystem) { + CoordinateSystem system = (CoordinateSystem) constructor; + CoordinateSystemType xml = (CoordinateSystemType) type; + List<RelationType> relations = xml.getRelation(); + for (RelationType current : relations) { + system.add(internalizeRelation(current, map)); + } + } } *************** *** 1160,1163 **** --- 1179,1189 ---- } + private static RelationType externalizeRelation(Relation relation, Map map) { + RelationType xml = new RelationImpl(); + xml.setOffset(relation.getOffset()); + xml.setGeometric(id(map, relation.geometric())); + return xml; + } + /** * Return the id of an xml entity by looking the entity up in the map *************** *** 1350,1353 **** --- 1376,1388 ---- xml.getConnected().add(new Long(l)); } + + if (object instanceof CoordinateSystem) { + CoordinateSystem system = (CoordinateSystem) object; + CoordinateSystemType cs = (CoordinateSystemType) xml; + Collection<Relation> relations = system.relations(); + for (Relation current : relations) { + cs.getRelation().add(externalizeRelation(current, map)); + } + } } Index: Relation.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Relation.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Relation.java 12 Mar 2007 08:32:47 -0000 1.6 --- Relation.java 13 Mar 2007 09:56:50 -0000 1.7 *************** *** 28,31 **** --- 28,40 ---- private String offset; + + /** + * Construct an empty Relation + * + */ + public Relation() { + + } + /** * Constructs a Relation *************** *** 55,58 **** --- 64,75 ---- /** + * Sets the offset. + * @param offset The offset + */ + public void setOffset(String offset) { + this.offset = offset; + } + + /** * * @return geometric *************** *** 63,66 **** --- 80,91 ---- /** + * Sets the geometric + * @param geometric The geometric + */ + public void setGeometric(Geometric geometric) { + this.geometric = geometric; + } + + /** * @return offset */ |
|
From: Nordholt <nor...@us...> - 2007-03-13 09:49:12
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6741/src/net/sourceforge/bprocessor/facade/modellor Modified Files: NetFacadeModellor.java Log Message: checkstyle errors...sorry Index: NetFacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/NetFacadeModellor.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** NetFacadeModellor.java 13 Mar 2007 09:31:44 -0000 1.19 --- NetFacadeModellor.java 13 Mar 2007 09:49:11 -0000 1.20 *************** *** 75,81 **** private boolean single = true; - /** Window spaces for the double facade */ - private Set<Space> windows = new HashSet<Space>(); - /** The logger */ private static Logger log = Logger.getLogger(NetFacadeModellor.class); --- 75,78 ---- *************** *** 150,154 **** frontCandidate = (Surface)it.next(); } ! while(it.hasNext()) { Surface surface = (Surface)it.next(); Classification frontClass = surface.getFrontDomain().getClassification(); --- 147,151 ---- frontCandidate = (Surface)it.next(); } ! while (it.hasNext()) { Surface surface = (Surface)it.next(); Classification frontClass = surface.getFrontDomain().getClassification(); *************** *** 207,211 **** frame = null; front = null; - windows = null; } --- 204,207 ---- *************** *** 762,801 **** return getGeneralName(); } ! ! public static void genFrameTest() { ! Space test = new Space("test", ! Space.CONSTRUCTION, ! Space.SPACE_LEVEL, ! true); ! Project.getInstance().world().add(test); ! { ! Surface cut = cutType1(); ! cut.setBackDomain(test); ! cut.setFrontDomain(test); ! Set<Surface> testFrame = generateFrame(cut, 1, 1); ! for (Surface s: testFrame) { ! Project.getInstance().world().add(s); ! Iterator edgs = s.getEdges().iterator(); ! while (edgs.hasNext()) { ! Project.getInstance().world().add((Edge)edgs.next()); ! } ! } ! } ! { ! Surface cut = cutType2(); ! cut.setBackDomain(test); ! cut.setFrontDomain(test); ! Set<Surface> testFrame = generateFrame(cut, 1, 1); ! for (Surface s: testFrame) { ! Project.getInstance().world().add(s); ! Iterator edgs = s.getEdges().iterator(); ! while (edgs.hasNext()) { ! Project.getInstance().world().add((Edge)edgs.next()); ! } ! } ! } ! ! } ! private static Set<Surface> generateFrame(Surface cut, double height, double width) { Set topPost = genFramePost(cut, width); --- 758,769 ---- return getGeneralName(); } ! ! /** ! * Generates a frame based an a surface descibing a cut of the frame ! * @param cut the cut surface ! * @param height height of the frame ! * @param width with of the frame ! * @return the set of surfaces in the frame ! */ private static Set<Surface> generateFrame(Surface cut, double height, double width) { Set topPost = genFramePost(cut, width); *************** *** 861,865 **** List<Edge> el = new LinkedList<Edge>(); Vertex prevV = first; ! for (Vertex v: vl) { el.add(new Edge(prevV, v)); prevV = v; --- 829,833 ---- List<Edge> el = new LinkedList<Edge>(); Vertex prevV = first; ! for (Vertex v : vl) { el.add(new Edge(prevV, v)); prevV = v; *************** *** 878,882 **** List<Edge> el = new LinkedList<Edge>(); Vertex prevV = first; ! for (Vertex v: vl) { el.add(new Edge(prevV, v)); prevV = v; --- 846,850 ---- List<Edge> el = new LinkedList<Edge>(); Vertex prevV = first; ! for (Vertex v : vl) { el.add(new Edge(prevV, v)); prevV = v; *************** *** 898,902 **** copy.setFrontDomain(cut.getFrontDomain()); Plane topPlane = new Plane(1, 0, 1, new Vertex(0, 0, length / 2)); ! Plane bottomPlane = new Plane(-1, 0, 1, new Vertex(0 , 0, - length / 2)); Set surfaces = new HashSet(); --- 866,870 ---- copy.setFrontDomain(cut.getFrontDomain()); Plane topPlane = new Plane(1, 0, 1, new Vertex(0, 0, length / 2)); ! Plane bottomPlane = new Plane(-1, 0, 1, new Vertex(0 , 0, -length / 2)); Set surfaces = new HashSet(); *************** *** 905,909 **** copy.extrusionAllOnto(bottomPlane, surfaces, surfaces); Set<Vertex> verts = Geometry.collect(surfaces); ! for (Vertex v: verts) { v.move(0, 0, length / 2); } --- 873,877 ---- copy.extrusionAllOnto(bottomPlane, surfaces, surfaces); Set<Vertex> verts = Geometry.collect(surfaces); ! for (Vertex v : verts) { v.move(0, 0, length / 2); } |
|
From: Nordholt <nor...@us...> - 2007-03-13 09:49:08
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6570/src/net/sourceforge/bprocessor/model Modified Files: CoordinateSystem.java Log Message: checkstyle errors...sorry Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** CoordinateSystem.java 13 Mar 2007 09:26:15 -0000 1.42 --- CoordinateSystem.java 13 Mar 2007 09:49:05 -0000 1.43 *************** *** 391,395 **** public List<Vertex> unTranslate(List<Vertex> vertices) { List<Vertex> result = new ArrayList<Vertex>(); ! for (Vertex current: vertices) { result.add(unTranslate(current)); } --- 391,395 ---- public List<Vertex> unTranslate(List<Vertex> vertices) { List<Vertex> result = new ArrayList<Vertex>(); ! for (Vertex current : vertices) { result.add(unTranslate(current)); } |
|
From: Nordholt <nor...@us...> - 2007-03-13 09:35:35
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30641/src/net/sourceforge/bprocessor/model Modified Files: Entity.java Log Message: put in a logger object Index: Entity.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Entity.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Entity.java 2 Jan 2007 17:48:58 -0000 1.13 --- Entity.java 13 Mar 2007 09:27:26 -0000 1.14 *************** *** 14,21 **** --- 14,25 ---- import java.util.List; + import org.apache.log4j.Logger; /** * The entity class */ public abstract class Entity implements Serializable { + /** The Logger */ + private static Logger log = Logger.getLogger(Entity.class); + /** The id */ protected Long id; |
|
From: Nordholt <nor...@us...> - 2007-03-13 09:33:52
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30209/src/net/sourceforge/bprocessor/model Modified Files: CoordinateSystem.java Log Message: made it possible to untranslate a list of vertices Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** CoordinateSystem.java 12 Mar 2007 08:32:47 -0000 1.41 --- CoordinateSystem.java 13 Mar 2007 09:26:15 -0000 1.42 *************** *** 385,388 **** --- 385,401 ---- /** + * Untranslate all vertices in the list + * @param vertices The list of vertices + * @return The untranslated list + */ + public List<Vertex> unTranslate(List<Vertex> vertices) { + List<Vertex> result = new ArrayList<Vertex>(); + for (Vertex current: vertices) { + result.add(unTranslate(current)); + } + return result; + } + + /** * Translate an edge * @param edge The edge |
|
From: Nordholt <nor...@us...> - 2007-03-13 09:31:51
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32206/src/net/sourceforge/bprocessor/facade/modellor Modified Files: NetFacadeModellor.java Log Message: new window frames for double posted facades Index: NetFacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/NetFacadeModellor.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** NetFacadeModellor.java 16 Feb 2007 13:33:42 -0000 1.18 --- NetFacadeModellor.java 13 Mar 2007 09:31:44 -0000 1.19 *************** *** 17,20 **** --- 17,22 ---- import net.sourceforge.bprocessor.model.Attribute; + import net.sourceforge.bprocessor.model.Classification; + import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometric; *************** *** 22,25 **** --- 24,28 ---- import net.sourceforge.bprocessor.model.Net; import net.sourceforge.bprocessor.model.ParameterBlock; + import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selector; *************** *** 125,140 **** */ public Modellor newInstance(Space s) { NetFacadeModellor mod = new NetFacadeModellor(); mod.setSpace(s); Project.getInstance().scheduleObserver(mod); s.setModellor(mod); ! Iterator it = s.getEnvelope().iterator(); ! if (it.hasNext()) { ! mod.setFront((Surface)it.next()); ! } mod.setNet(mod.createNet(mod.getFront())); mod.regenerate(); return mod; } /** --- 128,165 ---- */ public Modellor newInstance(Space s) { + //genFrameTest(); NetFacadeModellor mod = new NetFacadeModellor(); mod.setSpace(s); Project.getInstance().scheduleObserver(mod); s.setModellor(mod); ! mod.setFront(findFront(s)); mod.setNet(mod.createNet(mod.getFront())); mod.regenerate(); return mod; } + + /** + * Finds a suitable surface for the front surface. + * @param s the space which envelope should be searched + * @return a suitable surface from the s' envelope + */ + private Surface findFront(Space s) { + Iterator it = s.getEnvelope().iterator(); + Surface frontCandidate = null; + if (it.hasNext()) { + frontCandidate = (Surface)it.next(); + } + while(it.hasNext()) { + Surface surface = (Surface)it.next(); + Classification frontClass = surface.getFrontDomain().getClassification(); + Classification backClass = surface.getBackDomain().getClassification(); + + if ((frontClass != null && frontClass.getFullId(null).equalsIgnoreCase("-80")) || + (backClass != null && backClass.getFullId(null).equalsIgnoreCase("-80"))) { + frontCandidate = surface; + } + } + return frontCandidate; + } /** *************** *** 352,367 **** while (fields.hasNext()) { Surface field = (Surface)fields.next(); ! Space window = new Space("Window", ! Space.CONSTRUCTION, ! space.getLevel() + 1, ! true); ! space.add(window); ! Surface fcopy = field.copyall(space); ! assignSame(front, fcopy, space, window); ! windows.add(window); ! NetFacadeModellor winModellor = (NetFacadeModellor)newInstance(window); ! winModellor.setFront(fcopy); ! winModellor.setDepth(depth); ! winModellor.setFrameWidth(frameWidth); } } --- 377,413 ---- while (fields.hasNext()) { Surface field = (Surface)fields.next(); ! //assuming here that each window is a rectangle. ! if (field.getEdges().size() == 4) { ! Surface cut1 = cutType1(); ! Surface cut2 = cutType2(); ! cut1.setBackDomain(frame); ! cut1.setFrontDomain(frame); ! cut2.setBackDomain(frame); ! cut2.setFrontDomain(frame); ! ! Iterator it = field.getEdges().iterator(); ! Edge e1 = (Edge)it.next(); ! Edge e2 = (Edge)it.next(); ! Set<Surface> frame1 = generateFrame(cut1, e2.getLength(), e1.getLength()); ! Set<Surface> frame2 = generateFrame(cut2, e2.getLength(), e1.getLength()); ! ! frame.removeSurface(cut1); ! frame.removeSurface(cut2); ! Vertex common = Edge.commonVertex(e1, e2); ! Vertex i = e1.otherVertex(common).minus(common); ! Vertex n = e2.otherVertex(common).minus(common); ! Vertex j = front.normal(); ! if (front.getBackDomain() == space) { ! j.scale(-1); ! } ! i.normalize(); ! j.normalize(); ! n.normalize(); ! CoordinateSystem anker = new CoordinateSystem(i, j, n, common); ! unTranslateGeometry(frame1, anker); ! unTranslateGeometry(frame2, anker); ! space.addAll(frame1); ! space.addAll(frame2); ! } } } *************** *** 416,425 **** Surface hole = new Surface(Edge.placeOffset(field.getEdges(), field, offsetMap)); hole = space.insert(hole); Geometry.holeAnalysis(hole); Set sides2 = new HashSet(); Surface holeEx = space.insert(extrudeIntoSpace(hole, depth, sides2)); Geometry.holeAnalysis(holeEx); ! detailField(envF, hole); } } --- 462,478 ---- Surface hole = new Surface(Edge.placeOffset(field.getEdges(), field, offsetMap)); hole = space.insert(hole); + Space holeSpace = new Space("Facade Hole", + Space.FUNCTIONAL, + space.getLevel() + 1, + true); + space.add(holeSpace); + assignSame(front, hole, space, holeSpace); Geometry.holeAnalysis(hole); Set sides2 = new HashSet(); Surface holeEx = space.insert(extrudeIntoSpace(hole, depth, sides2)); + assignOpposite(front, holeEx, space, holeSpace); Geometry.holeAnalysis(holeEx); ! detailField(envF, hole, holeSpace); } } *************** *** 431,436 **** * @param envF the parameters for the field * @param hole the hole in the frame for the field */ ! private void detailField(Map envF, Surface hole) { double frameSize = 0.0; String type = ""; --- 484,490 ---- * @param envF the parameters for the field * @param hole the hole in the frame for the field + * @param holeSpace the space of the hole in the facade */ ! private void detailField(Map envF, Surface hole, Space holeSpace) { double frameSize = 0.0; String type = ""; *************** *** 454,465 **** Surface in = new Surface(Edge.placeOffset(hole.getEdges(), hole, offmap1)); Surface out = new Surface(Edge.placeOffset(hole.getEdges(), hole, offmap2)); - hole.getExterior().removeHole(hole); - pushIntoSpace(hole, FRAME_DEPTH); - Geometry.holeAnalysis(hole); - in = space.insert(in); - out = space.insert(out); - Geometry.holeAnalysis(in); - Geometry.holeAnalysis(out); - Space f = new Space(type + " Frame", Space.CONSTRUCTION, --- 508,511 ---- *************** *** 474,478 **** space.add(f); assignSame(front, in, space, f); ! assignSame(front, out, space, g); Set sides = new HashSet(); --- 520,533 ---- space.add(f); assignSame(front, in, space, f); ! assignSame(front, out, space, g); ! ! hole.getExterior().removeHole(hole); ! pushIntoSpace(hole, FRAME_DEPTH); ! Geometry.holeAnalysis(hole); ! ! in = space.insert(in); ! out = space.insert(out); ! Geometry.holeAnalysis(in); ! Geometry.holeAnalysis(out); Set sides = new HashSet(); *************** *** 517,525 **** boolean done = false; Iterator nextEdges = nextVertex.getEdges().iterator(); ! while (nextEdges.hasNext() && !done) { Object e = nextEdges.next(); if (outer.contains(e)) { next = (Edge)e; ! done = true; } } --- 572,580 ---- boolean done = false; Iterator nextEdges = nextVertex.getEdges().iterator(); ! while (nextEdges.hasNext()) { Object e = nextEdges.next(); if (outer.contains(e)) { next = (Edge)e; ! break; } } *************** *** 540,544 **** } else { log.warn("Outline not well defined, " + ! " all outer edges in outline: " + outer.size() + " outline connected: " + first.getFrom().getEdges().contains(outline.getLast())); } --- 595,599 ---- } else { log.warn("Outline not well defined, " + ! " outer edges left: " + outer.size() + " outline connected: " + first.getFrom().getEdges().contains(outline.getLast())); } *************** *** 707,709 **** --- 762,912 ---- return getGeneralName(); } + + public static void genFrameTest() { + Space test = new Space("test", + Space.CONSTRUCTION, + Space.SPACE_LEVEL, + true); + Project.getInstance().world().add(test); + { + Surface cut = cutType1(); + cut.setBackDomain(test); + cut.setFrontDomain(test); + Set<Surface> testFrame = generateFrame(cut, 1, 1); + for (Surface s: testFrame) { + Project.getInstance().world().add(s); + Iterator edgs = s.getEdges().iterator(); + while (edgs.hasNext()) { + Project.getInstance().world().add((Edge)edgs.next()); + } + } + } + { + Surface cut = cutType2(); + cut.setBackDomain(test); + cut.setFrontDomain(test); + Set<Surface> testFrame = generateFrame(cut, 1, 1); + for (Surface s: testFrame) { + Project.getInstance().world().add(s); + Iterator edgs = s.getEdges().iterator(); + while (edgs.hasNext()) { + Project.getInstance().world().add((Edge)edgs.next()); + } + } + } + + } + + private static Set<Surface> generateFrame(Surface cut, double height, double width) { + Set topPost = genFramePost(cut, width); + Set leftPost = genFramePost(cut, height); + Set rightPost = genFramePost(cut, height); + Set bottomPost = genFramePost(cut, width); + CoordinateSystem csTop = new CoordinateSystem(new Vertex(0, 0, -1), + new Vertex(0, 1, 0), + new Vertex(1, 0, 0), + new Vertex(0, 0, height)); + CoordinateSystem csRight = new CoordinateSystem(new Vertex(-1, 0, 0), + new Vertex(0, 1, 0), + new Vertex(0, 0, -1), + new Vertex(width, 0, height)); + CoordinateSystem csBottom = new CoordinateSystem(new Vertex(0, 0, 1), + new Vertex(0, 1, 0), + new Vertex(-1, 0, 0), + new Vertex(width, 0, 0)); + unTranslateGeometry(bottomPost, csBottom); + unTranslateGeometry(rightPost, csRight); + unTranslateGeometry(topPost, csTop); + + Set<Surface> surfaces = new HashSet<Surface>(); + HashSet surfs = new HashSet(leftPost); + surfs.addAll(rightPost); + surfs.addAll(topPost); + surfs.addAll(bottomPost); + Iterator it = surfs.iterator(); + while (it.hasNext()) { + Surface s = (Surface)it.next(); + surfaces.add(s); + } + return surfaces; + } + + /** + * untranslates a set of geometry. + * @param geometry the geometry + * @param system the coordinate system to untranslate according to + */ + private static void unTranslateGeometry(Set geometry, CoordinateSystem system) { + List<Vertex> vertices = new LinkedList<Vertex>(Geometry.collect(geometry)); + List<Vertex> unTranslatedVertices = system.unTranslate(vertices); + Iterator it = vertices.iterator(); + Iterator unTranslatedIt = unTranslatedVertices.iterator(); + while (it.hasNext() && unTranslatedIt.hasNext()) { + Vertex v = (Vertex)it.next(); + Vertex vUnTranslated = (Vertex)unTranslatedIt.next(); + v.setX(vUnTranslated.getX()); + v.setY(vUnTranslated.getY()); + v.setZ(vUnTranslated.getZ()); + } + } + + private static Surface cutType1() { + List<Vertex> vl = new LinkedList<Vertex>(); + Vertex first = new Vertex(0, 0, 0); + vl.add(new Vertex(0.050, 0, 0)); + vl.add(new Vertex(0.050, 0.016, 0)); + vl.add(new Vertex(0.008, 0.016, 0)); + vl.add(new Vertex(0.008, 0.125, 0)); + vl.add(new Vertex(0.000, 0.125, 0)); + List<Edge> el = new LinkedList<Edge>(); + Vertex prevV = first; + for (Vertex v: vl) { + el.add(new Edge(prevV, v)); + prevV = v; + } + el.add(new Edge(prevV, first)); + Surface cut = new Surface(el); + return cut; + } + + private static Surface cutType2() { + List<Vertex> vl = new LinkedList<Vertex>(); + Vertex first = new Vertex(0.004, 0, 0); + vl.add(new Vertex(0.050, 0, 0)); + vl.add(new Vertex(0.050, -0.035, 0)); + vl.add(new Vertex(0.004, -0.035, 0)); + List<Edge> el = new LinkedList<Edge>(); + Vertex prevV = first; + for (Vertex v: vl) { + el.add(new Edge(prevV, v)); + prevV = v; + } + el.add(new Edge(prevV, first)); + Surface cut = new Surface(el); + return cut; + } + + /** + * Generates one frame post. + * @param cut the cut of the post + * @param length the length of the post + * @return the surfaces of the new post + */ + private static Set genFramePost(Surface cut, double length) { + Surface copy = cut.copy(new HashMap()); + copy.setBackDomain(cut.getBackDomain()); + copy.setFrontDomain(cut.getFrontDomain()); + Plane topPlane = new Plane(1, 0, 1, new Vertex(0, 0, length / 2)); + Plane bottomPlane = new Plane(-1, 0, 1, new Vertex(0 , 0, - length / 2)); + + Set surfaces = new HashSet(); + surfaces.add(copy); + copy.extrusionAllOnto(topPlane, surfaces, surfaces); + copy.extrusionAllOnto(bottomPlane, surfaces, surfaces); + Set<Vertex> verts = Geometry.collect(surfaces); + for (Vertex v: verts) { + v.move(0, 0, length / 2); + } + return surfaces; + } } |
|
From: Michael L. <he...@us...> - 2007-03-13 08:39:37
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10941/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: small style-error Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** GenericTreeView.java 12 Mar 2007 16:14:38 -0000 1.85 --- GenericTreeView.java 13 Mar 2007 08:39:29 -0000 1.86 *************** *** 1150,1154 **** ParameterBlock pb = Project.getInstance().getGlobals(); pb.put("new global", 0); ! AttributeView.instance().display(pb.getAttributes().get(pb.getAttributes().size()-1)); Project.getInstance().changed(pb); Project.getInstance().checkpoint(); --- 1150,1154 ---- ParameterBlock pb = Project.getInstance().getGlobals(); pb.put("new global", 0); ! AttributeView.instance().display(pb.getAttributes().get(pb.getAttributes().size() - 1)); Project.getInstance().changed(pb); Project.getInstance().checkpoint(); |
|
From: rimestad <rim...@us...> - 2007-03-12 16:14:47
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27667/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: now the new created attribute are shown in the attributeview Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** GenericTreeView.java 12 Mar 2007 15:57:17 -0000 1.84 --- GenericTreeView.java 12 Mar 2007 16:14:38 -0000 1.85 *************** *** 1150,1153 **** --- 1150,1154 ---- ParameterBlock pb = Project.getInstance().getGlobals(); pb.put("new global", 0); + AttributeView.instance().display(pb.getAttributes().get(pb.getAttributes().size()-1)); Project.getInstance().changed(pb); Project.getInstance().checkpoint(); |
|
From: rimestad <rim...@us...> - 2007-03-12 16:01:36
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18225/src/net/sourceforge/bprocessor/gl/tool Modified Files: ExtrusionTool.java Log Message: made minor changes to extrudetool, and made extrude of edges extrude against a plane Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** ExtrusionTool.java 1 Mar 2007 14:53:56 -0000 1.50 --- ExtrusionTool.java 12 Mar 2007 16:01:32 -0000 1.51 *************** *** 9,16 **** import java.awt.Cursor; import java.awt.event.MouseEvent; import java.util.Collection; import java.util.HashSet; - import java.util.Iterator; import java.util.LinkedList; import java.util.Set; --- 9,17 ---- import java.awt.Cursor; import java.awt.event.MouseEvent; + import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.LinkedList; + import java.util.List; import java.util.Set; *************** *** 20,26 **** --- 21,33 ---- import net.sourceforge.bprocessor.gl.view.Transformation; import net.sourceforge.bprocessor.gl.view.View; + import net.sourceforge.bprocessor.gui.GUI; + import net.sourceforge.bprocessor.model.Constructor; 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.Plane; import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; *************** *** 37,40 **** --- 44,50 ---- private Surface extrudesurface; + /** Edges to extrude */ + private List<Edge> extrudeEdges; + /** start x */ private int startx; *************** *** 59,63 **** /** Extrusion */ ! private Collection extrusion; private Plane ontoPlane; --- 69,73 ---- /** Extrusion */ ! private Collection<Surface> extrusion; private Plane ontoPlane; *************** *** 77,84 **** * @param extrusion Collection of surfaces */ ! public void insert(Space space, Collection extrusion) { ! Iterator surfaces = extrusion.iterator(); ! while (surfaces.hasNext()) { ! Surface surface = (Surface) surfaces.next(); space.insert(surface); } --- 87,92 ---- * @param extrusion Collection of surfaces */ ! private void insert(Space space, Collection<Surface> extrusion) { ! for (Surface surface : extrusion) { space.insert(surface); } *************** *** 92,96 **** * @param finish Finish extrusion */ ! public void extrude(double distance, boolean all, boolean finish) { Space space = Project.getInstance().getActiveSpace(); if (extrusion != null) { --- 100,104 ---- * @param finish Finish extrusion */ ! private void extrude(double distance, boolean all, boolean finish) { Space space = Project.getInstance().getActiveSpace(); if (extrusion != null) { *************** *** 99,105 **** extrusion = null; } ! extrusion = new LinkedList(); ! Collection sides = new LinkedList(); ! Set tops = new HashSet(); if (all) { extrudesurface.extrusionall(distance, sides, tops); --- 107,113 ---- extrusion = null; } ! extrusion = new LinkedList<Surface>(); ! Collection<Surface> sides = new LinkedList<Surface>(); ! Set<Surface> tops = new HashSet<Surface>(); if (all) { extrudesurface.extrusionall(distance, sides, tops); *************** *** 125,129 **** * @param finish Finish extrusion */ ! public void extrudeOnto(Plane p, boolean all, boolean finish) { Space space = Project.getInstance().getActiveSpace(); if (extrusion != null) { --- 133,137 ---- * @param finish Finish extrusion */ ! private void extrudeOnto(Plane p, boolean all, boolean finish) { Space space = Project.getInstance().getActiveSpace(); if (extrusion != null) { *************** *** 132,138 **** extrusion = null; } ! extrusion = new LinkedList(); ! Collection sides = new LinkedList(); ! Set tops = new HashSet(); if (p == null) { log.info("Found null plane"); --- 140,146 ---- extrusion = null; } ! extrusion = new LinkedList<Surface>(); ! Collection<Surface> sides = new LinkedList<Surface>(); ! Set<Surface> tops = new HashSet<Surface>(); if (p == null) { log.info("Found null plane"); *************** *** 157,234 **** /** * Moved * @param e MouseEvent */ protected void moved(MouseEvent e) { ! if (extrudesurface == null) { ! //the extrusion isn't started yet ! findTarget(e); ! if (target instanceof Surface) { ! glv.getView().makeTarget(target); ! } else if (target == null) { ! glv.getView().makeTarget(null); ! } ! active = true; ! } else { ! // a extrudesurface have been chosen ! to = glv.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); ! Vertex normal = extrudesurface.normal(); ! //a bit cleanup ! ontoPlane = null; ! // the list of all extruded geometric objects ! Set elements = new HashSet(); ! if (extrusion != null) { ! elements.addAll(extrusion); ! elements.addAll(Surface.edges(extrusion)); ! elements.add(extrudesurface); ! } ! //ignore self when extruding ! Set ignore = new HashSet(2); ! ignore.add(extrudesurface); ! if (extrudesurface.getExterior() != null) { ! ignore.add(extrudesurface.getExterior()); ! } ! findTarget(e, ignore); ! { ! if (target instanceof Surface && extrusion != null && !extrusion.contains(target)) { ! Surface surface = (Surface) target; ! if (!elements.contains(surface)) { ! Vertex n = surface.normal(); ! Vertex cross = normal.cross(n); ! if (cross.isZero()) { ! // the surfaces are coplanar ! Vertex v = surface.getFirstVertex(); ! if (!extrudesurface.plane().contains(v)) { ! to = v; ! } ! calcDistCallExtrude(to, from, normal); ! } else { ! ontoPlane = surface.plane(); ! if (Math.abs(ontoPlane.normal().dot(normal)) <= 0.1) { ! // the two normals have a greater angle between 0 and 84 or 94 and 180 degrees calcDistCallExtrude(to, from, normal); } else { ! extrudeOnto(ontoPlane, all, false); } } ! } ! } else if (target instanceof Edge) { ! Edge edge = (Edge) target; ! if (!elements.contains(edge)) { ! to = edge.center(); ! Vertex v = edge.center(); ! if (!extrudesurface.plane().contains(v)) { ! to = v; } } - calcDistCallExtrude(to, from, normal); } else { ! calcDistCallExtrude(to, from, normal); } } } updateLength(); } ! /** * @param to --- 165,324 ---- /** + * @param plane the plane to extrude onto (give null if none) + * @param finish true if the extrusion should be permanent otherwise false + */ + private void extrudeEdgesOnto(Plane plane, boolean finish) { + Space space = Project.getInstance().getActiveSpace(); + if (extrusion != null) { + space.removeProtected(extrusion); + space.computeNextId(); + extrusion = null; + } + extrusion = new LinkedList<Surface>(); + Vertex dir = to.minus(from); + if (plane != null && Math.abs(plane.normal().dot(dir)) <= 0.1) { + // if the planes are parallel + plane = null; + } + extrusion = Edge.extrude(extrudeEdges, dir, plane); + if (finish) { + insert(space, extrusion); + } else { + space.addProtected(extrusion); + } + } + + /** * Moved * @param e MouseEvent */ protected void moved(MouseEvent e) { ! if (Selection.primary().isEmpty()) { ! // extrude surface ! if (extrudesurface == null) { ! //the extrusion isn't started yet ! findTarget(e); ! if (target instanceof Surface) { ! glv.getView().makeTarget(target); ! } else if (target == null) { ! glv.getView().makeTarget(null); ! } ! active = true; ! ! } else { ! // a extrudesurface have been chosen ! to = glv.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); ! Vertex normal = extrudesurface.normal(); ! //a bit cleanup ! ontoPlane = null; ! // the list of all extruded geometric objects ! Set<Geometric> elements = new HashSet<Geometric>(); ! if (extrusion != null) { ! elements.addAll(extrusion); ! elements.addAll(Surface.edges(extrusion)); ! elements.add(extrudesurface); ! } ! //ignore the extruded surface and holes when extruding ! Set<Surface> ignore = new HashSet<Surface>(2); ! ignore.add(extrudesurface); ! if (extrudesurface.getExterior() != null) { ! ignore.add(extrudesurface.getExterior()); ! } ! findTarget(e, ignore); ! { ! if (target instanceof Surface && extrusion != null && !extrusion.contains(target)) { ! Surface surface = (Surface) target; ! if (!elements.contains(surface)) { ! Vertex n = surface.normal(); ! Vertex cross = normal.cross(n); ! if (cross.isZero()) { ! // the surfaces are coplanar ! Vertex v = surface.getFirstVertex(); ! if (!extrudesurface.plane().contains(v)) { ! to = v; ! } calcDistCallExtrude(to, from, normal); } else { ! ontoPlane = surface.plane(); ! if (Math.abs(ontoPlane.normal().dot(normal)) <= 0.1) { ! // the two normals have a greater angle between 0 and 84 or 94 and 180 degrees ! calcDistCallExtrude(to, from, normal); ! } else { ! extrudeOnto(ontoPlane, all, false); ! } } } ! } else if (target instanceof Edge) { ! Edge edge = (Edge) target; ! if (!elements.contains(edge)) { ! to = edge.center(); ! Vertex v = edge.center(); ! if (!extrudesurface.plane().contains(v)) { ! to = v; ! } } + calcDistCallExtrude(to, from, normal); + } else { + calcDistCallExtrude(to, from, normal); + } + } + } + } else { + //The extrusion should be found in the selection (EDGE EXTRUSION) + if (extrudeEdges != null) { + // the extrusion should begin + to = glv.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); + + //list of moving elements + Set<Geometric> elements = new HashSet<Geometric>(extrudeEdges); + if (extrusion != null) { + elements.addAll(extrusion); + elements.addAll(Surface.edges(extrusion)); + } + + // ignore the extruded surface and holes when extruding + List<Geometric> ignore = new LinkedList<Geometric>(extrudeEdges); + if (extrusion != null) { + ignore.addAll(extrusion); + ignore.addAll(Surface.edges(extrusion)); + ignore.addAll(Geometry.collect(extrusion)); + } + excluded(ignore); + current = findIntersection(e); + if (e.isShiftDown()) { + to = current.vertex(); + } + findTarget(e, ignore); + updateConstructors(); + log.info("Target is " + target); + if (target != null && !elements.contains(target)) { + if (target instanceof Surface) { + ontoPlane = ((Surface) target).plane(); + makeTarget(current); + } else if (target instanceof Plane && target != plane) { + ontoPlane = (Plane)target; + makeTarget(current); + } else if (target instanceof Line || + target instanceof Constructor || + target instanceof Edge) { + to = current.vertex(); + makeTarget(current); + ontoPlane = null; + } else { + ontoPlane = null; } } else { ! ontoPlane = null; } + distance = to.minus(from).length(); + extrudeEdgesOnto(ontoPlane, false); + } else { + current = findIntersection(e); + makeTarget(current); } } updateLength(); } ! /** * @param to *************** *** 247,281 **** */ protected void pressed(MouseEvent e) { ! if (extrudesurface == null) { ! findTarget(e); ! if (target instanceof Surface) { ! extrudesurface = (Surface) target; ! startx = e.getX(); ! starty = e.getY(); ! View view = glv.getView(); ! Transformation trans = view.transformation(); ! double x = startx; ! double y = View.getHeight() - starty; ! Vertex near = new Vertex(x, y, 0.0); ! Vertex far = new Vertex(x, y, 1.0); ! Edge ray = new Edge(near, far); ! ray = trans.unProject(ray); ! Plane plane = extrudesurface.plane(); ! dragplane = plane.orthogonalPlane(ray); ! from = view.toPlaneCoords(startx, starty, dragplane); ! all = !e.isAltDown(); ! } ! } else { ! if (extrusion != null) { ! if (ontoPlane != null) { ! extrudeOnto(ontoPlane, all, true); } else { ! extrude(distance, all, true); } extrusion = null; Project.getInstance().checkpoint(); } - cleanUp(); - moved(e); } } --- 337,419 ---- */ protected void pressed(MouseEvent e) { ! if (!Selection.primary().isEmpty()) { ! // some of the selction should be extruded ! if (extrudeEdges == null) { ! // The extrusion havn't started yet ! extrudeEdges = new ArrayList<Edge>(); ! for (Object o : Selection.primary()) { ! if (o instanceof Edge) { ! extrudeEdges.add((Edge) o); ! } else { ! GUI.getInstance().alert("Selection isn't extrudable, due to other elements than edges"); ! extrudeEdges.clear(); ! } ! } ! if (extrudeEdges.size() != Selection.primary().size()) { ! extrudeEdges = null; } else { ! startx = e.getX(); ! starty = e.getY(); ! View view = glv.getView(); ! Transformation trans = view.transformation(); ! double x = startx; ! double y = View.getHeight() - starty; ! Vertex near = new Vertex(x, y, 0.0); ! Vertex far = new Vertex(x, y, 1.0); ! Edge ray = new Edge(near, far); ! ray = trans.unProject(ray); ! Plane plane = new Plane(0, 0, 1, extrudeEdges.get(0).getFrom()); ! dragplane = plane.orthogonalPlane(ray); ! from = view.toPlaneCoords(startx, starty, dragplane); ! active = true; ! start = findIntersection(e); ! } ! } else { ! // finish the extrusion ! if (extrusion != null) { ! if (ontoPlane != null) { ! extrudeEdgesOnto(ontoPlane, true); ! } else { ! extrudeEdgesOnto(null, true); ! } } extrusion = null; Project.getInstance().checkpoint(); + cleanUp(); + } + } else { + // look at the mouse target + if (extrudesurface == null) { + findTarget(e); + if (target instanceof Surface) { + extrudesurface = (Surface) target; + startx = e.getX(); + starty = e.getY(); + View view = glv.getView(); + Transformation trans = view.transformation(); + double x = startx; + double y = View.getHeight() - starty; + Vertex near = new Vertex(x, y, 0.0); + Vertex far = new Vertex(x, y, 1.0); + Edge ray = new Edge(near, far); + ray = trans.unProject(ray); + Plane plane = extrudesurface.plane(); + dragplane = plane.orthogonalPlane(ray); + from = view.toPlaneCoords(startx, starty, dragplane); + all = !e.isAltDown(); + } + } else { + if (extrusion != null) { + if (ontoPlane != null) { + extrudeOnto(ontoPlane, all, true); + } else { + extrude(distance, all, true); + } + extrusion = null; + Project.getInstance().checkpoint(); + } + cleanUp(); + moved(e); } } } *************** *** 287,294 **** public void apply(double length) { if (extrusion != null) { ! if (distance < 0) { ! length = -length; } - extrude(length, all, true); extrusion = null; Project.getInstance().checkpoint(); --- 425,444 ---- public void apply(double length) { if (extrusion != null) { ! if (extrudesurface != null) { ! if (distance < 0) { ! length = -length; ! } ! extrude(length, all, true); ! } else if (extrudeEdges != null) { ! if (to != null) { ! Vertex dir = to.minus(from); ! dir.normalize(); ! dir.scale(length); ! to = from.add(dir); ! } else { ! to = from.add(new Vertex(0, 0, length)); ! } ! extrudeEdgesOnto(null, true); } extrusion = null; Project.getInstance().checkpoint(); *************** *** 301,307 **** */ public void updateLength() { ! if (extrudesurface == null) { ! glv.setLengthValue(""); ! } else { double value = distance; if (value < 0) { --- 451,455 ---- */ public void updateLength() { ! if (extrudesurface != null) { double value = distance; if (value < 0) { *************** *** 309,321 **** } this.setLength(value); } } /** ! * */ public void cleanUp() { all = false; dragplane = null; from = null; to = null; --- 457,474 ---- } this.setLength(value); + } else if (extrudeEdges != null) { + this.setLength(distance); + } else { + glv.setLengthValue(""); } } /** ! * {@inheritDoc} */ public void cleanUp() { all = false; dragplane = null; + ontoPlane = null; from = null; to = null; *************** *** 327,330 **** --- 480,485 ---- } extrudesurface = null; + extrudeEdges = null; + makeTarget(null); super.cleanUp(); } |
|
From: rimestad <rim...@us...> - 2007-03-12 16:01:36
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18159/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Log Message: made minor changes to extrudetool, and made extrude of edges extrude against a plane Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** Edge.java 8 Mar 2007 12:07:28 -0000 1.74 --- Edge.java 12 Mar 2007 16:01:26 -0000 1.75 *************** *** 951,959 **** * Extrude a set of lines in a given direction, create the surfaces in between * @param edges The edges to extrude ! * @param direction the direction of the extrusion * @return the generated surfaces during extrusion */ ! public static Collection<Geometric> extrude(Set<Edge> edges, Vertex direction) { ! Collection<Geometric> extrusion = new ArrayList<Geometric>(); if (edges == null || edges.isEmpty() || direction == null) { return extrusion; --- 951,960 ---- * Extrude a set of lines in a given direction, create the surfaces in between * @param edges The edges to extrude ! * @param direction The direction to extrude in ! * @param onto the plane to extrude to (null if there is none) * @return the generated surfaces during extrusion */ ! public static Collection<Surface> extrude(Collection<Edge> edges, Vertex direction, Plane onto) { ! Collection<Surface> extrusion = new ArrayList<Surface>(); if (edges == null || edges.isEmpty() || direction == null) { return extrusion; *************** *** 966,970 **** // generate new vertexes and edges to them for (Vertex v : vertexes) { ! Vertex newv = v.add(direction); vertexmap.put(v, newv); Edge newe = new Edge(v, newv); --- 967,981 ---- // generate new vertexes and edges to them for (Vertex v : vertexes) { ! Vertex addon = direction; ! if (onto != null) { ! addon = onto.intersection(v, direction, true); ! if (addon == null) { ! log.info("intersection were null"); ! addon = direction; ! } else { ! addon = addon.minus(v); ! } ! } ! Vertex newv = v.add(addon); vertexmap.put(v, newv); Edge newe = new Edge(v, newv); |
|
From: rimestad <rim...@us...> - 2007-03-12 15:58:09
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15395/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: added some generics Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.139 retrieving revision 1.140 diff -C2 -d -r1.139 -r1.140 *** Surface.java 26 Feb 2007 15:06:33 -0000 1.139 --- Surface.java 12 Mar 2007 15:58:01 -0000 1.140 *************** *** 42,50 **** private boolean constructor; ! private List edges; private Surface exterior; ! private Set holes; private Space frontDomain; --- 42,50 ---- private boolean constructor; ! private List<Edge> edges; private Surface exterior; ! private Set<Surface> holes; private Space frontDomain; *************** *** 158,166 **** * @return Collection of edges */ ! public static Collection edges(Collection surfaces) { ! Set edges = new HashSet(); ! Iterator iter = surfaces.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); edges.addAll(current.getEdges()); } --- 158,164 ---- * @return Collection of edges */ ! public static Collection<Edge> edges(Collection<Surface> surfaces) { ! Set<Edge> edges = new HashSet<Edge>(); ! for (Surface current : surfaces) { edges.addAll(current.getEdges()); } *************** *** 212,216 **** * class="net.sourceforge.bprocessor.model.Edge" */ ! public List getEdges() { return edges; } --- 210,214 ---- * class="net.sourceforge.bprocessor.model.Edge" */ ! public List<Edge> getEdges() { return edges; } |
|
From: rimestad <rim...@us...> - 2007-03-12 15:57:25
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15187/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: changed listener to use mouse released and not pressed to have the ispopuptrigger boolean avaiable i windows... calls model.nodeChanged when eye icon is changed Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** GenericTreeView.java 9 Mar 2007 12:59:53 -0000 1.83 --- GenericTreeView.java 12 Mar 2007 15:57:17 -0000 1.84 *************** *** 1311,1318 **** protected class GenericMouseAdapter extends MouseAdapter { /** ! * Mouse pressed * @param e MouseEvent */ ! public void mousePressed(MouseEvent e) { react(e); } --- 1311,1318 ---- protected class GenericMouseAdapter extends MouseAdapter { /** ! * Mouse released * @param e MouseEvent */ ! public void mouseReleased(MouseEvent e) { react(e); } *************** *** 1349,1356 **** c.addHiddenGeometric(g); } } } } else { - if (object instanceof GenericNode) { GenericNode node = (GenericNode) object; --- 1349,1356 ---- c.addHiddenGeometric(g); } + model.nodeChanged((GenericNode)object); } } } else { if (object instanceof GenericNode) { GenericNode node = (GenericNode) object; |
|
From: Michael L. <he...@us...> - 2007-03-12 08:32:55
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9267/src/net/sourceforge/bprocessor/model Modified Files: Space.java Attribute.java Relation.java CoordinateSystem.java Log Message: Relation demo ready Index: Attribute.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Attribute.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Attribute.java 9 Mar 2007 12:59:49 -0000 1.17 --- Attribute.java 12 Mar 2007 08:32:47 -0000 1.18 *************** *** 7,10 **** --- 7,11 ---- package net.sourceforge.bprocessor.model; + import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; *************** *** 191,194 **** --- 192,201 ---- } } + // FIXME: the above update should only update relations + // that depends on this attribute. + Collection<CoordinateSystem> systems = Project.getInstance().world().getCoordinateSystems(); + for (CoordinateSystem current : systems) { + current.update(); + } Project.getInstance().changed(this); } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.123 retrieving revision 1.124 diff -C2 -d -r1.123 -r1.124 *** Space.java 7 Mar 2007 09:47:13 -0000 1.123 --- Space.java 12 Mar 2007 08:32:47 -0000 1.124 *************** *** 2701,2703 **** --- 2701,2723 ---- } + /** + * Returns a direction-map for the given collection a vertices. + * @param vertices Collection of vertices for which to compute a direction-map + * @return A direction-map for the collection of vertices. + */ + public Map<Vertex, Vertex> directionMap(Collection<Vertex> vertices) { + Map <Vertex, Collection<Edge>> binding = edgeMap(vertices); + Map<Vertex, Vertex> map = new HashMap(); + for (Vertex vertex : vertices) { + Collection<Edge> edges = binding.get(vertex); + if (edges.size() > 0) { + Edge edge = edges.iterator().next(); + Vertex direction = edge.getDirection(); + direction.normalize(); + map.put(vertex, direction); + } + } + return map; + } + } Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** CoordinateSystem.java 8 Mar 2007 10:05:19 -0000 1.40 --- CoordinateSystem.java 12 Mar 2007 08:32:47 -0000 1.41 *************** *** 10,13 **** --- 10,14 ---- import java.util.ArrayList; import java.util.Collection; + import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; *************** *** 710,726 **** */ public void update() { for (Relation relation : relations) { - double distance = relation.evaluate(); Geometric geometric = relation.geometric(); Space space = geometric.getOwner(); Collection<Vertex> vertices = geometric.collect(); ! Map<Vertex, Collection<Edge>> map = space.edgeMap(vertices); for (Vertex vertex : vertices) { ! Vertex vector = getN(); ! Collection<Edge> binding = map.get(vertex); ! if (!binding.isEmpty()) { ! Edge bind = binding.iterator().next(); ! vector = bind.getDirection(); ! vector.normalize(); } Plane plane = plane(distance); --- 711,731 ---- */ public void update() { + Map<Relation, Map<Vertex, Vertex>> directions = new HashMap(); for (Relation relation : relations) { Geometric geometric = relation.geometric(); Space space = geometric.getOwner(); Collection<Vertex> vertices = geometric.collect(); ! Map<Vertex, Vertex> map = space.directionMap(vertices); ! directions.put(relation, map); ! } ! for (Relation relation : relations) { ! double distance = relation.evaluate(); ! Geometric geometric = relation.geometric(); ! Collection<Vertex> vertices = geometric.collect(); ! Map<Vertex, Vertex> map = directions.get(relation); for (Vertex vertex : vertices) { ! Vertex vector = map.get(vertex); ! if (vector == null) { ! vector = getN(); } Plane plane = plane(distance); Index: Relation.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Relation.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Relation.java 7 Mar 2007 09:47:13 -0000 1.5 --- Relation.java 12 Mar 2007 08:32:47 -0000 1.6 *************** *** 10,13 **** --- 10,14 ---- import java.io.Reader; import java.io.StringReader; + import java.util.Collection; import java.util.HashMap; import java.util.Iterator; *************** *** 105,108 **** --- 106,115 ---- } } + //FIXME: the above update should only update relations + // that contains on this relations. + Collection<CoordinateSystem> systems = Project.getInstance().world().getCoordinateSystems(); + for (CoordinateSystem current : systems) { + current.update(); + } } |
|
From: Michael L. <he...@us...> - 2007-03-12 08:32:51
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9251/src/net/sourceforge/bprocessor/gl/tool Modified Files: RelationTool.java AltMoveTool.java Log Message: Relation demo ready Index: RelationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RelationTool.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RelationTool.java 8 Feb 2007 12:23:13 -0000 1.2 --- RelationTool.java 12 Mar 2007 08:32:43 -0000 1.3 *************** *** 14,17 **** --- 14,19 ---- import java.net.URL; import java.util.ArrayList; + import java.util.Collection; + import java.util.LinkedList; import java.util.List; *************** *** 19,22 **** --- 21,25 ---- import net.sourceforge.bprocessor.gui.GUI; import net.sourceforge.bprocessor.model.Constructor; + import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Geometric; import net.sourceforge.bprocessor.model.Edge; *************** *** 28,31 **** --- 31,35 ---- */ public class RelationTool extends AbstractPencil { + private Geometric source; private Constructor constructor; private Edge edge; *************** *** 50,59 **** */ private void updateFeedback() { ! if (constructor != null) { if (edge != null) { edge.setTo(current.vertex()); } else { // make new feedback ! edge = new Edge(constructor.center(), current.vertex()); edge.setStrippled(true); List<Edge> es = new ArrayList<Edge>(1); --- 54,63 ---- */ private void updateFeedback() { ! if (source != null) { if (edge != null) { edge.setTo(current.vertex()); } else { // make new feedback ! edge = new Edge(source.center(), current.vertex()); edge.setStrippled(true); List<Edge> es = new ArrayList<Edge>(1); *************** *** 94,97 **** --- 98,102 ---- edge = null; constructor = null; + source = null; } *************** *** 101,108 **** */ public void onVertex(MouseEvent e) { ! if (constructor == null) { if (target != null) { ! if (target instanceof Constructor) { ! constructor = (Constructor) target; start = current; active = true; --- 106,113 ---- */ public void onVertex(MouseEvent e) { ! if (source == null) { if (target != null) { ! if (target instanceof Geometric) { ! source = (Geometric) target; start = current; active = true; *************** *** 114,128 **** } } else { ! if (target != null && target != constructor) { if (target instanceof Geometric) { ! Geometric g = (Geometric) target; ! if (metaPressed) { ! // remove the connection ! constructor.disconnect(g); } else { ! // add a connection ! constructor.connect(g); } ! Project.getInstance().changed(constructor); Project.getInstance().checkpoint(); cleanUp(); --- 119,141 ---- } } else { ! if (target != null && target != source) { if (target instanceof Geometric) { ! Geometric geometric = (Geometric) target; ! if (source instanceof Constructor) { ! constructor = (Constructor) source; ! if (metaPressed) { ! // remove the connection ! constructor.disconnect(geometric); ! } else { ! // add a connection ! constructor.connect(geometric); ! } } else { ! Collection<Geometric> geometrics = new LinkedList(); ! geometrics.add(source); ! geometrics.add(geometric); ! CoordinateSystem.relate(geometrics); } ! Project.getInstance().changed(source); Project.getInstance().checkpoint(); cleanUp(); Index: AltMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AltMoveTool.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AltMoveTool.java 8 Mar 2007 10:05:14 -0000 1.7 --- AltMoveTool.java 12 Mar 2007 08:32:43 -0000 1.8 *************** *** 24,27 **** --- 24,28 ---- import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Relation; import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Space; *************** *** 52,68 **** private void move(Vertex to) { ! system.setOrigin(to); ! for (Vertex vertex : vertices) { ! Vertex vector = system.getN(); ! Collection<Edge> binding = map.get(vertex); ! if (!binding.isEmpty()) { ! Edge bind = binding.iterator().next(); ! vector = bind.getDirection(); ! vector.normalize(); } ! Vertex project = system.slide(vertex, vector); ! vertex.set(project); } - system.update(); } --- 53,73 ---- private void move(Vertex to) { ! if (to == null) { ! System.out.println("move-to null"); ! } else { ! system.setOrigin(to); ! for (Vertex vertex : vertices) { ! Vertex vector = system.getN(); ! Collection<Edge> binding = map.get(vertex); ! if (!binding.isEmpty()) { ! Edge bind = binding.iterator().next(); ! vector = bind.getDirection(); ! vector.normalize(); ! } ! Vertex project = system.slide(vertex, vector); ! vertex.set(project); } ! system.update(); } } *************** *** 99,111 **** glv.getView().makeTarget(target); if (target instanceof Surface) { ! surface = (Surface) target; Space space = surface.getOwner(); vertices = surface.collect(); map = space.edgeMap(vertices); Selection.primary().set(surface); ! system = surface.coordinateSystem(); ! system.onlyPlane(true); ! system.setActive(true); ! } else if (target instanceof CoordinateSystem) { system = (CoordinateSystem) target; --- 104,128 ---- glv.getView().makeTarget(target); if (target instanceof Surface) { ! surface = (Surface) target; Space space = surface.getOwner(); + + Collection<CoordinateSystem> systems = space.getCoordinateSystems(); + for (CoordinateSystem current : systems) { + Collection<Relation> relations = current.relations(); + for (Relation relation : relations) { + if (relation.geometric() == surface) { + system = current; + } + } + } + vertices = surface.collect(); map = space.edgeMap(vertices); Selection.primary().set(surface); ! if (system == null) { ! system = surface.coordinateSystem(); ! system.onlyPlane(true); ! system.setActive(true); ! } } else if (target instanceof CoordinateSystem) { system = (CoordinateSystem) target; |
|
From: Michael L. <he...@us...> - 2007-03-09 13:00:04
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1926/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Fixed implementation of ParameterBlockNode; made Attribute extend Entity Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** GenericTreeView.java 9 Mar 2007 10:48:34 -0000 1.82 --- GenericTreeView.java 9 Mar 2007 12:59:53 -0000 1.83 *************** *** 492,496 **** } } else { ! log.warn(userObject + " were called with " + object + " and not a list"); } } --- 492,496 ---- } } else { ! log.warn(userObject + " were called with " + object + " and not a collection"); } } *************** *** 1136,1140 **** public void update(Object o) { if (o instanceof ParameterBlock) { ! //super.update(((ParameterBlock)o).getAttributes()); } } --- 1136,1140 ---- public void update(Object o) { if (o instanceof ParameterBlock) { ! super.update(((ParameterBlock)o).getAttributes()); } } |
|
From: Michael L. <he...@us...> - 2007-03-09 13:00:04
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1918/src/net/sourceforge/bprocessor/model Modified Files: Attribute.java Log Message: Fixed implementation of ParameterBlockNode; made Attribute extend Entity Index: Attribute.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Attribute.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Attribute.java 6 Jan 2007 21:06:59 -0000 1.16 --- Attribute.java 9 Mar 2007 12:59:49 -0000 1.17 *************** *** 17,21 **** * shown in the attributeview in the gui */ ! public class Attribute implements Parametric { /** The logger */ private static Logger log = Logger.getLogger(Attribute.class); --- 17,21 ---- * shown in the attributeview in the gui */ ! public class Attribute extends Entity implements Parametric { /** The logger */ private static Logger log = Logger.getLogger(Attribute.class); *************** *** 227,230 **** } ! } --- 227,233 ---- } ! /** {@inheritDoc} */ ! @Override ! public void delete() { ! } } |
|
From: Michael L. <he...@us...> - 2007-03-09 12:59:52
|
Update of /cvsroot/bprocessor/gui/.settings In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1911/.settings Log Message: Directory /cvsroot/bprocessor/gui/.settings added to the repository |
|
From: Michael L. <he...@us...> - 2007-03-09 10:48:35
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11522/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Removed some insertChildren implementations and added a nodeFor method instead so that the insertChildren method in ContainerNode is general (depends on nodeFor to create nodes of correct type). Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** GenericTreeView.java 9 Mar 2007 10:03:48 -0000 1.81 --- GenericTreeView.java 9 Mar 2007 10:48:34 -0000 1.82 *************** *** 15,20 **** import java.net.URL; import java.util.Collection; - import java.util.Collections; - import java.util.Comparator; import java.util.Enumeration; import java.util.HashSet; --- 15,18 ---- *************** *** 508,512 **** int i = 0; for (Object current : entities) { ! this.add(new EntityNode(current)); ins[i] = this.getChildCount() - 1; i++; --- 506,510 ---- int i = 0; for (Object current : entities) { ! this.add(nodeFor(current)); ins[i] = this.getChildCount() - 1; i++; *************** *** 890,920 **** } ! /** ! * Insert the given object into the node ! * @param elem the elements ! */ ! public void insertChildren(Collection elem) { ! final Comparator num = ! new Comparator() { ! public int compare(Object s1, Object s2) { ! return ((Surface) s1).getId().compareTo(((Surface) s2).getId()); ! } ! }; ! LinkedList sort = new LinkedList(elem); ! Collections.sort(sort, num); ! //insert ! int[] ins = new int[sort.size()]; ! int i = 0; ! Iterator iter = sort.iterator(); ! while (iter.hasNext()) { ! Surface s = (Surface)iter.next(); ! this.add(new SurfaceNode(s)); ! ins[i] = this.getChildCount() - 1; ! i++; ! } ! model.nodesWereInserted(this, ins); } - /** * Return icon --- 888,896 ---- } ! /** {@inheritDoc} */ ! public EntityNode nodeFor(Object entity) { ! return new SurfaceNode((Surface) entity); } /** * Return icon *************** *** 945,972 **** } ! /** ! * Insert the given object into the node ! * @param elem the elements ! */ ! public void insertChildren(Collection elem) { ! final Comparator num = ! new Comparator() { ! public int compare(Object s1, Object s2) { ! return ((Space) s1).getId().compareTo(((Space) s2).getId()); ! } ! }; ! LinkedList sort = new LinkedList(elem); ! Collections.sort(sort, num); ! ! int[] ins = new int[sort.size()]; ! int i = 0; ! Iterator iter = sort.iterator(); ! while (iter.hasNext()) { ! Space s = (Space)iter.next(); ! this.add(new SpaceNode(s)); ! ins[i] = this.getChildCount() - 1; ! i++; ! } ! model.nodesWereInserted(this, ins); } --- 921,927 ---- } ! /** {@inheritDoc} */ ! public EntityNode nodeFor(Object entity) { ! return new SpaceNode((Space) entity); } *************** *** 1034,1060 **** } ! /** ! * Insert the given object into the node ! * @param elem the elements ! */ ! public void insertChildren(Collection elem) { ! final Comparator num = ! new Comparator() { ! public int compare(Object s1, Object s2) { ! return ((Constructor) s1).getId().compareTo(((Constructor) s2).getId()); ! } ! }; ! LinkedList sort = new LinkedList(elem); ! Collections.sort(sort, num); ! int[] ins = new int[sort.size()]; ! int i = 0; ! Iterator iter = sort.iterator(); ! while (iter.hasNext()) { ! Constructor s = (Constructor)iter.next(); ! this.add(new ConstructorNode(s)); ! ins[i] = this.getChildCount() - 1; ! i++; ! } ! model.nodesWereInserted(this, ins); } } --- 989,995 ---- } ! /** {@inheritDoc} */ ! public EntityNode nodeFor(Object entity) { ! return new ConstructorNode((Constructor) entity); } } *************** *** 1074,1094 **** } ! /** ! * Insert collection of Entity in this node ! * @param entities collection of Entity ! */ ! public void insertChildren(Collection entities) { ! LinkedList sorted = new LinkedList(entities); ! Entity.sort(sorted); ! int[] ins = new int[sorted.size()]; ! int i = 0; ! Iterator iter = sorted.iterator(); ! while (iter.hasNext()) { ! Edge s = (Edge)iter.next(); ! this.add(new EdgeNode(s)); ! ins[i] = this.getChildCount() - 1; ! i++; ! } ! model.nodesWereInserted(this, ins); } --- 1009,1015 ---- } ! /** {@inheritDoc} */ ! public EntityNode nodeFor(Object entity) { ! return new EdgeNode((Edge) entity); } *************** *** 1132,1159 **** } ! /** ! * Insert the given objects into the node ! * @param elem the elements ! */ ! public void insertChildren(Collection elem) { ! final Comparator num = ! new Comparator() { ! public int compare(Object s1, Object s2) { ! return ((Space) s1).getId().compareTo(((Space) s2).getId()); ! } ! }; ! LinkedList sort = new LinkedList(elem); ! Collections.sort(sort, num); ! ! int[] ins = new int[sort.size()]; ! int i = 0; ! Iterator iter = sort.iterator(); ! while (iter.hasNext()) { ! Space s = (Space)iter.next(); ! this.add(new SpaceNode(s)); ! ins[i] = this.getChildCount() - 1; ! i++; ! } ! model.nodesWereInserted(this, ins); } } --- 1053,1059 ---- } ! /** {@inheritDoc} */ ! public EntityNode nodeFor(Object entity) { ! return new SpaceNode((Space) entity); } } *************** *** 1211,1239 **** } ! ! /** ! * Insert the given object into the node ! * @param elem the elements ! */ ! public void insertChildren(Collection elem) { ! final Comparator num = ! new Comparator() { ! public int compare(Object s1, Object s2) { ! return ((Vertex) s1).getId().compareTo(((Vertex) s2).getId()); ! } ! }; ! LinkedList sort = new LinkedList(elem); ! Collections.sort(sort, num); ! ! int[] ins = new int[sort.size()]; ! int i = 0; ! Iterator iter = sort.iterator(); ! while (iter.hasNext()) { ! Vertex s = (Vertex)iter.next(); ! this.add(new VertexNode(s)); ! ins[i] = this.getChildCount() - 1; ! i++; ! } ! model.nodesWereInserted(this, ins); } } --- 1111,1117 ---- } ! /** {@inheritDoc} */ ! public EntityNode nodeFor(Object entity) { ! return new VertexNode((Vertex) entity); } } |