From 9d93322a347dd1e89f15a2ddd4cc7351c7556e1f Mon Sep 17 00:00:00 2001 From: Riegel Date: Tue, 21 Jan 2025 16:31:59 +0100 Subject: [PATCH] Fix: Add BridgeObject to PDF report output --- .../reporting/pdf/PdfStreamReporter.java | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/reporting/pdf/PdfStreamReporter.java b/CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/reporting/pdf/PdfStreamReporter.java index ebf6ce2d..1db08f93 100644 --- a/CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/reporting/pdf/PdfStreamReporter.java +++ b/CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/reporting/pdf/PdfStreamReporter.java @@ -33,6 +33,7 @@ import de.hft.stuttgart.citydoctor2.datastructure.AbstractBuilding; import de.hft.stuttgart.citydoctor2.datastructure.AbstractFurniture; import de.hft.stuttgart.citydoctor2.datastructure.AbstractRoom; import de.hft.stuttgart.citydoctor2.datastructure.AbstractTunnel; +import de.hft.stuttgart.citydoctor2.datastructure.BridgeConstructiveElement; import de.hft.stuttgart.citydoctor2.datastructure.BuildingUnit; import de.hft.stuttgart.citydoctor2.datastructure.CityFurniture; import de.hft.stuttgart.citydoctor2.datastructure.GenericCityObject; @@ -266,6 +267,8 @@ public class PdfStreamReporter implements StreamReporter { bSection.setHeadlineColor(OK_COLOR); } writeErrorForCityObject(co, bSection); + BridgeObject bo = (BridgeObject) co; + writeCheckResultForBridgeObject(bo, bSection); } private void reportTrans(CityObject co, boolean hasError) { @@ -407,6 +410,7 @@ public class PdfStreamReporter implements StreamReporter { for (AbstractFurniture af : ab.getBuildingRoomFurnitureList()) { writeCheckResultForAbstractFurniture(af, root); } + for (Storey s : ab.getBuildingStoreys()) { writeCheckResultForStorey(s, root); } @@ -421,6 +425,33 @@ public class PdfStreamReporter implements StreamReporter { } } + private void writeCheckResultForBridgeObject(BridgeObject bo, Section root) { + Map results = bo.getAllCheckResults(); + writeCheckResults(results.values(), root); + for (BridgeObject parts : bo.getParts()) { + sectionMap.put(bo.getGmlId().getGmlString(), root); + writeCheckResultForBridgeObject(parts, root); + } + for (Geometry geom : bo.getGeometries()) { + writeCheckResultForGeometry(geom, root); + } + for (AbstractRoom ar : bo.getBridgeRooms()) { + writeCheckResultForRoom(ar, root); + } + for (AbstractFurniture af : bo.getBridgeFurniture()) { + writeCheckResultForAbstractFurniture(af, root); + } + for (BridgeConstructiveElement bce : bo.getConstructiveElements()) { + writeCheckResultForBridgeConstructiveElement(bce, root); + } + for (BoundarySurface bs : bo.getBoundarySurfaces()) { + writeCheckResultForBoundarySurface(bs, root); + } + for (Installation bi : bo.getBridgeInstallations()) { + writeCheckResultForInstallation(bi, root); + } + } + private void writeCheckResultForStorey(Storey s, Section root) { Map results = s.getAllCheckResults(); writeCheckResults(results.values(), root); @@ -507,6 +538,17 @@ public class PdfStreamReporter implements StreamReporter { } } + private void writeCheckResultForBridgeConstructiveElement(BridgeConstructiveElement bce, Section root) { + Map results = bce.getAllCheckResults(); + writeCheckResults(results.values(), root); + for (Geometry geom : bce.getGeometries()) { + writeCheckResultForGeometry(geom, root); + } + for (BoundarySurface bs : bce.getBoundarySurfaces()) { + writeCheckResultForBoundarySurface(bs, root); + } + } + private void writeErrorForCityObject(CityObject co, Section section) { Map results = co.getAllCheckResults(); writeCheckResults(results.values(), section); -- GitLab