[Bprocessor-commit] facade/src/net/sourceforge/bprocessor/facade/modellor FacadeModellor.java, 1.1
Status: Pre-Alpha
Brought to you by:
henryml
From: Nordholt <nor...@us...> - 2006-10-02 14:19:36
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26958/src/net/sourceforge/bprocessor/facade/modellor Modified Files: FacadeModellor.java Log Message: Made ready for presentation Index: FacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/FacadeModellor.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** FacadeModellor.java 29 Sep 2006 13:41:27 -0000 1.17 --- FacadeModellor.java 2 Oct 2006 14:19:26 -0000 1.18 *************** *** 7,10 **** --- 7,11 ---- package net.sourceforge.bprocessor.facade.modellor; + import java.util.Collection; import java.util.HashMap; import java.util.List; *************** *** 170,175 **** createWindows(); } - - /** * Removes constructors from the facade --- 171,174 ---- *************** *** 191,195 **** } } - /** * Set the attributes of the object to the values in the list --- 190,193 ---- *************** *** 251,255 **** createFacade(); } ! } else if (a.getName().equals("Single bars")) { boolean b = ((Boolean)a.getValue()).booleanValue(); if (b && type != SINGLE_BAR) { --- 249,253 ---- createFacade(); } ! } else if (a.getName().equals("Single posted")) { boolean b = ((Boolean)a.getValue()).booleanValue(); if (b && type != SINGLE_BAR) { *************** *** 270,274 **** Project.getInstance().changed(space); } - /** * Retrn a list of the attributes in the object --- 268,271 ---- *************** *** 295,299 **** return attributes; } - /** * Get the name --- 292,295 ---- *************** *** 303,307 **** return name; } - /** * @see net.sourceforge.bprocessor.model.Parametric#getGeneralName() --- 299,302 ---- *************** *** 310,319 **** return "Facade Modellor"; } - /** Delete */ public void delete() { space.setModellor(null); } - /** * Creates the frame for this facade based on frame thickness and depth. --- 305,312 ---- *************** *** 341,345 **** } } - /** * Removes the current frame so a new one can be created. --- 334,337 ---- *************** *** 358,365 **** removeWindows(); removeConstructors(); space.clear(); } - - /** * Creates the post constructors for this facade based on the number of posts. --- 350,356 ---- removeWindows(); removeConstructors(); + removeSegmentLines(); space.clear(); } /** * Creates the post constructors for this facade based on the number of posts. *************** *** 478,481 **** --- 469,473 ---- horSegs[i][j] = hSeg; vertSegs[i][j] = vSeg; + /* if (j > 0 && i < vertPosts + 1 && j < horPosts + 1 && i % 2 == 0) { *************** *** 484,487 **** --- 476,481 ---- drawSeg.put(hSeg, Boolean.TRUE); } + */ + drawSeg.put(hSeg, Boolean.TRUE); drawSeg.put(vSeg, Boolean.TRUE); h.connect(hSeg); *************** *** 507,511 **** for (int i = 0; i < vertPosts; i++) { for (int j = 0; j < horPosts; j++) { ! if (vertSegs[i][j] != null && horSegs[i][j] != null) { vertSegs[i][j].delete(); horSegs[i][j].delete(); --- 501,508 ---- for (int i = 0; i < vertPosts; i++) { for (int j = 0; j < horPosts; j++) { ! if (vertSegs[i][j] != null && ! vertSegs[i][j].getOwner() != null && ! horSegs[i][j] != null && ! horSegs[i][j].getOwner() != null) { vertSegs[i][j].delete(); horSegs[i][j].delete(); *************** *** 516,521 **** vertSegs = new Line[vertPosts + 2][horPosts + 2]; drawSeg = new HashMap(); ! } ! /** * Creates the holes for windows in the facade based on the post constructors, --- 513,517 ---- vertSegs = new Line[vertPosts + 2][horPosts + 2]; drawSeg = new HashMap(); ! } /** * Creates the holes for windows in the facade based on the post constructors, *************** *** 530,534 **** Vertex hDir = horSegs[0][0].getDirection(); hDir = hDir.copy((horPostWidth / 2) / hDir.length()); ! //List slist = new LinkedList(); for (int i = 0; i < vertPosts + 1; i++) { for (int j = 0; j < horPosts + 1; j++) { --- 526,531 ---- Vertex hDir = horSegs[0][0].getDirection(); hDir = hDir.copy((horPostWidth / 2) / hDir.length()); ! List slist = new LinkedList(); ! Map connectMap = new HashMap(); for (int i = 0; i < vertPosts + 1; i++) { for (int j = 0; j < horPosts + 1; j++) { *************** *** 545,558 **** Vertex start = h.intersection(v); start = start.add(vDir).add(hDir); ! Vertex last = start = Geometry.insertVertex(start, false); Vertex next = vertSegs[i + di][j].intersection(h); ! next = Geometry.insertVertex(next.add(vDir), false); ! Map connectMap = new HashMap(); //make edges till we are back at the start-vertex while (di != 0 || dj != 0) { boolean dirChanged = false; ! next = Geometry.insertVertex(next, false); Edge e = new Edge(last, next); edges.add(e); if (stepI == 1) { //stepped right --- 542,556 ---- Vertex start = h.intersection(v); start = start.add(vDir).add(hDir); ! Vertex last = start; //= Geometry.insertVertex(start, false); ! space.add(start); Vertex next = vertSegs[i + di][j].intersection(h); ! next = next.add(vDir); //make edges till we are back at the start-vertex while (di != 0 || dj != 0) { boolean dirChanged = false; ! space.add(next); Edge e = new Edge(last, next); edges.add(e); + space.add(e); if (stepI == 1) { //stepped right *************** *** 617,649 **** } Edge e = new Edge(last, start); connectMap.put(e, vertSegs[i + di][j + dj]); edges.add(e); ! List surface = Geometry.insertEdges(edges); ! if (surface.isEmpty()) { ! log.info("NO SURFACE FROM EDGES :'-("); ! } else { ! Set sides = new HashSet(); ! Geometry.holeAnalysis(extrudeIntoSpace((Surface)surface.iterator().next(), ! depth, ! sides)); ! Iterator it = sides.iterator(); ! while (it.hasNext()) { ! Surface side = (Surface)it.next(); ! Iterator sIt = side.getEdges().iterator(); ! while (sIt.hasNext()) { ! Line seg = (Line)connectMap.get(sIt.next()); ! if (seg != null) { ! seg.connect(side); ! } ! } ! } ! } } } } Project.getInstance().setActiveSpace(oldActive); } } ! /** * Removes the windows of the facade. --- 615,675 ---- } Edge e = new Edge(last, start); + space.add(e); connectMap.put(e, vertSegs[i + di][j + dj]); edges.add(e); ! Surface s = new Surface(edges); ! space.add(s); ! slist.add(s); ! Geometry.holeAnalysis(s); } } } + extrudeWindows(slist, connectMap); Project.getInstance().setActiveSpace(oldActive); } } ! ! /** ! * extrudes the window surfaces and does the appropriate connections between ! * segment constructors and windows. ! * @param surfaces the window surfaces ! * @param connectMap the map describing the segment constructor that ! * each edge should be connected to ! */ ! private void extrudeWindows(Collection surfaces, Map connectMap) { ! Iterator it = surfaces.iterator(); ! while (it.hasNext()) { ! Surface s = (Surface)it.next(); ! Set sides = new HashSet(); ! if (type == SINGLE_BAR) { ! Geometry.holeAnalysis(extrudeIntoSpace(s, depth, sides)); ! } else if (type == DOUBLE_BAR) { ! Space w = new Space("Window", Space.CONSTRUCTION, Space.ELEMENT_LEVEL, true); ! double u = s.normal().dot(front.normal()); ! if ((u > 0 && front.getBackDomain() == space) || ! u < 0 && front.getFrontDomain() == space) { ! s.setBackDomain(w); ! } else { ! s.setFrontDomain(w); ! } ! space.add(w); ! Modellor wm = new WindowModellor(w, s); ! w.setModellor(wm); ! sides.addAll(w.getEnvelope()); ! sides.remove(s); ! } ! Iterator sideIt = sides.iterator(); ! while (sideIt.hasNext()) { ! Surface side = (Surface)sideIt.next(); ! Iterator sIt = side.getEdges().iterator(); ! while (sIt.hasNext()) { ! Line seg = (Line)connectMap.get(sIt.next()); ! if (seg != null) { ! seg.connect(side); ! } ! } ! } ! } ! } /** * Removes the windows of the facade. *************** *** 668,672 **** windows = new HashSet(); } - /** * Makes sure to extrude the a surface to the right side --- 694,697 ---- |