bprocessor-commit Mailing List for B-processor (Page 109)
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...> - 2006-08-23 13:43:25
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17589/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Vertex.java Surface.java Space.java Project.java Log Message: Mad some changed to the naming scheme Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** Surface.java 21 Aug 2006 14:18:50 -0000 1.103 --- Surface.java 23 Aug 2006 13:43:19 -0000 1.104 *************** *** 80,88 **** */ public String getName() { ! String name = super.getName(); if (id == null) { ! name = name + "S"; } else { ! name = name + "S" + id; } return name; --- 80,88 ---- */ public String getName() { ! String name; if (id == null) { ! name = "None"; } else { ! name = "S" + id; } return name; *************** *** 1344,1349 **** } else if (a.getName().equals("Space")) { continue; - } else { - log.error("Wrong attribute for the object " + a); } } --- 1344,1347 ---- *************** *** 1358,1361 **** --- 1356,1360 ---- ArrayList res = new ArrayList(); res.add(new Attribute("Name", getName(), false)); + res.add(new Attribute("Owner", getOwner(), false)); if (getFrontDomain() != null) { res.add(new Attribute("Space1", getFrontDomain(), true)); Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** Space.java 21 Aug 2006 20:32:17 -0000 1.48 --- Space.java 23 Aug 2006 13:43:19 -0000 1.49 *************** *** 138,146 **** --- 138,152 ---- if (container) { vertices = new HashMap(); + nextVertexId = 1; edges = new HashMap(); + nextEdgeId = 1; surfaces = new HashMap(); + nextSurfaceId = 1; elements = new HashMap(); + nextElementId = 1; materials = new HashMap(); + nextMaterialId = 1; constructors = new HashMap(); + nextConstructorId = 1; empty = new Space("Void", FUNCTIONAL, false); this.add(empty); *************** *** 262,274 **** if (container) { vertices.clear(); ! nextVertexId = 0; edges.clear(); ! nextEdgeId = 0; surfaces.clear(); ! nextSurfaceId = 0; elements.clear(); ! nextElementId = 0; constructors.clear(); ! nextConstructorId = 0; empty = new Space("Void", FUNCTIONAL, false); this.add(empty); --- 268,280 ---- if (container) { vertices.clear(); ! nextVertexId = 1; edges.clear(); ! nextEdgeId = 1; surfaces.clear(); ! nextSurfaceId = 1; elements.clear(); ! nextElementId = 1; constructors.clear(); ! nextConstructorId = 1; empty = new Space("Void", FUNCTIONAL, false); this.add(empty); *************** *** 1058,1063 **** } else if (a.getName().equals("Description")) { setDescription(((String)a.getValue().toString())); - } else { - log.error("Wrong attribute for the object " + a); } } --- 1064,1067 ---- *************** *** 1072,1075 **** --- 1076,1080 ---- res.add(new Attribute("Name", getName())); res.add(new Attribute("ID", getId().toString(), false)); + res.add(new Attribute("Owner", getOwner(), false)); if (isConstructionSpace()) { res.add(new Attribute("Classification", constructionOptions, getClassification())); Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** Vertex.java 11 Aug 2006 13:36:20 -0000 1.42 --- Vertex.java 23 Aug 2006 13:43:19 -0000 1.43 *************** *** 79,87 **** */ public String getName() { ! String name = super.getName(); ! if (id != null) { ! name = name + "V" + id; } else { ! name = name + "V"; } return name; --- 79,87 ---- */ public String getName() { ! String name; ! if (id == null) { ! name = "None"; } else { ! name = "V" + id; } return name; *************** *** 383,388 **** } else if (a.getName().equals("Z")) { setZ(((Double)a.getValue()).doubleValue()); - } else { - log.error("Wrong attribute for the object " + a); } } --- 383,386 ---- *************** *** 395,400 **** public List getAttributes() { ArrayList res = new ArrayList(); - res.add(new Attribute("Name", getName(), false)); res.add(new Attribute("X", new Double(getX()))); res.add(new Attribute("Y", new Double(getY()))); --- 393,398 ---- public List getAttributes() { ArrayList res = new ArrayList(); res.add(new Attribute("Name", getName(), false)); + res.add(new Attribute("Owner", getOwner(), false)); res.add(new Attribute("X", new Double(getX()))); res.add(new Attribute("Y", new Double(getY()))); Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** Edge.java 22 Aug 2006 14:15:10 -0000 1.50 --- Edge.java 23 Aug 2006 13:43:19 -0000 1.51 *************** *** 151,160 **** */ public String getName() { ! String name = super.getName(); ! if (id == null) { ! name = name + "E"; } else { ! name = name + "E" + id; } return name; --- 151,159 ---- */ public String getName() { ! String name; if (id == null) { ! name = "None"; } else { ! name = "E" + id; } return name; *************** *** 474,479 **** } else if (a.getName().equals("Length")) { setLength(((Double)a.getValue()).doubleValue()); - } else { - log.error("Wrong attribute for the object " + a); } } --- 473,476 ---- *************** *** 487,490 **** --- 484,488 ---- ArrayList res = new ArrayList(); res.add(new Attribute("Name", getName(), false)); + res.add(new Attribute("Owner", getOwner(), false)); res.add(new Attribute("Length", new Double(getLength()))); return res; Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** Project.java 10 Aug 2006 13:13:26 -0000 1.69 --- Project.java 23 Aug 2006 13:43:19 -0000 1.70 *************** *** 229,233 **** world.delete((Edge)next); } else if (next instanceof Surface) { ! world.delete((Surface)next); } else if (next instanceof Vertex) { world.delete((Vertex)next); --- 229,233 ---- world.delete((Edge)next); } else if (next instanceof Surface) { ! delete((Surface)next); } else if (next instanceof Vertex) { world.delete((Vertex)next); *************** *** 472,476 **** */ public void delete(Surface surface) { ! world.delete(surface); changed(this); } --- 472,476 ---- */ public void delete(Surface surface) { ! surface.delete(); changed(this); } |
From: Michael L. <he...@us...> - 2006-08-23 13:43:24
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17537/src/net/sourceforge/bprocessor/gui/attrview Modified Files: LinkAttribute.java Log Message: Mad some changed to the naming scheme Index: LinkAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/LinkAttribute.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** LinkAttribute.java 17 May 2006 12:03:42 -0000 1.10 --- LinkAttribute.java 23 Aug 2006 13:43:12 -0000 1.11 *************** *** 173,177 **** JLabel valueLabel; if (value instanceof Entity) { ! s = ((Entity)value).getName() + "-" + ((Entity)value).getId().toString(); valueLabel = new JLabel(s); } else { --- 173,177 ---- JLabel valueLabel; if (value instanceof Entity) { ! s = ((Entity)value).getName(); valueLabel = new JLabel(s); } else { |
From: Michael L. <he...@us...> - 2006-08-23 13:43:24
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17537/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Mad some changed to the naming scheme Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** GenericTreeView.java 18 Aug 2006 11:25:01 -0000 1.36 --- GenericTreeView.java 23 Aug 2006 13:43:11 -0000 1.37 *************** *** 457,461 **** Object object = this.getUserObject(); Entity entity = (Entity) object; ! String nid = entity.getName() + "-" + entity.getId().toString(); if (GUI.getInstance().isClosed((Space)object)) { nid += " (C)"; --- 457,461 ---- Object object = this.getUserObject(); Entity entity = (Entity) object; ! String nid = entity.getName(); if (GUI.getInstance().isClosed((Space)object)) { nid += " (C)"; |
From: rimestad <rim...@us...> - 2006-08-22 14:15:19
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26620/src/net/sourceforge/bprocessor/facade/modellor Modified Files: WindowModellor.java Log Message: not all done yet Index: WindowModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/WindowModellor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** WindowModellor.java 21 Aug 2006 14:17:55 -0000 1.1 --- WindowModellor.java 22 Aug 2006 14:15:15 -0000 1.2 *************** *** 14,20 **** --- 14,22 ---- import net.sourceforge.bprocessor.model.Attribute; + import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; + import net.sourceforge.bprocessor.model.Vertex; import net.sourceforge.bprocessor.model.modellor.Modellor; *************** *** 73,76 **** --- 75,87 ---- public void drawWindow() { Space frame = new Space("Frame", Space.CONSTRUCTION, true); + Space glass = new Space("Glass", Space.CONSTRUCTION, true); + Surface inner = surface.copy(frame); + Vertex normal = surface.normal(); + normal.scale(-offset); + inner.move(normal.getX(), normal.getY(), normal.getZ()); + List offset = Edge.offset(inner.getEdges(), inner, framewidth); + Surface glasssurface = new Surface(offset); + inner.addHole(glasssurface); + inner.setBackDomain(frame); space.add(frame); } |
From: rimestad <rim...@us...> - 2006-08-22 14:15:16
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26538/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Log Message: not all done yet Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** Edge.java 4 Aug 2006 11:48:04 -0000 1.49 --- Edge.java 22 Aug 2006 14:15:10 -0000 1.50 *************** *** 512,514 **** --- 512,527 ---- return surfaces; } + + /** + * Create a offset from a list of lines and a surface + * PRECONDITION: all the edges have to be in the given surface + * @param edges The list of edges + * @param inner The surface + * @param framewidth The offset positive inside and negative outside + * @return The generated list of lines + */ + public static List offset(List edges, Surface inner, double framewidth) { + // TODO Auto-generated method stub + return null; + } } |
From: Nikolaj B. <nbr...@us...> - 2006-08-21 21:47:21
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9879/src/net/sourceforge/bprocessor/model Modified Files: Space.java Plane.java Log Message: Improved the energy calc to now consider if rooms are heated or not Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** Space.java 21 Aug 2006 14:18:50 -0000 1.47 --- Space.java 21 Aug 2006 20:32:17 -0000 1.48 *************** *** 107,111 **** /** The functionalspace classification options */ private String[] functionalOptions = ! {"None", "Exteriør", "Stue", "Badeværelse", "Uopvarmet rum"}; /** The modellor */ --- 107,111 ---- /** The functionalspace classification options */ private String[] functionalOptions = ! {"None", "Exteriør", "Stue", "Badeværelse", "Opvarmet rum", "Uopvarmet rum"}; /** The modellor */ Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Plane.java 21 Jul 2006 08:07:02 -0000 1.24 --- Plane.java 21 Aug 2006 20:32:17 -0000 1.25 *************** *** 175,180 **** * @param direction The direction of the ray * @return The intersection point */ ! public Vertex intersection(Vertex origin, Vertex direction) { double x0 = origin.getX(); double y0 = origin.getY(); --- 175,182 ---- * @param direction The direction of the ray * @return The intersection point + * @param endless If the intersection should be endless + * or just from origin to the direction tip */ ! public Vertex intersection(Vertex origin, Vertex direction, boolean endless) { double x0 = origin.getX(); double y0 = origin.getY(); *************** *** 187,191 **** double v0 = -(a * x0 + b * y0 + c * z0 + d); double t = v0 / vd; ! if (t < -0.001 || t > 1.001) { return null; } --- 189,193 ---- double v0 = -(a * x0 + b * y0 + c * z0 + d); double t = v0 / vd; ! if (!endless && (t < -0.001 || t > 1.001)) { return null; } *************** *** 224,228 **** Vertex p1 = edge.getTo(); p1 = p1.minus(p0); ! return intersection(p0, p1); } --- 226,230 ---- Vertex p1 = edge.getTo(); p1 = p1.minus(p0); ! return intersection(p0, p1, false); } |
From: Nikolaj B. <nbr...@us...> - 2006-08-21 21:47:21
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9928/src/net/sourceforge/bprocessor/gui/actions Modified Files: ToolsEnergyActionListener.java Log Message: Improved the energy calc to now consider if rooms are heated or not Index: ToolsEnergyActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/ToolsEnergyActionListener.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ToolsEnergyActionListener.java 17 Jul 2006 08:32:00 -0000 1.3 --- ToolsEnergyActionListener.java 21 Aug 2006 20:32:42 -0000 1.4 *************** *** 8,12 **** --- 8,14 ---- import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; + import net.sourceforge.bprocessor.model.Vertex; import java.awt.event.ActionEvent; *************** *** 43,56 **** Surface current = (Surface) it.next(); if (current.getFrontDomain().getClassification().equalsIgnoreCase("Exteriør")) { ! totalloss = totalloss + calcloss(current.getBackDomain().getClassification(), current); } if (current.getFrontDomain().getClassification().equalsIgnoreCase("Uopvarmet rum")) { ! totalloss = totalloss + calcloss(current.getBackDomain().getClassification(), current); } if (current.getBackDomain().getClassification().equalsIgnoreCase("Exteriør")) { ! totalloss = totalloss + calcloss(current.getFrontDomain().getClassification(), current); } if (current.getBackDomain().getClassification().equalsIgnoreCase("Uopvarmet rum")) { ! totalloss = totalloss + calcloss(current.getFrontDomain().getClassification(), current); } } --- 45,58 ---- Surface current = (Surface) it.next(); if (current.getFrontDomain().getClassification().equalsIgnoreCase("Exteriør")) { ! totalloss = totalloss + calcloss(current.getBackDomain(), current); } if (current.getFrontDomain().getClassification().equalsIgnoreCase("Uopvarmet rum")) { ! totalloss = totalloss + calcloss(current.getBackDomain(), current); } if (current.getBackDomain().getClassification().equalsIgnoreCase("Exteriør")) { ! totalloss = totalloss + calcloss(current.getFrontDomain(), current); } if (current.getBackDomain().getClassification().equalsIgnoreCase("Uopvarmet rum")) { ! totalloss = totalloss + calcloss(current.getFrontDomain(), current); } } *************** *** 67,107 **** * @return the loss */ ! private double calcloss(String classification, Surface current) { double loss = 0; ! if (classification.equalsIgnoreCase("Terrandæk")) { ! loss = 0.15 * current.getArea(); ! return loss; ! } ! if (classification.equalsIgnoreCase("Tagkonstruktion")) { ! loss = 0.15 * current.getArea(); ! return loss; ! } ! if (classification.equalsIgnoreCase("Loft")) { ! loss = 0.15 * current.getArea(); ! return loss; } ! if (classification.equalsIgnoreCase("Ydervæg")) { ! loss = 0.25 * current.getArea(); ! return loss; } ! if (classification.equalsIgnoreCase("Ældre termovindue")) { ! loss = 2.5 * current.getArea(); ! return loss; } ! if (classification.equalsIgnoreCase("2-lags lavenergivindue")) { ! loss = 1.5 * current.getArea(); ! return loss; } ! if (classification.equalsIgnoreCase("3-lags lavenergivindue")) { ! loss = 0.8 * current.getArea(); ! return loss; } ! if (classification.equalsIgnoreCase("Dør")) { ! loss = 1.5 * current.getArea(); ! return loss; ! } ! return loss; } } --- 69,180 ---- * @return the loss */ ! private double calcloss(Space classification, Surface current) { double loss = 0; ! boolean first = true; ! if (isrelevant(classification, current)) { ! Iterator it = classification.getElements().iterator(); ! ! ! while (it.hasNext()) { ! Space elemcheck = (Space) it.next(); ! if (elemcheck.getName().equalsIgnoreCase("Void") && first) { ! ! if (classification.getClassification().equalsIgnoreCase("Terrandæk")) { ! loss = 0.15 * current.getArea(); ! return loss; ! } ! if (classification.getClassification().equalsIgnoreCase("Tagkonstruktion")) { ! loss = 0.15 * current.getArea(); ! return loss; ! } ! if (classification.getClassification().equalsIgnoreCase("Loft")) { ! loss = 0.15 * current.getArea(); ! return loss; ! } ! if (classification.getClassification().equalsIgnoreCase("Ydervæg")) { ! loss = 0.25 * current.getArea(); ! return loss; ! } ! if (classification.getClassification().equalsIgnoreCase("Ældre termovindue")) { ! loss = 2.5 * current.getArea(); ! return loss; ! } ! if (classification.getClassification().equalsIgnoreCase("2-lags lavenergivindue")) { ! loss = 1.5 * current.getArea(); ! return loss; ! } ! ! if (classification.getClassification().equalsIgnoreCase("3-lags lavenergivindue")) { ! loss = 0.8 * current.getArea(); ! return loss; ! } ! ! if (classification.getClassification().equalsIgnoreCase("Dør")) { ! loss = 1.5 * current.getArea(); ! return loss; ! } ! System.out.println("void - no more element spaces"); ! } ! if (!elemcheck.getName().equalsIgnoreCase("Void")) { ! System.out.println(elemcheck.getName()); ! } ! first = false; ! } ! } ! return loss; ! } ! ! /** ! * Test if the surface is relevant for thermiccalculation ! * @param classification The classifaction of the surface ! * @param current The current Surface ! * @return true if the surface is relevant ! */ ! private boolean isrelevant(Space classification, Surface current) { ! boolean relevant = false; ! Vertex normal = current.normal(); ! if (current.getBackDomain().isConstructionSpace()) { ! normal.scale(-1); ! } ! Vertex origin = current.center(); ! double distance = 0; ! Surface closest = null; ! Space spa = null; ! ! Iterator it = Project.getInstance().getSurfaces().iterator(); ! ! while (it.hasNext()) { ! Surface sur = (Surface) it.next(); ! Vertex interpoint = sur.plane().intersection(origin, normal, true); ! if (interpoint != null) { ! if (sur.surrounds(interpoint)) { ! if (sur.getFrontDomain().isFunctionalSpace() || sur.getBackDomain().isFunctionalSpace()) { ! if (origin.distance(interpoint) != 0 && ! (distance == 0 || distance > origin.distance(interpoint))) { ! distance = origin.distance(interpoint); ! closest = sur; ! } ! } ! } ! } } ! if (closest != null && closest.getFrontDomain().isFunctionalSpace()) { ! spa = closest.getFrontDomain(); } ! if (closest != null && closest.getBackDomain().isFunctionalSpace()) { ! spa = closest.getBackDomain(); } ! if (spa != null && ! spa.getClassification().equalsIgnoreCase("Stue") || ! spa.getClassification().equalsIgnoreCase("Badeværelse") || ! spa.getClassification().equalsIgnoreCase("Opvarmet rum")) { ! relevant = true; ! } ! ! return relevant; } } |
From: rimestad <rim...@us...> - 2006-08-21 14:25:15
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23289/src/net/sourceforge/bprocessor/gl/tool Modified Files: VectorMoveTool.java ControlledMoveTool.java Log Message: Changed vector move to make use of gemetric interface and added change call to both controlled and vector move tools Index: ControlledMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ControlledMoveTool.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ControlledMoveTool.java 14 Aug 2006 08:41:57 -0000 1.2 --- ControlledMoveTool.java 21 Aug 2006 14:25:13 -0000 1.3 *************** *** 263,266 **** --- 263,267 ---- vertex.move(slideDir.getX(), slideDir.getY(), slideDir.getZ()); } + Project.getInstance().changed(vertices); } } Index: VectorMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/VectorMoveTool.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** VectorMoveTool.java 21 Aug 2006 09:49:22 -0000 1.3 --- VectorMoveTool.java 21 Aug 2006 14:25:13 -0000 1.4 *************** *** 13,18 **** import net.sourceforge.bprocessor.gl.GLView; ! import net.sourceforge.bprocessor.model.Edge; ! import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; --- 13,18 ---- import net.sourceforge.bprocessor.gl.GLView; ! import net.sourceforge.bprocessor.model.Geometric; ! import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Vertex; *************** *** 41,52 **** while (it.hasNext()) { Object elm = it.next(); ! if (elm instanceof Vertex) { ! ((Vertex)elm).move(delta.getX(), delta.getY(), delta.getZ()); ! } else if (elm instanceof Edge) { ! ((Edge)elm).move(delta.getX(), delta.getY(), delta.getZ()); ! } else if (elm instanceof Surface) { ! ((Surface) elm).move(delta.getX(), delta.getY(), delta.getZ()); } } } } --- 41,49 ---- while (it.hasNext()) { Object elm = it.next(); ! if (elm instanceof Geometric) { ! ((Geometric)elm).move(delta.getX(), delta.getY(), delta.getZ()); } } + Project.getInstance().changed(vertices); } } |
From: rimestad <rim...@us...> - 2006-08-21 14:18:53
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20266/src/net/sourceforge/bprocessor/model Modified Files: ClippingPlane.java Surface.java Space.java Geometric.java Log Message: Made the move command a part of Geometric and implemented it in clippingplane, space and surface Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** Surface.java 9 Jul 2006 16:24:39 -0000 1.102 --- Surface.java 21 Aug 2006 14:18:50 -0000 1.103 *************** *** 901,905 **** } } - changed(); } --- 901,904 ---- Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** Space.java 10 Aug 2006 13:13:26 -0000 1.46 --- Space.java 21 Aug 2006 14:18:50 -0000 1.47 *************** *** 1085,1088 **** --- 1085,1091 ---- } res.add(new Attribute("Description", getDescription())); + if (getModellor() != null) { + res.add(new Attribute("Modellor", getModellor(), false)); + } return res; } *************** *** 1625,1627 **** --- 1628,1638 ---- } } + + /** @see net.sourceforge.bprocessor.model.Geometric#move(double, double, double)*/ + public void move(double x, double y, double z) { + Iterator iter = getVertices().iterator(); + while (iter.hasNext()) { + ((Vertex)iter.next()).move(x, y, z); + } + } } Index: ClippingPlane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClippingPlane.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ClippingPlane.java 9 Aug 2006 18:10:31 -0000 1.6 --- ClippingPlane.java 21 Aug 2006 14:18:50 -0000 1.7 *************** *** 276,278 **** --- 276,283 ---- this.isActive = isActive; } + + /** @see net.sourceforge.bprocessor.model.Geometric#move(double, double, double) */ + public void move(double x, double y, double z) { + center().move(x, y, z); + } } Index: Geometric.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometric.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Geometric.java 9 Aug 2006 15:14:58 -0000 1.9 --- Geometric.java 21 Aug 2006 14:18:50 -0000 1.10 *************** *** 75,77 **** --- 75,85 ---- */ public abstract Vertex center(); + + /** + * Move the geometric object x,y,z + * @param x the distance in x + * @param y the distance in y + * @param z the distance in z + */ + public abstract void move(double x, double y, double z); } |
From: rimestad <rim...@us...> - 2006-08-21 14:18:10
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19841/src/net/sourceforge/bprocessor/facade Modified Files: FacadeMain.java Log Message: Added window modellor to the facade project and registred it via the main class. It is not done yet, just comitting to be able to work at home Index: FacadeMain.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/FacadeMain.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FacadeMain.java 15 Aug 2006 08:35:01 -0000 1.2 --- FacadeMain.java 21 Aug 2006 14:17:56 -0000 1.3 *************** *** 8,11 **** --- 8,12 ---- import net.sourceforge.bprocessor.facade.modellor.FacadeModellor; + import net.sourceforge.bprocessor.facade.modellor.WindowModellor; import net.sourceforge.bprocessor.model.modellor.Modellor; *************** *** 24,27 **** --- 25,29 ---- public FacadeMain () { Modellor.registerModellor(new FacadeModellor()); + Modellor.registerModellor(new WindowModellor()); } } |
From: rimestad <rim...@us...> - 2006-08-21 14:18:04
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19841/src/net/sourceforge/bprocessor/facade/modellor Added Files: WindowModellor.java Log Message: Added window modellor to the facade project and registred it via the main class. It is not done yet, just comitting to be able to work at home --- NEW FILE: WindowModellor.java --- //--------------------------------------------------------------------------------- // $Id: WindowModellor.java,v 1.1 2006/08/21 14:17:55 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.facade.modellor; import java.util.Collection; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Iterator; import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.modellor.Modellor; /** A modellor to make windows */ public class WindowModellor extends Modellor { /** The width of the frame */ private double framewidth = 0.1; /** The depth of the frame */ private double framedepth = 0.075; /** The offset in the window */ private double offset = 0; /** The number of vertical sprosses */ private int verticalSprosses = 0; /** The number of horizontal sprosses */ private int horizontalSprosses = 0; /** The used space */ private Space space; /** The bound surface */ private Surface surface; /** The created bounding */ private Surface opposite; /** * the constructor */ public WindowModellor() { } /** * the constructor * @param s The space this modellor makes * @param sur The surface in the given space is use as base */ public WindowModellor(Space s, Surface sur) { space = s; surface = sur; } /** * @see net.sourceforge.bprocessor.model.Modellor#update(Object) */ public void update(Object entity) { if (entity == space || entity == surface) { drawWindow(); } } /** Draw the window */ public void drawWindow() { Space frame = new Space("Frame", Space.CONSTRUCTION, true); space.add(frame); } /** * @see net.sourceforge.bprocessor.model.Modellor#newInstance(Space) */ public Modellor newInstance(Space s) { if (s.getSurfaces().size() == 1) { Surface sur = (Surface)s.getSurfaces().iterator().next(); opposite = sur.extrude(framedepth, new HashSet()); } return new WindowModellor(s, (Surface)s.getSurfaces().iterator().next()); } /** * @see net.sourceforge.bprocessor.model.Entity#delete() */ public void delete() { Collection added = space.getElements(); Iterator iter = added.iterator(); while (iter.hasNext()) { Space s = (Space)iter.next(); s.delete(); } if (opposite != null) { Collection surs = space.getSurfaces(); iter = surs.iterator(); while (iter.hasNext()) { Surface cur = (Surface)iter.next(); if (cur != surface) { cur.delete(); } } } space.setModellor(null); } /** * @see net.sourceforge.bprocessor.model.Parametric#setAttributes(List) */ public void setAttributes(List attributes) { framewidth = ((Double)((Attribute)attributes.get(1)).getValue()).doubleValue(); framedepth = ((Double)((Attribute)attributes.get(2)).getValue()).doubleValue(); offset = ((Double)((Attribute)attributes.get(3)).getValue()).doubleValue(); Iterator sit = Project.getInstance().getSurfaces().iterator(); Object value = ((Attribute)attributes.get(4)).getValue(); while (sit.hasNext()) { Project.getInstance().checkpoint(); Surface s = (Surface)sit.next(); if (s.getName().equals(value)) { surface = s; } } update(this); } /** * @see net.sourceforge.bprocessor.model.Parametric#getAttributes() */ public List getAttributes() { List res = new LinkedList(); res.add(new Attribute("Name", getName(), false)); res.add(new Attribute("Framewidth", new Double(framewidth))); res.add(new Attribute("Framedepth", new Double(framedepth))); res.add(new Attribute("Offset", new Double(offset))); res.add(new Attribute("Surface", surface)); return res; } /** * @see net.sourceforge.bprocessor.model.Entity#getName() */ public String getName() { return "Window-" + id; } /** * @see net.sourceforge.bprocessor.model.Parametric#getGeneralName() */ public String getGeneralName() { return "Window modellor"; } } |
From: rimestad <rim...@us...> - 2006-08-21 14:18:04
|
Update of /cvsroot/bprocessor/facade In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19841 Modified Files: .classpath Log Message: Added window modellor to the facade project and registred it via the main class. It is not done yet, just comitting to be able to work at home Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/facade/.classpath,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** .classpath 21 Aug 2006 09:33:39 -0000 1.4 --- .classpath 21 Aug 2006 14:17:55 -0000 1.5 *************** *** 2,11 **** <classpath> <classpathentry kind="src" path="src"/> ! <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> ! <classpathentry kind="lib" path="lib/log4j.jar"/> <classpathentry combineaccessrules="false" kind="src" path="/gl"/> <classpathentry combineaccessrules="false" kind="src" path="/gui"/> <classpathentry combineaccessrules="false" kind="src" path="/kernel"/> ! <classpathentry combineaccessrules="false" kind="src" path="/model"/> <classpathentry kind="output" path="build"/> </classpath> --- 2,11 ---- <classpath> <classpathentry kind="src" path="src"/> ! <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> ! <classpathentry exported="true" kind="lib" path="lib/log4j.jar"/> <classpathentry combineaccessrules="false" kind="src" path="/gl"/> <classpathentry combineaccessrules="false" kind="src" path="/gui"/> <classpathentry combineaccessrules="false" kind="src" path="/kernel"/> ! <classpathentry combineaccessrules="false" exported="true" kind="src" path="/model"/> <classpathentry kind="output" path="build"/> </classpath> |
From: Nordholt <nor...@us...> - 2006-08-21 09:49:24
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8833/src/net/sourceforge/bprocessor/gl/tool Modified Files: VectorMoveTool.java Log Message: fixing error when trying to move nothing Index: VectorMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/VectorMoveTool.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** VectorMoveTool.java 14 Aug 2006 08:41:57 -0000 1.2 --- VectorMoveTool.java 21 Aug 2006 09:49:22 -0000 1.3 *************** *** 30,34 **** super(glv, cursor); } ! /** * Move the vertices --- 30,34 ---- super(glv, cursor); } ! /** * Move the vertices *************** *** 37,52 **** */ public void move(Collection objects, Vertex delta) { ! Iterator it = objects.iterator(); ! while (it.hasNext()) { ! Object elm = it.next(); ! if (elm instanceof Vertex) { ! ((Vertex)elm).move(delta.getX(), delta.getY(), delta.getZ()); ! } else if (elm instanceof Edge) { ! ((Edge)elm).move(delta.getX(), delta.getY(), delta.getZ()); ! } else if (elm instanceof Surface) { ! ((Surface) elm).move(delta.getX(), delta.getY(), delta.getZ()); } } } - } --- 37,53 ---- */ public void move(Collection objects, Vertex delta) { ! if (objects != null) { ! Iterator it = objects.iterator(); ! while (it.hasNext()) { ! Object elm = it.next(); ! if (elm instanceof Vertex) { ! ((Vertex)elm).move(delta.getX(), delta.getY(), delta.getZ()); ! } else if (elm instanceof Edge) { ! ((Edge)elm).move(delta.getX(), delta.getY(), delta.getZ()); ! } else if (elm instanceof Surface) { ! ((Surface) elm).move(delta.getX(), delta.getY(), delta.getZ()); ! } } } } } |
From: Nordholt <nor...@us...> - 2006-08-21 09:33:48
|
Update of /cvsroot/bprocessor/facade In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2472 Modified Files: .classpath Log Message: New classpath Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/facade/.classpath,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** .classpath 10 Aug 2006 15:37:34 -0000 1.3 --- .classpath 21 Aug 2006 09:33:39 -0000 1.4 *************** *** 4,7 **** --- 4,11 ---- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="lib" path="lib/log4j.jar"/> + <classpathentry combineaccessrules="false" kind="src" path="/gl"/> + <classpathentry combineaccessrules="false" kind="src" path="/gui"/> + <classpathentry combineaccessrules="false" kind="src" path="/kernel"/> + <classpathentry combineaccessrules="false" kind="src" path="/model"/> <classpathentry kind="output" path="build"/> </classpath> |
From: Nordholt <nor...@us...> - 2006-08-21 09:33:21
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2430/src/net/sourceforge/bprocessor/facade/modellor Modified Files: FacadeModellor.java Log Message: Some more work on the facade modellor Index: FacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/FacadeModellor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FacadeModellor.java 16 Aug 2006 09:32:31 -0000 1.3 --- FacadeModellor.java 21 Aug 2006 09:33:12 -0000 1.4 *************** *** 22,25 **** --- 22,26 ---- import net.sourceforge.bprocessor.model.Line; import net.sourceforge.bprocessor.model.Constructor; + import net.sourceforge.bprocessor.model.Geometry; import org.apache.log4j.Logger; *************** *** 39,52 **** /** Number of vertical posts */ ! private int vertPosts = -1; /** Number of horizontal posts */ ! private int horPosts = -1; /** Default vertical post width */ ! private double vertPostWidth; /** Default horizontal post width */ ! private double horPostWidth; /** The space this modellor is connected to */ --- 40,53 ---- /** Number of vertical posts */ ! private int vertPosts = 0; /** Number of horizontal posts */ ! private int horPosts = 0; /** Default vertical post width */ ! private double vertPostWidth = 0; /** Default horizontal post width */ ! private double horPostWidth = 0; /** The space this modellor is connected to */ *************** *** 61,65 **** /** The set of horizontal constructor lines */ private Set horCons = new HashSet(); ! /** The constructor */ public FacadeModellor() { --- 62,81 ---- /** The set of horizontal constructor lines */ private Set horCons = new HashSet(); ! ! /** Thickness of the frame */ ! private double frameThickness = 0; ! ! /** Facade depth */ ! private double depth = 0; ! ! /** The frame space */ ! private Space frame; ! ! /** The surfaces of the frame */ ! private Set frameSurfaces = new HashSet(); ! ! /** frame present */ ! private boolean present = false; ! /** The constructor */ public FacadeModellor() { *************** *** 94,145 **** */ public void update(Object entity) { ! if (this.front != null) { ! List edges = this.front.getEdges(); ! if (edges.size() == 4) { ! Iterator it = edges.iterator(); ! Edge vertEdge = null; ! Edge horEdge = null; ! while (it.hasNext() && ! (vertEdge == null || ! horEdge == null)) { ! Edge e = (Edge)it.next(); ! if (Math.abs(e.getDirection().dot(new Vertex(0, 0, 1))) < 0.0001) { ! horEdge = e; ! } else if (Math.abs(e.getDirection().dot(new Vertex(1, 0, 0))) < 0.0001 && ! Math.abs(e.getDirection().dot(new Vertex(0, 1, 0))) < 0.0001) { ! vertEdge = e; ! } ! } ! if (horEdge != null && vertEdge != null) { ! Vertex cross; ! if (horEdge.contains(vertEdge.getFrom())) { ! cross = vertEdge.getFrom(); ! } else { ! cross = vertEdge.getTo(); ! } ! Vertex horDir = horEdge.otherVertex(cross).minus(cross); ! Vertex vertDir = vertEdge.otherVertex(cross).minus(cross); ! removeConstructors(vertCons); ! removeConstructors(horCons); ! vertCons = new HashSet(); ! horCons = new HashSet(); ! double interval = horEdge.getLength() / (vertPosts + 1); ! for (int i = 1; i < vertPosts + 1; i++) { ! Vertex offset = horDir.copy(); ! offset.scale((interval * i) / offset.length()); ! Line l = new Line(cross.add(offset), vertDir.copy(), true); ! vertCons.add(l); ! space.add(l); ! } ! interval = vertEdge.getLength() / (horPosts + 1); ! for (int i = 1; i < horPosts + 1; i++) { ! Vertex offset = vertDir.copy(); ! offset.scale((interval * i) / offset.length()); ! Line l = new Line(cross.add(offset), horDir.copy(), true); ! horCons.add(l); ! space.add(l); ! } ! } ! } } } --- 110,116 ---- */ public void update(Object entity) { ! if (entity == front) { ! createPostConstructors(); ! createFrame(); } } *************** *** 165,179 **** Attribute a = (Attribute)it.next(); if (a.getName().equals("Name")) { name = (String)a.getValue(); } else if (a.getName().equals("Front")) { ! front = (Surface)a.getValue(); } else if (a.getName().equals("V-posts")) { ! vertPosts = ((Double)a.getValue()).intValue(); } else if (a.getName().equals("H-posts")) { ! horPosts = ((Double)a.getValue()).intValue(); } else if (a.getName().equals("V-postwidth")) { vertPostWidth = ((Double)a.getValue()).doubleValue(); } else if (a.getName().equals("H-postwidth")) { horPostWidth = ((Double)a.getValue()).doubleValue(); } } --- 136,184 ---- Attribute a = (Attribute)it.next(); if (a.getName().equals("Name")) { + Project.getInstance().checkpoint(); name = (String)a.getValue(); } else if (a.getName().equals("Front")) { ! Iterator sit = Project.getInstance().getSurfaces().iterator(); ! while (sit.hasNext()) { ! Project.getInstance().checkpoint(); ! Surface s = (Surface)sit.next(); ! if (s.getName().equals(a.getValue())) { ! front = s; ! } ! } } else if (a.getName().equals("V-posts")) { ! int n = ((Double)a.getValue()).intValue(); ! if (n != vertPosts) { ! Project.getInstance().checkpoint(); ! vertPosts = n; ! createPostConstructors(); ! } } else if (a.getName().equals("H-posts")) { ! int n = ((Double)a.getValue()).intValue(); ! if (n != horPosts) { ! Project.getInstance().checkpoint(); ! horPosts = n; ! createPostConstructors(); ! } } else if (a.getName().equals("V-postwidth")) { vertPostWidth = ((Double)a.getValue()).doubleValue(); } else if (a.getName().equals("H-postwidth")) { horPostWidth = ((Double)a.getValue()).doubleValue(); + } else if (a.getName().equals("Frame thickness")) { + double n = ((Double)a.getValue()).doubleValue(); + if (n != frameThickness) { + Project.getInstance().checkpoint(); + frameThickness = n; + createFrame(); + createPostConstructors(); + } + } else if (a.getName().equals("Depth")) { + double n = ((Double)a.getValue()).doubleValue(); + if (n != depth) { + Project.getInstance().checkpoint(); + depth = n; + createFrame(); + createPostConstructors(); + } } } *************** *** 193,196 **** --- 198,203 ---- attributes.add(new Attribute("V-postwidth", new Double(vertPostWidth))); attributes.add(new Attribute("H-postwidth", new Double(horPostWidth))); + attributes.add(new Attribute("Frame thickness", new Double(frameThickness))); + attributes.add(new Attribute("Depth", new Double(depth))); return attributes; } *************** *** 213,216 **** --- 220,374 ---- /** Delete */ public void delete() { + space.setModellor(null); + } + + /** + * Creates the frame for this facade based on frame thickness and depth. + */ + private void createFrame() { + if (front != null && + frameThickness > 0 && + depth > 0) { + removeFrame(); + frame = new Space("Frame", Space.CONSTRUCTION, true); + space.add(frame); + Surface s = front.copy(space); + frameSurfaces.add(s); + if (front.getBackDomain() == space) { + s.setBackDomain(frame); + } else { + s.setFrontDomain(frame); + } + List edges = new LinkedList(); + Iterator it = s.getVertices().iterator(); + Vertex oldV = null; + while (it.hasNext()) { + Vertex v = (Vertex)it.next(); + Iterator eit = v.getEdges().iterator(); + Edge e1 = (Edge)eit.next(); + Edge e2 = (Edge)eit.next(); + Vertex e1Dir = e1.otherVertex(v).minus(v); + Vertex e2Dir = e2.otherVertex(v).minus(v); + e1Dir.scale(frameThickness / e1Dir.length()); + e2Dir.scale(frameThickness / e2Dir.length()); + Vertex vCopy = v.add(e1Dir).add(e2Dir); + if (oldV != null) { + Edge e = new Edge(oldV, vCopy); + space.add(e); + edges.add(e); + } + oldV = vCopy; + } + Edge e = new Edge(oldV, ((Edge)edges.get(0)).getFrom()); + space.add(e); + edges.add(e); + Surface h = new Surface(edges); + frameSurfaces.add(h); + space.add(h); + s.addHole(h); + h.setBackDomain(space.getEmpty()); + h.setFrontDomain(space.getEmpty()); + Set sides = new HashSet(); + frameSurfaces.add(s.extrude(depth, sides)); + frameSurfaces.addAll(sides); + Iterator sidesIt = sides.iterator(); + while (sidesIt.hasNext()) { + space.add((Surface)sidesIt.next()); + } + sides = new HashSet(); + Surface top = h.extrude(depth, sides); + frameSurfaces.add(top); + Geometry.holeAnalysis(top); + frameSurfaces.addAll(sides); + sidesIt = sides.iterator(); + while (sidesIt.hasNext()) { + space.add((Surface)sidesIt.next()); + } + } + } + + /** + * Removes the current frame so a new one can be created. + */ + private void removeFrame() { + if (frame != null) { + Iterator it = frameSurfaces.iterator(); + while (it.hasNext()) { + ((Surface)it.next()).delete(); + } + frameSurfaces = new HashSet(); + frame.delete(); + } + } + + /** + * Creates the post constructors for this facade based on the number of posts. + */ + private void createPostConstructors() { + if (this.front != null) { + List edges = this.front.getEdges(); + if (edges.size() == 4) { + Iterator it = edges.iterator(); + Edge vertEdge = null; + Edge horEdge = null; + while (it.hasNext() && + (vertEdge == null || + horEdge == null)) { + Edge e = (Edge)it.next(); + if (Math.abs(e.getDirection().dot(new Vertex(0, 0, 1))) < 0.0001) { + horEdge = e; + } else if (Math.abs(e.getDirection().dot(new Vertex(1, 0, 0))) < 0.0001 && + Math.abs(e.getDirection().dot(new Vertex(0, 1, 0))) < 0.0001) { + vertEdge = e; + } + } + if (horEdge != null && vertEdge != null) { + Vertex cross; + if (horEdge.contains(vertEdge.getFrom())) { + cross = vertEdge.getFrom(); + } else { + cross = vertEdge.getTo(); + } + Vertex horDir = horEdge.otherVertex(cross).minus(cross); + Vertex vertDir = vertEdge.otherVertex(cross).minus(cross); + removeConstructors(vertCons); + removeConstructors(horCons); + vertCons = new HashSet(); + horCons = new HashSet(); + double interval = (horEdge.getLength() - (frameThickness * 2)) / (vertPosts + 1); + for (int i = 1; i < vertPosts + 1; i++) { + Vertex offset = horDir.copy(); + offset.scale((interval * i + frameThickness) / offset.length()); + Line l = new Line(cross.add(offset), vertDir.copy(), true); + vertCons.add(l); + space.add(l); + } + interval = (vertEdge.getLength() - (frameThickness * 2)) / (horPosts + 1); + for (int i = 1; i < horPosts + 1; i++) { + Vertex offset = vertDir.copy(); + offset.scale((interval * i + frameThickness) / offset.length()); + Line l = new Line(cross.add(offset), horDir.copy(), true); + horCons.add(l); + space.add(l); + } + } + } + } + } + + /** + * Creates the posts for the facade based on the post constructors, + * the post width and the depth. + * + */ + private void createPosts() { + + } + /** + * + * + */ + private void createColumn() { + } } |
From: Nordholt <nor...@us...> - 2006-08-18 11:52:08
|
Update of /cvsroot/bprocessor/CVSROOT In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26260 Modified Files: modules Log Message: added facade Index: modules =================================================================== RCS file: /cvsroot/bprocessor/CVSROOT/modules,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** modules 14 Jul 2005 09:52:37 -0000 1.3 --- modules 18 Aug 2006 11:52:03 -0000 1.4 *************** *** 25,29 **** # can be useful for creating a module that consists of many directories # spread out over the entire source repository. ! all -a build kernel model gui gl tools build build --- 25,29 ---- # can be useful for creating a module that consists of many directories # spread out over the entire source repository. ! all -a build kernel model gui gl tools facade build build *************** *** 33,34 **** --- 33,35 ---- gl gl tools tools + facade facade |
From: Michael L. <he...@us...> - 2006-08-18 11:25:07
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15664/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java Log Message: Attempt to fix CameraNode class not found on startup Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** AttributeView.java 13 Feb 2006 21:16:39 -0000 1.35 --- AttributeView.java 18 Aug 2006 11:25:01 -0000 1.36 *************** *** 56,59 **** --- 56,60 ---- */ public void update(Object object) { + Selection selection = Selection.primary(); if (object == selection) { |
From: Michael L. <he...@us...> - 2006-08-18 11:25:05
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15664/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Attempt to fix CameraNode class not found on startup Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** GenericTreeView.java 10 Aug 2006 13:13:32 -0000 1.35 --- GenericTreeView.java 18 Aug 2006 11:25:01 -0000 1.36 *************** *** 214,226 **** */ public void changed() { ! if (!isChanged) { ! isChanged = true; ! SwingUtilities.invokeLater ( ! new Runnable() { ! public void run() { ! flush(); } ! } ! ); } } --- 214,228 ---- */ public void changed() { ! if (GUI.getInstance().isPresented()) { ! if (!isChanged) { ! isChanged = true; ! SwingUtilities.invokeLater ( ! new Runnable() { ! public void run() { ! flush(); ! } } ! ); ! } } } |
From: Michael L. <he...@us...> - 2006-08-18 11:25:04
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15664/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Attempt to fix CameraNode class not found on startup Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** GUI.java 8 Aug 2006 15:12:57 -0000 1.38 --- GUI.java 18 Aug 2006 11:25:02 -0000 1.39 *************** *** 66,69 **** --- 66,72 ---- private static GUI instance; + /** Presented */ + private boolean presented = false; + /** The main split pane */ private JSplitPane splitPaneLeftRight; *************** *** 110,113 **** --- 113,124 ---- return instance; } + + /** + * + * @return is presented + */ + public boolean isPresented() { + return presented; + } /** Abstract action */ *************** *** 426,430 **** --- 437,443 ---- pack(); setVisible(true); + presented = true; Project.getInstance().checkpoint(); + Project.getInstance().changed(Project.getInstance()); } |
From: Michael L. <he...@us...> - 2006-08-18 08:24:21
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9005/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Minor changes to appearance in tools Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.139 retrieving revision 1.140 diff -C2 -d -r1.139 -r1.140 *** View.java 15 Aug 2006 09:51:14 -0000 1.139 --- View.java 18 Aug 2006 08:24:16 -0000 1.140 *************** *** 1169,1178 **** Vertex c = origin.minus(u).add(v); Vertex d = origin.minus(u).minus(v); - - //(gl.glEnable(GL.GL_POLYGON_STIPPLE); - //gl.glPolygonStipple(seethrough); gl.glColor4fv(CLIP_PLANE_INTERIOR_COLOR); gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); ! gl.glPolygonOffset(0.5f, 0.5f); gl.glBegin(GL.GL_QUADS); gl.glVertex3d(a.getX(), a.getY(), a.getZ()); --- 1169,1175 ---- Vertex c = origin.minus(u).add(v); Vertex d = origin.minus(u).minus(v); gl.glColor4fv(CLIP_PLANE_INTERIOR_COLOR); gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); ! gl.glPolygonOffset(1f, 1f); gl.glBegin(GL.GL_QUADS); gl.glVertex3d(a.getX(), a.getY(), a.getZ()); *************** *** 1182,1186 **** gl.glEnd(); gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); - //gl.glDisable(GL.GL_POLYGON_STIPPLE); } } else { --- 1179,1182 ---- |
From: Michael L. <he...@us...> - 2006-08-18 08:24:21
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9005/src/net/sourceforge/bprocessor/gl/tool Modified Files: TapeMeasureTool.java ConstructorTool.java AbstractPencil.java Log Message: Minor changes to appearance in tools Index: TapeMeasureTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/TapeMeasureTool.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** TapeMeasureTool.java 3 Aug 2006 14:27:52 -0000 1.17 --- TapeMeasureTool.java 18 Aug 2006 08:24:16 -0000 1.18 *************** *** 145,149 **** private void endTapeMeasure() { if (currentConstruction != null) { ! currentConstruction.setEditable(true); insertConstructor(currentConstruction); constructors(new LinkedList()); --- 145,149 ---- private void endTapeMeasure() { if (currentConstruction != null) { ! // currentConstruction.setEditable(true); insertConstructor(currentConstruction); constructors(new LinkedList()); Index: ConstructorTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ConstructorTool.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ConstructorTool.java 11 Aug 2006 12:44:25 -0000 1.10 --- ConstructorTool.java 18 Aug 2006 08:24:16 -0000 1.11 *************** *** 147,150 **** --- 147,151 ---- insertPoint(current.vertex().copy()); cleanUp(); + moved(e); return; } else if (p2 == null) { *************** *** 154,161 **** --- 155,164 ---- insertLine(p1.vertex().copy(), p2.vertex().copy()); cleanUp(); + moved(e); return; } else { insertPlane(p1.vertex().copy(), p2.vertex().copy(), current.vertex().copy()); cleanUp(); + moved(e); return; } Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** AbstractPencil.java 15 Aug 2006 13:31:48 -0000 1.58 --- AbstractPencil.java 18 Aug 2006 08:24:16 -0000 1.59 *************** *** 82,85 **** --- 82,87 ---- protected Plane lockingPlane; + /** Original vertex when snapping */ + protected Vertex original; /** Whether or not the tool is locked */ *************** *** 175,178 **** --- 177,181 ---- (Intersection) glv.getView().getObjectAtPoint(e.getX(), e.getY(), unwanted, View.INTERSECTIONS, work); + if (intersection != null) { Space space = Project.getInstance().getActiveSpace(); *************** *** 184,189 **** } } ! if (constrain) { if (lockingEdge != null) { Vertex vertex = lockingEdge.intersection(intersection.vertex()); --- 187,193 ---- } } ! original = null; if (constrain) { + original = intersection.vertex(); if (lockingEdge != null) { Vertex vertex = lockingEdge.intersection(intersection.vertex()); *************** *** 896,899 **** --- 900,904 ---- feedback(new LinkedList()); excluded(new LinkedList()); + points(new LinkedList()); number = ""; glv.repaint(); |
From: rimestad <rim...@us...> - 2006-08-18 07:01:28
|
Update of /cvsroot/bprocessor/model/src/etc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8300/src/etc Modified Files: bprocessor.xsd Log Message: Fixed the problem with loading by two hacks. First by making three lists one for Point, Line and Coordinatesystem. Then for some reason it is not possible to make a origin reference to a vertex??? Have to check this further cause can't make reason out of that... But end of it is it works at the moment... Index: bprocessor.xsd =================================================================== RCS file: /cvsroot/bprocessor/model/src/etc/bprocessor.xsd,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** bprocessor.xsd 31 Jul 2006 11:25:51 -0000 1.13 --- bprocessor.xsd 18 Aug 2006 07:01:25 -0000 1.14 *************** *** 10,14 **** <xsd:complexType name="EntityType"> <xsd:sequence> ! <xsd:element name="id" type="xsd:long" maxOccurs="1" minOccurs="1"/> <xsd:element name="progid" type="xsd:long" maxOccurs="1" minOccurs="0"/> </xsd:sequence> --- 10,14 ---- <xsd:complexType name="EntityType"> <xsd:sequence> ! <xsd:element name="id" type="xsd:long" maxOccurs="1" minOccurs="0"/> <xsd:element name="progid" type="xsd:long" maxOccurs="1" minOccurs="0"/> </xsd:sequence> *************** *** 19,23 **** <xsd:extension base="EntityType"> <xsd:sequence> ! <xsd:element ref="origin" maxOccurs="1" minOccurs="1"/> <xsd:element name="active" type="xsd:boolean" maxOccurs="1" minOccurs="0"/> <xsd:element name="editable" type="xsd:boolean" maxOccurs="1" minOccurs="0"/> --- 19,23 ---- <xsd:extension base="EntityType"> <xsd:sequence> ! <xsd:element ref="vertex" maxOccurs="1" minOccurs="0"/> <xsd:element name="active" type="xsd:boolean" maxOccurs="1" minOccurs="0"/> <xsd:element name="editable" type="xsd:boolean" maxOccurs="1" minOccurs="0"/> *************** *** 42,46 **** <xsd:element ref="vertex" maxOccurs="unbounded" minOccurs="0"/> <xsd:element ref="material" maxOccurs="unbounded" minOccurs="0"/> ! <xsd:element ref="constructor" maxOccurs="unbounded" minOccurs="0"/> </xsd:sequence> </xsd:extension> --- 42,48 ---- <xsd:element ref="vertex" maxOccurs="unbounded" minOccurs="0"/> <xsd:element ref="material" maxOccurs="unbounded" minOccurs="0"/> ! <xsd:element ref="line" maxOccurs="unbounded" minOccurs="0"/> ! <xsd:element ref="point" maxOccurs="unbounded" minOccurs="0"/> ! <xsd:element ref="coordinatesystem" maxOccurs="unbounded" minOccurs="0"/> </xsd:sequence> </xsd:extension> *************** *** 106,110 **** <xsd:extension base="ConstructorType"> <xsd:sequence> ! <xsd:element ref="direction" maxOccurs="1" minOccurs="1"/> </xsd:sequence> </xsd:extension> --- 108,112 ---- <xsd:extension base="ConstructorType"> <xsd:sequence> ! <xsd:element ref="direction" maxOccurs="1" minOccurs="0"/> </xsd:sequence> </xsd:extension> *************** *** 126,130 **** <xsd:sequence> <xsd:element name="onlyplane" type="xsd:boolean" maxOccurs="1" minOccurs="0"/> ! <xsd:element ref="ijn" maxOccurs="3" minOccurs="3"/> </xsd:sequence> </xsd:extension> --- 128,132 ---- <xsd:sequence> <xsd:element name="onlyplane" type="xsd:boolean" maxOccurs="1" minOccurs="0"/> ! <xsd:element ref="ijn" maxOccurs="1" minOccurs="0"/> </xsd:sequence> </xsd:extension> *************** *** 132,135 **** --- 134,143 ---- </xsd:complexType> + <xsd:complexType name="VertexesType"> + <xsd:sequence> + <xsd:element ref="vertex" maxOccurs="unbounded" minOccurs="0"/> + </xsd:sequence> + </xsd:complexType> + <!-- Element definitions --> <xsd:element name="space" type="SpaceType"/> *************** *** 138,145 **** <xsd:element name="vertex" type="VertexType"/> <xsd:element name="material" type="MaterialType"/> ! <xsd:element name="constructor" type="ConstructorType"/> <xsd:element name="origin" type="VertexType"/> ! <xsd:element name="direction" type="VertexType"/> ! <xsd:element name="ijn" type="VertexType"/> <!-- Main element --> --- 146,155 ---- <xsd:element name="vertex" type="VertexType"/> <xsd:element name="material" type="MaterialType"/> ! <xsd:element name="line" type="LineType"/> ! <xsd:element name="point" type="PointType"/> ! <xsd:element name="coordinatesystem" type="CoordinateSystemType"/> <xsd:element name="origin" type="VertexType"/> ! <xsd:element name="direction" type="VertexesType"/> ! <xsd:element name="ijn" type="VertexesType"/> <!-- Main element --> |
From: rimestad <rim...@us...> - 2006-08-18 07:01:28
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8300/src/net/sourceforge/bprocessor/model Modified Files: Persistence.java Log Message: Fixed the problem with loading by two hacks. First by making three lists one for Point, Line and Coordinatesystem. Then for some reason it is not possible to make a origin reference to a vertex??? Have to check this further cause can't make reason out of that... But end of it is it works at the moment... Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Persistence.java 3 Aug 2006 14:35:21 -0000 1.5 --- Persistence.java 18 Aug 2006 07:01:24 -0000 1.6 *************** *** 19,22 **** --- 19,23 ---- import net.sourceforge.bprocessor.model.xml.SurfaceType; import net.sourceforge.bprocessor.model.xml.VertexType; + import net.sourceforge.bprocessor.model.xml.VertexesType; import net.sourceforge.bprocessor.model.xml.impl.BmodelImpl; import net.sourceforge.bprocessor.model.xml.impl.CoordinateSystemTypeImpl; *************** *** 28,31 **** --- 29,33 ---- import net.sourceforge.bprocessor.model.xml.impl.SurfaceImpl; import net.sourceforge.bprocessor.model.xml.impl.VertexImpl; + import net.sourceforge.bprocessor.model.xml.impl.VertexesTypeImpl; import java.awt.Color; *************** *** 184,191 **** } { ! Iterator iter = xml.getConstructor().iterator(); while (iter.hasNext()) { ! ConstructorType current = (ConstructorType) iter.next(); ! space.add(internalizeConstructor(current, mapper, xmls)); } } --- 186,207 ---- } { ! Iterator iter = xml.getPoint().iterator(); while (iter.hasNext()) { ! PointType current = (PointType) iter.next(); ! space.add(internalizePoint(current, mapper, xmls)); ! } ! } ! { ! Iterator iter = xml.getLine().iterator(); ! while (iter.hasNext()) { ! LineType current = (LineType) iter.next(); ! space.add(internalizeLine(current, mapper, xmls)); ! } ! } ! { ! Iterator iter = xml.getCoordinatesystem().iterator(); ! while (iter.hasNext()) { ! CoordinateSystemType current = (CoordinateSystemType) iter.next(); ! space.add(internalizeCoordinateSystem(current, mapper, xmls)); } } *************** *** 201,233 **** * @return The Constructor */ ! private static Constructor internalizeConstructor(ConstructorType xml, Map mapper, Collection xmls) { ! Constructor res; ! if (xml instanceof PointType) { ! res = new Point(); ! } else if (xml instanceof LineType) { ! Line l = new Line(); ! l.setDirection(internalizeVertex(((LineType)xml).getDirection(), new HashMap(), new LinkedList())); - res = l; - } else if (xml instanceof CoordinateSystemType) { - CoordinateSystem cs = new CoordinateSystem(); - CoordinateSystemType cst = (CoordinateSystemType)xml; - cs.onlyPlane(cst.isOnlyplane()); - List ijn = cst.getIjn(); - Vertex i = internalizeVertex((VertexType)ijn.get(0), new HashMap(), new LinkedList()); - Vertex j = internalizeVertex((VertexType)ijn.get(1), new HashMap(), new LinkedList()); - Vertex n = internalizeVertex((VertexType)ijn.get(2), new HashMap(), new LinkedList()); - cs.setIJN(i, j, n); - res = cs; - } else { - log.error(xml + " were not a known constructor"); - return null; - } res.setActive(xml.isActive()); res.setEditable(xml.isEditable()); res.setId(new Long(xml.getProgid())); mapper.put(new Long(xml.getId()), res); ! res.setOrigin(internalizeVertex(xml.getOrigin(), new HashMap(), new LinkedList())); xmls.add(xml); return res; --- 217,276 ---- * @return The Constructor */ ! private static Point internalizePoint(PointType xml, Map mapper, Collection xmls) { ! Point res = new Point(); ! res.setActive(xml.isActive()); ! res.setEditable(xml.isEditable()); ! res.setId(new Long(xml.getProgid())); ! mapper.put(new Long(xml.getId()), res); ! res.setOrigin(internalizeVertex(xml.getVertex(), new HashMap(), new LinkedList())); ! xmls.add(xml); ! return res; ! } ! ! /** ! * ! * @param xml The ConstructorType ! * @param mapper The mapper ! * @param xmls The xmls ! * @return The Constructor ! */ ! private static Line internalizeLine(LineType xml, ! Map mapper, Collection xmls) { ! Line res = new Line(); ! res.setDirection(internalizeVertex( ! (VertexType)((LineType)xml).getDirection().getVertex().get(0), new HashMap(), new LinkedList())); res.setActive(xml.isActive()); res.setEditable(xml.isEditable()); res.setId(new Long(xml.getProgid())); mapper.put(new Long(xml.getId()), res); ! res.setOrigin(internalizeVertex(xml.getVertex(), new HashMap(), new LinkedList())); ! xmls.add(xml); ! return res; ! } ! ! /** ! * ! * @param xml The ConstructorType ! * @param mapper The mapper ! * @param xmls The xmls ! * @return The Constructor ! */ ! private static CoordinateSystem internalizeCoordinateSystem(CoordinateSystemType xml, ! Map mapper, Collection xmls) { ! CoordinateSystem res = new CoordinateSystem(); ! CoordinateSystemType cst = (CoordinateSystemType)xml; ! res.onlyPlane(cst.isOnlyplane()); ! List ijn = cst.getIjn().getVertex(); ! Vertex i = internalizeVertex((VertexType)ijn.get(0), new HashMap(), new LinkedList()); ! Vertex j = internalizeVertex((VertexType)ijn.get(1), new HashMap(), new LinkedList()); ! Vertex n = internalizeVertex((VertexType)ijn.get(2), new HashMap(), new LinkedList()); ! res.setIJN(i, j, n); ! res.setActive(xml.isActive()); ! res.setEditable(xml.isEditable()); ! res.setId(new Long(xml.getProgid())); ! mapper.put(new Long(xml.getId()), res); ! res.setOrigin(internalizeVertex(xml.getVertex(), new HashMap(), new LinkedList())); xmls.add(xml); return res; *************** *** 535,539 **** while (iter.hasNext()) { Constructor current = (Constructor) iter.next(); ! xml.getConstructor().add(externalizeConstructor(current, map)); } } --- 578,582 ---- while (iter.hasNext()) { Constructor current = (Constructor) iter.next(); ! externalizeConstructor(current, map, xml); } } *************** *** 545,579 **** * @param constructor The constructor * @param map The map ! * @return The ConstructorImpl */ ! private static ConstructorType externalizeConstructor(Constructor constructor, Map map) { ! ConstructorType xml; if (constructor instanceof Point) { ! xml = new PointTypeImpl(); } else if (constructor instanceof Line) { ! xml = new LineTypeImpl(); ! ((LineType)xml).setDirection(externalizeVertex(((Line)constructor).getDirection(), new HashMap())); } else if (constructor instanceof CoordinateSystem) { CoordinateSystem cs = (CoordinateSystem)constructor; ! CoordinateSystemType cst = new CoordinateSystemTypeImpl(); ! cst.setOnlyplane(((CoordinateSystem)constructor).onlyPlane()); ! List ijn = cst.getIjn(); ijn.add(0, externalizeVertex(cs.getI(), new HashMap())); ijn.add(1, externalizeVertex(cs.getJ(), new HashMap())); ijn.add(2, externalizeVertex(cs.getN(), new HashMap())); ! xml = cst; } else { log.error(constructor + " were of unknown type"); - return null; } - xml.setId(counter++); - xml.setProgid(constructor.getId().longValue()); - xml.setActive(constructor.isActive()); - xml.setEditable(constructor.isEditable()); - VertexType orig = externalizeVertex(constructor.getOrigin(), new HashMap()); - xml.setOrigin(orig); - map.put(constructor, xml); - return xml; } --- 588,640 ---- * @param constructor The constructor * @param map The map ! * @param to The space that the constructors are extracted from */ ! private static void externalizeConstructor(Constructor constructor, ! Map map, SpaceType to) { if (constructor instanceof Point) { ! PointType xml = new PointTypeImpl(); ! xml.setId(counter++); ! xml.setProgid(constructor.getId().longValue()); ! xml.setActive(constructor.isActive()); ! xml.setEditable(constructor.isEditable()); ! VertexType orig = externalizeVertex(constructor.getOrigin(), new HashMap()); ! xml.setVertex(orig); ! to.getPoint().add(xml); ! map.put(constructor, xml); } else if (constructor instanceof Line) { ! LineType xml = new LineTypeImpl(); ! VertexesType vt = new VertexesTypeImpl(); ! vt.getVertex().add(externalizeVertex(((Line)constructor).getDirection(), new HashMap())); + ((LineType)xml).setDirection(vt); + xml.setId(counter++); + xml.setProgid(constructor.getId().longValue()); + xml.setActive(constructor.isActive()); + xml.setEditable(constructor.isEditable()); + VertexType orig = externalizeVertex(constructor.getOrigin(), new HashMap()); + xml.setVertex(orig); + to.getLine().add(xml); + map.put(constructor, xml); } else if (constructor instanceof CoordinateSystem) { CoordinateSystem cs = (CoordinateSystem)constructor; ! CoordinateSystemType xml = new CoordinateSystemTypeImpl(); ! xml.setOnlyplane(((CoordinateSystem)constructor).onlyPlane()); ! VertexesType vt = new VertexesTypeImpl(); ! List ijn = vt.getVertex(); ijn.add(0, externalizeVertex(cs.getI(), new HashMap())); ijn.add(1, externalizeVertex(cs.getJ(), new HashMap())); ijn.add(2, externalizeVertex(cs.getN(), new HashMap())); ! xml.setIjn(vt); ! xml.setId(counter++); ! xml.setProgid(constructor.getId().longValue()); ! xml.setActive(constructor.isActive()); ! xml.setEditable(constructor.isEditable()); ! VertexType orig = externalizeVertex(constructor.getOrigin(), new HashMap()); ! xml.setVertex(orig); ! to.getCoordinatesystem().add(xml); ! map.put(constructor, xml); } else { log.error(constructor + " were of unknown type"); } } |
From: Nordholt <nor...@us...> - 2006-08-16 09:32:35
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8280/src/net/sourceforge/bprocessor/facade/modellor Modified Files: FacadeModellor.java Log Message: blabla Index: FacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/FacadeModellor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FacadeModellor.java 15 Aug 2006 08:35:01 -0000 1.2 --- FacadeModellor.java 16 Aug 2006 09:32:31 -0000 1.3 *************** *** 9,12 **** --- 9,14 ---- import java.util.List; import java.util.LinkedList; + import java.util.Set; + import java.util.HashSet; import java.util.Iterator; *************** *** 18,21 **** --- 20,25 ---- import net.sourceforge.bprocessor.model.Vertex; import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.Line; + import net.sourceforge.bprocessor.model.Constructor; import org.apache.log4j.Logger; *************** *** 35,42 **** /** Number of vertical posts */ ! private int vertPosts; /** Number of horizontal posts */ ! private int horPosts; /** Default vertical post width */ --- 39,46 ---- /** Number of vertical posts */ ! private int vertPosts = -1; /** Number of horizontal posts */ ! private int horPosts = -1; /** Default vertical post width */ *************** *** 52,56 **** private Surface front; ! /** The empty constructor */ public FacadeModellor() { this.name = "Facade Modellor"; --- 56,66 ---- private Surface front; ! /** The set of vertical constructor lines */ ! private Set vertCons = new HashSet(); ! ! /** The set of horizontal constructor lines */ ! private Set horCons = new HashSet(); ! ! /** The constructor */ public FacadeModellor() { this.name = "Facade Modellor"; *************** *** 61,64 **** --- 71,75 ---- */ public FacadeModellor(Space s) { + Project.getInstance().addObserver(this); this.space = s; this.name = "Facade Modellor"; *************** *** 90,95 **** Edge horEdge = null; while (it.hasNext() && ! vertEdge == null && ! horEdge == null) { Edge e = (Edge)it.next(); if (Math.abs(e.getDirection().dot(new Vertex(0, 0, 1))) < 0.0001) { --- 101,106 ---- Edge horEdge = null; while (it.hasNext() && ! (vertEdge == null || ! horEdge == null)) { Edge e = (Edge)it.next(); if (Math.abs(e.getDirection().dot(new Vertex(0, 0, 1))) < 0.0001) { *************** *** 100,105 **** } } ! ! } } } --- 111,156 ---- } } ! if (horEdge != null && vertEdge != null) { ! Vertex cross; ! if (horEdge.contains(vertEdge.getFrom())) { ! cross = vertEdge.getFrom(); ! } else { ! cross = vertEdge.getTo(); ! } ! Vertex horDir = horEdge.otherVertex(cross).minus(cross); ! Vertex vertDir = vertEdge.otherVertex(cross).minus(cross); ! removeConstructors(vertCons); ! removeConstructors(horCons); ! vertCons = new HashSet(); ! horCons = new HashSet(); ! double interval = horEdge.getLength() / (vertPosts + 1); ! for (int i = 1; i < vertPosts + 1; i++) { ! Vertex offset = horDir.copy(); ! offset.scale((interval * i) / offset.length()); ! Line l = new Line(cross.add(offset), vertDir.copy(), true); ! vertCons.add(l); ! space.add(l); ! } ! interval = vertEdge.getLength() / (horPosts + 1); ! for (int i = 1; i < horPosts + 1; i++) { ! Vertex offset = vertDir.copy(); ! offset.scale((interval * i) / offset.length()); ! Line l = new Line(cross.add(offset), horDir.copy(), true); ! horCons.add(l); ! space.add(l); ! } ! } ! } ! } ! } ! ! ! /** Removes a set of constructors from the facade ! * @param cons the constructors ! */ ! private void removeConstructors(Set cons) { ! Iterator it = cons.iterator(); ! while (it.hasNext()) { ! space.remove((Constructor)it.next()); } } |
From: Michael L. <he...@us...> - 2006-08-15 13:31:57
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28759/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Log Message: Edge-midpoint and Edge-intersection now same color Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** AbstractPencil.java 15 Aug 2006 13:25:44 -0000 1.57 --- AbstractPencil.java 15 Aug 2006 13:31:48 -0000 1.58 *************** *** 724,728 **** case Intersection.EDGE_MIDPOINT: target = current; ! targetColor = View.EDGE_MIDPOINT_COLOR; break; case Intersection.EDGE_INTERSECTION: --- 724,728 ---- case Intersection.EDGE_MIDPOINT: target = current; ! targetColor = View.EDGE_INTERSECTION_COLOR; break; case Intersection.EDGE_INTERSECTION: |