Commit 1ac443c8 authored by Luna Riegel's avatar Luna Riegel
Browse files

Refactor: Restructure and add missing Features

parent 03fbe199
...@@ -29,17 +29,29 @@ import java.util.Map.Entry; ...@@ -29,17 +29,29 @@ import java.util.Map.Entry;
import java.util.Set; import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import de.hft.stuttgart.citydoctor2.datastructure.AbstractBridgeObject;
import de.hft.stuttgart.citydoctor2.datastructure.AbstractBuilding; import de.hft.stuttgart.citydoctor2.datastructure.AbstractBuilding;
import de.hft.stuttgart.citydoctor2.datastructure.AbstractBuildingSubdivision;
import de.hft.stuttgart.citydoctor2.datastructure.AbstractConstructiveElement;
import de.hft.stuttgart.citydoctor2.datastructure.AbstractConstructiveFillingElement;
import de.hft.stuttgart.citydoctor2.datastructure.AbstractFurniture; import de.hft.stuttgart.citydoctor2.datastructure.AbstractFurniture;
import de.hft.stuttgart.citydoctor2.datastructure.AbstractRoom; import de.hft.stuttgart.citydoctor2.datastructure.AbstractRoom;
import de.hft.stuttgart.citydoctor2.datastructure.AbstractTunnel; import de.hft.stuttgart.citydoctor2.datastructure.AbstractTunnel;
import de.hft.stuttgart.citydoctor2.datastructure.BridgeConstructiveElement; import de.hft.stuttgart.citydoctor2.datastructure.BoundedSpace;
import de.hft.stuttgart.citydoctor2.datastructure.BridgeObjectPart;
import de.hft.stuttgart.citydoctor2.datastructure.BuildingUnit; import de.hft.stuttgart.citydoctor2.datastructure.BuildingUnit;
import de.hft.stuttgart.citydoctor2.datastructure.CityFurniture; import de.hft.stuttgart.citydoctor2.datastructure.CityFurniture;
import de.hft.stuttgart.citydoctor2.datastructure.ConstructionObject;
import de.hft.stuttgart.citydoctor2.datastructure.GenericCityObject; import de.hft.stuttgart.citydoctor2.datastructure.GenericCityObject;
import de.hft.stuttgart.citydoctor2.datastructure.OtherConstructionObject;
import de.hft.stuttgart.citydoctor2.datastructure.ReliefObject;
import de.hft.stuttgart.citydoctor2.datastructure.Storey; import de.hft.stuttgart.citydoctor2.datastructure.Storey;
import de.hft.stuttgart.citydoctor2.datastructure.TinObject;
import de.hft.stuttgart.citydoctor2.datastructure.TopLevelTransportFeature;
import de.hft.stuttgart.citydoctor2.datastructure.TrafficAreaObject;
import de.hft.stuttgart.citydoctor2.datastructure.TrafficSpaceObject;
import de.hft.stuttgart.citydoctor2.datastructure.TransportationSpace;
import de.hft.stuttgart.citydoctor2.datastructure.Tunnel; import de.hft.stuttgart.citydoctor2.datastructure.Tunnel;
import de.hft.stuttgart.citydoctor2.datastructure.TunnelConstructiveElement;
import de.hft.stuttgart.citydoctor2.datastructure.TunnelPart; import de.hft.stuttgart.citydoctor2.datastructure.TunnelPart;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
...@@ -117,6 +129,10 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -117,6 +129,10 @@ public class PdfStreamReporter implements StreamReporter {
private int numErrorLand; private int numErrorLand;
private int numOkLand; private int numOkLand;
private Section relief;
private int numErrorRelief;
private int numOkRelief;
private Section tunnel; private Section tunnel;
private int numErrorTunnel; private int numErrorTunnel;
private int numOkTunnel; private int numOkTunnel;
...@@ -129,6 +145,10 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -129,6 +145,10 @@ public class PdfStreamReporter implements StreamReporter {
private int numErrorGenericCityObject; private int numErrorGenericCityObject;
private int numOkGenericCityObject; private int numOkGenericCityObject;
private Section otherConstruction;
private int numErrorOtherConstruction;
private int numOkOtherConstruction;
private Section globalErrors; private Section globalErrors;
private final Map<String, Section> sectionMap = new HashMap<>(); private final Map<String, Section> sectionMap = new HashMap<>();
...@@ -198,35 +218,41 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -198,35 +218,41 @@ public class PdfStreamReporter implements StreamReporter {
errorCount.incrementAndGet(); errorCount.incrementAndGet();
} }
boolean hasError = containsError(co); boolean hasError = containsError(co);
if (co instanceof Building) { if (co instanceof Building bu) {
reportBuilding(co, hasError); reportBuilding(bu, hasError);
} else if (co instanceof Vegetation) { } else if (co instanceof Vegetation ve) {
reportVegetation(co, hasError); reportVegetation(ve, hasError);
} else if (co instanceof TransportationObject) { } else if (co instanceof TopLevelTransportFeature to) {
reportTrans(co, hasError); reportTopLevelTransportFeature(to, hasError);
} else if (co instanceof BridgeObject) { } else if (co instanceof TransportationObject to){
reportBridge(co, hasError); reportTransportationObject(to, hasError);
} else if (co instanceof WaterObject) { } else if (co instanceof BridgeObject bo) {
reportWater(co, hasError); reportBridge(bo, hasError);
} else if (co instanceof LandObject) { } else if (co instanceof WaterObject wo) {
reportLand(co, hasError); reportWater(wo, hasError);
} else if (co instanceof Tunnel) { } else if (co instanceof LandObject lo) {
reportTunnel(co, hasError); reportLand(lo, hasError);
} else if (co instanceof CityFurniture) { } else if (co instanceof ReliefObject ro) {
reportCityFurniture(co, hasError); reportRelief(ro, hasError);
} else if (co instanceof GenericCityObject) { } else if (co instanceof Tunnel tu) {
reportGenericCityObject(co, hasError); reportTunnel(tu, hasError);
} else if (co instanceof CityFurniture cf) {
reportCityFurniture(cf, hasError);
} else if (co instanceof GenericCityObject gc) {
reportGenericCityObject(gc, hasError);
} else if (co instanceof OtherConstructionObject ot) {
reportOtherConstructionObject(ot, hasError);
} else { } else {
throw new IllegalStateException("Unknown City Object found: " + co.getClass()); throw new IllegalStateException("Unknown City Object found: " + co.getClass());
} }
} }
private void reportLand(CityObject co, boolean hasError) { private void reportLand(LandObject lo, boolean hasError) {
if (land == null) { if (land == null) {
land = vr.createSubSection("Land Objects"); land = vr.createSubSection("Land Objects");
} }
Section lSection = land.createSubSection(co.getGmlId().getGmlString()); Section lSection = land.createSubSection(lo.getGmlId().getGmlString());
sectionMap.put(co.getGmlId().getGmlString(), lSection); sectionMap.put(lo.getGmlId().getGmlString(), lSection);
if (hasError) { if (hasError) {
numErrorLand++; numErrorLand++;
lSection.setHeadlineColor(ERROR_COLOR); lSection.setHeadlineColor(ERROR_COLOR);
...@@ -234,15 +260,15 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -234,15 +260,15 @@ public class PdfStreamReporter implements StreamReporter {
numOkLand++; numOkLand++;
lSection.setHeadlineColor(OK_COLOR); lSection.setHeadlineColor(OK_COLOR);
} }
writeErrorForCityObject(co, lSection); writeErrorForCityObject(lo, lSection);
} }
private void reportWater(CityObject co, boolean hasError) { private void reportWater(WaterObject wo, boolean hasError) {
if (water == null) { if (water == null) {
water = vr.createSubSection("Water Objects"); water = vr.createSubSection("Water Objects");
} }
Section wSection = water.createSubSection(co.getGmlId().getGmlString()); Section wSection = water.createSubSection(wo.getGmlId().getGmlString());
sectionMap.put(co.getGmlId().getGmlString(), wSection); sectionMap.put(wo.getGmlId().getGmlString(), wSection);
if (hasError) { if (hasError) {
numErrorWater++; numErrorWater++;
wSection.setHeadlineColor(ERROR_COLOR); wSection.setHeadlineColor(ERROR_COLOR);
...@@ -250,15 +276,16 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -250,15 +276,16 @@ public class PdfStreamReporter implements StreamReporter {
numOkWater++; numOkWater++;
wSection.setHeadlineColor(OK_COLOR); wSection.setHeadlineColor(OK_COLOR);
} }
writeErrorForCityObject(co, wSection); writeErrorForCityObject(wo, wSection);
writeCheckResultForBoundedSpace(wo, wSection);
} }
private void reportBridge(CityObject co, boolean hasError) { private void reportBridge(BridgeObject bo, boolean hasError) {
if (bridge == null) { if (bridge == null) {
bridge = vr.createSubSection("Bridge Objects"); bridge = vr.createSubSection("Bridge Objects");
} }
Section bSection = bridge.createSubSection(co.getGmlId().getGmlString()); Section bSection = bridge.createSubSection(bo.getGmlId().getGmlString());
sectionMap.put(co.getGmlId().getGmlString(), bSection); sectionMap.put(bo.getGmlId().getGmlString(), bSection);
if (hasError) { if (hasError) {
numErrorBridge++; numErrorBridge++;
bSection.setHeadlineColor(ERROR_COLOR); bSection.setHeadlineColor(ERROR_COLOR);
...@@ -266,17 +293,25 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -266,17 +293,25 @@ public class PdfStreamReporter implements StreamReporter {
numOkBridge++; numOkBridge++;
bSection.setHeadlineColor(OK_COLOR); bSection.setHeadlineColor(OK_COLOR);
} }
writeErrorForCityObject(co, bSection); writeCheckResultForAbstractBridgeObject(bo, bSection);
BridgeObject bo = (BridgeObject) co; for (BridgeObjectPart part : bo.getParts()) {
writeCheckResultForBridgeObject(bo, bSection); if (containsError(part)) {
numErrorBridge++;
} else {
numOkBridge++;
}
sectionMap.put(bo.getGmlId().getGmlString(), bSection);
writeCheckResultForAbstractBridgeObject(part, bSection);
}
} }
private void reportTrans(CityObject co, boolean hasError) { private Section setupTransportationHeader(TransportationObject to, boolean hasError) {
if (trans == null) { if (trans == null) {
trans = vr.createSubSection("Transportation Objects"); trans = vr.createSubSection("Transportation Objects");
} }
Section tSection = trans.createSubSection(co.getGmlId().getGmlString()); Section tSection = trans.createSubSection(to.getGmlId().getGmlString());
sectionMap.put(co.getGmlId().getGmlString(), tSection); sectionMap.put(to.getGmlId().getGmlString(), tSection);
if (hasError) { if (hasError) {
numErrorTrans++; numErrorTrans++;
tSection.setHeadlineColor(ERROR_COLOR); tSection.setHeadlineColor(ERROR_COLOR);
...@@ -284,15 +319,25 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -284,15 +319,25 @@ public class PdfStreamReporter implements StreamReporter {
numOkTrans++; numOkTrans++;
tSection.setHeadlineColor(OK_COLOR); tSection.setHeadlineColor(OK_COLOR);
} }
writeErrorForCityObject(co, tSection); return tSection;
} }
private void reportVegetation(CityObject co, boolean hasError) { private void reportTopLevelTransportFeature(TopLevelTransportFeature top, boolean hasError) {
Section tSection = setupTransportationHeader(top, hasError);
writeCheckResultForTopLevelTransport(top, tSection);
}
private void reportTransportationObject(TransportationObject to, boolean hasError) {
Section tSection = setupTransportationHeader(to, hasError);
writeCheckResultForTransportationObject(to, tSection);
}
private void reportVegetation(Vegetation ve, boolean hasError) {
if (vegetation == null) { if (vegetation == null) {
vegetation = vr.createSubSection("Vegetation"); vegetation = vr.createSubSection("Vegetation");
} }
Section vSection = vegetation.createSubSection(co.getGmlId().getGmlString()); Section vSection = vegetation.createSubSection(ve.getGmlId().getGmlString());
sectionMap.put(co.getGmlId().getGmlString(), vSection); sectionMap.put(ve.getGmlId().getGmlString(), vSection);
if (hasError) { if (hasError) {
numErrorVegetation++; numErrorVegetation++;
vSection.setHeadlineColor(ERROR_COLOR); vSection.setHeadlineColor(ERROR_COLOR);
...@@ -300,15 +345,16 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -300,15 +345,16 @@ public class PdfStreamReporter implements StreamReporter {
numOkVegetation++; numOkVegetation++;
vSection.setHeadlineColor(OK_COLOR); vSection.setHeadlineColor(OK_COLOR);
} }
writeErrorForCityObject(co, vSection); writeErrorForCityObject(ve, vSection);
writeCheckResultForBoundedSpace(ve, vSection);
} }
private void reportBuilding(CityObject co, boolean hasError) { private void reportBuilding(Building bu, boolean hasError) {
if (buildings == null) { if (buildings == null) {
buildings = vr.createSubSection("Buildings"); buildings = vr.createSubSection("Buildings");
} }
Section bSection = buildings.createSubSection(co.getGmlId().getGmlString()); Section bSection = buildings.createSubSection(bu.getGmlId().getGmlString());
sectionMap.put(co.getGmlId().getGmlString(), bSection); sectionMap.put(bu.getGmlId().getGmlString(), bSection);
if (hasError) { if (hasError) {
numErrorBuildings++; numErrorBuildings++;
bSection.setHeadlineColor(ERROR_COLOR); bSection.setHeadlineColor(ERROR_COLOR);
...@@ -316,9 +362,8 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -316,9 +362,8 @@ public class PdfStreamReporter implements StreamReporter {
numOkBuildings++; numOkBuildings++;
bSection.setHeadlineColor(OK_COLOR); bSection.setHeadlineColor(OK_COLOR);
} }
writeErrorForCityObject(co, bSection); writeCheckResultForAbstractBuilding(bu, bSection);
Building b = (Building) co; for (BuildingPart bp : bu.getBuildingParts()) {
for (BuildingPart bp : b.getBuildingParts()) {
if (containsError(bp)) { if (containsError(bp)) {
numErrorBuildings++; numErrorBuildings++;
} else { } else {
...@@ -327,15 +372,31 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -327,15 +372,31 @@ public class PdfStreamReporter implements StreamReporter {
sectionMap.put(bp.getGmlId().getGmlString(), bSection); sectionMap.put(bp.getGmlId().getGmlString(), bSection);
writeCheckResultForAbstractBuilding(bp, bSection); writeCheckResultForAbstractBuilding(bp, bSection);
} }
writeCheckResultForAbstractBuilding(b, bSection);
} }
private void reportTunnel(CityObject co, boolean hasError) { private void reportRelief(ReliefObject ro, boolean hasError) {
if (relief == null) {
relief = vr.createSubSection("Relief objects");
}
Section lSection = relief.createSubSection(ro.getGmlId().getGmlString());
sectionMap.put(ro.getGmlId().getGmlString(), lSection);
if (hasError) {
numErrorRelief++;
lSection.setHeadlineColor(ERROR_COLOR);
} else {
numOkRelief++;
lSection.setHeadlineColor(OK_COLOR);
}
writeCheckResultForRelief(ro, lSection);
}
private void reportTunnel(Tunnel tu, boolean hasError) {
if (tunnel == null) { if (tunnel == null) {
tunnel = vr.createSubSection("Tunnel"); tunnel = vr.createSubSection("Tunnel");
} }
Section tSection = tunnel.createSubSection(co.getGmlId().getGmlString()); Section tSection = tunnel.createSubSection(tu.getGmlId().getGmlString());
sectionMap.put(co.getGmlId().getGmlString(), tSection); sectionMap.put(tu.getGmlId().getGmlString(), tSection);
if (hasError) { if (hasError) {
numErrorTunnel++; numErrorTunnel++;
tSection.setHeadlineColor(ERROR_COLOR); tSection.setHeadlineColor(ERROR_COLOR);
...@@ -343,17 +404,25 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -343,17 +404,25 @@ public class PdfStreamReporter implements StreamReporter {
numOkTunnel++; numOkTunnel++;
tSection.setHeadlineColor(OK_COLOR); tSection.setHeadlineColor(OK_COLOR);
} }
writeErrorForCityObject(co, tSection); writeCheckResultForAbstractTunnel(tu, tSection);
Tunnel t = (Tunnel) co; for (TunnelPart tp : tu.getTunnelParts()) {
writeCheckResultForAbstractTunnel(t, tSection); if (containsError(tp)) {
numErrorTunnel++;
} else {
numOkTunnel++;
}
sectionMap.put(tp.getGmlId().getGmlString(), tSection);
writeCheckResultForAbstractTunnel(tp, tSection);
} }
private void reportCityFurniture(CityObject co, boolean hasError) { }
private void reportCityFurniture(CityFurniture cf, boolean hasError) {
if (cityFurniture == null) { if (cityFurniture == null) {
cityFurniture = vr.createSubSection("CityFurniture"); cityFurniture = vr.createSubSection("City furniture");
} }
Section cfSection = cityFurniture.createSubSection(co.getGmlId().getGmlString()); Section cfSection = cityFurniture.createSubSection(cf.getGmlId().getGmlString());
sectionMap.put(co.getGmlId().getGmlString(), cfSection); sectionMap.put(cf.getGmlId().getGmlString(), cfSection);
if (hasError) { if (hasError) {
numErrorCityFurniture++; numErrorCityFurniture++;
cfSection.setHeadlineColor(ERROR_COLOR); cfSection.setHeadlineColor(ERROR_COLOR);
...@@ -361,15 +430,16 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -361,15 +430,16 @@ public class PdfStreamReporter implements StreamReporter {
numOkCityFurniture++; numOkCityFurniture++;
cfSection.setHeadlineColor(OK_COLOR); cfSection.setHeadlineColor(OK_COLOR);
} }
writeErrorForCityObject(co, cfSection); writeErrorForCityObject(cf, cfSection);
writeCheckResultForBoundedSpace(cf, cfSection);
} }
private void reportGenericCityObject(CityObject co, boolean hasError) { private void reportGenericCityObject(GenericCityObject gc, boolean hasError) {
if (genericCityObject == null) { if (genericCityObject == null) {
genericCityObject = vr.createSubSection("GenericCityObject"); genericCityObject = vr.createSubSection("Generic CityObjects");
} }
Section gcSection = genericCityObject.createSubSection(co.getGmlId().getGmlString()); Section gcSection = genericCityObject.createSubSection(gc.getGmlId().getGmlString());
sectionMap.put(co.getGmlId().getGmlString(), gcSection); sectionMap.put(gc.getGmlId().getGmlString(), gcSection);
if (hasError) { if (hasError) {
numErrorGenericCityObject++; numErrorGenericCityObject++;
gcSection.setHeadlineColor(ERROR_COLOR); gcSection.setHeadlineColor(ERROR_COLOR);
...@@ -377,175 +447,127 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -377,175 +447,127 @@ public class PdfStreamReporter implements StreamReporter {
numOkGenericCityObject++; numOkGenericCityObject++;
gcSection.setHeadlineColor(OK_COLOR); gcSection.setHeadlineColor(OK_COLOR);
} }
writeErrorForCityObject(co, gcSection); writeErrorForCityObject(gc, gcSection);
writeCheckResultForBoundedSpace(gc, gcSection);
} }
private void writeCheckResultForInstallation(Installation bi, Section root) { private void reportOtherConstructionObject(OtherConstructionObject oc, boolean hasError) {
Map<CheckId, CheckResult> results = bi.getAllCheckResults(); if (otherConstruction == null) {
writeCheckResults(results.values(), root); otherConstruction = vr.createSubSection("Other construction objects");
for (BoundarySurface bs : bi.getBoundarySurfaces()) { }
writeCheckResultForBoundarySurface(bs, root); Section ocSection = otherConstruction.createSubSection(oc.getGmlId().getGmlString());
sectionMap.put(oc.getGmlId().getGmlString(), ocSection);
if (hasError) {
numErrorOtherConstruction++;
ocSection.setHeadlineColor(ERROR_COLOR);
} else {
numOkOtherConstruction++;
ocSection.setHeadlineColor(OK_COLOR);
} }
writeErrorForCityObject(oc, ocSection);
writeCheckResultForBoundedSpace(oc, ocSection);
} }
private void writeCheckResultForAbstractBuilding(AbstractBuilding ab, Section root) { private void writeCheckResultForInstallation(Installation bi, Section root) {
Map<CheckId, CheckResult> results = ab.getAllCheckResults(); Map<CheckId, CheckResult> results = bi.getAllCheckResults();
writeCheckResults(results.values(), root); writeCheckResults(results.values(), root);
for (Geometry geom : ab.getGeometries()) { writeCheckResultForBoundedSpace(bi, root);
writeCheckResultForGeometry(geom, root);
}
for (AbstractRoom ar : ab.getBuildingRooms()) {
writeCheckResultForRoom(ar, root);
}
for (AbstractFurniture af : ab.getBuildingRoomFurnitureList()) {
writeCheckResultForAbstractFurniture(af, root);
} }
for (Storey s : ab.getBuildingStoreys()) {
writeCheckResultForStorey(s, root); private void writeCheckResultForBoundedSpace(BoundedSpace space, Section root) {
} for (BoundarySurface bs: space.getBoundarySurfaces()) {
for (BuildingUnit bu : ab.getBuildingUnits()) {
writeCheckResultForBuildingUnit(bu, root);
}
for (BoundarySurface bs : ab.getBoundarySurfaces()) {
writeCheckResultForBoundarySurface(bs, root); writeCheckResultForBoundarySurface(bs, root);
} }
for (Installation bi : ab.getBuildingInstallations()) {
writeCheckResultForInstallation(bi, root);
}
} }
private void writeCheckResultForBridgeObject(BridgeObject bo, Section root) { private void writeCheckResultForConstructionObject(ConstructionObject con, Section root) {
Map<CheckId, CheckResult> results = bo.getAllCheckResults(); writeCheckResultForBoundedSpace(con, root);
writeCheckResults(results.values(), root); for (BoundarySurface bs : con.getBoundarySurfaces()) {
for (BridgeObject part : bo.getParts()) { writeCheckResultForBoundarySurface(bs, root);
if (containsError(part)) {
numErrorBridge++;
} else {
numOkBridge++;
}
sectionMap.put(bo.getGmlId().getGmlString(), root);
writeCheckResultForBridgeObject(part, root);
}
for (Geometry geom : bo.getGeometries()) {
writeCheckResultForGeometry(geom, root);
} }
for (AbstractRoom ar : bo.getBridgeRooms()) { for (AbstractRoom ar : con.getRooms()) {
writeCheckResultForRoom(ar, root); writeCheckResultForRoom(ar, root);
} }
for (AbstractFurniture af : bo.getBridgeFurniture()) { for (AbstractFurniture af : con.getFurniture()) {
writeCheckResultForAbstractFurniture(af, root); writeCheckResultForAbstractFurniture(af, root);
} }
for (BridgeConstructiveElement bce : bo.getConstructiveElements()) { for (AbstractConstructiveElement ace: con.getConstructiveElements()){
writeCheckResultForBridgeConstructiveElement(bce, root); writeCheckResultForAbstractConstructiveElement(ace, root);
}
for (BoundarySurface bs : bo.getBoundarySurfaces()) {
writeCheckResultForBoundarySurface(bs, root);
} }
for (Installation bi : bo.getBridgeInstallations()) { for (Installation inst : con.getInstallations()) {
writeCheckResultForInstallation(bi, root); writeCheckResultForInstallation(inst, root);
} }
} }
private void writeCheckResultForStorey(Storey s, Section root) { private void writeCheckResultForAbstractConstructiveElement(AbstractConstructiveElement ace, Section root) {
Map<CheckId, CheckResult> results = s.getAllCheckResults(); Map<CheckId, CheckResult> results = ace.getAllCheckResults();
writeCheckResults(results.values(), root); writeCheckResults(results.values(), root);
for (Geometry geom : s.getGeometries()) { for (Geometry geom : ace.getGeometries()) {
writeCheckResultForGeometry(geom, root); writeCheckResultForGeometry(geom, root);
} }
for (AbstractRoom ar : s.getBuildingRooms()) { for (AbstractConstructiveFillingElement fill : ace.getFillings()){
writeCheckResultForRoom(ar, root); writeCheckResultForFillingElement(fill, root);
}
for (BuildingUnit bu : s.getBuildingUnits()) {
writeCheckResultForBuildingUnit(bu, root);
}
for (AbstractFurniture af : s.getBuildingRoomFurnitureList()) {
writeCheckResultForAbstractFurniture(af, root);
}
for (BoundarySurface bs : s.getBoundarySurfaces()) {
writeCheckResultForBoundarySurface(bs, root);
}
for (Installation bi : s.getBuildingInstallations()) {
writeCheckResultForInstallation(bi, root);
} }
writeCheckResultForBoundedSpace(ace, root);
} }
private void writeCheckResultForBuildingUnit(BuildingUnit bu, Section root) { private void writeCheckResultForFillingElement(AbstractConstructiveFillingElement fill, Section root) {
Map<CheckId, CheckResult> results = bu.getAllCheckResults(); Map<CheckId, CheckResult> results = fill.getAllCheckResults();
writeCheckResults(results.values(), root); writeCheckResults(results.values(), root);
for (Geometry geom : bu.getGeometries()) { for (Geometry geom : fill.getGeometries()) {
writeCheckResultForGeometry(geom, root); writeCheckResultForGeometry(geom, root);
} }
for (AbstractRoom ar : bu.getBuildingRooms()) { writeCheckResultForBoundedSpace(fill, root);
writeCheckResultForRoom(ar, root);
} }
for (Storey s : bu.getStoreys()) {
private void writeCheckResultForAbstractBuilding(AbstractBuilding ab, Section root) {
writeErrorForCityObject(ab, root);
writeCheckResultForConstructionObject(ab, root);
for (Storey s : ab.getStoreys()) {
writeCheckResultForStorey(s, root); writeCheckResultForStorey(s, root);
} }
for (AbstractFurniture af : bu.getBuildingRoomFurnitureList()) { for (BuildingUnit bu : ab.getBuildingUnits()) {
writeCheckResultForAbstractFurniture(af, root); writeCheckResultForBuildingUnit(bu, root);
}
for (BoundarySurface bs : bu.getBoundarySurfaces()) {
writeCheckResultForBoundarySurface(bs, root);
}
for (Installation bi : bu.getBuildingInstallations()) {
writeCheckResultForInstallation(bi, root);
} }
} }
private void writeCheckResultForRelief(ReliefObject ro, Section root) {
private void writeCheckResultForAbstractTunnel(AbstractTunnel at, Section root) { writeErrorForCityObject(ro, root);
Map<CheckId, CheckResult> results = at.getAllCheckResults(); for(TinObject to: ro.getComponents()) {
writeCheckResults(results.values(), root); writeErrorForCityObject(to, root);
for (TunnelPart tp : at.getTunnelParts()) {
if (containsError(tp)) {
numErrorTunnel++;
} else {
numOkTunnel++;
}
sectionMap.put(tp.getGmlId().getGmlString(), root);
writeCheckResultForAbstractTunnel(tp, root);
}
for (Geometry geom : at.getGeometries()) {
writeCheckResultForGeometry(geom, root);
}
for (AbstractRoom ar : at.getTunnelHollows()) {
writeCheckResultForRoom(ar, root);
}
for (TunnelConstructiveElement te : at.getTunnelConstructiveElements()) {
writeCheckResultForTunnelConstructiveElement(te, root);
}
for (AbstractFurniture tf : at.getTunnelFurniture()) {
writeCheckResultForAbstractFurniture(tf, root);
} }
for (BoundarySurface bs : at.getBoundarySurfaces()) {
writeCheckResultForBoundarySurface(bs, root);
}
for (Installation bi : at.getTunnelInstallations()) {
writeCheckResultForInstallation(bi, root);
} }
private void writeCheckResultForAbstractBridgeObject(AbstractBridgeObject bo, Section root) {
writeErrorForCityObject(bo, root);
writeCheckResultForConstructionObject(bo, root);
} }
private void writeCheckResultForTunnelConstructiveElement(TunnelConstructiveElement te, Section root) { private void writeCheckResultForAbstractBuildingSubdivision(AbstractBuildingSubdivision abs, Section root) {
Map<CheckId, CheckResult> results = te.getAllCheckResults(); writeErrorForCityObject(abs, root);
writeCheckResults(results.values(), root); writeCheckResultForConstructionObject(abs, root);
for (Geometry geom : te.getGeometries()) {
writeCheckResultForGeometry(geom, root);
} }
for (BoundarySurface bs : te.getBoundarySurfaces()) {
writeCheckResultForBoundarySurface(bs, root); private void writeCheckResultForStorey(Storey s, Section root) {
writeCheckResultForAbstractBuildingSubdivision(s, root);
for (BuildingUnit bu : s.getBuildingUnits()) {
writeCheckResultForAbstractBuildingSubdivision(bu, root);
} }
} }
private void writeCheckResultForBridgeConstructiveElement(BridgeConstructiveElement bce, Section root) { private void writeCheckResultForBuildingUnit(BuildingUnit bu, Section root) {
Map<CheckId, CheckResult> results = bce.getAllCheckResults(); writeCheckResultForAbstractBuildingSubdivision(bu, root);
writeCheckResults(results.values(), root); for (Storey s : bu.getStoreys()) {
for (Geometry geom : bce.getGeometries()) { writeCheckResultForAbstractBuildingSubdivision(s, root);
writeCheckResultForGeometry(geom, root);
} }
for (BoundarySurface bs : bce.getBoundarySurfaces()) {
writeCheckResultForBoundarySurface(bs, root);
} }
private void writeCheckResultForAbstractTunnel(AbstractTunnel at, Section root) {
writeErrorForCityObject(at, root);
writeCheckResultForConstructionObject(at, root);
} }
private void writeErrorForCityObject(CityObject co, Section section) { private void writeErrorForCityObject(CityObject co, Section section) {
...@@ -557,35 +579,55 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -557,35 +579,55 @@ public class PdfStreamReporter implements StreamReporter {
} }
private void writeCheckResultForBoundarySurface(BoundarySurface bs, Section root) { private void writeCheckResultForBoundarySurface(BoundarySurface bs, Section root) {
Map<CheckId, CheckResult> results = bs.getAllCheckResults(); writeErrorForCityObject(bs, root);
writeCheckResults(results.values(), root);
for (Opening o : bs.getOpenings()) { for (Opening o : bs.getOpenings()) {
writeCheckResultForOpening(o, root); writeCheckResultForOpening(o, root);
} }
} }
private void writeCheckResultForAbstractFurniture(AbstractFurniture af, Section root) { private void writeCheckResultForAbstractFurniture(AbstractFurniture af, Section root) {
Map<CheckId, CheckResult> results = af.getAllCheckResults(); writeErrorForCityObject(af, root);
writeCheckResults(results.values(), root); writeCheckResultForBoundedSpace(af, root);
for (Geometry geom : af.getGeometries()) {
writeCheckResultForGeometry(geom, root);
} }
for (BoundarySurface bs : af.getBoundarySurfaces()) {
writeCheckResultForBoundarySurface(bs, root); private void writeCheckResultForRoom(AbstractRoom ar, Section root) {
writeErrorForCityObject(ar, root);
writeCheckResultForBoundedSpace(ar, root);
for (Installation in : ar.getInstallations()) {
writeCheckResultForInstallation(in, root);
} }
} }
private void writeCheckResultForRoom(AbstractRoom ar, Section root) { private void writeCheckResultForTransportationObject(TransportationObject to, Section root) {
Map<CheckId, CheckResult> results = ar.getAllCheckResults(); writeErrorForCityObject(to, root);
writeCheckResults(results.values(), root); writeCheckResultForBoundedSpace(to, root);
for (Geometry geom : ar.getGeometries()) {
writeCheckResultForGeometry(geom, root);
} }
for (Installation in : ar.getRoomInstallations()) {
writeCheckResultForInstallation(in, root); private void writeCheckResultForTopLevelTransport(TopLevelTransportFeature top, Section root) {
writeCheckResultForTransportationSpace(top, root);
for(TransportationSpace ts : top.getSections()){
writeCheckResultForTransportationSpace(ts, root);
} }
for (BoundarySurface bs : ar.getBoundarySurfaces()) { for(TransportationSpace tis: top.getIntersections()){
writeCheckResultForBoundarySurface(bs, root); writeCheckResultForTransportationSpace(tis, root);
}
}
private void writeCheckResultForTransportationSpace(TransportationSpace ts, Section root) {
writeCheckResultForTransportationObject(ts, root);
for (TrafficSpaceObject tso : ts.getTrafficSpaces()) {
writeCheckResultForTrafficSpace(tso, root);
}
for (TrafficSpaceObject atso : ts.getAuxTrafficSpaces()){
writeCheckResultForTrafficSpace(atso, root);
}
}
private void writeCheckResultForTrafficSpace(TrafficSpaceObject tso, Section root) {
writeCheckResultForTransportationObject(tso, root);
for(TrafficAreaObject tao : tso.getTrafficAreas()){
writeCheckResultForTransportationObject(tao, root);
} }
} }
...@@ -667,6 +709,11 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -667,6 +709,11 @@ public class PdfStreamReporter implements StreamReporter {
statistics.addDistributionBar("Water Objects", numErrorWater, numOkWater); statistics.addDistributionBar("Water Objects", numErrorWater, numOkWater);
} }
int numRelief = numErrorRelief + numOkRelief;
if (numRelief > 0) {
statistics.addDistributionBar("Relief Objects", numErrorRelief, numOkRelief);
}
int numLand = numErrorLand + numOkLand; int numLand = numErrorLand + numOkLand;
if (numLand > 0) { if (numLand > 0) {
statistics.addDistributionBar("Land Objects", numErrorLand, numOkLand); statistics.addDistributionBar("Land Objects", numErrorLand, numOkLand);
...@@ -687,6 +734,11 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -687,6 +734,11 @@ public class PdfStreamReporter implements StreamReporter {
statistics.addDistributionBar("Generic City Objects", numErrorGenericCityObject, numOkGenericCityObject); statistics.addDistributionBar("Generic City Objects", numErrorGenericCityObject, numOkGenericCityObject);
} }
int numOtherConstructionObjects = numErrorOtherConstruction + numOkOtherConstruction;
if(numOtherConstructionObjects > 0) {
statistics.addDistributionBar("Other Construction", numErrorOtherConstruction, numOkOtherConstruction);
}
statistics.addTextElement("Error Statistics:"); statistics.addTextElement("Error Statistics:");
for (Entry<ErrorId, AtomicInteger> e : errorStatistics.entrySet()) { for (Entry<ErrorId, AtomicInteger> e : errorStatistics.entrySet()) {
statistics.add10PtTextElement(e.getKey().toString() + ": " + e.getValue().intValue(), 10); statistics.add10PtTextElement(e.getKey().toString() + ": " + e.getValue().intValue(), 10);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment