public static PolygonWithHolesList2d buildingPartToPolygonWithHoles(BuildingPart bp) { PolygonList2d outerPolygon = wallToOuterPolygon(bp.getWall()); List<PolygonList2d> innerList = new ArrayList<PolygonList2d>(); if (bp.getInlineWalls() != null) { for (Wall innerWall : bp.getInlineWalls()) { PolygonList2d innerPolygon = wallToOuterPolygon(innerWall); innerList.add(innerPolygon); } } return new PolygonWithHolesList2d(outerPolygon, innerList); }
private Bbox2d calcBounds(BuildingPart bp) { Bbox2d bbox = new Bbox2d(); List<WallPart> wallParts = bp.getWall().getWallParts(); for (WallPart wp : wallParts) { for (WallNode wn : wp.getNodes()) { Point2d p = wn.getPoint(); bbox.addPoint(p); } } return bbox; }
if (parts != null) { for (BuildingPart bp : parts) { List<WallPart> wallParts = bp.getWall().getWallParts(); for (WallPart wp : wallParts) { for (WallNode wn : wp.getNodes()) {
private static BuildingPartOutput buildPart(BuildingPart bp, BuildingModel buildingModel, ModelFactory mf, BuildingElementsTextureManager tm) { BuildingPartOutput partOutput = new BuildingPartOutput(); CatchFaceFactory catchFaceFactory = new CatchFaceFactory(mf); Wall w = bp.getWall(); double maxHeight = bp.getDefaultMaxHeight(); double minHeight = bp.getDefaultMinHeight(); WallPart firstWallPart = getFirstWallPart(w); Color facadeColor = takeFacadeColor(buildingModel, bp, w, firstWallPart, tm); Color roofColor = takeRoofColor(buildingModel, bp, w, firstWallPart, tm); TextureData roofTextureData = takeRoofTextureData(buildingModel, bp, w, tm, roofColor != null); // XXX TextureData facadeTextureData = takeFacadeTextureData(buildingModel, bp, w, firstWallPart, tm, facadeColor != null); RoofOutput roofOutput = buildRoof(bp, mf, maxHeight, facadeColor, roofColor, facadeTextureData, roofTextureData); double wallHeight = maxHeight - roofOutput.getHeight(); buildWall(w, minHeight, wallHeight, bp, buildingModel, mf, catchFaceFactory, tm, roofOutput.getHeightCalculator()); buildFloor(bp, buildingModel, mf, tm, roofTextureData, facadeColor, minHeight); if (bp.getInlineWalls() != null) { for (Wall in : bp.getInlineWalls()) { buildWall(in, minHeight, wallHeight, bp, buildingModel, mf, catchFaceFactory, tm, roofOutput.getHeightCalculator()); } } partOutput.setRoofDebug(roofOutput.getDebug()); partOutput.setEdges(roofOutput.getEdges()); return partOutput; }
private static BuildingPart cloneBuildingPart(BuildingPart bp, Double height) { BuildingPart ret = new BuildingPart(); if (bp.getMaxHeight() == null) { ret.setMaxHeight(bp.getDefaultMaxHeight() + height); } else { ret.setMaxHeight(bp.getMaxHeight() + height); } if (bp.getMinHeight() == null) { ret.setMinHeight(bp.getDefaultMinHeight() + height); } else { ret.setMinHeight(bp.getMinHeight() + height); } ret.setFacadeColor(bp.getFacadeColor()); ret.setFacadeMaterialType(bp.getFacadeMaterialType()); ret.setFloorColor(bp.getFloorColor()); ret.setFloorMaterialType(bp.getFloorMaterialType()); ret.setInlineWalls(bp.getInlineWalls()); ret.setLevelHeight(bp.getLevelHeight()); ret.setMaxLevel(bp.getMaxLevel()); ret.setMinLevel(bp.getMinLevel()); ret.setRoof(bp.getRoof()); ret.setRoofColor(bp.getRoofColor()); ret.setRoofLevels(bp.getRoofLevels()); ret.setRoofMaterialType(bp.getRoofMaterialType()); ret.setWall(bp.getWall()); return ret; }