[Bprocessor-commit] facade/src/net/sourceforge/bprocessor/facade/modellor NetFacadeModellor.java,
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2007-12-13 12:00:17
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20650/src/net/sourceforge/bprocessor/facade/modellor Modified Files: NetFacadeModellor.java FacadeModellor.java Log Message: Major change wrt Space/Container Index: NetFacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/NetFacadeModellor.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** NetFacadeModellor.java 12 Dec 2007 12:48:18 -0000 1.44 --- NetFacadeModellor.java 13 Dec 2007 12:00:15 -0000 1.45 *************** *** 19,23 **** import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Classification; - import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; --- 19,22 ---- *************** *** 28,32 **** import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selector; ! import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; --- 27,31 ---- import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selector; ! import net.sourceforge.bprocessor.model.Container; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 65,75 **** /** The space of the facade */ ! private Space space; /** The frame space */ ! private Space frame; /** The net for this facade */ ! private Space net; /** The framewidth of the facade */ --- 64,74 ---- /** The space of the facade */ ! private Container space; /** The frame space */ ! private Container frame; /** The net for this facade */ ! private Container net; /** The framewidth of the facade */ *************** *** 113,123 **** */ public void setSubContent(Map<String, Object> m) { ! space = (Space)m.get("space"); ! net = (Space)m.get("net"); depth = ((Double)m.get("depth")).doubleValue(); frameWidth = ((Double)m.get("frameWidth")).doubleValue(); front = (Surface)m.get("front"); single = ((Boolean)m.get("single")).booleanValue(); ! frame = (Space)m.get("frame"); Project.getInstance().addObserver(this); } --- 112,122 ---- */ public void setSubContent(Map<String, Object> m) { ! space = (Container)m.get("space"); ! net = (Container)m.get("net"); depth = ((Double)m.get("depth")).doubleValue(); frameWidth = ((Double)m.get("frameWidth")).doubleValue(); front = (Surface)m.get("front"); single = ((Boolean)m.get("single")).booleanValue(); ! frame = (Container)m.get("frame"); Project.getInstance().addObserver(this); } *************** *** 128,132 **** * @return a new modellor */ ! public Modellor newInstance(Space s) { NetFacadeModellor mod = new NetFacadeModellor(); mod.setSpace(s); --- 127,131 ---- * @return a new modellor */ ! public Modellor newInstance(Container s) { NetFacadeModellor mod = new NetFacadeModellor(); mod.setSpace(s); *************** *** 134,138 **** s.setModellor(mod); frame = new Container("Frame", ! Space.CONSTRUCTION, true); Classification frameClass = Project.getInstance().getClassification(FRAME, 0); --- 133,137 ---- s.setModellor(mod); frame = new Container("Frame", ! Container.CONSTRUCTION, true); Classification frameClass = Project.getInstance().getClassification(FRAME, 0); *************** *** 150,154 **** * @return a suitable surface from the s' envelope */ ! private Surface findFront(Space s) { Surface frontCandidate = null; if (!s.getEnvelope().isEmpty()) { --- 149,153 ---- * @return a suitable surface from the s' envelope */ ! private Surface findFront(Container s) { Surface frontCandidate = null; if (!s.getEnvelope().isEmpty()) { *************** *** 228,232 **** Attribute a = attributes.get("Net"); if (a != null) { ! setNet((Space)a.getValue()); } a = attributes.get("Framewidth"); --- 227,231 ---- Attribute a = attributes.get("Net"); if (a != null) { ! setNet((Container)a.getValue()); } a = attributes.get("Framewidth"); *************** *** 270,274 **** *@return the space */ ! public Space getSpace() { return space; } --- 269,273 ---- *@return the space */ ! public Container getSpace() { return space; } *************** *** 278,282 **** * @param space the space */ ! public void setSpace(Space space) { this.space = space; } --- 277,281 ---- * @param space the space */ ! public void setSpace(Container space) { this.space = space; } *************** *** 286,290 **** * @return the net of this modellor */ ! public Space getNet() { return this.net; } --- 285,289 ---- * @return the net of this modellor */ ! public Container getNet() { return this.net; } *************** *** 294,298 **** * @param net the net */ ! public void setNet(Space net) { if (net.isNet()) { if (this.net != null) { --- 293,297 ---- * @param net the net */ ! public void setNet(Container net) { if (net.isNet()) { if (this.net != null) { *************** *** 345,349 **** * @param n the net */ ! private void prepareNet(Space n) { Collection<Edge> edges = n.getEdges(); for (Edge e : edges) { --- 344,348 ---- * @param n the net */ ! private void prepareNet(Container n) { Collection<Edge> edges = n.getEdges(); for (Edge e : edges) { *************** *** 389,396 **** * @param net the net */ ! private void createDoubleFacade(Space net) { if (frame == null) { frame = new Container("Frame", ! Space.CONSTRUCTION, true); Classification frameClass = Project.getInstance().getClassification(FRAME, 0); --- 388,395 ---- * @param net the net */ ! private void createDoubleFacade(Container net) { if (frame == null) { frame = new Container("Frame", ! Container.CONSTRUCTION, true); Classification frameClass = Project.getInstance().getClassification(FRAME, 0); *************** *** 438,445 **** * @param net the net */ ! private void createSingleFacade(Space net) { if (frame == null) { frame = new Container("Frame", ! Space.CONSTRUCTION, true); space.add(frame); --- 437,444 ---- * @param net the net */ ! private void createSingleFacade(Container net) { if (frame == null) { frame = new Container("Frame", ! Container.CONSTRUCTION, true); space.add(frame); *************** *** 475,480 **** Surface hole = new Surface(Edge.placeOffset(field.getEdges(), field, offsetMap)); hole = space.insert(hole); ! Space holeSpace = new Container("Facade Hole", ! Space.FUNCTIONAL, true); space.add(holeSpace); --- 474,479 ---- Surface hole = new Surface(Edge.placeOffset(field.getEdges(), field, offsetMap)); hole = space.insert(hole); ! Container holeSpace = new Container("Facade Hole", ! Container.FUNCTIONAL, true); space.add(holeSpace); *************** *** 498,502 **** * @param holeSpace the space of the hole in the facade */ ! private void detailField(Map envF, Surface hole, Space holeSpace) { double frameSize = 0.0; String type = ""; --- 497,501 ---- * @param holeSpace the space of the hole in the facade */ ! private void detailField(Map envF, Surface hole, Container holeSpace) { double frameSize = 0.0; String type = ""; *************** *** 520,530 **** Surface in = new Surface(Edge.placeOffset(hole.getEdges(), hole, offmap1)); Surface out = new Surface(Edge.placeOffset(hole.getEdges(), hole, offmap2)); ! Space f = new Container(type + " Frame", ! Space.CONSTRUCTION, true); Classification frameClass = Project.getInstance().getClassification(FRAME, 0); f.setClassification(frameClass); ! Space g = new Container("Glass", ! Space.CONSTRUCTION, true); Classification glassClass = Project.getInstance().getClassification(GLASS, 0); --- 519,529 ---- Surface in = new Surface(Edge.placeOffset(hole.getEdges(), hole, offmap1)); Surface out = new Surface(Edge.placeOffset(hole.getEdges(), hole, offmap2)); ! Container f = new Container(type + " Frame", ! Container.CONSTRUCTION, true); Classification frameClass = Project.getInstance().getClassification(FRAME, 0); f.setClassification(frameClass); ! Container g = new Container("Glass", ! Container.CONSTRUCTION, true); Classification glassClass = Project.getInstance().getClassification(GLASS, 0); *************** *** 565,569 **** * @return a list of connected edges making up the net outline */ ! private List<Edge> netOutline(Space net) { /*Find outer edges*/ Set<Edge> outer = new HashSet<Edge>(); --- 564,568 ---- * @return a list of connected edges making up the net outline */ ! private List<Edge> netOutline(Container net) { /*Find outer edges*/ Set<Edge> outer = new HashSet<Edge>(); *************** *** 617,622 **** * @return a new net */ ! private Space createNet(Surface front) { ! Space n = Space.createNet("Facade net"); if (front != null) { front.copy(n); --- 616,621 ---- * @return a new net */ ! private Container createNet(Surface front) { ! Container n = Container.createNet("Facade net"); if (front != null) { front.copy(n); *************** *** 697,703 **** * @param sp2 second space */ ! private void assignOpposite(Surface s1, Surface s2, Space sp1, Space sp2) { ! Space back = s2.getBackDomain(); ! Space front = s2.getFrontDomain(); Geometry.assignSame(s1, s2, sp1, sp2); if (s2.getBackDomain() == sp2) { --- 696,702 ---- * @param sp2 second space */ ! private void assignOpposite(Surface s1, Surface s2, Container sp1, Container sp2) { ! Container back = s2.getBackDomain(); ! Container front = s2.getFrontDomain(); Geometry.assignSame(s1, s2, sp1, sp2); if (s2.getBackDomain() == sp2) { *************** *** 750,759 **** @Override public int getUseableLevel() { ! return Space.SPACE_LEVEL; } private Set<Surface> generateFrame2(Surface cut, Surface contourSurf, ! Space frameSpace, Vertex out) { Set<Surface> generatedSurfaces = new HashSet<Surface>(); --- 749,758 ---- @Override public int getUseableLevel() { ! return Container.SPACE_LEVEL; } private Set<Surface> generateFrame2(Surface cut, Surface contourSurf, ! Container frameSpace, Vertex out) { Set<Surface> generatedSurfaces = new HashSet<Surface>(); Index: FacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/FacadeModellor.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** FacadeModellor.java 12 Dec 2007 12:48:18 -0000 1.39 --- FacadeModellor.java 13 Dec 2007 12:00:15 -0000 1.40 *************** *** 19,23 **** import net.sourceforge.bprocessor.model.modellor.Modellor; import net.sourceforge.bprocessor.model.Container; - import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Surface; --- 19,22 ---- *************** *** 63,67 **** /** The space this modellor is connected to */ ! private Space space; /** The front surface of the facade */ --- 62,66 ---- /** The space this modellor is connected to */ ! private Container space; /** The front surface of the facade */ *************** *** 115,119 **** * @param s the space */ ! public FacadeModellor(Space s) { this(s, null); } --- 114,118 ---- * @param s the space */ ! public FacadeModellor(Container s) { this(s, null); } *************** *** 123,127 **** * @param front Front */ ! public FacadeModellor(Space s, Surface front) { if (front == null) { front = null; --- 122,126 ---- * @param front Front */ ! public FacadeModellor(Container s, Surface front) { if (front == null) { front = null; *************** *** 154,158 **** * @return The created modellor object for the given space */ ! public Modellor newInstance(Space s) { return new FacadeModellor(s); } --- 153,157 ---- * @return The created modellor object for the given space */ ! public Modellor newInstance(Container s) { return new FacadeModellor(s); } *************** *** 366,370 **** if (front != null && depth > 0) { ! Space frame = new Container("Frame", Space.CONSTRUCTION, true); space.add(frame); Surface eFront = front.copy(space); --- 365,369 ---- if (front != null && depth > 0) { ! Container frame = new Container("Frame", Container.CONSTRUCTION, true); space.add(frame); Surface eFront = front.copy(space); *************** *** 691,695 **** Surface s = (Surface)it.next(); Set sides = new HashSet(); ! Space w = new Container("Window", Space.CONSTRUCTION, true); double u = s.normal().dot(front.normal()); if ((u > 0 && front.getBackDomain() == space) || --- 690,694 ---- Surface s = (Surface)it.next(); Set sides = new HashSet(); ! Container w = new Container("Window", Container.CONSTRUCTION, true); double u = s.normal().dot(front.normal()); if ((u > 0 && front.getBackDomain() == space) || *************** *** 808,812 **** type = ((Integer)m.get("type")).intValue(); name = (String)m.get("name"); ! space = (Space)m.get("Space"); } --- 807,811 ---- type = ((Integer)m.get("type")).intValue(); name = (String)m.get("name"); ! space = (Container)m.get("Space"); } *************** *** 854,858 **** @Override public int getUseableLevel() { ! return Space.SPACE_LEVEL; } } --- 853,857 ---- @Override public int getUseableLevel() { ! return Container.SPACE_LEVEL; } } |