bprocessor-commit Mailing List for B-processor (Page 70)
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: rimestad <rim...@us...> - 2007-04-10 20:55:21
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25207/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: heavy changes towards generics Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.130 retrieving revision 1.131 diff -C2 -d -r1.130 -r1.131 *** Space.java 10 Apr 2007 13:01:11 -0000 1.130 --- Space.java 10 Apr 2007 20:53:16 -0000 1.131 *************** *** 32,35 **** --- 32,37 ---- */ public class Space extends Geometric implements Parametric { + private static final long serialVersionUID = 1L; + private static Logger log = Logger.getLogger(Space.class); /** Construction Type */ *************** *** 63,67 **** private Description description; [...979 lines suppressed...] */ public Mesh insert(Mesh mesh) { ! Collection<Vertex> vertices = new LinkedList<Vertex>(); ! Collection<Edge> edges = new LinkedList<Edge>(); ! Collection<Surface> surfaces = new LinkedList<Surface>(); mesh.split(this.getVertices()); for (Vertex vertex : mesh.vertices()) { *************** *** 2737,2741 **** surface.check(); surfaces.add(insert(surface)); ! } catch(Exception error) { System.out.println("inconsistent: " + surface); } --- 2736,2740 ---- surface.check(); surfaces.add(insert(surface)); ! } catch (Exception error) { System.out.println("inconsistent: " + surface); } |
|
From: rimestad <rim...@us...> - 2007-04-10 20:55:21
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25235/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: refactoring of space assignment Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.153 retrieving revision 1.154 diff -C2 -d -r1.153 -r1.154 *** Surface.java 10 Apr 2007 13:01:10 -0000 1.153 --- Surface.java 10 Apr 2007 20:53:49 -0000 1.154 *************** *** 653,656 **** --- 653,669 ---- // FIXME should return the sides instead of assigning // spaces here. + assignSpaceForExtrusion(delta, n, facemap, top); + + return top; + } + + /** + * Assign the spaces for the extruded surfaces + * @param delta to know if the extrusion is forward or backward + * @param n the number of surfaces + * @param facemap the array of surfaces + * @param top the top surface + */ + private void assignSpaceForExtrusion(double delta, int n, Surface[] facemap, Surface top) { boolean flip = false; boolean inside = false; *************** *** 669,686 **** --- 682,705 ---- if (delta < 0) { facemap[i].setBackDomain(getBackDomain()); + //facemap[i].setFrontMaterial(getBackMaterial()); if (exterior != null && inside) { if (flip) { facemap[i].setFrontDomain(exterior.getFrontDomain()); + //facemap[i].setBackMaterial(exterior.getFrontMaterial()); } else { facemap[i].setFrontDomain(exterior.getBackDomain()); + //facemap[i].setBackMaterial(exterior.getBackMaterial()); } } } else { facemap[i].setFrontDomain(getFrontDomain()); + //facemap[i].setBackMaterial(getFrontMaterial()); if (exterior != null && inside) { if (flip) { facemap[i].setBackDomain(exterior.getBackDomain()); + //facemap[i].setFrontMaterial(exterior.getBackMaterial()); } else { facemap[i].setBackDomain(exterior.getFrontDomain()); + //facemap[i].setFrontMaterial(exterior.getFrontMaterial()); } } *************** *** 689,697 **** if (delta < 0) { top.setBackDomain(getBackDomain()); } else { top.setFrontDomain(getFrontDomain()); } - - return top; } --- 708,716 ---- if (delta < 0) { top.setBackDomain(getBackDomain()); + //top.setFrontMaterial(getBackMaterial()); } else { top.setFrontDomain(getFrontDomain()); + //top.setBackMaterial(getFrontMaterial()); } } *************** *** 815,859 **** } ! // FIXME should return the sides instead of assigning ! // spaces here. ! boolean flip = false; ! boolean inside = false; ! ! if (exterior != null) { ! Vertex n0 = normal(); ! Vertex n1 = exterior.normal(); ! Vertex o = n0.add(n1); ! if (o.isZero()) { ! flip = true; ! } ! inside = exterior.getOwner() == getOwner(); ! } ! ! for (int i = 0; i < n; i++) { ! if (delta < 0) { ! facemap[i].setBackDomain(getBackDomain()); ! if (exterior != null && inside) { ! if (flip) { ! facemap[i].setFrontDomain(exterior.getFrontDomain()); ! } else { ! facemap[i].setFrontDomain(exterior.getBackDomain()); ! } ! } ! } else { ! facemap[i].setFrontDomain(getFrontDomain()); ! if (exterior != null && inside) { ! if (flip) { ! facemap[i].setBackDomain(exterior.getBackDomain()); ! } else { ! facemap[i].setBackDomain(exterior.getFrontDomain()); ! } ! } ! } ! } ! if (delta < 0) { ! top.setBackDomain(getBackDomain()); ! } else { ! top.setFrontDomain(getFrontDomain()); ! } return top; --- 834,838 ---- } ! assignSpaceForExtrusion(delta, n, facemap, top); return top; *************** *** 2072,2076 **** * * @return true if consistent ! * @throws Exception */ public boolean check() throws Exception { --- 2051,2055 ---- * * @return true if consistent ! * @throws Exception Exception if the list of surfaces is null */ public boolean check() throws Exception { |
|
From: rimestad <rim...@us...> - 2007-04-10 20:55:20
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25592/src/net/sourceforge/bprocessor/model Modified Files: Net.java Log Message: minor javadoc add Index: Net.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Net.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Net.java 28 Nov 2006 16:15:45 -0000 1.1 --- Net.java 10 Apr 2007 20:54:09 -0000 1.2 *************** *** 36,39 **** --- 36,40 ---- * @param e the edge to add */ + @Override public void add(Edge e) { super.add(e); |
|
From: rimestad <rim...@us...> - 2007-04-10 20:55:20
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25628/src/net/sourceforge/bprocessor/model Modified Files: Entity.java Log Message: generic Index: Entity.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Entity.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Entity.java 13 Mar 2007 09:27:26 -0000 1.14 --- Entity.java 10 Apr 2007 20:54:26 -0000 1.15 *************** *** 67,73 **** * @param entities List of entities to be sorted */ ! public static void sort(List entities) { ! final Comparator comparator = ! new Comparator() { public int compare(Object s1, Object s2) { return ((Entity) s1).getId().compareTo(((Entity) s2).getId()); --- 67,73 ---- * @param entities List of entities to be sorted */ ! public static void sort(List<?> entities) { ! final Comparator<Object> comparator = ! new Comparator<Object>() { public int compare(Object s1, Object s2) { return ((Entity) s1).getId().compareTo(((Entity) s2).getId()); |
|
From: rimestad <rim...@us...> - 2007-04-10 13:24:45
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4862/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java SpaceTreeView.java Log Message: Blody checkstyle Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** GenericTreeView.java 10 Apr 2007 13:01:24 -0000 1.93 --- GenericTreeView.java 10 Apr 2007 13:24:45 -0000 1.94 *************** *** 67,71 **** public class GenericTreeView extends TreeView implements Observer { /** The logger */ ! protected static Logger log = Logger.getLogger(GenericTreeView.class); /** UID */ private static final long serialVersionUID = 1L; --- 67,71 ---- public class GenericTreeView extends TreeView implements Observer { /** The logger */ ! private static Logger log = Logger.getLogger(GenericTreeView.class); /** UID */ private static final long serialVersionUID = 1L; Index: SpaceTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/SpaceTreeView.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** SpaceTreeView.java 10 Apr 2007 13:01:24 -0000 1.23 --- SpaceTreeView.java 10 Apr 2007 13:24:45 -0000 1.24 *************** *** 8,12 **** package net.sourceforge.bprocessor.gui.treeview; ! import net.sourceforge.bprocessor.gui.treeview.GenericTreeView.GeometryContainer; import net.sourceforge.bprocessor.model.Project; --- 8,13 ---- package net.sourceforge.bprocessor.gui.treeview; ! import org.apache.log4j.Logger; ! import net.sourceforge.bprocessor.model.Project; *************** *** 15,19 **** */ public class SpaceTreeView extends GenericTreeView { ! /** * --- 16,21 ---- */ public class SpaceTreeView extends GenericTreeView { ! /** The logger */ ! private static Logger log = Logger.getLogger(SpaceTreeView.class); /** * *************** *** 23,27 **** /** * Constructor for SpaceTreeView ! * IF CHANGES ARE MADE REMEMBER TO CHANGE THE CHANGE THE UPDATE MECHANISM */ public SpaceTreeView() { --- 25,29 ---- /** * Constructor for SpaceTreeView ! * IF CHANGES ARE MADE REMEMBER TO CHANGE THE UPDATE MECHANISM */ public SpaceTreeView() { |
|
From: rimestad <rim...@us...> - 2007-04-10 13:19:53
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2817/src/net/sourceforge/bprocessor/model/modellor Modified Files: Modellor.java Log Message: added generics to modellor Index: Modellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/Modellor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Modellor.java 7 Feb 2007 16:52:56 -0000 1.5 --- Modellor.java 10 Apr 2007 13:19:52 -0000 1.6 *************** *** 28,32 **** public abstract class Modellor extends Entity implements Observer, Parametric { /** The registered modellors */ ! private static LinkedList modellors; /** Parameters for elements */ --- 28,32 ---- public abstract class Modellor extends Entity implements Observer, Parametric { /** The registered modellors */ ! private static LinkedList<Modellor> modellors; /** Parameters for elements */ *************** *** 37,41 **** static { ! modellors = new LinkedList(); } --- 37,41 ---- static { ! modellors = new LinkedList<Modellor>(); } *************** *** 60,64 **** * @return A collection of the modellors */ ! public static Collection getRegisteredModellors() { return modellors; } --- 60,64 ---- * @return A collection of the modellors */ ! public static Collection<Modellor> getRegisteredModellors() { return modellors; } |
|
From: rimestad <rim...@us...> - 2007-04-10 13:01:39
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27597/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java SpaceTreeView.java Log Message: fixed tree update to reflect the contructor content Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** GenericTreeView.java 28 Mar 2007 06:16:43 -0000 1.92 --- GenericTreeView.java 10 Apr 2007 13:01:24 -0000 1.93 *************** *** 67,71 **** public class GenericTreeView extends TreeView implements Observer { /** The logger */ ! private static Logger log = Logger.getLogger(GenericTreeView.class); /** UID */ private static final long serialVersionUID = 1L; --- 67,71 ---- public class GenericTreeView extends TreeView implements Observer { /** The logger */ ! protected static Logger log = Logger.getLogger(GenericTreeView.class); /** UID */ private static final long serialVersionUID = 1L; Index: SpaceTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/SpaceTreeView.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** SpaceTreeView.java 29 Mar 2007 22:02:36 -0000 1.22 --- SpaceTreeView.java 10 Apr 2007 13:01:24 -0000 1.23 *************** *** 23,26 **** --- 23,27 ---- /** * Constructor for SpaceTreeView + * IF CHANGES ARE MADE REMEMBER TO CHANGE THE CHANGE THE UPDATE MECHANISM */ public SpaceTreeView() { *************** *** 39,48 **** */ public void update() { ! if (root.getChildCount() == 6) { ((GenericNode)root.getChildAt(0)).update(Project.getInstance()); ((GenericNode)root.getChildAt(1)).update(Project.getInstance().world()); ((GenericNode)root.getChildAt(2)).update(Project.getInstance().getConstraints()); ((GenericNode)root.getChildAt(3)).update(Project.getInstance().getGlobals()); ! ((GenericNode)root.getChildAt(5)).update(Project.getInstance().getConstructors()); } } --- 40,52 ---- */ public void update() { ! try { ((GenericNode)root.getChildAt(0)).update(Project.getInstance()); ((GenericNode)root.getChildAt(1)).update(Project.getInstance().world()); ((GenericNode)root.getChildAt(2)).update(Project.getInstance().getConstraints()); ((GenericNode)root.getChildAt(3)).update(Project.getInstance().getGlobals()); ! ((GenericNode)root.getChildAt(4)).update(Project.getInstance().getConstructors()); ! } catch (ArrayIndexOutOfBoundsException e) { ! log.error("There were a inconsistent number of nodes attached to " + ! "the root which resulted in a exception: " + e.getMessage()); } } |
|
From: Michael L. <he...@us...> - 2007-04-10 13:01:13
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27542/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Space.java Log Message: Minor changes Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.152 retrieving revision 1.153 diff -C2 -d -r1.152 -r1.153 *** Surface.java 10 Apr 2007 07:56:01 -0000 1.152 --- Surface.java 10 Apr 2007 13:01:10 -0000 1.153 *************** *** 254,266 **** vertices.add(current); Edge edge = (Edge) iter.next(); - Vertex prev = current; current = edge.otherVertex(current); if (current == null) { return null; - //throw new Error("the vertex following " + prev + " is null in surface " + this); } } } else { ! throw new Error("first vertex null in Surface " + this); } } --- 254,264 ---- vertices.add(current); Edge edge = (Edge) iter.next(); current = edge.otherVertex(current); if (current == null) { return null; } } } else { ! return null; } } *************** *** 2074,2082 **** * * @return true if consistent */ ! public boolean check() { Collection<Vertex> vertices = this.getVertices(); if (vertices == null) { ! throw new Error("surface inconsistent"); } return true; --- 2072,2081 ---- * * @return true if consistent + * @throws Exception */ ! public boolean check() throws Exception { Collection<Vertex> vertices = this.getVertices(); if (vertices == null) { ! throw new Exception("surface inconsistent"); } return true; Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.129 retrieving revision 1.130 diff -C2 -d -r1.129 -r1.130 *** Space.java 10 Apr 2007 07:56:01 -0000 1.129 --- Space.java 10 Apr 2007 13:01:11 -0000 1.130 *************** *** 2734,2739 **** } for (Surface surface : mesh.surfaces()) { ! surface.check(); ! surfaces.add(insert(surface)); } SurfaceAnalysis analysis = new SurfaceAnalysis(); --- 2734,2743 ---- } for (Surface surface : mesh.surfaces()) { ! try { ! surface.check(); ! surfaces.add(insert(surface)); ! } catch(Exception error) { ! System.out.println("inconsistent: " + surface); ! } } SurfaceAnalysis analysis = new SurfaceAnalysis(); |
|
From: Michael L. <he...@us...> - 2007-04-10 08:38:13
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2129/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Surface.java Space.java Log Message: Check functions Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.151 retrieving revision 1.152 diff -C2 -d -r1.151 -r1.152 *** Surface.java 30 Mar 2007 11:14:04 -0000 1.151 --- Surface.java 10 Apr 2007 07:56:01 -0000 1.152 *************** *** 257,261 **** current = edge.otherVertex(current); if (current == null) { ! throw new Error("the vertex following " + prev + " is null in surface " + this); } } --- 257,262 ---- current = edge.otherVertex(current); if (current == null) { ! return null; ! //throw new Error("the vertex following " + prev + " is null in surface " + this); } } *************** *** 339,342 **** --- 340,347 ---- } setEdges(lst); + Space holeBack = this.getBackDomain(); + Space holeFront = this.getFrontDomain(); + this.setFrontDomain(holeBack); + this.setBackDomain(holeFront); } *************** *** 1112,1122 **** double dot = normal.dot(other); if (dot < 0) { - /* If the normal of the hole is not the same the hole is reversed */ hole.flip(); //FIXME: maybe the holes just shouldnt be flipped - Space holeBack = hole.getBackDomain(); - Space holeFront = hole.getFrontDomain(); - hole.setFrontDomain(holeBack); - hole.setBackDomain(holeFront); } } --- 1117,1122 ---- *************** *** 2070,2072 **** --- 2070,2084 ---- } } + + /** + * + * @return true if consistent + */ + public boolean check() { + Collection<Vertex> vertices = this.getVertices(); + if (vertices == null) { + throw new Error("surface inconsistent"); + } + return true; + } } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.128 retrieving revision 1.129 diff -C2 -d -r1.128 -r1.129 *** Space.java 29 Mar 2007 13:52:04 -0000 1.128 --- Space.java 10 Apr 2007 07:56:01 -0000 1.129 *************** *** 2734,2737 **** --- 2734,2738 ---- } for (Surface surface : mesh.surfaces()) { + surface.check(); surfaces.add(insert(surface)); } Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** Edge.java 29 Mar 2007 13:50:44 -0000 1.80 --- Edge.java 10 Apr 2007 07:56:01 -0000 1.81 *************** *** 1076,1078 **** --- 1076,1098 ---- return cross.length() < 0.000001; } + + /** + * Check consistency + * @return true if ok + */ + public boolean check() { + if (from == null) { + throw new Error("from null"); + } + if (to == null) { + throw new Error ("to null"); + } + if (from == to) { + throw new Error ("from == to"); + } + if (from.equalEps(to)) { + throw new Error ("from overlaps to"); + } + return true; + } } |
|
From: Nordholt <nor...@us...> - 2007-03-30 11:39:34
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30922/src/net/sourceforge/bprocessor/facade/modellor Modified Files: NetFacadeModellor.java Log Message: simpler and better implementation for merging surfaces Index: NetFacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/NetFacadeModellor.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** NetFacadeModellor.java 29 Mar 2007 14:01:52 -0000 1.24 --- NetFacadeModellor.java 30 Mar 2007 11:11:47 -0000 1.25 *************** *** 413,417 **** frame1.removeAll(Geometry.deleteRedundantSurfaces(frame1)); Geometry.allPossibleCollapses(Geometry.collect(frame1)); ! space.addAll(Geometry.mergeAllPossibleSurfaces(frame1)); Set<Edge> edges = new HashSet<Edge>(); for (Surface s : frame1) { --- 413,417 ---- frame1.removeAll(Geometry.deleteRedundantSurfaces(frame1)); Geometry.allPossibleCollapses(Geometry.collect(frame1)); ! Geometry.mergeAllPossibleSurfaces(frame1); Set<Edge> edges = new HashSet<Edge>(); for (Surface s : frame1) { |
|
From: Nordholt <nor...@us...> - 2007-03-30 11:23:28
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4488/src/net/sourceforge/bprocessor/gui/treeview Modified Files: DBKTreeView.java Log Message: fixed checkstyle Index: DBKTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/DBKTreeView.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DBKTreeView.java 29 Mar 2007 22:02:36 -0000 1.1 --- DBKTreeView.java 30 Mar 2007 11:23:25 -0000 1.2 *************** *** 8,13 **** package net.sourceforge.bprocessor.gui.treeview; - import net.sourceforge.bprocessor.gui.treeview.GenericTreeView.ClassificationContainer; - import net.sourceforge.bprocessor.gui.treeview.GenericTreeView.GeometryContainer; import net.sourceforge.bprocessor.model.Project; --- 8,11 ---- *************** *** 28,33 **** super(); root.removeAllChildren(); ! root.add(new ClassificationContainer("Construction", Project.getInstance().getConstructionClas())); ! root.add(new ClassificationContainer("Functional", Project.getInstance().getFunctionalClas())); model.nodeStructureChanged(root); } --- 26,33 ---- super(); root.removeAllChildren(); ! root.add(new ClassificationContainer("Construction", ! Project.getInstance().getConstructionClas())); ! root.add(new ClassificationContainer("Functional", ! Project.getInstance().getFunctionalClas())); model.nodeStructureChanged(root); } |
|
From: Nordholt <nor...@us...> - 2007-03-30 11:14:16
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31825/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: adding support for surfaces that are not in the xy plane in the mergespaces method Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.150 retrieving revision 1.151 diff -C2 -d -r1.150 -r1.151 *** Surface.java 29 Mar 2007 13:57:14 -0000 1.150 --- Surface.java 30 Mar 2007 11:14:04 -0000 1.151 *************** *** 2024,2029 **** Space front = null; Space back = null; ! if (sur1.direction(Project.getInstance().getActiveCoordinateSystem()) == ! sur2.direction(Project.getInstance().getActiveCoordinateSystem())) { //the surfaces have the same turning so front is front if (sur1.getFrontDomain() == sur2.getFrontDomain()) { --- 2024,2030 ---- Space front = null; Space back = null; ! Vertex n1 = sur1.normal(); ! Vertex n2 = sur2.normal(); ! if (n1.dot(n2) > 0) { //the surfaces have the same turning so front is front if (sur1.getFrontDomain() == sur2.getFrontDomain()) { |
|
From: Nordholt <nor...@us...> - 2007-03-30 11:11:44
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30910/src/net/sourceforge/bprocessor/model Modified Files: Geometry.java Log Message: simpler and better implementation for merging surfaces Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** Geometry.java 29 Mar 2007 13:59:21 -0000 1.50 --- Geometry.java 30 Mar 2007 11:11:43 -0000 1.51 *************** *** 626,703 **** * new surfaces corresponding to the merge of those surfaces. * @param surfaces a set of surfaces - * @return the surfaces created by merging */ ! public static Set<Surface> mergeAllPossibleSurfaces(Set<Surface> surfaces) { ! Set<Surface> mergedSurfaces = new HashSet<Surface>(); ! Set<Surface> newSurfaces = new HashSet<Surface>(); for (Surface s : surfaces) { ! Space front = s.getFrontDomain(); ! Space back = s.getBackDomain(); ! if (!mergedSurfaces.contains(s)) { ! Set<Surface> merged = new HashSet<Surface>(); ! List<Edge> edgeList = mergeSurface(s, merged); ! if (merged.size() > 1) { ! mergedSurfaces.addAll(merged); ! Surface newSurface = new Surface(edgeList); ! for (Surface merge : merged) { ! Collection<Surface> holes = merge.getHoles(); ! for (Surface hole : holes) { ! newSurface.addHole(hole); ! } } - assignSame(s, newSurface, front, front); - assignSame(s, newSurface, back, back); - newSurfaces.add(newSurface); } ! } } ! for (Surface s : mergedSurfaces) { ! s.delete(); } ! return newSurfaces; ! } ! ! /** ! * Merges a surface with all possible surrounding surfaces. ! * @param surface the surface ! * @param mergedSurfaces the surfaces that were allready merged, (for ! * recursive calls.) ! * @return a list of edges defining the contour of the merged surface ! */ ! private static List<Edge> mergeSurface(Surface surface, Set<Surface> mergedSurfaces) { ! List<Edge> edgeList = new LinkedList<Edge>(surface.getEdges()); ! mergedSurfaces.add(surface); ! for (Edge e : surface.getEdges()) { ! Set<Surface> surfaces = e.getSurfaces(); ! if (surfaces.size() == 2) { ! surfaces.remove(surface); ! Surface nextSurface = surfaces.iterator().next(); ! if (mergedSurfaces.contains(nextSurface)) { ! edgeList.remove(e); ! } else if (mergeTest(surface, nextSurface)) { ! int index = edgeList.indexOf(e); ! int listSize = edgeList.size(); ! Edge beforeIndex = edgeList.get((index - 1 + listSize) % listSize); ! Edge afterIndex = edgeList.get((index + 1) % listSize); ! ! List<Edge> nextList = mergeSurface(nextSurface, mergedSurfaces); ! if (!nextList.isEmpty()) { ! Edge first = nextList.get(0); ! Edge last = nextList.get(nextList.size() - 1); ! if (Edge.commonVertex(first, beforeIndex) != null && ! Edge.commonVertex(last, afterIndex) != null) { ! edgeList.addAll(index, nextList); ! } else if (Edge.commonVertex(last, beforeIndex) != null && ! Edge.commonVertex(first, afterIndex) != null) { ! Collections.reverse(nextList); ! edgeList.addAll(index, nextList); ! } ! } ! edgeList.remove(e); ! } ! } ! } ! return edgeList; ! } /** --- 626,648 ---- * new surfaces corresponding to the merge of those surfaces. * @param surfaces a set of surfaces */ ! public static void mergeAllPossibleSurfaces(Set<Surface> surfaces) { ! Set<Edge> mergeEdges = new HashSet<Edge>(); for (Surface s : surfaces) { ! for (Edge e : s.getEdges()) { ! Set<Surface> surfs = e.getSurfaces(); ! if (surfs.size() == 2) { ! surfs.remove(s); ! Surface otherSurface = surfs.iterator().next(); ! if (mergeTest(s, otherSurface)) { ! mergeEdges.add(e); } } ! } } ! for (Edge e : mergeEdges) { ! e.delete(); } ! } /** |
|
From: Nikolaj B. <nbr...@us...> - 2007-03-29 22:02:46
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5073/src/net/sourceforge/bprocessor/gui/actions Modified Files: ToolsEnergyActionListener.java Log Message: Made alot changes regarding DBK, and energycalc Index: ToolsEnergyActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/ToolsEnergyActionListener.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ToolsEnergyActionListener.java 11 Sep 2006 09:19:54 -0000 1.6 --- ToolsEnergyActionListener.java 29 Mar 2007 22:02:37 -0000 1.7 *************** *** 36,41 **** public void actionPerformed(ActionEvent e) { JOptionPane.showMessageDialog(null, ! "The total energytransmission loss is: " + EnergyCalc.energyLoss()); } --- 36,47 ---- public void actionPerformed(ActionEvent e) { + Double loss = 0.0; + if (EnergyCalc.heatedArea() != 0) { + loss = EnergyCalc.energyLoss() / EnergyCalc.heatedArea(); + } JOptionPane.showMessageDialog(null, ! "The total energytransmission loss per year is: " + EnergyCalc.energyLoss() + "kWh" ! + "\n" + "The total energytransmission loss per year per m2 is: " ! + loss + "kWh/m2"); } |
|
From: Nikolaj B. <nbr...@us...> - 2007-03-29 22:02:46
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5073/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Made alot changes regarding DBK, and energycalc Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** GUI.java 30 Jan 2007 19:57:26 -0000 1.59 --- GUI.java 29 Mar 2007 22:02:37 -0000 1.60 *************** *** 25,28 **** --- 25,29 ---- import net.sourceforge.bprocessor.gui.attrview.AttributeView; import net.sourceforge.bprocessor.gui.splash.SplashWindow; + import net.sourceforge.bprocessor.gui.treeview.DBKTreeView; import net.sourceforge.bprocessor.gui.treeview.SpaceTreeView; import net.sourceforge.bprocessor.model.CoordinateSystem; *************** *** 498,501 **** --- 499,503 ---- tree.addTab("Project", new JScrollPane (new SpaceTreeView())); tree.addTab("Views", new CameraView()); + tree.addTab("DBK", new JScrollPane (new DBKTreeView())); tree.setMinimumSize(new Dimension(120, 240)); tree.setPreferredSize(new Dimension(120, 240)); |
|
From: Nikolaj B. <nbr...@us...> - 2007-03-29 22:02:46
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5073/src/net/sourceforge/bprocessor/gui/treeview Modified Files: SpaceTreeView.java Added Files: DBKTreeView.java Log Message: Made alot changes regarding DBK, and energycalc --- NEW FILE: DBKTreeView.java --- //--------------------------------------------------------------------------------- // $Id: DBKTreeView.java,v 1.1 2007/03/29 22:02:36 nbramsen Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.treeview; import net.sourceforge.bprocessor.gui.treeview.GenericTreeView.ClassificationContainer; import net.sourceforge.bprocessor.gui.treeview.GenericTreeView.GeometryContainer; import net.sourceforge.bprocessor.model.Project; /** * The DBKTreeView */ public class DBKTreeView extends GenericTreeView { /** * */ private static final long serialVersionUID = 1L; /** * Constructor for DBKTreeView */ public DBKTreeView() { super(); root.removeAllChildren(); root.add(new ClassificationContainer("Construction", Project.getInstance().getConstructionClas())); root.add(new ClassificationContainer("Functional", Project.getInstance().getFunctionalClas())); model.nodeStructureChanged(root); } /** * Update the treeview */ public void update() { if (root.getChildCount() == 1) { ((GenericNode)root.getChildAt(0)).update(Project.getInstance()); } } } Index: SpaceTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/SpaceTreeView.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** SpaceTreeView.java 27 Mar 2007 08:47:07 -0000 1.21 --- SpaceTreeView.java 29 Mar 2007 22:02:36 -0000 1.22 *************** *** 31,35 **** root.add(new ConstraintContainer("Constraints", Project.getInstance().getConstraints())); root.add(new ParameterBlockNode("Globals", Project.getInstance().getGlobals())); - root.add(new DBKContainer("DBK", Project.getInstance())); root.add(new ConstructorContainer("Constructors", Project.getInstance().getConstructors())); model.nodeStructureChanged(root); --- 31,34 ---- *************** *** 45,49 **** ((GenericNode)root.getChildAt(2)).update(Project.getInstance().getConstraints()); ((GenericNode)root.getChildAt(3)).update(Project.getInstance().getGlobals()); - ((GenericNode)root.getChildAt(4)).update(Project.getInstance()); ((GenericNode)root.getChildAt(5)).update(Project.getInstance().getConstructors()); } --- 44,47 ---- |
|
From: Nikolaj B. <nbr...@us...> - 2007-03-29 22:02:38
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5073/src/net/sourceforge/bprocessor/gui/attrview Modified Files: StringAttribute.java Log Message: Made alot changes regarding DBK, and energycalc Index: StringAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/StringAttribute.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** StringAttribute.java 4 Nov 2006 16:54:53 -0000 1.12 --- StringAttribute.java 29 Mar 2007 22:02:37 -0000 1.13 *************** *** 79,82 **** --- 79,93 ---- component.add(createValueLabel(attribute.getValue())); this.add(component); + JLabel ext; + if (attribute.getName().equalsIgnoreCase("Density")) { + ext = new JLabel(" kg/m3"); + ext.setFont(AttributeView.FONT_PLAIN); + this.add(ext); + } + if (attribute.getName().equalsIgnoreCase("U-value")) { + ext = new JLabel(" W/m2K"); + ext.setFont(AttributeView.FONT_PLAIN); + this.add(ext); + } this.add(Box.createHorizontalGlue()); } |
|
From: Nikolaj B. <nbr...@us...> - 2007-03-29 22:00:40
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3899/src/net/sourceforge/bprocessor/model Modified Files: EnergyCalc.java Log Message: Updated energy calc to the new calculation system using the attributes of DBK classifications etc Index: EnergyCalc.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/EnergyCalc.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** EnergyCalc.java 20 Mar 2007 09:46:14 -0000 1.7 --- EnergyCalc.java 29 Mar 2007 22:00:12 -0000 1.8 *************** *** 43,46 **** --- 43,47 ---- } } + totalloss = 0.024 * 3680 * totalloss; int i = (int) (totalloss * 1000); totalloss = ((double) i) / 1000; *************** *** 64,85 **** if (classification.getClassification().getFullId(null).equalsIgnoreCase("-210.01")) { ! loss = 0.15 * current.getArea(); return loss; } if (classification.getClassification().getFullId(null).equalsIgnoreCase("-215.01") || classification.getClassification().getFullId(null).equalsIgnoreCase("-215")) { ! loss = 0.15 * current.getArea(); return loss; } if (classification.getClassification().getFullId(null).equalsIgnoreCase("-215.04")) { ! loss = 0.15 * current.getArea(); return loss; } ! if (classification.getClassification().getFullId(null).equalsIgnoreCase("-205") || ! classification.getClassification().getFullId(null).equalsIgnoreCase("-205.01")) { ! loss = 0.25 * current.getArea(); return loss; } ! if (classification.getClassification().getName().equalsIgnoreCase("Ældre termovindue")) { loss = 2.5 * current.getArea(); return loss; --- 65,93 ---- if (classification.getClassification().getFullId(null).equalsIgnoreCase("-210.01")) { ! loss = classification.getClassification().getUvalue() * current.getArea(); ! //loss = 0.15 * current.getArea(); return loss; } if (classification.getClassification().getFullId(null).equalsIgnoreCase("-215.01") || classification.getClassification().getFullId(null).equalsIgnoreCase("-215")) { ! loss = classification.getClassification().getUvalue() * current.getArea(); ! //loss = 0.15 * current.getArea(); return loss; } if (classification.getClassification().getFullId(null).equalsIgnoreCase("-215.04")) { ! loss = classification.getClassification().getUvalue() * current.getArea(); ! //loss = 0.15 * current.getArea(); return loss; } ! if (classification.getClassification().getFullId(null).equalsIgnoreCase("-205")) { ! loss = classification.getClassification().getUvalue() * current.getArea(); ! //loss = 0.25 * current.getArea(); return loss; } ! if (classification.getClassification().getFullId(null).equalsIgnoreCase("-205.01")) { ! loss = classification.getClassification().getUvalue() * current.getArea(); ! return loss; ! } ! if (classification.getClassification().getName().equalsIgnoreCase("termovindue")) { loss = 2.5 * current.getArea(); return loss; *************** *** 93,97 **** if (classification.getClassification(). getFullId(null).equalsIgnoreCase("-205.02")) { ! loss = 0.8 * current.getArea(); return loss; } --- 101,106 ---- if (classification.getClassification(). getFullId(null).equalsIgnoreCase("-205.02")) { ! loss = classification.getClassification().getUvalue() * current.getArea(); ! //loss = 0.8 * current.getArea(); return loss; } *************** *** 148,151 **** --- 157,162 ---- } + + if (closest != null && closest.getFrontDomain().isFunctionalSpace()) { *************** *** 156,159 **** --- 167,172 ---- } + + if (spa != null) { if (spa.getClassification() != null) { |
|
From: Nikolaj B. <nbr...@us...> - 2007-03-29 21:58:19
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3002/src/net/sourceforge/bprocessor/model Modified Files: Classification.java Log Message: Made it paramametric and gave a series of new attributes etc Index: Classification.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Classification.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Classification.java 19 Mar 2007 12:46:16 -0000 1.9 --- Classification.java 29 Mar 2007 21:57:49 -0000 1.10 *************** *** 39,42 **** --- 39,48 ---- private Double uvalue = 0.0; + /** The density the classification */ + private Double density = 0.0; + + /** The classification */ + private Classification productType; + /** Construction Type */ *************** *** 249,254 **** ArrayList res = new ArrayList(); res.add(new Attribute("Name", getName(), false)); ! res.add(new Attribute("Id", getId(), false)); res.add(new Attribute("U-value", getUvalue(), true)); return res; } --- 255,265 ---- ArrayList res = new ArrayList(); res.add(new Attribute("Name", getName(), false)); ! res.add(new Attribute("Code", getFullId(null), false)); res.add(new Attribute("U-value", getUvalue(), true)); + res.add(new Attribute("Density", getDensity(), true)); + if (!getProdukt().equalsIgnoreCase("")) { + res.add(new Attribute("Type", Project.getInstance(). + getType(getName()))); + } return res; } *************** *** 270,273 **** --- 281,290 ---- setUvalue((Double)a.getValue()); } + if (a.getName().equals("Density")) { + setDensity((Double)a.getValue()); + } + if (a.getName().equals("Type")) { + setTypeClassification((Classification)a.getValue()); + } } } *************** *** 290,294 **** --- 307,341 ---- } + /** + * Get the density for this classification + * @return density the density + */ + public Double getDensity() { + return density; + } + + /** + * Set the density for this classification + * @param density the density + */ + public void setDensity(Double density) { + this.density = density; + } + + /** + * Return the product type + * @return The product type + */ + public Classification getTypeClassification() { + return productType; + } + /** + * Set the product type + * @param productType The product type + */ + public void setTypeClassification(Classification productType) { + this.productType = productType; + } |
|
From: Nikolaj B. <nbr...@us...> - 2007-03-29 21:58:16
|
Update of /cvsroot/bprocessor/bprocessor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2576 Modified Files: functionals.txt Log Message: Completed the list of fuctionals taken from the pdf document Index: functionals.txt =================================================================== RCS file: /cvsroot/bprocessor/bprocessor/functionals.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** functionals.txt 17 Nov 2006 14:28:06 -0000 1.1 --- functionals.txt 29 Mar 2007 21:56:53 -0000 1.2 *************** *** 43,46 **** ;B.A;Tørrerum ;B.B;Strygerum ! -80;Exteriør --stop-- \ No newline at end of file --- 43,347 ---- ;B.A;Tørrerum ;B.B;Strygerum ! -13;Opbevaring af fødevarer;; ! ;A;Spisekammer / forrådskammer ! ;B;Forrådsrum ! ;C;Kølerum ! ;D;Fryserum ! -14;Tilberedning og anretning af føde;; ! ;A;Køkkenrum knyttet til beboelse ! ;A.A;Køkkenrum ! ;A.B;Køkken-alrum ! ;A.C;Bryggers ! ;B;Kommercielle køkkenrum ! ;B.A;Restaurationskøkkenrum ! ;B.B;Kantinekøkkenrum ! ;B.C;Storkøkkenrum ! ;C;Anretningsrum ! ;C.A;Anretterrum ! ;D;Maritime køkkenrum ! ;D.A;Kabys ! ;D.B;Pantry ! -15;Servering og indtagelse af mad;; ! ;A;Spiserum knyttet til beboelse ! ;A.A;Spisestuer ! ;A.B;Køkken-alrum ! ;B;Kommercielle spiserum ! ;B.A;Kantinerum ! ;B.B;Restaurantrum ! ;B.C;Caferum ! ;B.D;Krolokaler ! -16;Undervisning og forskning;; ! ;A;Undervisningslokaler ! ;A.A;Klasserum ! ;A.B;Grupperum ! ;A.C;Computerrum ! ;A.D;Sløjdlokaler ! ;A.E;Fysiklokaler ! ;A.F;Håndarbejdslokaler ! ;A.G;Skolekøkkenrum ! ;A.H;Skolegymnastiksale ! ;A.J;Musiklokaler ! ;B;Forsamlingsrum til undervisnings- og kommerciel brug ! ;B.A;Auditorier ! ;B.B;Aulaer ! ;B.C;Kursuslokaler ! ;B.D;Biblioteksrum ! ;C;Forskningsrum for udvikling og kommerciel udnyttelse ! ;C.A;Laboratorier ! ;C.B;Værksteder ! -17;Religiøs aktivitet;; ! ;A;Tilbedelsesrum ! ;A.A;Kirkerum ! ;A.B;Moskerum ! ;A.C;Tempelrum ! ;A.D;Bederum ! ;B;Siderum for religiøse aktiviteter ! ;B.A;Våbenhuse ! ;B.B;Kapelrum ! ;B.C;Sakristier ! ;C;Bisættelsesrum ! ;C.A;Gravrum ! ;C.B;Krypter ! ;C.C;Ligbrændingsrum ! -18;Leg, sport og motion;; ! ;A;Legerum ! ;A.A;Tumlerum ! ;A.B;Puderum ! ;B;Sportshaller / idrætshaller ! ;B.A;Gymnastiksal ! ;B.B;Boldspilhaller ! ;B.C;Skøjtehal ! ;B.D;Svømmehal ! ;B.E;Tennishaller ! ;B.F;Badmintonhaller ! ;B.G;Bowlinghaller ! ;C;Motionslokaler ! ;C.A;Fitnesslokaler ! ;C.B;Motionsrum ! -19;Udstilling, fremførelse og forlystelse;; ! ;A;Udstillingslokaler ! ;A.A;Udstillingsrum ! ;A.B;Museumssale ! ;A.C;Showrooms ! ;A.D;Gallerilokaler ! ;B;Fremførelseslokaler ! ;B.A;Teatersale ! ;B.B;Koncertsale ! ;B.C;Biografsale ! ;B.D;Orkestergrave ! ;B.E;Logerum ! ;C;Birum til udstillings- og fremførelsesformål ! ;C.A;Øverum / øvelokaler ! ;C.B;Sminkerum ! ;C.C;Teatergarderober ! ;C.D;Teknikrum ! ;D;Forlystelsesrum ! ;D.A;Spillehaller ! ;D.B;Danselokaler ! ;D.C;Diskoteksrum ! -20;Møde og forsamling;; ! ;A;Mødelokaler ! ;A.A;Møderum ! ;A.B;Konferencerum ! ;A.C;Grupperum ! ;B;Forsamlingsrum ! ;B.A;Forsamlingslokaler ! ;B.B;Rådsale ! ;B.C;Parlamentssale ! ;B.D;Retslokaler ! -21;Sygdomsbehandling og pleje;; ! ;A;Behandlingslokaler ! ;A.A;Lægeværelser ! ;A.B;Undersøgelsesrum ! ;A.C;Konsultationsværelser ! ;A.D;Operationsstuer ! ;A.E;Ambulatorier ! ;A.F;Intensivrum ! ;A.G;Lavementrum ! ;A.H;Opduktionsrum ! ;A.J;Røntgenrum ! ;A.K;Skanningsrum ! ;A.L;Dialyserum ! ;A.M;Fysioterapirum ! ;A.N;Ergoterapirum ! ;B;Patientrum ! ;B.A;Modtagerum ! ;B.B;Sengestuer ! ;B.C;Opvågningsstuer ! ;B.D;Venteværelser ! ;B.E;Vente- og opholdsrum ! ;B.F;Rygerum ! ;C;Personalelokaler ! ;C.A;Personalekontorer ! ;C.B;Vagtværelser ! ;C.C;Konferencerum ! ;C.D;Vagtmesterrum ! ;C.E;Vagtværelser ! ;D;Hospitalsservicerum ! ;D.A;Linneddepoter ! ;D.B;Sengevaskerum ! ;D.C;Vaskerum ! ;D.D;Sterilrum ! ;D.E;Skyllerum ! ;E;Rum for tekniske undersøgelser ! ;E.A;Hospitalslaboratorier ! ;E.B;Analyserum ! -22;Pasning og omsorg;; ! ;A;Pasningsrum ! ;A.A;Vuggestuerum ! ;A.B;Børnehaverum ! ;A.C;Legerum ! ;A.D;Boldrum ! ;B;Omsorgsrum ! ;B.A;Hospicerum ! ;B.B;Plejehjemsrum ! -23;Industri og reparation;; ! ;A;Industrilokaler ! ;A.A;Produktionshaller / fabrikationshaller ! ;A.B;Monteringshaller / montagehaller ! ;A.C;Støberihaller ! ;A.D;Svejsehaller ! ;A.E;Rum til overfladebehandling ! ;B;Værkstedslokaler ! ;B.A;Reperationsværkstedsrum ! ;B.B;Maskinværkstedsrum ! ;B.C;Malerværkstedsrum ! ;B.D;Metalværkstedsrum ! ;B.E;Snedkerværkstedrum ! ;B.F;Systuer ! ;C;Lokaler for industriel test og udvikling ! ;C.A;Industrilaboratorier ! ;C.B;Lokale til kvalitetskontrol ! ;C.c;Testrum ! ;D;Lokaler for opbevaring, pakning og forsendelse af industriprodukter ! ;D.A;Emballeringsrum / indpakningsrum ! -24;Energiproduktion, forsyning og bortskaffelse;; ! ;A;Rum for energiproduktion ! ;A.A;Turbinehaller ! ;A.B;Reaktorhaller ! ;B;Bortskaffelsesrum ! ;B.A;Forbrændingsrum ! ;B.B;Affaldsdepoter ! ;B.C;Skralderum / skarnkasserum ! -25;Landbrugsproduktion;; ! ;A;Rum for animalsk produktion ! ;A.A;Staldrum ! ;A.B;Foderrum ! ;A.C;Malkerum ! ;A.D;Slagterum ! ;B;Rum for produktion af afgrøder ! ;B.A;Tærskerum ! ;B.B;Laderum ! ;B.C;Hølofter ! ;B.D;Silorum ! ;C;Rum for tilvirkning af animalske produkter ! ;C.A;Mejerilokaler ! ;C.B;Slagtehaller ! ;C.C;Ægsorteringshaller ! ;D;Rum for tilvirkning af afgrøder ! ;D.A;Brygrum ! ;D.B;Tapperum ! ;D.C;Møllerum ! ;D.D;Bagerum ! ;D.E;Dejrum ! ;E;Maskinlokaler for landbrugsproduktion ! ;E.A;Maskinrum ! -26;Service, forvaltning og tjenestydelse;; ! ;A;Kontorlokaler ! ;A.A;Kontorer ! ;A.B;Storrumskontorer ! ;A.C;Projektrum ! ;A.D;Administrationskontorer ! ;B;Butikslokaler ! ;B.A;Butiksrum ! ;B.B;Prøverum ! ;C;Tegnestuer ! ;D;Auktionslokaler ! ;E;Forvaltnings- og servicelokaler ! ;E.A;Ekspeditionsrum ! ;E.B;Betjeningslokaler ! -27;Ordens- og retshåndhævelse;; ! ;A;Vagtrum ! ;B;Forhørslokaler ! ;C;Rum for indsatte ! ;C.A;Fængselsceller ! ;C.B;Detentionsrum ! ;D;Retslokaler ! ;D.A;Domslokale ! ;D.B;Vidnerum ! -28;Opbevaring og lagring;; ! ;A;Lagerlokaler ! ;A.A;Lagerrum ! ;A.B;Depoter ! ;B;Opbevaringsrum ! ;B.A;Arkivrum ! ;B.B;Pulterrum ! ;B.C;Bagagerum ! ;C;Rum til værdiopbevaring ! ;C.A;Bankbokse ! ;C.B;Bankhvælvinger ! -29;Transportaktiviteter;; ! ;A;Parkeringsrum ! ;A.A;Garagerum ! ;A.B;Garagehaller ! ;A.C;Remisehaller ! ;A.D;Hangarhaller ! ;B;Klagøringslokaler ! ;B.A;Klargøringshaller ! ;B.B;Reparationsværkstedsrum ! ;B.C;Synshaller ! ;B.D;Vaskehaller ! ;C;Transportkorridorer ! ;C.A;Tunnelrør ! -30;Adgang, modtagelse og fordeling;; ! ;A;Adgangsrum ! ;A.A;Entréer ! ;A.B;Vindfang ! ;A.C;Sluser ! ;A.D;Foyerrum / publikumsfoyeer ! ;A.E;Vestibuler ! ;B;Vandrette fordelingsrum ! ;B.A;Gange ! ;B.B;Korridorer ! ;B.C;Passager ! ;B.D;Kanaler ! ;C;Lodrette fordelings rum ! ;C.A;Trapperum ! ;C.B;Ramperum ! ;C.C;Elevatorrum ! ;C.D;Elevatorskakte ! ;C.E;Installationsskakte ! ;C.F;Affaldsskate ! ;C.G;Lysbrønde ! ;D;Modtagelsesrum ! ;D.A;Receptionsrum ! -31;Bygningers indretning og drift;; ! ;A;Installationsrum ! ;A.A;Transformerrum ! ;A.B;Tavlerum ! ;A.C;Telerum ! ;A.D;Ventilationsrum ! ;B;Spilrum ! ;B.A;Elevatorspilrum ! ;B.B;Spilrum til rullende trapper ! ;B.C;Spilrum til rullende fortove ! ;C;Overvågningsrum ! ;C.A;Rum til drifts- og overvågningscentraler ! ;D;IT-rum ! ;D.A;Serverrum ! ;D.B;PC-rum ! ;D.C;EDB-rum ! ;D.D;Maskinrum ! ;D.E;Krydsfeltrum ! -70;Uderum;; ! ;A;Uderum i bebyggelser ! ;A.A;Haverum ! ;A.B;Legepladsrum ! ;B;Uderum i tilknytning til bygninger ! ;B.A;Gårdhaverum ! ;C;Uderum som byrum ! ;C.A;Parkrum ! ;C.B;Gaderum ! ;C.C;Pladsrum ! -80;Exteriør;; --stop-- \ No newline at end of file |
|
From: Nordholt <nor...@us...> - 2007-03-29 14:01:53
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32449/src/net/sourceforge/bprocessor/facade/modellor Modified Files: NetFacadeModellor.java Log Message: now uses the geometry simplifying of the Geometry class Index: NetFacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/NetFacadeModellor.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** NetFacadeModellor.java 19 Mar 2007 12:39:45 -0000 1.23 --- NetFacadeModellor.java 29 Mar 2007 14:01:52 -0000 1.24 *************** *** 318,323 **** */ private void regenerate() { ! space.clear(); ! frame = null; space.add(getNet()); prepareNet(getNet()); --- 318,326 ---- */ private void regenerate() { ! if (frame != null) { ! frame.clear(); ! frame = null; ! } ! space.clear(); space.add(getNet()); prepareNet(getNet()); *************** *** 406,411 **** frame.removeSurface(cut1); frame.removeSurface(cut2); ! space.addAll(frame1); ! space.addAll(frame2); } } --- 409,422 ---- frame.removeSurface(cut1); frame.removeSurface(cut2); ! frame1.addAll(frame2); ! space.addAll(frame1); ! frame1.removeAll(Geometry.deleteRedundantSurfaces(frame1)); ! Geometry.allPossibleCollapses(Geometry.collect(frame1)); ! space.addAll(Geometry.mergeAllPossibleSurfaces(frame1)); ! Set<Edge> edges = new HashSet<Edge>(); ! for (Surface s : frame1) { ! edges.addAll(s.getEdges()); ! } ! Geometry.extendAllPossibleEdges(edges); } } *************** *** 436,440 **** Surface frameSurface = new Surface(outlineCopies); frameSurface = space.insert(frameSurface); ! assignSame(front, frameSurface, space, frame); Set sides1 = new HashSet(); Surface frameSurfEx = extrudeIntoSpace(frameSurface, depth, sides1); --- 447,451 ---- Surface frameSurface = new Surface(outlineCopies); frameSurface = space.insert(frameSurface); ! Geometry.assignSame(front, frameSurface, space, frame); Set sides1 = new HashSet(); Surface frameSurfEx = extrudeIntoSpace(frameSurface, depth, sides1); *************** *** 466,470 **** true); space.add(holeSpace); ! assignSame(front, hole, space, holeSpace); Geometry.holeAnalysis(hole); --- 477,481 ---- true); space.add(holeSpace); ! Geometry.assignSame(front, hole, space, holeSpace); Geometry.holeAnalysis(hole); *************** *** 518,523 **** space.add(g); space.add(f); ! assignSame(front, in, space, f); ! assignSame(front, out, space, g); hole.getExterior().removeHole(hole); --- 529,534 ---- space.add(g); space.add(f); ! Geometry.assignSame(front, in, space, f); ! Geometry.assignSame(front, out, space, g); hole.getExterior().removeHole(hole); *************** *** 533,537 **** Surface inEx = extrudeIntoSpace(in, FRAME_DEPTH, sides); space.add(inEx); ! assignSame(front, inEx, space, frame); Geometry.holeAnalysis(inEx); --- 544,548 ---- Surface inEx = extrudeIntoSpace(in, FRAME_DEPTH, sides); space.add(inEx); ! Geometry.assignSame(front, inEx, space, frame); Geometry.holeAnalysis(inEx); *************** *** 714,740 **** /** - * Assign space sp2 to the same side of s2 as space sp1 is assigned to s1 - * @param s1 first surface - * @param s2 second surface - * @param sp1 first space - * @param sp2 second space - */ - private void assignSame(Surface s1, Surface s2, Space sp1, Space sp2) { - if (s1.getFrontDomain() == sp1) { - if (s1.normal().dot(s2.normal()) > 0) { - s2.setFrontDomain(sp2); - } else { - s2.setBackDomain(sp2); - } - } else if (s1.getBackDomain() == sp1) { - if (s1.normal().dot(s2.normal()) > 0) { - s2.setBackDomain(sp2); - } else { - s2.setFrontDomain(sp2); - } - } - } - - /** * Assign space sp2 to the opposite side of s2 as space sp1 is assigned to s1 * @param s1 first surface --- 725,728 ---- *************** *** 746,750 **** Space back = s2.getBackDomain(); Space front = s2.getFrontDomain(); ! assignSame(s1, s2, sp1, sp2); if (s2.getBackDomain() == sp2) { s2.setBackDomain(back); --- 734,738 ---- Space back = s2.getBackDomain(); Space front = s2.getFrontDomain(); ! Geometry.assignSame(s1, s2, sp1, sp2); if (s2.getBackDomain() == sp2) { s2.setBackDomain(back); *************** *** 945,951 **** 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) { --- 933,947 ---- new Vertex(0 , 0, -length / 2)); Set surfaces = new HashSet(); + Set tops = new HashSet(); surfaces.add(copy); ! copy.extrusionAllOnto(topPlane, surfaces, tops); ! copy.extrusionAllOnto(bottomPlane, surfaces, tops); ! Iterator it = tops.iterator(); ! while (it.hasNext()) { ! Surface top = (Surface)it.next(); ! top.setFrontDomain(cut.getFrontDomain()); ! top.setBackDomain(cut.getBackDomain()); ! } ! surfaces.addAll(tops); Set<Vertex> verts = Geometry.collect(surfaces); for (Vertex v : verts) { |
|
From: Nordholt <nor...@us...> - 2007-03-29 13:59:22
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31556/src/net/sourceforge/bprocessor/model Modified Files: Geometry.java Log Message: added methods for simplifying geometry Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** Geometry.java 29 Mar 2007 10:00:53 -0000 1.49 --- Geometry.java 29 Mar 2007 13:59:21 -0000 1.50 *************** *** 10,13 **** --- 10,14 ---- import java.util.ArrayList; import java.util.Collection; + import java.util.Collections; import java.util.Comparator; *************** *** 603,605 **** --- 604,911 ---- log.info(object); } + + /** + * Deletes all surfaces that have the same space assignment on each side + * @param surfaces a set of surfaces to delete from + * @return the set of surfaces that were deleted + */ + public static Set<Surface> deleteRedundantSurfaces(Set<Surface> surfaces) { + Set<Surface> redundant = new HashSet<Surface>(); + for (Surface s : surfaces) { + if (s.getFrontDomain() == s.getBackDomain()) { + redundant.add(s); + s.getFrontDomain().removeSurface(s); + s.delete(); + } + } + return redundant; + } + + /** + * Deletes all surfaces that can be merged together and creates + * new surfaces corresponding to the merge of those surfaces. + * @param surfaces a set of surfaces + * @return the surfaces created by merging + */ + public static Set<Surface> mergeAllPossibleSurfaces(Set<Surface> surfaces) { + Set<Surface> mergedSurfaces = new HashSet<Surface>(); + Set<Surface> newSurfaces = new HashSet<Surface>(); + for (Surface s : surfaces) { + Space front = s.getFrontDomain(); + Space back = s.getBackDomain(); + if (!mergedSurfaces.contains(s)) { + Set<Surface> merged = new HashSet<Surface>(); + List<Edge> edgeList = mergeSurface(s, merged); + if (merged.size() > 1) { + mergedSurfaces.addAll(merged); + Surface newSurface = new Surface(edgeList); + for (Surface merge : merged) { + Collection<Surface> holes = merge.getHoles(); + for (Surface hole : holes) { + newSurface.addHole(hole); + } + } + assignSame(s, newSurface, front, front); + assignSame(s, newSurface, back, back); + newSurfaces.add(newSurface); + } + } + } + for (Surface s : mergedSurfaces) { + s.delete(); + } + return newSurfaces; + } + + /** + * Merges a surface with all possible surrounding surfaces. + * @param surface the surface + * @param mergedSurfaces the surfaces that were allready merged, (for + * recursive calls.) + * @return a list of edges defining the contour of the merged surface + */ + private static List<Edge> mergeSurface(Surface surface, Set<Surface> mergedSurfaces) { + List<Edge> edgeList = new LinkedList<Edge>(surface.getEdges()); + mergedSurfaces.add(surface); + for (Edge e : surface.getEdges()) { + Set<Surface> surfaces = e.getSurfaces(); + if (surfaces.size() == 2) { + surfaces.remove(surface); + Surface nextSurface = surfaces.iterator().next(); + if (mergedSurfaces.contains(nextSurface)) { + edgeList.remove(e); + } else if (mergeTest(surface, nextSurface)) { + int index = edgeList.indexOf(e); + int listSize = edgeList.size(); + Edge beforeIndex = edgeList.get((index - 1 + listSize) % listSize); + Edge afterIndex = edgeList.get((index + 1) % listSize); + + List<Edge> nextList = mergeSurface(nextSurface, mergedSurfaces); + if (!nextList.isEmpty()) { + Edge first = nextList.get(0); + Edge last = nextList.get(nextList.size() - 1); + if (Edge.commonVertex(first, beforeIndex) != null && + Edge.commonVertex(last, afterIndex) != null) { + edgeList.addAll(index, nextList); + } else if (Edge.commonVertex(last, beforeIndex) != null && + Edge.commonVertex(first, afterIndex) != null) { + Collections.reverse(nextList); + edgeList.addAll(index, nextList); + } + } + edgeList.remove(e); + } + } + } + return edgeList; + } + + /** + * Tests if two surfaces can be merged. + * The surfaces will be assumed to share an edge. + * @param s1 the first surface + * @param s2 the second surface + * @return wherther or not the surfaces can be merged. + */ + private static boolean mergeTest(Surface s1, Surface s2) { + Vertex n1 = s1.normal(); + Vertex n2 = s2.normal(); + Plane p = s1.plane(); + if (p.contains(s2)) { + Space front = s1.getFrontDomain(); + Space back = s1.getBackDomain(); + Space nextFront = s2.getFrontDomain(); + Space nextBack = s2.getBackDomain(); + if (n1.dot(n2) > 0) { + if (nextFront == front && nextBack == back) { + return true; + } + } else { + if (nextBack == front && nextFront == back) { + return true; + } + } + } + return false; + } + + /** + * Collapses a set of vertices, so that all vertices that + * lies in the same coordinates are replaced with one new vertex + * @param vertices the set of vertices + */ + public static void allPossibleCollapses(Set<Vertex> vertices) { + Set<Vertex> collapsable = firstCollapsSet(vertices); + while (!collapsable.isEmpty()) { + vertices.removeAll(collapsable); + collapsVertices(collapsable); + collapsable = firstCollapsSet(vertices); + } + } + + /** + * Finds the first vertex that has a collaps set in a set of vertices + * @param vertices the set of vertices + * @return the set of vertices that can be collapsed + */ + private static Set<Vertex> firstCollapsSet(Set<Vertex> vertices) { + Set<Vertex> collapsable = new HashSet<Vertex>(); + Set<Vertex> unChecked = new HashSet<Vertex>(); + unChecked.addAll(vertices); + for (Vertex v1 : vertices) { + unChecked.remove(v1); + for (Vertex v2 : unChecked) { + if (v1.equalEps(v2)) { + collapsable.add(v2); + } + } + if (!collapsable.isEmpty()) { + collapsable.add(v1); + break; + } + } + return collapsable; + } + + /** + * Collapses a set of vertices + * @param vertices vertices that should be collapsed to a single + * vertex + */ + private static void collapsVertices(Set<Vertex> vertices) { + if (vertices.size() > 0) { + Vertex collaps = vertices.iterator().next().copy(); + for (Vertex v : vertices) { + Set<Edge> edges = v.getEdges(); + for (Edge e : edges) { + if (e.getTo() == v) { + e.setTo(collaps); + } else if (e.getFrom() == v) { + e.setFrom(collaps); + } + e.changed(); + } + } + for (Vertex v : vertices) { + v.delete(); + } + } + } + + /** + * Finds edges in the set that can be extended and extends them + * to their longest possible lenght (also if that means + * replacing edges that are not in the set in which the method + * searches for extendable edges) + * @param edges the set of edges in which to search for extendable edges + */ + public static void extendAllPossibleEdges(Set<Edge> edges) { + List<Edge> extendable = firstExtendList(edges); + while (!extendable.isEmpty()) { + log.info("extended"); + extendEdges(extendable); + for (Edge e : extendable) { + e.delete(); + } + edges.removeAll(extendable); + extendable = firstExtendList(edges); + } + } + + /** + * Replaces a list of edges with a new edge. The list of edges are assummed + * to be a connected sequence of parrallel edges, that all longs to one + * set of surfaces. The new edge will replace the sequence of edges in all of + * the surfaces that the sequence belonged to. + * @param extendable a list of extendable edges + */ + private static void extendEdges(List<Edge> extendable) { + if (extendable.size() > 1) { + Edge first = extendable.get(0); + Edge afterFirst = extendable.get(1); + Edge last = extendable.get(extendable.size() - 1); + Edge beforeLast = extendable.get(extendable.size() - 2); + Vertex from = first.otherVertex(Edge.commonVertex(first, afterFirst)); + Vertex to = last.otherVertex(Edge.commonVertex(last, beforeLast)); + Edge extendedEdge = new Edge(to, from); + //All these edges should share all of their surfaces + Set<Surface> surfaces = first.getSurfaces(); + for (Surface s : surfaces) { + s.replace(extendable, extendedEdge); + Space owner = s.getOwner(); + if (owner != null) { + owner.add(extendedEdge); + } + } + } + } + + /** + * Returns the first set of extendable edges found + * @param edges the set of edges in wich to search for extendable edges + * @return a set of extendable edges + */ + private static List<Edge> firstExtendList(Set<Edge> edges) { + log.info("extend set size: " + edges.size()); + List<Edge> extendable = new LinkedList<Edge>(); + for (Edge e : edges) { + List<Edge> toList = extendList(e, e.getTo()); + List<Edge> fromList = extendList(e, e.getFrom()); + if (!toList.isEmpty() || !fromList.isEmpty()) { + log.info("break"); + extendable.addAll(toList); + extendable.add(e); + extendable.addAll(fromList); + break; + } + } + log.info("extendable size: " + extendable.size()); + return extendable; + } + + /** + * Gives a list of all edges that extends an edge from + * a given endpoint (to or from). + * @param e the edge + * @param v an end point of the edge + * @return a list of edges that extends the edge from the given endpoint + * (notice, this is NOT including the first edge) + */ + private static List<Edge> extendList(Edge e, Vertex v) { + List<Edge> extendList = new LinkedList<Edge>(); + if (e.contains(v) && v.getEdges().size() == 2) { + Set<Edge> edges = v.getEdges(); + edges.remove(e); + Edge otherEdge = edges.iterator().next(); + if (e.parrallel(otherEdge) && + e.getSurfaces().equals(otherEdge.getSurfaces())) { + extendList.add(otherEdge); + extendList.addAll(extendList(otherEdge, otherEdge.otherVertex(v))); + } + } + return extendList; + } + + /** + * Assign space sp2 to the same side of s2 as space sp1 is assigned to s1 + * @param s1 first surface + * @param s2 second surface + * @param sp1 first space + * @param sp2 second space + */ + public static void assignSame(Surface s1, Surface s2, Space sp1, Space sp2) { + if (s1.getFrontDomain() == sp1) { + if (s1.normal().dot(s2.normal()) > 0) { + s2.setFrontDomain(sp2); + } else { + s2.setBackDomain(sp2); + } + } else if (s1.getBackDomain() == sp1) { + if (s1.normal().dot(s2.normal()) > 0) { + s2.setBackDomain(sp2); + } else { + s2.setFrontDomain(sp2); + } + } + } } |
|
From: Nordholt <nor...@us...> - 2007-03-29 13:57:17
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30719/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Added method to replace a segment of edges with one new edge, also an equalEps method, and some generics Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.149 retrieving revision 1.150 diff -C2 -d -r1.149 -r1.150 *** Surface.java 29 Mar 2007 12:51:05 -0000 1.149 --- Surface.java 29 Mar 2007 13:57:14 -0000 1.150 *************** *** 354,357 **** --- 354,373 ---- } + /** Replaces a set of edges in this surface with a single edge + * @param replacedEdges Set of edges to replace + * @param newEdge the edge to replace with + */ + public void replace(List<Edge> replacedEdges, Edge newEdge) { + List<Edge> currentEdges = new LinkedList<Edge>(getEdges()); + if (!replacedEdges.isEmpty() && + currentEdges.containsAll(replacedEdges)) { + Edge oldEdge = replacedEdges.iterator().next(); + int index = currentEdges.indexOf(oldEdge); + currentEdges.set(index, newEdge); + currentEdges.removeAll(replacedEdges); + setEdges(currentEdges); + } + } + /** * Replace one edge e1 and its vertices with e2's *************** *** 489,493 **** * class="net.sourceforge.bprocessor.model.Surface" */ ! public Collection getHoles() { if (holes == null) { return Collections.EMPTY_LIST; --- 505,509 ---- * class="net.sourceforge.bprocessor.model.Surface" */ ! public Collection<Surface> getHoles() { if (holes == null) { return Collections.EMPTY_LIST; *************** *** 1671,1674 **** --- 1687,1717 ---- return getName() + "[" + edges.size() + "]"; } + + /** + * Tests if all edges of this surface has the same coordinates + * as all those of another surface. + * @param s another surface + * @return true if all edges have same coordinates + */ + public boolean equalEps(Surface s) { + List<Edge> thisEdgeList = this.getEdges(); + List<Edge> otherEdgeList = new LinkedList(s.getEdges()); + for (Edge e1 : thisEdgeList) { + boolean match = false; + for (Edge e2 : otherEdgeList) { + if ((e1.from.equalEps(e2.from) || + e1.from.equalEps(e2.to)) && + (e1.to.equalEps(e2.from) || + e1.to.equalEps(e2.to))) { + match = true; + break; + } + } + if (!match) { + return false; + } + } + return true; + } |
|
From: Nordholt <nor...@us...> - 2007-03-29 13:52:05
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28257/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: refactored the addAll method to have more general names and use generics Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.127 retrieving revision 1.128 diff -C2 -d -r1.127 -r1.128 *** Space.java 28 Mar 2007 13:52:06 -0000 1.127 --- Space.java 29 Mar 2007 13:52:04 -0000 1.128 *************** *** 2508,2521 **** /** ! * Add extrusion to this space ! * @param extrusion Collection of surfaces */ ! public void addAll(Collection extrusion) { ! Iterator surfaces = extrusion.iterator(); ! while (surfaces.hasNext()) { ! Surface surface = (Surface) surfaces.next(); ! Iterator edges = surface.getEdges().iterator(); ! while (edges.hasNext()) { ! Edge edge = (Edge) edges.next(); Vertex from = edge.getFrom(); if (from.getOwner() == null) { --- 2508,2517 ---- /** ! * Add surfaces to this space ! * @param surfaces Collection of surfaces */ ! public void addAll(Collection<Surface> surfaces) { ! for (Surface surface : surfaces) { ! for (Edge edge : surface.getEdges()) { Vertex from = edge.getFrom(); if (from.getOwner() == null) { |
|
From: Nordholt <nor...@us...> - 2007-03-29 13:51:50
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27776/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Log Message: method to determine if two edges are parrallel Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** Edge.java 28 Mar 2007 09:00:47 -0000 1.79 --- Edge.java 29 Mar 2007 13:50:44 -0000 1.80 *************** *** 1064,1066 **** --- 1064,1078 ---- return null; } + + /** + * Tells is this edge is parrallel to an other edge + * @param e the other edge + * @return wherther or not the edges are parrallel + */ + public boolean parrallel(Edge e) { + Vertex thisDir = this.getDirection(); + Vertex otherDir = e.getDirection(); + Vertex cross = thisDir.cross(otherDir); + return cross.length() < 0.000001; + } } |