[Bprocessor-commit] facade/src/net/sourceforge/bprocessor/facade/modellor NetFacadeModellor.java,
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Nordholt <nor...@us...> - 2007-05-18 19:07:37
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4220/src/net/sourceforge/bprocessor/facade/modellor Modified Files: NetFacadeModellor.java Log Message: removed some code that did writeouts Index: NetFacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/NetFacadeModellor.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** NetFacadeModellor.java 17 May 2007 08:51:41 -0000 1.31 --- NetFacadeModellor.java 18 May 2007 19:07:27 -0000 1.32 *************** *** 55,58 **** --- 55,64 ---- public static final String EXTERIOR = "-1.-80"; + /** The classification id for window frames */ + public static final String FRAME = "-1.-205.02.01.01"; + + /** The classification id for window glass */ + public static final String GLASS = "-1.-205.02.01.02"; + /** serial id */ private static final long serialVersionUID = 1L; *************** *** 82,88 **** private static Logger log = Logger.getLogger(NetFacadeModellor.class); - /** Times a facade has been generated */ - private int facades = 0; - /** * Empty constructor for the net facade --- 88,91 ---- *************** *** 130,133 **** --- 133,143 ---- Project.getInstance().scheduleObserver(mod); s.setModellor(mod); + frame = new Space("Frame", + Space.CONSTRUCTION, + Space.ELEMENT_LEVEL, + true); + Classification frameClass = Project.getInstance().getClassification(FRAME, 0); + frame.setClassification(frameClass); + mod.frame = frame; mod.setFront(findFront(s)); mod.setNet(mod.createNet(mod.getFront())); *************** *** 206,211 **** l.add(new Attribute("Net", net, true)); l.add(new Attribute("Front", front, true)); ! l.add(new Attribute("Framewidth", new Double(frameWidth), true)); ! l.add(new Attribute("Depth", new Double(depth), true)); l.add(new Attribute("Single", Boolean.valueOf(single), true)); } --- 216,223 ---- l.add(new Attribute("Net", net, true)); l.add(new Attribute("Front", front, true)); ! if (single) { ! l.add(new Attribute("Framewidth", new Double(frameWidth), true)); ! l.add(new Attribute("Depth", new Double(depth), true)); ! } l.add(new Attribute("Single", Boolean.valueOf(single), true)); } *************** *** 311,315 **** } } ! /** * Regenerate the entire facade, deleting what ever was there before. --- 323,327 ---- } } ! /** * Regenerate the entire facade, deleting what ever was there before. *************** *** 318,342 **** if (frame != null) { frame.clear(); ! frame = null; ! } ! double time = System.nanoTime(); ! space.clear(); ! space.add(getNet()); ! prepareNet(getNet()); ! if (single) { ! log.info("calling create1"); ! createSingleFacade(getNet()); ! } else { ! log.info("calling create2"); ! createDoubleFacade(getNet()); ! } ! time = (System.nanoTime() - time) / 1000000; ! facades++; ! int fields = 0; ! if (net != null) { ! fields = net.getSurfaces().size(); } - log.info("Facade no.: " + facades + " with: " + fields + " fields " + - " were generated in: " + time); } --- 330,343 ---- if (frame != null) { frame.clear(); ! space.clear(); ! space.add(getNet()); ! space.add(frame); ! prepareNet(getNet()); ! if (single) { ! createSingleFacade(getNet()); ! } else { ! createDoubleFacade(getNet()); ! } } } *************** *** 382,391 **** if (frame == null) { frame = new Space("Frame", ! Space.CONSTRUCTION, ! Space.ELEMENT_LEVEL, ! true); space.add(frame); } - log.info("create"); if (net != null) { for (Surface field : net.getSurfaces()) { --- 383,393 ---- if (frame == null) { frame = new Space("Frame", ! Space.CONSTRUCTION, ! Space.ELEMENT_LEVEL, ! true); ! Classification frameClass = Project.getInstance().getClassification(FRAME, 0); ! frame.setClassification(frameClass); space.add(frame); } if (net != null) { for (Surface field : net.getSurfaces()) { *************** *** 414,418 **** out.scale(-1); } - log.info("create"); Set<Surface> frame1 = generateFrame(cut1, field.getEdges(), out); Set<Surface> frame2 = generateFrame(cut2, field.getEdges(), out); --- 416,419 ---- *************** *** 453,467 **** /* Put holes into the shell */ for (Surface field : net.getSurfaces()) { ! Map offsetMap = new HashMap(); ! Iterator fieldEdges = field.getEdges().iterator(); Map envF = field.getParameters().environment(); ! while (fieldEdges.hasNext()) { ! Edge e = (Edge)fieldEdges.next(); Map envE = e.getParameters().environment(); double width = ((Double)envE.get("width")).doubleValue(); if (outline.contains(e)) { ! offsetMap.put(e, Double.valueOf(-(width))); } else { ! offsetMap.put(e, Double.valueOf(-((width / 2)))); } } --- 454,466 ---- /* Put holes into the shell */ for (Surface field : net.getSurfaces()) { ! Map<Edge, Double> offsetMap = new HashMap<Edge, Double>(); Map envF = field.getParameters().environment(); ! for (Edge e : field.getEdges()) { Map envE = e.getParameters().environment(); double width = ((Double)envE.get("width")).doubleValue(); if (outline.contains(e)) { ! offsetMap.put(e, -width); } else { ! offsetMap.put(e, -(width / 2)); } } *************** *** 519,526 **** --- 518,529 ---- Space.ELEMENT_LEVEL, true); + Classification frameClass = Project.getInstance().getClassification(FRAME, 0); + f.setClassification(frameClass); Space g = new Space("Glass", Space.CONSTRUCTION, Space.ELEMENT_LEVEL, true); + Classification glassClass = Project.getInstance().getClassification(GLASS, 0); + g.setClassification(glassClass); g.setTransparent(true); space.add(g); *************** *** 643,647 **** * @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) { --- 646,650 ---- * @return the top surface of the extrusion */ ! private Surface extrudeIntoSpace(Surface s, double delta, Set<Surface> sides) { int deltaCorrection = 1; if (s.normal().dot(front.normal()) < 0) { *************** *** 651,661 **** deltaCorrection *= -1; } ! Set tops = new HashSet(); Surface top = s.extrusionall(delta * deltaCorrection, sides, tops); tops.addAll(sides); ! for (Object o1 : tops) { ! Surface surface = (Surface)o1; ! for (Object o2 : surface.getEdges()) { ! Edge edge = (Edge)o2; space.add(edge.getTo()); space.add(edge.getFrom()); --- 654,662 ---- deltaCorrection *= -1; } ! Set<Surface> tops = new HashSet<Surface>(); Surface top = s.extrusionall(delta * deltaCorrection, sides, tops); tops.addAll(sides); ! for (Surface surface : tops) { ! for (Edge edge : surface.getEdges()) { space.add(edge.getTo()); space.add(edge.getFrom()); *************** *** 869,880 **** contour = test.getEdges(); } ! Set<Surface> surfaces = new HashSet<Surface>(); ! HashSet surfs = new HashSet(); if (contour.size() > 2) { Vertex j = out; - Iterator it = contour.iterator(); Edge prev = contour.get(contour.size() - 1); - Edge current = (Edge)it.next(); Edge next; double bottomAngle = angle(prev, current); double topAngle; --- 870,880 ---- contour = test.getEdges(); } ! HashSet<Surface> surfaces = new HashSet<Surface>(); if (contour.size() > 2) { Vertex j = out; Edge prev = contour.get(contour.size() - 1); Edge next; + Iterator<Edge> it = contour.iterator(); + Edge current = it.next(); double bottomAngle = angle(prev, current); double topAngle; *************** *** 888,894 **** i.normalize(); CoordinateSystem cs = new CoordinateSystem(i, j, n, origin); ! Set post = genFramePost(cut, current.getLength(), bottomAngle, topAngle); Geometry.unTranslateGeometry(post, cs); ! surfs.addAll(post); prev = current; current = next; --- 888,894 ---- i.normalize(); CoordinateSystem cs = new CoordinateSystem(i, j, n, origin); ! Set<Surface> post = genFramePost(cut, current.getLength(), bottomAngle, topAngle); Geometry.unTranslateGeometry(post, cs); ! surfaces.addAll(post); prev = current; current = next; *************** *** 903,914 **** i.normalize(); CoordinateSystem cs = new CoordinateSystem(i, j, n, origin); ! Set post = genFramePost(cut, current.getLength(), bottomAngle, topAngle); Geometry.unTranslateGeometry(post, cs); ! surfs.addAll(post); ! Iterator surfIt = surfs.iterator(); ! while (surfIt.hasNext()) { ! Surface s = (Surface)surfIt.next(); ! surfaces.add(s); ! } } return surfaces; --- 903,909 ---- i.normalize(); CoordinateSystem cs = new CoordinateSystem(i, j, n, origin); ! Set<Surface> post = genFramePost(cut, current.getLength(), bottomAngle, topAngle); Geometry.unTranslateGeometry(post, cs); ! surfaces.addAll(post); } return surfaces; *************** *** 918,927 **** private static Surface cutType1() { List<Vertex> vl = new LinkedList<Vertex>(); ! Vertex first = new Vertex(0, 0, 0); ! vl.add(new Vertex(0.050, 0, 0)); ! vl.add(new Vertex(0.050, 0.016, 0)); ! vl.add(new Vertex(0.008, 0.016, 0)); ! vl.add(new Vertex(0.008, 0.125, 0)); ! vl.add(new Vertex(0.000, 0.125, 0)); List<Edge> el = new LinkedList<Edge>(); Vertex prevV = first; --- 913,922 ---- private static Surface cutType1() { List<Vertex> vl = new LinkedList<Vertex>(); ! Vertex first = new Vertex(0, 0 + 0.035, 0); ! vl.add(new Vertex(0.050, 0 + 0.035, 0)); ! vl.add(new Vertex(0.050, 0.016 + 0.035, 0)); ! vl.add(new Vertex(0.008, 0.016 + 0.035, 0)); ! vl.add(new Vertex(0.008, 0.125 + 0.035, 0)); ! vl.add(new Vertex(0.000, 0.125 + 0.035, 0)); List<Edge> el = new LinkedList<Edge>(); Vertex prevV = first; *************** *** 939,944 **** Vertex first = new Vertex(0.004, 0, 0); vl.add(new Vertex(0.050, 0, 0)); ! vl.add(new Vertex(0.050, -0.035, 0)); ! vl.add(new Vertex(0.004, -0.035, 0)); List<Edge> el = new LinkedList<Edge>(); Vertex prevV = first; --- 934,939 ---- Vertex first = new Vertex(0.004, 0, 0); vl.add(new Vertex(0.050, 0, 0)); ! vl.add(new Vertex(0.050, 0.035, 0)); ! vl.add(new Vertex(0.004, 0.035, 0)); List<Edge> el = new LinkedList<Edge>(); Vertex prevV = first; *************** *** 954,963 **** private static Surface cutType3() { List<Vertex> vl = new LinkedList<Vertex>(); ! Vertex first = new Vertex(0, 0, 0); ! vl.add(new Vertex(0.050, 0, 0)); ! vl.add(new Vertex(0.050, 0.125, 0)); ! vl.add(new Vertex(0.004, 0.125, 0)); ! vl.add(new Vertex(0.004, 0.121, 0)); ! vl.add(new Vertex(0.000, 0.121, 0)); List<Edge> el = new LinkedList<Edge>(); Vertex prevV = first; --- 949,958 ---- private static Surface cutType3() { List<Vertex> vl = new LinkedList<Vertex>(); ! Vertex first = new Vertex(0, 0 + 0.035, 0); ! vl.add(new Vertex(0.050, 0 + 0.035, 0)); ! vl.add(new Vertex(0.050, 0.125 + 0.035, 0)); ! vl.add(new Vertex(0.004, 0.125 + 0.035, 0)); ! vl.add(new Vertex(0.004, 0.121 + 0.035, 0)); ! vl.add(new Vertex(0.000, 0.121 + 0.035, 0)); List<Edge> el = new LinkedList<Edge>(); Vertex prevV = first; *************** *** 977,981 **** * @return the surfaces of the new post */ ! private static Set genFramePost(Surface cut, double length, double bottomAngle, double topAngle) { Surface copy = cut.copy(new HashMap()); copy.setBackDomain(cut.getBackDomain()); --- 972,977 ---- * @return the surfaces of the new post */ ! private static Set<Surface> genFramePost(Surface cut, double length, ! double bottomAngle, double topAngle) { Surface copy = cut.copy(new HashMap()); copy.setBackDomain(cut.getBackDomain()); *************** *** 987,998 **** Math.sin(-bottomAngle / 2), 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()); --- 983,992 ---- Math.sin(-bottomAngle / 2), new Vertex(0 , 0, -length / 2)); ! Set<Surface> surfaces = new HashSet<Surface>(); ! Set<Surface> tops = new HashSet<Surface>(); surfaces.add(copy); copy.extrusionAllOnto(topPlane, surfaces, tops); copy.extrusionAllOnto(bottomPlane, surfaces, tops); ! for (Surface top : tops) { top.setFrontDomain(cut.getFrontDomain()); top.setBackDomain(cut.getBackDomain()); |