private static List<BuildingPart> parseBuildingPart(Way primitive, Perspective pPerspective) { if (!primitive.isClosed()) { throw new RuntimeException("Way is not closed: " + primitive); } OsmPrimitive p = primitive; BuildingPart bp = parseBuildingPartAttributes(p); bp.setWall(parseWall((Way) p, pPerspective)); bp.setInlineWalls(null); bp.setRoof(RoofParser.parse(primitive, pPerspective)); List<BuildingPart> bpList = new ArrayList<BuildingPart>(); bpList.add(bp); bpList.addAll(parseRelationClone(primitive, bp)); return bpList; }
/** * Parse building model from multipolygon. * * @param pRelation * @param pPerspective * @return */ static List<BuildingPart> parseBuildingMultiPolygonPart(Relation pRelation, Perspective pPerspective) { List<AreaWithHoles> waysPolygon = PolygonWithHolesUtil.findAreaWithHoles(pRelation); List<BuildingPart> ret = new ArrayList<BuildingPart>(); for (AreaWithHoles waysPolygon2 : waysPolygon) { BuildingPart bp = parseBuildingPartAttributes(pRelation); // DormerRoofModel roofClosedWay = RoofParser.parse(p, // pPerspective); // bp.setRoof(marge(roof, roofClosedWay)); bp.setRoof(RoofParser.parse(pRelation, pPerspective)); bp.setWall(parseWall(waysPolygon2.getOuter(), pPerspective)); if (waysPolygon2.getInner() != null) { List<Wall> innerWall = new ArrayList<Wall>(); for (List<ReversableWay> rwList : waysPolygon2.getInner()) { innerWall.add(parseWall(rwList, pPerspective)); } bp.setInlineWalls(innerWall); } ret.add(bp); } return ret; }