[Bprocessor-commit] facade/src/net/sourceforge/bprocessor/facade/modellor FacadeModellor.java, 1.9
Status: Pre-Alpha
Brought to you by:
henryml
From: Nordholt <nor...@us...> - 2006-09-07 15:57:39
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24908/src/net/sourceforge/bprocessor/facade/modellor Modified Files: FacadeModellor.java Log Message: Facade can now be a double-bar type facade using the windowmodellor Index: FacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/FacadeModellor.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** FacadeModellor.java 7 Sep 2006 11:41:26 -0000 1.9 --- FacadeModellor.java 7 Sep 2006 15:57:36 -0000 1.10 *************** *** 98,101 **** --- 98,107 ---- private Line bottomBound; + /** Set of window elements */ + private Set windowElements = new HashSet(); + + /** Set of window modellors */ + private Set windowModellors = new HashSet(); + /** Type facade */ private int type; *************** *** 188,194 **** name = (String)a.getValue(); } else if (a.getName().equals("Front")) { ! Iterator sit = Project.getInstance().getSurfaces().iterator(); ! while (sit.hasNext()) { ! Project.getInstance().checkpoint(); Surface s = (Surface)sit.next(); if (s.getName().equals(a.getValue())) { --- 194,200 ---- name = (String)a.getValue(); } else if (a.getName().equals("Front")) { ! Project.getInstance().checkpoint(); ! Iterator sit = Project.getInstance().getSurfaces().iterator(); ! while (sit.hasNext()) { Surface s = (Surface)sit.next(); if (s.getName().equals(a.getValue())) { *************** *** 196,199 **** --- 202,206 ---- } } + createFacade(); } else if (a.getName().equals("V-posts")) { int n = ((Double)a.getValue()).intValue(); *************** *** 201,206 **** Project.getInstance().checkpoint(); vertPosts = n; ! createPostConstructors(); ! createWindows(); } } else if (a.getName().equals("H-posts")) { --- 208,212 ---- Project.getInstance().checkpoint(); vertPosts = n; ! createFacade(); } } else if (a.getName().equals("H-posts")) { *************** *** 209,214 **** Project.getInstance().checkpoint(); horPosts = n; ! createPostConstructors(); ! createWindows(); } } else if (a.getName().equals("V-postwidth")) { --- 215,219 ---- Project.getInstance().checkpoint(); horPosts = n; ! createFacade(); } } else if (a.getName().equals("V-postwidth")) { *************** *** 217,222 **** Project.getInstance().checkpoint(); vertPostWidth = d; ! createPostConstructors(); ! createWindows(); } } else if (a.getName().equals("H-postwidth")) { --- 222,226 ---- Project.getInstance().checkpoint(); vertPostWidth = d; ! createFacade(); } } else if (a.getName().equals("H-postwidth")) { *************** *** 225,230 **** Project.getInstance().checkpoint(); horPostWidth = d; ! createPostConstructors(); ! createWindows(); } } else if (a.getName().equals("Frame thickness")) { --- 229,233 ---- Project.getInstance().checkpoint(); horPostWidth = d; ! createFacade(); } } else if (a.getName().equals("Frame thickness")) { *************** *** 233,241 **** Project.getInstance().checkpoint(); frameThickness = n; ! if (type == SINGLE_BAR) { ! createFrame(); ! } ! createPostConstructors(); ! createWindows(); } } else if (a.getName().equals("Depth")) { --- 236,240 ---- Project.getInstance().checkpoint(); frameThickness = n; ! createFacade(); } } else if (a.getName().equals("Depth")) { *************** *** 244,252 **** Project.getInstance().checkpoint(); depth = n; ! if (type == SINGLE_BAR) { ! createFrame(); ! } ! createPostConstructors(); ! createWindows(); } } else if (a.getName().equals("Single bars")) { --- 243,247 ---- Project.getInstance().checkpoint(); depth = n; ! createFacade(); } } else if (a.getName().equals("Single bars")) { *************** *** 254,261 **** if (b && type != SINGLE_BAR) { type = SINGLE_BAR; ! removeFacade(); ! createFrame(); ! createPostConstructors(); ! createWindows(); Project.getInstance().changed(this); } --- 249,253 ---- if (b && type != SINGLE_BAR) { type = SINGLE_BAR; ! createFacade(); Project.getInstance().changed(this); } *************** *** 265,272 **** horPostWidth = 0; frameThickness = 0; ! removeFacade(); ! createFrame(); ! createPostConstructors(); ! createWindows(); Project.getInstance().changed(this); } --- 257,261 ---- horPostWidth = 0; frameThickness = 0; ! createFacade(); Project.getInstance().changed(this); } *************** *** 351,366 **** */ private void removeFacade() { ! if (frame != null) { ! Iterator it = frameSurfaces.iterator(); ! while (it.hasNext()) { ! ((Surface)it.next()).delete(); ! } ! frameSurfaces = new HashSet(); frame.delete(); - removeWindows(); - removeConstructors(); } } /** * Creates the post constructors for this facade based on the number of posts. --- 340,357 ---- */ private void removeFacade() { ! Iterator it = frameSurfaces.iterator(); ! while (it.hasNext()) { ! ((Surface)it.next()).delete(); ! } ! frameSurfaces = new HashSet(); ! if(frame != null) { frame.delete(); } + frame = null; + removeWindows(); + removeConstructors(); } + /** * Creates the post constructors for this facade based on the number of posts. *************** *** 493,497 **** Vertex c3 = bottom.intersection(right); Vertex c4 = bottom.intersection(left); ! //log.info("c1: " + c1); // log.info("c2: " + c2); // log.info("c3: " + c3); --- 484,488 ---- Vertex c3 = bottom.intersection(right); Vertex c4 = bottom.intersection(left); ! // log.info("c1: " + c1); // log.info("c2: " + c2); // log.info("c3: " + c3); *************** *** 513,521 **** windows.add(s); space.add(s); ! //log.info("left: " + left); ! //log.info("right: " + right); ! //log.info("top: " + top); ! //log.info("bottom: " + bottom); Geometry.holeAnalysis(s); Set sides = new HashSet(); Surface t = extrudeIntoSpace(s, depth, sides); --- 504,579 ---- windows.add(s); space.add(s); ! // log.info("left: " + left); ! // log.info("right: " + right); ! // log.info("top: " + top); ! // log.info("bottom: " + bottom); Geometry.holeAnalysis(s); + if (type == DOUBLE_BAR) { + Vertex sn = s.normal(); + Vertex fn = front.normal(); + Space wf = new Space("Window", Space.CONSTRUCTION, true); + space.add(wf); + windowElements.add(wf); + if (sn.dot(fn) > 0) { + if (front.getFrontDomain() == space) { + s.setFrontDomain(wf); + } else { + s.setBackDomain(wf); + } + } else { + if (front.getBackDomain() == space) { + s.setFrontDomain(wf); + } else { + s.setBackDomain(wf); + } + } + Modellor wm = new WindowModellor(wf, s); + wf.setModellor(wm); + windowModellors.add(wm); + /* + Vertex sn = s.normal(); + Vertex fn = front.normal(); + Space wf = new Space("Windowframe", Space.CONSTRUCTION, true); + space.add(wf); + windowElements.add(wf); + if (sn.dot(fn) > 0) { + if (front.getFrontDomain() == space) { + s.setFrontDomain(wf); + } else { + s.setBackDomain(wf); + } + } else { + if (front.getBackDomain() == space) { + s.setFrontDomain(wf); + } else { + s.setBackDomain(wf); + } + } + //TODO: Change magic number -0.1 + List l = e1.offset(edges, s, -0.1); + Iterator it = l.iterator(); + while (it.hasNext()) { + Edge e = (Edge)it.next(); + space.add(e); + } + Surface offset = new Surface(l); + space.add(offset); + windows.add(offset); + Geometry.holeAnalysis(offset); + Set sidesOff = new HashSet(); + Surface exOff = extrudeIntoSpace(offset, depth, sidesOff); + + windows.add(exOff); + space.add(exOff); + Iterator sidesIt = sidesOff.iterator(); + while (sidesIt.hasNext()) { + Surface surf = (Surface)sidesIt.next(); + windows.add(surf); + space.add(surf); + } + + Geometry.holeAnalysis(exOff); + */ + } Set sides = new HashSet(); Surface t = extrudeIntoSpace(s, depth, sides); *************** *** 537,540 **** --- 595,608 ---- ((Surface)it.next()).delete(); } + it = windowModellors.iterator(); + while (it.hasNext()) { + ((Modellor)it.next()).delete(); + } + it = windowElements.iterator(); + while (it.hasNext()) { + ((Space)it.next()).delete(); + } + windowModellors = new HashSet(); + windowElements = new HashSet(); windows = new HashSet(); } |