bprocessor-commit Mailing List for B-processor (Page 107)
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-31 13:01:51
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8138/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Implemented a space-checking method that is invoked by the menu on a space Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** GUI.java 29 Aug 2006 08:26:04 -0000 1.41 --- GUI.java 31 Aug 2006 13:01:49 -0000 1.42 *************** *** 95,99 **** */ public GUI() { ! super("BProcessor"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); instance = this; --- 95,99 ---- */ public GUI() { ! super("B-processor"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); instance = this; |
From: Michael L. <he...@us...> - 2006-08-31 13:01:48
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8113/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Implemented a space-checking method that is invoked by the menu on a space Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** Space.java 30 Aug 2006 09:53:15 -0000 1.53 --- Space.java 31 Aug 2006 13:01:39 -0000 1.54 *************** *** 1670,1672 **** --- 1670,1744 ---- } } + + /** + * Perform a consistency check of the geometry. + * @return True of sucessful + */ + public boolean check() { + { + // Check ownership relation + { + Iterator iter = getElements().iterator(); + while (iter.hasNext()) { + Geometric current = (Geometric) iter.next(); + if (current.getOwner() != this) { + throw new Error(current + " not owned by " + this); + } + } + } + { + Iterator iter = getSurfaces().iterator(); + while (iter.hasNext()) { + Geometric current = (Geometric) iter.next(); + if (current.getOwner() != this) { + throw new Error(current + " not owned by " + this); + } + } + } + { + Iterator iter = getEdges().iterator(); + while (iter.hasNext()) { + Geometric current = (Geometric) iter.next(); + if (current.getOwner() != this) { + throw new Error(current + " not owned by " + this); + } + } + } + { + Iterator iter = getVertices().iterator(); + while (iter.hasNext()) { + Geometric current = (Geometric) iter.next(); + if (current.getOwner() != this) { + throw new Error(current + " not owned by " + this); + } + } + } + } + { + // Exterior - hole check + { + Iterator iter = getSurfaces().iterator(); + while (iter.hasNext()) { + Surface current = (Surface) iter.next(); + Iterator holes = current.getHoles().iterator(); + while (holes.hasNext()) { + Surface hole = (Surface) holes.next(); + if (hole.getExterior() != current) { + throw new Error(current + " not exterior to " + hole); + } + } + Set mark = new HashSet(); + while (current != null) { + if (mark.contains(current)) { + throw new Error("cycle in exterior " + current); + } else { + mark.add(current); + current = current.getExterior(); + } + } + } + } + } + return true; + } } |
From: Nordholt <nor...@us...> - 2006-08-31 11:25:08
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv676/src/net/sourceforge/bprocessor/facade/modellor Modified Files: FacadeModellor.java Log Message: All holes for windows should now have the same dimensions, also the facade should now be correct no matter the orientation of the front surface. Index: FacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/FacadeModellor.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FacadeModellor.java 29 Aug 2006 09:44:50 -0000 1.6 --- FacadeModellor.java 31 Aug 2006 11:24:55 -0000 1.7 *************** *** 25,29 **** import org.apache.log4j.Logger; - /** * The facade modellor models the elements for a facade space. --- 25,28 ---- *************** *** 306,310 **** h.setFrontDomain(space.getEmpty()); Set sides = new HashSet(); ! frameSurfaces.add(eFront.extrude(depth, sides)); frameSurfaces.addAll(sides); Iterator sidesIt = sides.iterator(); --- 305,309 ---- h.setFrontDomain(space.getEmpty()); Set sides = new HashSet(); ! frameSurfaces.add(extrudeIntoSpace(eFront, depth, sides)); frameSurfaces.addAll(sides); Iterator sidesIt = sides.iterator(); *************** *** 313,317 **** } sides = new HashSet(); ! Surface top = h.extrude(depth, sides); windows.add(top); Geometry.holeAnalysis(top); --- 312,316 ---- } sides = new HashSet(); ! Surface top = extrudeIntoSpace(h, depth, sides); windows.add(top); Geometry.holeAnalysis(top); *************** *** 374,401 **** horCons = new LinkedList(); Vertex offset = horDir.copy(); ! double intervalV = ((horEdge.getLength() - frameThickness * 2) + vertPostWidth) ! / (vertPosts + 1); ! for (int i = 1; i < vertPosts + 1; i++) { ! if (i > 1) { ! offset.scale((intervalV * i + frameThickness) / offset.length()); ! } else { ! offset.scale(((intervalV - vertPostWidth / 2) * i + frameThickness) ! / offset.length()); ! } Line l = new Line(cross.add(offset), vertDir.copy(), true); vertCons.add(l); space.add(l); } offset = vertDir.copy(); ! double intervalH = (vertEdge.getLength() - (frameThickness * 2) + horPostWidth) ! / (horPosts + 1); ! for (int i = 1; i < horPosts + 1; i++) { ! if (i > 1) { ! offset.scale((intervalH * i + frameThickness) / offset.length()); ! } else { ! offset.scale(((intervalH - horPostWidth / 2) * i + frameThickness) ! / offset.length()); ! } Line l = new Line(cross.add(offset), horDir.copy(), true); horCons.add(l); space.add(l); --- 373,396 ---- horCons = new LinkedList(); Vertex offset = horDir.copy(); ! double intervalV = ((horEdge.getLength() - frameThickness * 2) - ! vertPostWidth * vertPosts) / (vertPosts + 1); ! double lengthV = intervalV + frameThickness; ! for (int i = 0; i < vertPosts; i++) { ! lengthV += (vertPostWidth / 2); ! offset.scale(lengthV / offset.length()); Line l = new Line(cross.add(offset), vertDir.copy(), true); + lengthV += (intervalV + (vertPostWidth / 2)); vertCons.add(l); space.add(l); } offset = vertDir.copy(); ! double intervalH = ((vertEdge.getLength() - frameThickness * 2) - ! horPostWidth * horPosts) / (horPosts + 1); ! double lengthH = intervalH + frameThickness; ! for (int i = 0; i < horPosts; i++) { ! lengthH += (horPostWidth / 2); ! offset.scale(lengthH / offset.length()); Line l = new Line(cross.add(offset), horDir.copy(), true); + lengthH += (intervalH + (horPostWidth / 2)); horCons.add(l); space.add(l); *************** *** 490,494 **** Geometry.holeAnalysis(s); Set sides = new HashSet(); ! Surface t = s.extrude(depth, sides); windows.add(t); windows.addAll(sides); --- 485,489 ---- Geometry.holeAnalysis(s); Set sides = new HashSet(); ! Surface t = extrudeIntoSpace(s, depth, sides); windows.add(t); windows.addAll(sides); *************** *** 509,511 **** --- 504,524 ---- } } + /** + * Makes sure to extrude the a surface to the right side + * (towards the space of this modellor). + * @param s the surface + * @param delta the length to extrude + * @param sides this set will hold the sides of the extrusion + * @return the top surface of the extrusion + */ + private Surface extrudeIntoSpace(Surface s, double delta, Set sides) { + int deltaCorrection = 1; + if (s.normal().dot(front.normal()) < 0) { + deltaCorrection *= -1; + } + if (front.getFrontDomain() != space) { + deltaCorrection *= -1; + } + return s.extrude(delta * deltaCorrection, sides); + } } |
From: Michael L. <he...@us...> - 2006-08-30 12:23:38
|
Update of /cvsroot/bprocessor/bprocessor/src/net/sourceforge/bprocessor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18451/src/net/sourceforge/bprocessor Added Files: Application.java Log Message: Standalone application --- NEW FILE: Application.java --- package net.sourceforge.bprocessor; import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gui.GUI; public class Application { public Application() { super(); // TODO Auto-generated constructor stub } /** * @param args */ public static void main(String[] args) { GUI gui = new GUI(); gui.createMenus(); gui.createMainView(); gui.start(); GLView gl = new GLView(); } } |
From: Michael L. <he...@us...> - 2006-08-30 12:23:38
|
Update of /cvsroot/bprocessor/bprocessor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18451 Modified Files: .classpath Log Message: Standalone application Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/bprocessor/.classpath,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .classpath 30 Aug 2006 10:49:44 -0000 1.1 --- .classpath 30 Aug 2006 12:23:36 -0000 1.2 *************** *** 1,6 **** <?xml version="1.0" encoding="UTF-8"?> <classpath> ! <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> ! <classpathentry kind="output" path="bin"/> </classpath> --- 1,11 ---- <?xml version="1.0" encoding="UTF-8"?> <classpath> ! <classpathentry excluding="etc/" kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> ! <classpathentry kind="lib" path="/gl/src/gfx"/> ! <classpathentry kind="lib" path="/gui/src/gfx"/> ! <classpathentry combineaccessrules="false" kind="src" path="/gl"/> ! <classpathentry combineaccessrules="false" kind="src" path="/gui"/> ! <classpathentry combineaccessrules="false" kind="src" path="/model"/> ! <classpathentry kind="output" path="build"/> </classpath> |
From: Michael L. <he...@us...> - 2006-08-30 12:23:35
|
Update of /cvsroot/bprocessor/bprocessor/src/net In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18425/src/net Log Message: Directory /cvsroot/bprocessor/bprocessor/src/net added to the repository |
From: Michael L. <he...@us...> - 2006-08-30 12:23:35
|
Update of /cvsroot/bprocessor/bprocessor/src/net/sourceforge In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18425/src/net/sourceforge Log Message: Directory /cvsroot/bprocessor/bprocessor/src/net/sourceforge added to the repository |
From: Michael L. <he...@us...> - 2006-08-30 12:23:35
|
Update of /cvsroot/bprocessor/bprocessor/src/net/sourceforge/bprocessor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18425/src/net/sourceforge/bprocessor Log Message: Directory /cvsroot/bprocessor/bprocessor/src/net/sourceforge/bprocessor added to the repository |
From: Michael L. <he...@us...> - 2006-08-30 10:55:19
|
Update of /cvsroot/bprocessor/bprocessor/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15618/src Log Message: Directory /cvsroot/bprocessor/bprocessor/src added to the repository |
From: Michael L. <he...@us...> - 2006-08-30 10:51:06
|
Update of /cvsroot/bprocessor/bprocessor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13673 Added Files: .cvsignore Log Message: cvs ignore --- NEW FILE: .cvsignore --- build dist *.tar.gz *.zip *.tar.bz2 |
From: Michael L. <he...@us...> - 2006-08-30 10:49:48
|
Update of /cvsroot/bprocessor/bprocessor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13218 Added Files: .classpath .project Log Message: Base version --- NEW FILE: .project --- <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>bprocessor</name> <comment></comment> <projects> </projects> <buildSpec> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jdt.core.javanature</nature> </natures> </projectDescription> --- NEW FILE: .classpath --- <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="output" path="bin"/> </classpath> |
From: Michael L. <he...@us...> - 2006-08-30 10:49:26
|
Update of /cvsroot/bprocessor/bprocessor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13194/bprocessor Log Message: Directory /cvsroot/bprocessor/bprocessor added to the repository |
From: Michael L. <he...@us...> - 2006-08-30 10:05:50
|
Update of /cvsroot/bprocessor/kernel In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28238 Modified Files: .classpath Log Message: Changed build output to build from bin Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/kernel/.classpath,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** .classpath 24 Jan 2006 13:57:31 -0000 1.5 --- .classpath 30 Aug 2006 10:05:46 -0000 1.6 *************** *** 7,10 **** <classpathentry kind="src" path="/gui"/> <classpathentry kind="src" path="/model"/> ! <classpathentry kind="output" path="bin"/> </classpath> --- 7,10 ---- <classpathentry kind="src" path="/gui"/> <classpathentry kind="src" path="/model"/> ! <classpathentry kind="output" path="build"/> </classpath> |
From: Michael L. <he...@us...> - 2006-08-30 09:53:25
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23375/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Experimenting with space-selection Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** Space.java 29 Aug 2006 10:06:18 -0000 1.52 --- Space.java 30 Aug 2006 09:53:15 -0000 1.53 *************** *** 1155,1158 **** --- 1155,1171 ---- return result; } + + /** + * Collect all interior surfaces to specified container + * @param surfaces Set of surfaces + */ + public void collectSurfaces(Collection surfaces) { + surfaces.addAll(getSurfaces()); + Iterator iter = getElements().iterator(); + while (iter.hasNext()) { + Space element = (Space) iter.next(); + element.collectSurfaces(surfaces); + } + } /** |
From: Michael L. <he...@us...> - 2006-08-30 09:53:19
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23338/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Experimenting with space-selection Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.146 retrieving revision 1.147 diff -C2 -d -r1.146 -r1.147 *** View.java 29 Aug 2006 08:49:20 -0000 1.146 --- View.java 30 Aug 2006 09:53:09 -0000 1.147 *************** *** 1820,1824 **** private void drawSelectionMode(GLDrawable gld) { Space space = Project.getInstance().getActiveSpace(); ! Collection surfaces = space.getSurfaces(); Collection edges = new LinkedList(); edges.addAll(space.getEdges()); --- 1820,1830 ---- private void drawSelectionMode(GLDrawable gld) { Space space = Project.getInstance().getActiveSpace(); ! ! Collection surfaces = new LinkedList(); ! //space.collectSurfaces(surfaces); ! surfaces.addAll(space.getSurfaces()); ! surfaces.addAll(tempSurfaces); ! ! Collection edges = new LinkedList(); edges.addAll(space.getEdges()); *************** *** 1861,1887 **** } if (selectMode == SURFACES || selectMode == ALL) { ! if (space != null) { ! Set ss = new HashSet(); ! Collection surfs = space.getSurfaces(); ! ss.addAll(surfs); ! Iterator it = ss.iterator(); ! while (it.hasNext()) { ! Surface s = (Surface)it.next(); ! pushName(gl, s); ! drawSurface(s); ! popName(gl); ! } ! } else { ! Iterator it = surfaces.iterator(); ! while (it.hasNext()) { ! Surface s = (Surface)it.next(); ! pushName(gl, s); ! drawSurface(s); ! popName(gl); ! } ! } ! Iterator tempSurfaceIt = tempSurfaces.iterator(); ! while (tempSurfaceIt.hasNext()) { ! Surface s = (Surface)tempSurfaceIt.next(); pushName(gl, s); drawSurface(s); --- 1867,1873 ---- } if (selectMode == SURFACES || selectMode == ALL) { ! Iterator it = surfaces.iterator(); ! while (it.hasNext()) { ! Surface s = (Surface)it.next(); pushName(gl, s); drawSurface(s); |
From: Michael L. <he...@us...> - 2006-08-29 10:06:21
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19310/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Implemented parameter mechanism in modellor Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** Space.java 29 Aug 2006 10:05:11 -0000 1.51 --- Space.java 29 Aug 2006 10:06:18 -0000 1.52 *************** *** 1099,1103 **** res.add(new Attribute("Description", getDescription())); if (getModellor() != null) { ! res.add(new Attribute("Modellor", getModellor(), false)); } return res; --- 1099,1111 ---- res.add(new Attribute("Description", getDescription())); if (getModellor() != null) { ! List attributes = getModellor().getAttributes(); ! res.addAll(attributes); ! } ! if (getOwner().getModellor() != null) { ! Parametric parameters = getOwner().getModellor().get(this); ! if (parameters != null) { ! List attributes = parameters.getAttributes(); ! res.addAll(attributes); ! } } return res; |
From: Michael L. <he...@us...> - 2006-08-29 10:06:21
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19310/src/net/sourceforge/bprocessor/model/modellor Modified Files: Modellor.java LayerModellor.java Log Message: Implemented parameter mechanism in modellor Index: Modellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/Modellor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Modellor.java 10 Aug 2006 13:13:25 -0000 1.1 --- Modellor.java 29 Aug 2006 10:06:18 -0000 1.2 *************** *** 9,13 **** --- 9,15 ---- import java.util.Collection; + import java.util.HashMap; import java.util.LinkedList; + import java.util.Map; import net.sourceforge.bprocessor.model.Entity; *************** *** 25,28 **** --- 27,33 ---- private static LinkedList modellors; + /** Parameters for elements */ + protected Map parameters; + static { modellors = new LinkedList(); *************** *** 30,33 **** --- 35,46 ---- /** + * Constructor for modellor + * + */ + public Modellor() { + parameters = new HashMap(); + } + + /** * Register a modellor to the possible choices of modellors * @param m The modellor *************** *** 68,71 **** --- 81,102 ---- /** + * Get parameter block for element + * @param element Space + * @return Parametric + */ + public Parametric get(Space element) { + return (Parametric) parameters.get(element); + } + + /** + * Set parameter block for element + * @param element Space + * @param parametric Parametric + */ + public void set(Space element, Parametric parametric) { + parameters.put(element, parametric); + } + + /** * @see net.sourceforge.bprocessor.model.Parametric#getGeneralName() */ Index: LayerModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/LayerModellor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LayerModellor.java 29 Aug 2006 08:07:13 -0000 1.3 --- LayerModellor.java 29 Aug 2006 10:06:18 -0000 1.4 *************** *** 15,18 **** --- 15,19 ---- import net.sourceforge.bprocessor.model.Attribute; + import net.sourceforge.bprocessor.model.Parametric; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; *************** *** 60,63 **** --- 61,65 ---- public void update(Object entity) { space.clear(); + parameters.clear(); Surface bottom = surface.copy(space); if (surface.getBackDomain() == space) { *************** *** 68,71 **** --- 70,74 ---- Space layer = Space.createConstructionSpace("Layer " + (i + 1)); space.add(layer); + this.set(layer, new Layer()); bottom.setFrontDomain(layer); Set sides = new HashSet(); *************** *** 150,152 **** --- 153,187 ---- } } + + /** + * Layer class + */ + private class Layer implements Parametric { + + /** + * @param attributes Attributes + */ + public void setAttributes(List attributes) { + + } + + /** + * @return List of attributes + */ + public List getAttributes() { + LinkedList attributes = new LinkedList(); + attributes.add(new Attribute("Depth", new Double(0.3))); + attributes.add(new Attribute("Top offset", new Double(0.0))); + attributes.add(new Attribute("Bottom offset", new Double(0.0))); + return attributes; + } + + /** + * @return General name + */ + public String getGeneralName() { + return "Layer"; + } + + } } |
From: rimestad <rim...@us...> - 2006-08-29 10:05:14
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18841/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Vertex.java Surface.java Space.java Log Message: Fixed some problems and matbe the windowmodellor is working now Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** Surface.java 29 Aug 2006 09:32:26 -0000 1.106 --- Surface.java 29 Aug 2006 10:05:11 -0000 1.107 *************** *** 1178,1186 **** i.scale(1 / i.length()); j = i.cross(n); ! j.scale(1 / j.length()); ! return new CoordinateSystem(i, j, n, origin); ! } else { ! return null; } } --- 1178,1187 ---- i.scale(1 / i.length()); j = i.cross(n); ! if (j != null) { ! j.scale(1 / j.length()); ! return new CoordinateSystem(i, j, n, origin); ! } } + return null; } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** Space.java 29 Aug 2006 09:32:26 -0000 1.50 --- Space.java 29 Aug 2006 10:05:11 -0000 1.51 *************** *** 954,960 **** } } ! Space superSpace = findElement(element); ! superSpace.elements.remove(element.getId()); ! element.setId(null); } --- 954,962 ---- } } ! if (element != null) { ! Space superSpace = findElement(element); ! superSpace.elements.remove(element.getId()); ! element.setId(null); ! } } Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** Vertex.java 23 Aug 2006 13:43:19 -0000 1.43 --- Vertex.java 29 Aug 2006 10:05:11 -0000 1.44 *************** *** 245,253 **** */ public Vertex cross(Vertex v) { ! Vertex cross = new Vertex(); ! cross.setX(this.getY() * v.getZ() - v.getY() * this.getZ()); ! cross.setY(this.getZ() * v.getX() - v.getZ() * this.getX()); ! cross.setZ(this.getX() * v.getY() - v.getX() * this.getY()); ! return cross; } --- 245,256 ---- */ public Vertex cross(Vertex v) { ! if (v != null) { ! Vertex cross = new Vertex(); ! cross.setX(this.getY() * v.getZ() - v.getY() * this.getZ()); ! cross.setY(this.getZ() * v.getX() - v.getZ() * this.getX()); ! cross.setZ(this.getX() * v.getY() - v.getX() * this.getY()); ! return cross; ! } ! return null; } *************** *** 466,473 **** */ public Vertex projectOnto(Vertex onto) { ! double scale = this.dot(onto) / onto.dot(onto); ! Vertex res = onto.copy(); ! res.scale(scale); ! return res; } } --- 469,479 ---- */ public Vertex projectOnto(Vertex onto) { ! if (onto != null) { ! double scale = this.dot(onto) / onto.dot(onto); ! Vertex res = onto.copy(); ! res.scale(scale); ! return res; ! } ! return null; } } Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** Edge.java 28 Aug 2006 16:44:41 -0000 1.54 --- Edge.java 29 Aug 2006 10:05:11 -0000 1.55 *************** *** 538,542 **** /** * Create a offset from a list of lines and a surface ! * PRECONDITION: all the edges have to be in the given surface * @param which The list of edges in inner that are going to be offset * @param inner The surface --- 538,543 ---- /** * Create a offset from a list of lines and a surface ! * PRECONDITION: all the edges have to be in the given surface and the edges ! * in the surface have to be counter clockwise drawn. * @param which The list of edges in inner that are going to be offset * @param inner The surface *************** *** 574,578 **** v2v.put(from, e.getFrom()); res.add(new Edge(to, from)); ! if (from2edge.containsKey(e.getFrom())) { from2edge.put(e.getTo(), e); to2edge.put(e.getFrom(), e); --- 575,579 ---- v2v.put(from, e.getFrom()); res.add(new Edge(to, from)); ! /*if (from2edge.containsKey(e.getFrom()) || prevEdge == null) { from2edge.put(e.getTo(), e); to2edge.put(e.getFrom(), e); *************** *** 580,599 **** from2edge.put(e.getFrom(), e); to2edge.put(e.getTo(), e); ! } ! /*Vertex common = Edge.commonVertex(e, prevEdge); ! if (common == e.getFrom() || common == null) { from2edge.put(e.getFrom(), e); to2edge.put(e.getTo(), e); } else { ! from2edge.put(e.getTo(), e); ! to2edge.put(e.getFrom(), e); ! }*/ } else { ! if (from2edge.containsKey(e.getFrom())) { ! from2edge.put(e.getTo(), e); ! to2edge.put(e.getFrom(), e); ! } else { from2edge.put(e.getFrom(), e); to2edge.put(e.getTo(), e); } } --- 581,615 ---- from2edge.put(e.getFrom(), e); to2edge.put(e.getTo(), e); ! }*/ ! Vertex common = Edge.commonVertex(e, prevEdge); ! if (common == null) { from2edge.put(e.getFrom(), e); to2edge.put(e.getTo(), e); } else { ! if (from2edge.containsKey(common)) { ! to2edge.put(common, e); ! from2edge.put(e.otherVertex(common), e); ! } else if (to2edge.containsKey(common)) { ! from2edge.put(common, e); ! to2edge.put(e.otherVertex(common), e); ! } else { ! log.error("common should be either from or to???"); ! } ! } } else { ! Vertex common = Edge.commonVertex(e, prevEdge); ! if (common == null) { from2edge.put(e.getFrom(), e); to2edge.put(e.getTo(), e); + } else { + if (from2edge.containsKey(common)) { + to2edge.put(common, e); + from2edge.put(e.otherVertex(common), e); + } else if (to2edge.containsKey(common)) { + from2edge.put(common, e); + to2edge.put(e.otherVertex(common), e); + } else { + log.error("common should be either from or to???"); + } } } *************** *** 602,608 **** // calculate the directions iter = directions.values().iterator(); - System.out.println("To size " + to2edge.size()); - System.out.println("From size " + from2edge.size()); - System.out.println("Vertices " + directions.size()); while (iter.hasNext()) { Direction dir = (Direction)iter.next(); --- 618,621 ---- |
From: rimestad <rim...@us...> - 2006-08-29 10:04:07
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18077/src/net/sourceforge/bprocessor/facade/modellor Modified Files: WindowModellor.java Log Message: Fixed some problems and matbe the windowmodellor is working now Index: WindowModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/WindowModellor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** WindowModellor.java 28 Aug 2006 16:44:44 -0000 1.3 --- WindowModellor.java 29 Aug 2006 10:04:03 -0000 1.4 *************** *** 13,19 **** --- 13,22 ---- import java.util.List; import java.util.Iterator; + import java.util.Set; import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.Entity; + import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Project; *************** *** 25,28 **** --- 28,34 ---- /** A modellor to make windows */ public class WindowModellor extends Modellor { + /** Id */ + private static final long serialVersionUID = 1L; + /** The width of the frame */ private double framewidth = 0.054; *************** *** 49,52 **** --- 55,67 ---- private Surface opposite; + /** the constructed spaces */ + private List elements; + + /** The constructed geometry */ + private Set extension; + + /** The direction of action */ + private int sign; + /** * the constructor *************** *** 63,66 **** --- 78,133 ---- space = s; surface = sur; + elements = new LinkedList(); + extension = new HashSet(); + + if (s.getEnvelope().size() == 1) { + System.out.println("was here"); + Surface ext = sur.getExterior(); + double minDist = Double.NaN; + if (ext != null) { + Collection tryout = new ArrayList(0); + if (sur.getFrontDomain() == s) { + Space front = ext.getFrontDomain(); + if (front != null) { + tryout = front.getEnvelope(); + } + System.out.println("frontdomain " + ext.getFrontDomain()); + } else { + Space back = ext.getBackDomain(); + if (back != null) { + tryout = back.getEnvelope(); + } + System.out.println("backdomain " + ext.getBackDomain()); + } + Iterator iter = tryout.iterator(); + Vertex normal = sur.normal(); + Vertex center = sur.center(); + while (iter.hasNext()) { + Surface cur = (Surface)iter.next(); + Plane p = cur.plane(); + Vertex inter = p.intersection(center, normal, true); + if (inter != null) { + double dist = center.distance(inter); + System.out.println("Were here and internersection " + inter + + " with dist " + dist); + if (Double.isNaN(minDist) || (dist < minDist && dist > 0.00001)) { + minDist = dist; + System.out.println("Found a surface with dist " + dist); + } + } + } + } + if (Double.isNaN(minDist)) { + minDist = framedepth + offset; + } + sign = 1; + if (surface.getBackDomain() == space) { + sign = -1; + } + opposite = sur.extrude(sign * minDist, extension); + Geometry.holeAnalysis(opposite); + extension.add(opposite); + } + drawWindow(); } *************** *** 80,93 **** /** Draw the window */ public void drawWindow() { - if (surface.getBackDomain() == space) { - surface.extrude(-(offset + framewidth), new HashSet()); - } else { - surface.extrude(offset + framewidth, new HashSet()); - } - Space frame = new Space("Frame", Space.CONSTRUCTION, true); Space glass = new Space("Glass", Space.CONSTRUCTION, true); glass.setTransparent(true); Surface inner = surface.copy(space); inner.setFrontDomain(frame); //make hole in frame --- 147,155 ---- /** Draw the window */ public void drawWindow() { Space frame = new Space("Frame", Space.CONSTRUCTION, true); Space glass = new Space("Glass", Space.CONSTRUCTION, true); glass.setTransparent(true); Surface inner = surface.copy(space); + elements.add(inner); inner.setFrontDomain(frame); //make hole in frame *************** *** 104,112 **** } Surface glasssurface = new Surface(holeedges); inner.addHole(glasssurface); space.add(glasssurface); glasssurface.setFrontDomain(glass); ! Surface frametop = inner.extrude(framedepth, new HashSet()); ! frametop.addHole(glasssurface.extrude(framedepth, new HashSet())); space.add(frame); space.add(glass); --- 166,182 ---- } Surface glasssurface = new Surface(holeedges); + elements.add(glasssurface); inner.addHole(glasssurface); space.add(glasssurface); glasssurface.setFrontDomain(glass); ! HashSet tmp = new HashSet(); ! Surface frametop = inner.extrude(sign * framedepth, tmp); ! elements.addAll(tmp); ! elements.add(frametop); ! tmp.clear(); ! Surface hole = glasssurface.extrude(sign * framedepth, tmp); ! elements.add(hole); ! frametop.addHole(hole); ! elements.addAll(tmp); space.add(frame); space.add(glass); *************** *** 117,158 **** */ public Modellor newInstance(Space s) { - if (s.getSurfaces().size() == 1) { - Surface sur = (Surface)s.getSurfaces().iterator().next(); - Surface ext = sur.getExterior(); - double minDist = Double.NaN; - if (sur != null) { - Collection tryout = new ArrayList(0); - if (sur.getFrontDomain() == s) { - Space front = ext.getFrontDomain(); - if (front != null) { - tryout = front.getEnvelope(); - } - System.out.println("frontdomain " + ext.getFrontDomain()); - } else { - Space back = ext.getBackDomain(); - if (back != null) { - tryout = back.getEnvelope(); - } - System.out.println("backdomain " + ext.getBackDomain()); - } - Iterator iter = tryout.iterator(); - while (iter.hasNext()) { - Surface cur = (Surface)iter.next(); - Vertex center = cur.center(); - Plane p = cur.plane(); - Vertex inter = p.intersection(cur.center(), cur.normal(), true); - System.out.println("Were here and internersection " + inter); - double dist = center.distance(inter); - if (inter != null && dist < minDist) { - minDist = dist; - System.out.println("Found a surface with dist " + dist); - } - } - } - if (Double.isNaN(minDist)) { - minDist = framedepth + offset; - } - opposite = sur.extrude(minDist, new HashSet()); - } return new WindowModellor(s, (Surface)(s.getEnvelope().iterator().next())); } --- 187,190 ---- *************** *** 163,166 **** --- 195,205 ---- public void delete() { cleanUp(); + + Iterator iter = extension.iterator(); + while (iter.hasNext()) { + Surface s = (Surface)iter.next(); + s.delete(); + } + space.setModellor(null); } *************** *** 170,188 **** */ private void cleanUp() { ! 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(); ! } ! } } } --- 209,223 ---- */ private void cleanUp() { ! Iterator iter = elements.iterator(); while (iter.hasNext()) { ! Entity e = (Entity)iter.next(); ! e.delete(); } ! elements.clear(); ! ! iter = space.getElements().iterator(); ! while (iter.hasNext()) { ! Space s = (Space)iter.next(); ! space.remove(s); } } |
From: Nordholt <nor...@us...> - 2006-08-29 09:44:54
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10074/src/net/sourceforge/bprocessor/facade/modellor Modified Files: FacadeModellor.java Log Message: remembering to add the edges forming the holes. Index: FacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/FacadeModellor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FacadeModellor.java 29 Aug 2006 09:29:10 -0000 1.5 --- FacadeModellor.java 29 Aug 2006 09:44:50 -0000 1.6 *************** *** 473,480 **** Vertex c4 = bottom.intersection(left); List edges = new LinkedList(); ! edges.add(new Edge(c1, c2)); ! edges.add(new Edge(c2, c3)); ! edges.add(new Edge(c3, c4)); ! edges.add(new Edge(c4, c1)); Surface s = new Surface(edges); windows.add(s); --- 473,488 ---- Vertex c4 = bottom.intersection(left); List edges = new LinkedList(); ! Edge e1 = new Edge(c1, c2); ! space.add(e1); ! edges.add(e1); ! Edge e2 = new Edge(c2, c3); ! space.add(e2); ! edges.add(e2); ! Edge e3 = new Edge(c3, c4); ! space.add(e3); ! edges.add(e3); ! Edge e4 = new Edge(c4, c1); ! space.add(e4); ! edges.add(e4); Surface s = new Surface(edges); windows.add(s); |
From: Nordholt <nor...@us...> - 2006-08-29 09:32:29
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5089/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Space.java Log Message: Trying to make sure surfaces with NULL as a front or back domain does not occur Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** Surface.java 24 Aug 2006 11:51:10 -0000 1.105 --- Surface.java 29 Aug 2006 09:32:26 -0000 1.106 *************** *** 1009,1012 **** --- 1009,1015 ---- */ public Space getBackDomain() { + if (backDomain == null && getOwner() != null) { + setBackDomain(getOwner().getEmpty()); + } return backDomain; } *************** *** 1039,1042 **** --- 1042,1048 ---- */ public Space getFrontDomain() { + if (frontDomain == null && getOwner() != null) { + setFrontDomain(getOwner().getEmpty()); + } return frontDomain; } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** Space.java 23 Aug 2006 13:43:19 -0000 1.49 --- Space.java 29 Aug 2006 09:32:26 -0000 1.50 *************** *** 634,637 **** --- 634,643 ---- surfaces.put(id, surface); surface.setOwner(this); + if (surface.getFrontDomain() == null) { + surface.setFrontDomain(empty); + } + if (surface.getBackDomain() == null) { + surface.setBackDomain(empty); + } } else { throw new Error("adding surface to non-container " + this); |
From: Nordholt <nor...@us...> - 2006-08-29 09:31:04
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4318/src/net/sourceforge/bprocessor/model Modified Files: Line.java Log Message: Added method for intersection with an other line Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Line.java 11 Aug 2006 12:44:21 -0000 1.20 --- Line.java 29 Aug 2006 09:30:57 -0000 1.21 *************** *** 13,23 **** import java.util.Set; /** * The line constructor type */ public class Line extends Constructor { /** The direction vector */ private Vertex dir; ! /** * Empty constructor for persistence only --- 13,33 ---- import java.util.Set; + import org.apache.log4j.Logger; + /** * The line constructor type */ public class Line extends Constructor { + /** + * + */ + private static final long serialVersionUID = 1L; + + /** The logger */ + private static Logger log = Logger.getLogger(Line.class); + /** The direction vector */ private Vertex dir; ! /** * Empty constructor for persistence only *************** *** 26,30 **** super(); } ! /** * Constuctor of Line with only the origin and a standard direction of (1,0,0) --- 36,40 ---- super(); } ! /** * Constuctor of Line with only the origin and a standard direction of (1,0,0) *************** *** 34,38 **** this(origin, new Vertex(1, 0, 0), false); } ! /** * Constructor of the Line with orgin and three angles --- 44,48 ---- this(origin, new Vertex(1, 0, 0), false); } ! /** * Constructor of the Line with orgin and three angles *************** *** 43,47 **** this(origin, dir, false); } ! /** * Constructor of the Line with orgin and three angles --- 53,57 ---- this(origin, dir, false); } ! /** * Constructor of the Line with orgin and three angles *************** *** 56,60 **** this.dir = dir; } ! /** * Constructor of the Line with orgin and three angles --- 66,70 ---- this.dir = dir; } ! /** * Constructor of the Line with orgin and three angles *************** *** 69,73 **** this.dir = dir; } ! /** * Get a direction vector for the line --- 79,83 ---- this.dir = dir; } ! /** * Get a direction vector for the line *************** *** 77,81 **** return dir; } ! /** * Collects the set of vertices in this geometric --- 87,91 ---- return dir; } ! /** * Collects the set of vertices in this geometric *************** *** 111,115 **** dir.normalize(); } ! /** * @see net.sourceforge.bprocessor.model.Parametric#setAttributes() --- 121,125 ---- dir.normalize(); } ! /** * @see net.sourceforge.bprocessor.model.Parametric#setAttributes() *************** *** 117,121 **** public void setAttributes(List attributes) { Vertex orig = new Vertex(0, 0, 0); ! orig.setX(((Double)(((Attribute)attributes.get(1)).getValue())).doubleValue()); orig.setY(((Double)(((Attribute)attributes.get(2)).getValue())).doubleValue()); --- 127,131 ---- public void setAttributes(List attributes) { Vertex orig = new Vertex(0, 0, 0); ! orig.setX(((Double)(((Attribute)attributes.get(1)).getValue())).doubleValue()); orig.setY(((Double)(((Attribute)attributes.get(2)).getValue())).doubleValue()); *************** *** 133,137 **** setEditable(((Boolean)(((Attribute)attributes.get(11)).getValue())).booleanValue()); } ! /** * @see net.sourceforge.bprocessor.model.Parametric#getAttributes() --- 143,147 ---- setEditable(((Boolean)(((Attribute)attributes.get(11)).getValue())).booleanValue()); } ! /** * @see net.sourceforge.bprocessor.model.Parametric#getAttributes() *************** *** 168,172 **** return "Line"; } ! /** * Print a line --- 178,182 ---- return "Line"; } ! /** * Print a line *************** *** 183,187 **** return Geometry.degreesAboutY(dir); } ! /** * @see @see net.sourceforge.bprocessor.model.Geometry#degreesAboutZ(Vertex) --- 193,197 ---- return Geometry.degreesAboutY(dir); } ! /** * @see @see net.sourceforge.bprocessor.model.Geometry#degreesAboutZ(Vertex) *************** *** 190,194 **** return Geometry.degreesAboutZ(dir); } ! /** * Tip --- 200,204 ---- return Geometry.degreesAboutZ(dir); } ! /** * Tip *************** *** 198,202 **** return tip(1.0); } ! /** * Tip --- 208,212 ---- return tip(1.0); } ! /** * Tip *************** *** 210,214 **** return new Tip(x, y, z); } ! /** * @param distance distance --- 220,224 ---- return new Tip(x, y, z); } ! /** * @param distance distance *************** *** 220,224 **** return list; } ! /** * Return an edge for this line --- 230,234 ---- return list; } ! /** * Return an edge for this line *************** *** 236,239 **** --- 246,315 ---- return constructor; } + + /** + * Return the intersection point between this and an other line + * @param l a line + * @return intersection point, null if no point exists + */ + public Vertex intersection(Line l) { + //algorithm inspired by geometryalgorithms.com + Vertex o = this.getOrigin(); + Vertex d = this.getDirection().copy(); + Vertex p = l.getOrigin(); + Vertex c = l.getDirection().copy(); + double u1; + double u2; + double v1; + double v2; + double w1; + double w2; + if (d.getX() != 0 || c.getX() != 0) { + u1 = d.getX(); + v1 = c.getX(); + w1 = p.getX() - o.getX(); + if (d.getY() != 0 || c.getY() != 0) { + u2 = d.getY(); + v2 = c.getY(); + w2 = p.getY() - o.getY(); + } else if (d.getZ() != 0 || c.getZ() != 0) { + u2 = d.getZ(); + v2 = c.getZ(); + w2 = p.getZ() - o.getZ(); + } else { + return null; + } + } else if (d.getY() != 0 || c.getY() != 0) { + u1 = d.getY(); + v1 = c.getY(); + w1 = p.getY() - o.getY(); + if (d.getZ() != 0 || c.getZ() != 0) { + u2 = d.getZ(); + v2 = c.getZ(); + w2 = p.getZ() - o.getZ(); + } else { + return null; + } + } else { + return null; + } + double denom = v1 * u2 - v2 * u1; + if (denom == 0) { + //lines are parrallel + return null; + } + double s = ((v2 * w1 - v1 * w2) / denom); + double t = ((u1 * w2 - u2 * w1) / -denom); + + d.scale(-s); + c.scale(-t); + Vertex inter1 = d.add(o); + Vertex inter2 = c.add(p); + if (inter1.equalEps(inter2)) { + //lines are not in the same plane + return inter1; + } else { + return null; + } + } /** *************** *** 258,262 **** setDirection(minus(getOrigin())); } ! /** * Return the line --- 334,338 ---- setDirection(minus(getOrigin())); } ! /** * Return the line *************** *** 266,270 **** return Line.this; } ! /** * @return string --- 342,346 ---- return Line.this; } ! /** * @return string *************** *** 274,278 **** } } ! /** * Guide --- 350,354 ---- } } ! /** * Guide *************** *** 280,283 **** --- 356,364 ---- private class Guide extends Edge { /** + * + */ + private static final long serialVersionUID = 1L; + + /** * Constructor * @param from Vertex *************** *** 287,291 **** super(from, to); } ! /** * Parent --- 368,372 ---- super(from, to); } ! /** * Parent *************** *** 296,300 **** } } ! /** @see net.sourceforge.bprocessor.model.Geometric#getName() */ public String getName() { --- 377,381 ---- } } ! /** @see net.sourceforge.bprocessor.model.Geometric#getName() */ public String getName() { |
From: Nordholt <nor...@us...> - 2006-08-29 09:29:19
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3779/src/net/sourceforge/bprocessor/facade/modellor Modified Files: FacadeModellor.java Log Message: more work on facade modellor, still has problems with surfaces drawn in some ways. Index: FacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/FacadeModellor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FacadeModellor.java 21 Aug 2006 09:33:12 -0000 1.4 --- FacadeModellor.java 29 Aug 2006 09:29:10 -0000 1.5 *************** *** 55,65 **** /** The front surface of the facade */ ! 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(); /** Thickness of the frame */ --- 55,68 ---- /** The front surface of the facade */ ! private Surface front = null; ! ! /** A copy of the front surface but on element-level */ ! private Surface eFront = null; /** The set of vertical constructor lines */ ! private List vertCons = new LinkedList(); /** The set of horizontal constructor lines */ ! private List horCons = new LinkedList(); /** Thickness of the frame */ *************** *** 72,80 **** private Space frame; /** The surfaces of the frame */ private Set frameSurfaces = new HashSet(); ! /** frame present */ ! private boolean present = false; /** The constructor */ --- 75,95 ---- private Space frame; + /** Set of surfaces that forms the holes for windows*/ + private Set windows = new HashSet(); + /** The surfaces of the frame */ private Set frameSurfaces = new HashSet(); ! /** edge marking leftmost boundry of the facade */ ! private Line leftBound; ! ! /** edge marking rightmost boundry of the facade */ ! private Line rightBound; ! ! /** edge marking top boundry of the facade */ ! private Line topBound; ! ! /** edge marking leftmost boundry of the facade */ ! private Line bottomBound; /** The constructor */ *************** *** 113,116 **** --- 128,136 ---- createPostConstructors(); createFrame(); + createWindows(); + } + if (horCons.contains(entity) || vertCons.contains(entity)) { + createPostConstructors(); + createWindows(); } } *************** *** 120,124 **** * @param cons the constructors */ ! private void removeConstructors(Set cons) { Iterator it = cons.iterator(); while (it.hasNext()) { --- 140,144 ---- * @param cons the constructors */ ! private void removeConstructors(List cons) { Iterator it = cons.iterator(); while (it.hasNext()) { *************** *** 152,156 **** Project.getInstance().checkpoint(); vertPosts = n; ! createPostConstructors(); } } else if (a.getName().equals("H-posts")) { --- 172,177 ---- Project.getInstance().checkpoint(); vertPosts = n; ! createPostConstructors(); ! createWindows(); } } else if (a.getName().equals("H-posts")) { *************** *** 160,168 **** 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(); --- 181,202 ---- horPosts = n; createPostConstructors(); + createWindows(); } } else if (a.getName().equals("V-postwidth")) { ! double d = ((Double)a.getValue()).doubleValue(); ! if (d != vertPostWidth) { ! Project.getInstance().checkpoint(); ! vertPostWidth = d; ! createPostConstructors(); ! createWindows(); ! } } else if (a.getName().equals("H-postwidth")) { ! double d = ((Double)a.getValue()).doubleValue(); ! if (d != horPostWidth) { ! Project.getInstance().checkpoint(); ! horPostWidth = d; ! createPostConstructors(); ! createWindows(); ! } } else if (a.getName().equals("Frame thickness")) { double n = ((Double)a.getValue()).doubleValue(); *************** *** 172,175 **** --- 206,210 ---- createFrame(); createPostConstructors(); + createWindows(); } } else if (a.getName().equals("Depth")) { *************** *** 180,183 **** --- 215,219 ---- createFrame(); createPostConstructors(); + createWindows(); } } *************** *** 233,245 **** 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()) { --- 269,281 ---- frame = new Space("Frame", Space.CONSTRUCTION, true); space.add(frame); ! eFront = front.copy(space); ! frameSurfaces.add(eFront); if (front.getBackDomain() == space) { ! eFront.setBackDomain(frame); } else { ! eFront.setFrontDomain(frame); } List edges = new LinkedList(); ! Iterator it = eFront.getVertices().iterator(); Vertex oldV = null; while (it.hasNext()) { *************** *** 264,274 **** 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(); --- 300,310 ---- edges.add(e); Surface h = new Surface(edges); ! windows.add(h); space.add(h); ! eFront.addHole(h); h.setBackDomain(space.getEmpty()); h.setFrontDomain(space.getEmpty()); Set sides = new HashSet(); ! frameSurfaces.add(eFront.extrude(depth, sides)); frameSurfaces.addAll(sides); Iterator sidesIt = sides.iterator(); *************** *** 278,284 **** sides = new HashSet(); Surface top = h.extrude(depth, sides); ! frameSurfaces.add(top); Geometry.holeAnalysis(top); ! frameSurfaces.addAll(sides); sidesIt = sides.iterator(); while (sidesIt.hasNext()) { --- 314,320 ---- sides = new HashSet(); Surface top = h.extrude(depth, sides); ! windows.add(top); Geometry.holeAnalysis(top); ! windows.addAll(sides); sidesIt = sides.iterator(); while (sidesIt.hasNext()) { *************** *** 299,302 **** --- 335,339 ---- frameSurfaces = new HashSet(); frame.delete(); + removeWindows(); } } *************** *** 334,355 **** 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); } } } --- 371,416 ---- removeConstructors(vertCons); removeConstructors(horCons); ! vertCons = new LinkedList(); ! horCons = new LinkedList(); ! Vertex offset = horDir.copy(); ! double intervalV = ((horEdge.getLength() - frameThickness * 2) + vertPostWidth) ! / (vertPosts + 1); for (int i = 1; i < vertPosts + 1; i++) { ! if (i > 1) { ! offset.scale((intervalV * i + frameThickness) / offset.length()); ! } else { ! offset.scale(((intervalV - vertPostWidth / 2) * i + frameThickness) ! / offset.length()); ! } Line l = new Line(cross.add(offset), vertDir.copy(), true); vertCons.add(l); space.add(l); } ! offset = vertDir.copy(); ! double intervalH = (vertEdge.getLength() - (frameThickness * 2) + horPostWidth) ! / (horPosts + 1); for (int i = 1; i < horPosts + 1; i++) { ! if (i > 1) { ! offset.scale((intervalH * i + frameThickness) / offset.length()); ! } else { ! offset.scale(((intervalH - horPostWidth / 2) * i + frameThickness) ! / offset.length()); ! } Line l = new Line(cross.add(offset), horDir.copy(), true); horCons.add(l); space.add(l); } + { + offset = vertDir.copy(); + offset.scale(frameThickness / offset.length()); + topBound = new Line(cross.add(offset), horDir); + offset.scale((vertEdge.getLength() - frameThickness) / offset.length()); + bottomBound = new Line(cross.add(offset), horDir); + offset = horDir.copy(); + offset.scale(frameThickness / offset.length()); + leftBound = new Line(cross.add(offset), vertDir); + offset.scale((horEdge.getLength() - frameThickness) / offset.length()); + rightBound = new Line(cross.add(offset), vertDir); + } } } *************** *** 358,374 **** /** ! * Creates the posts for the facade based on the post constructors, * the post width and the depth. - * */ ! private void createPosts() { ! } /** ! * ! * */ ! private void createColumn() { ! } } --- 419,503 ---- /** ! * Creates the holes for windows in the facade based on the post constructors, * the post width and the depth. */ ! private void createWindows() { ! if (eFront != null) { ! removeWindows(); ! Vertex horDir = topBound.getDirection().copy(); ! horDir.scale(vertPostWidth / 2); ! Line oldV = leftBound; ! Line currentV = null; ! Iterator vIt = vertCons.iterator(); ! while (vIt.hasNext()) { ! Line vL = (Line)vIt.next(); ! currentV = new Line(vL.getOrigin().minus(horDir), vL.getDirection()); ! horizontalRun(oldV, currentV); ! oldV = new Line(vL.getOrigin().add(horDir), vL.getDirection()); ! } ! horizontalRun(oldV, rightBound); ! } } + /** ! * Runs through the horizontal constructors to create holes for windows. ! * @param oldV left boundry ! * @param currentV right boundry */ ! private void horizontalRun(Line oldV, Line currentV) { ! Line currentH; ! Vertex vertDir = leftBound.getDirection().copy(); ! vertDir.scale(horPostWidth / 2); ! Line oldH = topBound; ! Iterator hIt = horCons.iterator(); ! while (hIt.hasNext()) { ! Line hL = (Line)hIt.next(); ! currentH = new Line(hL.getOrigin().minus(vertDir), hL.getDirection()); ! createHole(oldV, currentV, oldH, currentH); ! oldH = new Line(hL.getOrigin().add(vertDir), hL.getDirection()); ! } ! createHole(oldV, currentV, oldH, bottomBound); ! } ! ! /** ! * Creates a hole based on four boundry lines ! * @param left left line ! * @param right right line ! * @param top top line ! * @param bottom bottom line ! */ ! private void createHole(Line left, Line right, Line top, Line bottom) { ! Vertex c1 = top.intersection(left); ! Vertex c2 = top.intersection(right); ! Vertex c3 = bottom.intersection(right); ! Vertex c4 = bottom.intersection(left); ! List edges = new LinkedList(); ! edges.add(new Edge(c1, c2)); ! edges.add(new Edge(c2, c3)); ! edges.add(new Edge(c3, c4)); ! edges.add(new Edge(c4, c1)); ! Surface s = new Surface(edges); ! windows.add(s); ! space.add(s); ! Geometry.holeAnalysis(s); ! Set sides = new HashSet(); ! Surface t = s.extrude(depth, sides); ! windows.add(t); ! windows.addAll(sides); ! Iterator it = sides.iterator(); ! while (it.hasNext()) { ! space.add((Surface)it.next()); ! } ! Geometry.holeAnalysis(t); ! } ! ! /** ! * Removes the windows of the facade. ! */ ! private void removeWindows() { ! Iterator it = windows.iterator(); ! while (it.hasNext()) { ! ((Surface)it.next()).delete(); ! } } } |
From: Michael L. <he...@us...> - 2006-08-29 08:49:27
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20325/src/net/sourceforge/bprocessor/model Modified Files: Camera.java Log Message: More supporting edges (selected spaces contribute their edges) Different default camera Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Camera.java 29 Aug 2006 08:07:13 -0000 1.21 --- Camera.java 29 Aug 2006 08:49:25 -0000 1.22 *************** *** 110,115 **** Camera res = null; if (type == VIEW_3D) { ! res = new Camera("3D", new double[]{0, 0, 0}, ! new double[]{22, 19, 22}, new double[] {0, 0, 1}, PERSPECTIVE); } else if (type == VIEW_XZ) { --- 110,115 ---- Camera res = null; if (type == VIEW_3D) { ! res = new Camera("3D", new double[]{6, 3, 2}, ! new double[]{7, -12, 16}, new double[] {0, 0, 1}, PERSPECTIVE); } else if (type == VIEW_XZ) { |
From: Michael L. <he...@us...> - 2006-08-29 08:49:22
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20304/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: More supporting edges (selected spaces contribute their edges) Different default camera Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.145 retrieving revision 1.146 diff -C2 -d -r1.145 -r1.146 *** View.java 28 Aug 2006 08:20:52 -0000 1.145 --- View.java 29 Aug 2006 08:49:20 -0000 1.146 *************** *** 16,19 **** --- 16,20 ---- import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Defaults; + import net.sourceforge.bprocessor.model.Geometric; import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Line; *************** *** 798,804 **** */ public Collection collectSupportingEdges(Space active) { ! if (active == Project.getInstance().world()) { ! return new LinkedList(); ! } else { Space empty = active.getOwner().getEmpty(); Collection envelope = active.getEnvelope(); --- 799,804 ---- */ public Collection collectSupportingEdges(Space active) { ! Collection edges = new HashSet(); ! if (active != Project.getInstance().world()) { Space empty = active.getOwner().getEmpty(); Collection envelope = active.getEnvelope(); *************** *** 828,834 **** } } ! Collection edges = Surface.edges(surfaces); ! return edges; } } --- 828,844 ---- } } ! edges.addAll(Surface.edges(surfaces)); ! } ! { ! Iterator iter = Selection.primary().iterator(); ! while (iter.hasNext()) { ! Geometric current = (Geometric) iter.next(); ! if (current instanceof Space) { ! Space space = (Space) current; ! edges.addAll(space.getEdges()); ! } ! } } + return edges; } |