[Bprocessor-commit] /model/src/net/sourceforge/bprocessor/model/modellor ModelBathModellor.java, 1
Status: Pre-Alpha
Brought to you by:
henryml
|
From: rimestad <rim...@us...> - 2007-05-09 09:33:03
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv856/src/net/sourceforge/bprocessor/model/modellor Modified Files: ModelBathModellor.java Log Message: commit before major change of modellor Index: ModelBathModellor.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/modellor/ModelBathModellor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ModelBathModellor.java 7 May 2007 13:40:18 -0000 1.3 --- ModelBathModellor.java 9 May 2007 09:33:03 -0000 1.4 *************** *** 50,53 **** --- 50,55 ---- private double ceilingThickness = 55; + + private HashSet<Surface> vertical; /** * the constructor *************** *** 66,79 **** space = s; bottom = null; ! Collection<Surface> vertical = new HashSet<Surface>(); Collection<Surface> horizontal = new HashSet<Surface>(); Collection<Surface> surs = s.getEnvelope(); Vertex up = new Vertex(0, 0, 1); for (Surface sur : surs) { ! double dot = (sur.normal()).dot(up); ! if (Math.abs(dot) - 1 < 0.001) { ! horizontal.add(sur); ! } else if (dot < 0.001 && dot > -0.001) { vertical.add(sur); } } --- 68,82 ---- space = s; bottom = null; ! vertical = new HashSet<Surface>(); Collection<Surface> horizontal = new HashSet<Surface>(); Collection<Surface> surs = s.getEnvelope(); Vertex up = new Vertex(0, 0, 1); for (Surface sur : surs) { ! Vertex normal = sur.normal(); ! double dot = (normal).dot(up); ! if (Math.abs(dot) < 0.001) { vertical.add(sur); + } else if (Math.abs(dot) - 1 < 0.001) { + horizontal.add(sur); } } *************** *** 82,85 **** --- 85,92 ---- return; } + if (horizontal.size() != 2) { + log.error("Ther have to be only 2 horizontal edges in the surrounding union"); + return; + } for (Surface sur : horizontal) { if (bottom == null) { *************** *** 95,99 **** } if (bottom == null || top == null) { ! log.error("Could not find at bottom surface"); return; } else { --- 102,106 ---- } if (bottom == null || top == null) { ! log.error("Could not find a bottom surface"); return; } else { *************** *** 131,136 **** space.add(badkabine); room.setBackDomain(badkabine); ! } ! { Set<Surface> sides = new HashSet<Surface>(); Set<Surface> tops = new HashSet<Surface>(); --- 138,142 ---- space.add(badkabine); room.setBackDomain(badkabine); ! Set<Surface> sides = new HashSet<Surface>(); Set<Surface> tops = new HashSet<Surface>(); *************** *** 148,153 **** space.addAll(sides); ! //find surfacesed parting wall and bath cabin ! } } --- 154,175 ---- space.addAll(sides); ! //find surfaces containing holes ! for (Surface s : vertical) { ! for (Surface sur : s.getHoles()) { ! if (sur.getFrontDomain() != space && sur.getBackDomain() != space) { ! Surface hole = sur.copy(space); ! Geometry.holeAnalysis(hole); ! sides.clear(); ! int sign = 1; ! if (hole.getExterior().getBackDomain() == wallSystem) { ! sign = -1; ! } ! Surface t = hole.extrusion(sign * wallThickness / 1000, sides); ! sides.add(t); ! space.addAll(sides); ! Geometry.holeAnalysis(t); ! } ! } ! } } } *************** *** 157,161 **** */ private Surface makeFloor() { ! Space floor = new Space("Floor", Space.CONSTRUCTION, Space.ELEMENT_LEVEL, true); space.add(floor); bottom = bottom.copy(space); --- 179,183 ---- */ private Surface makeFloor() { ! Space floor = new Space("Floor", Space.CONSTRUCTION, Space.SPACE_LEVEL, true); space.add(floor); bottom = bottom.copy(space); |