Commit ee31573f authored by Luna Riegel's avatar Luna Riegel
Browse files

Perf: Add intermediate clean up of Geometries

parent 3311849f
...@@ -318,6 +318,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -318,6 +318,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
} }
BuildingPart part = new BuildingPart(cdBuilding); BuildingPart part = new BuildingPart(cdBuilding);
mapAbstractBuilding(bpProp.getObject(), part); mapAbstractBuilding(bpProp.getObject(), part);
finishCityObjectConstruction(part);
cdBuilding.addBuildingPart(part); cdBuilding.addBuildingPart(part);
} }
finishFeatureConstruction(cdBuilding); finishFeatureConstruction(cdBuilding);
...@@ -408,6 +409,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -408,6 +409,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
relief.getTin().getObject().accept(tinMapper); relief.getTin().getObject().accept(tinMapper);
Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, reliefLod, Orientation.OUTWARD); Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, reliefLod, Orientation.OUTWARD);
tinMapper.getPolygons().forEach(geom::addPolygon); tinMapper.getPolygons().forEach(geom::addPolygon);
finishCityObjectConstruction(reliefObject);
to.addGeometry(geom); to.addGeometry(geom);
} }
...@@ -483,6 +485,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -483,6 +485,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
} }
BridgeObjectPart bPart = new BridgeObjectPart(gmlPart); BridgeObjectPart bPart = new BridgeObjectPart(gmlPart);
mapAbstractBridge(gmlPart, bPart); mapAbstractBridge(gmlPart, bPart);
finishCityObjectConstruction(bPart);
bo.addBridgePart(bPart); bo.addBridgePart(bPart);
} }
finishFeatureConstruction(bo); finishFeatureConstruction(bo);
...@@ -518,6 +521,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -518,6 +521,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
continue; continue;
} }
BridgeConstructiveElement cdEle = parseBridgeConstructiveElement(gmlBce); BridgeConstructiveElement cdEle = parseBridgeConstructiveElement(gmlBce);
finishCityObjectConstruction(cdEle);
elements.add(cdEle); elements.add(cdEle);
} }
return elements; return elements;
...@@ -531,6 +535,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -531,6 +535,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
continue; continue;
} }
Installation inst = parseBridgeInstallation(gmlBce); Installation inst = parseBridgeInstallation(gmlBce);
finishCityObjectConstruction(inst);
installations.add(inst); installations.add(inst);
} }
return installations; return installations;
...@@ -544,6 +549,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -544,6 +549,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
continue; continue;
} }
BridgeRoom room = parseBridgeRoom(gmlRoom); BridgeRoom room = parseBridgeRoom(gmlRoom);
finishCityObjectConstruction(room);
rooms.add(room); rooms.add(room);
} }
return rooms; return rooms;
...@@ -557,6 +563,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -557,6 +563,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
continue; continue;
} }
BridgeRoomFurniture furn = parseBridgeFurniture(gmlFurn); BridgeRoomFurniture furn = parseBridgeFurniture(gmlFurn);
finishCityObjectConstruction(furn);
rooms.add(furn); rooms.add(furn);
} }
return rooms; return rooms;
...@@ -629,9 +636,9 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -629,9 +636,9 @@ public class Citygml3FeatureMapper extends ObjectWalker {
TunnelPart cdTunnelPart = new TunnelPart(); TunnelPart cdTunnelPart = new TunnelPart();
cdTunnelPart.setParent(cdTunnel); cdTunnelPart.setParent(cdTunnel);
mapAbstractTunnel(gmlTunnelpart, cdTunnelPart); mapAbstractTunnel(gmlTunnelpart, cdTunnelPart);
finishCityObjectConstruction(cdTunnelPart);
cdTunnel.addTunnelPart(cdTunnelPart); cdTunnel.addTunnelPart(cdTunnelPart);
} }
finishFeatureConstruction(cdTunnel); finishFeatureConstruction(cdTunnel);
model.addTunnel(cdTunnel); model.addTunnel(cdTunnel);
...@@ -667,6 +674,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -667,6 +674,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
continue; continue;
} }
TunnelConstructiveElement tc = parseTunnelConstructiveElement(gmlTc); TunnelConstructiveElement tc = parseTunnelConstructiveElement(gmlTc);
finishCityObjectConstruction(tc);
elements.add(tc); elements.add(tc);
} }
return elements; return elements;
...@@ -680,6 +688,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -680,6 +688,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
continue; continue;
} }
TunnelFurniture tf = parseTunnelFurniture(gmlTf); TunnelFurniture tf = parseTunnelFurniture(gmlTf);
finishCityObjectConstruction(tf);
furniture.add(tf); furniture.add(tf);
} }
return furniture; return furniture;
...@@ -693,6 +702,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -693,6 +702,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
continue; continue;
} }
TunnelHollow br = parseTunnelHollow(gmlTh); TunnelHollow br = parseTunnelHollow(gmlTh);
finishCityObjectConstruction(br);
hollows.add(br); hollows.add(br);
} }
return hollows; return hollows;
...@@ -707,6 +717,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -707,6 +717,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
continue; continue;
} }
Installation ti = parseTunnelInstallation(gmlTi); Installation ti = parseTunnelInstallation(gmlTi);
finishCityObjectConstruction(ti);
installations.add(ti); installations.add(ti);
} }
return installations; return installations;
...@@ -889,12 +900,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -889,12 +900,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
private void finishFeatureConstruction(CityObject co) { private void finishFeatureConstruction(CityObject co) {
resolveAndClearReferences(co); resolveAndClearReferences(co);
co.accept(new CheckableUtilsVisitor() { finishCityObjectConstruction(co);
@Override
public void check(CityObject co) {
finishCityObjectConstruction(co);
}
});
co.setBbox(BoundingBox.of(co)); co.setBbox(BoundingBox.of(co));
} }
...@@ -912,6 +918,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -912,6 +918,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
if (tsp.isSetObject()) { if (tsp.isSetObject()) {
TrafficSpaceObject tso = new TrafficSpaceObject(TrafficSpaceObject.TrafficSpaceType.TRAFFIC_SPACE); TrafficSpaceObject tso = new TrafficSpaceObject(TrafficSpaceObject.TrafficSpaceType.TRAFFIC_SPACE);
mapTrafficSpace(tsp.getObject(), tso); mapTrafficSpace(tsp.getObject(), tso);
finishFeatureConstruction(tso);
trsp.addTrafficSpace(tso); trsp.addTrafficSpace(tso);
} }
} }
...@@ -919,6 +926,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -919,6 +926,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
if (atsp.isSetObject()) { if (atsp.isSetObject()) {
TrafficSpaceObject atso = new TrafficSpaceObject(TrafficSpaceObject.TrafficSpaceType.AUXILIARY_TRAFFIC_SPACE); TrafficSpaceObject atso = new TrafficSpaceObject(TrafficSpaceObject.TrafficSpaceType.AUXILIARY_TRAFFIC_SPACE);
mapAuxiliaryTrafficSpace(atsp.getObject(), atso); mapAuxiliaryTrafficSpace(atsp.getObject(), atso);
finishFeatureConstruction(atso);
trsp.addAuxTrafficSpace(atso); trsp.addAuxTrafficSpace(atso);
} }
} }
...@@ -955,6 +963,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -955,6 +963,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
TrafficArea area = (TrafficArea) boundary.getObject(); TrafficArea area = (TrafficArea) boundary.getObject();
TrafficAreaObject tao = new TrafficAreaObject(TrafficAreaObject.TrafficAreaType.TRAFFIC_AREA); TrafficAreaObject tao = new TrafficAreaObject(TrafficAreaObject.TrafficAreaType.TRAFFIC_AREA);
mapTrafficArea(area, tao); mapTrafficArea(area, tao);
finishFeatureConstruction(tao);
tso.addTrafficArea(tao); tso.addTrafficArea(tao);
} }
} }
...@@ -968,6 +977,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -968,6 +977,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
AuxiliaryTrafficArea area = (AuxiliaryTrafficArea) boundary.getObject(); AuxiliaryTrafficArea area = (AuxiliaryTrafficArea) boundary.getObject();
TrafficAreaObject tao = new TrafficAreaObject(TrafficAreaObject.TrafficAreaType.AUXILIARY_TRAFFIC_AREA); TrafficAreaObject tao = new TrafficAreaObject(TrafficAreaObject.TrafficAreaType.AUXILIARY_TRAFFIC_AREA);
mapAuxiliaryTrafficArea(area, tao); mapAuxiliaryTrafficArea(area, tao);
finishFeatureConstruction(tao);
tso.addTrafficArea(tao); tso.addTrafficArea(tao);
} }
} }
...@@ -1164,6 +1174,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -1164,6 +1174,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
continue; continue;
} }
BuildingRoomFurniture bf = parseBuildingFurniture(gmlBf); BuildingRoomFurniture bf = parseBuildingFurniture(gmlBf);
finishCityObjectConstruction(bf);
furnitureList.add(bf); furnitureList.add(bf);
} }
return furnitureList; return furnitureList;
...@@ -1241,6 +1252,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -1241,6 +1252,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
} else { } else {
cdBce = parseBuildingConstructiveElement(gmlBce); cdBce = parseBuildingConstructiveElement(gmlBce);
} }
finishCityObjectConstruction(cdBce);
abs.addConstructiveElement(cdBce); abs.addConstructiveElement(cdBce);
} }
for(BuildingRoomProperty brProp: gmlObject.getBuildingRooms()) { for(BuildingRoomProperty brProp: gmlObject.getBuildingRooms()) {
...@@ -1254,8 +1266,10 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -1254,8 +1266,10 @@ public class Citygml3FeatureMapper extends ObjectWalker {
} else { } else {
cdBr = parseBuildingRoom(gmlBR); cdBr = parseBuildingRoom(gmlBR);
} }
finishCityObjectConstruction(cdBr);
abs.addRoom(cdBr); abs.addRoom(cdBr);
} }
finishCityObjectConstruction(abs);
} }
} }
...@@ -1268,6 +1282,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -1268,6 +1282,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
} }
de.hft.stuttgart.citydoctor2.datastructure.BuildingConstructiveElement cdBce = de.hft.stuttgart.citydoctor2.datastructure.BuildingConstructiveElement cdBce =
parseBuildingConstructiveElement(gmlBCE); parseBuildingConstructiveElement(gmlBCE);
finishCityObjectConstruction(cdBce);
elements.add(cdBce); elements.add(cdBce);
} }
return elements; return elements;
...@@ -1290,6 +1305,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -1290,6 +1305,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
continue; continue;
} }
BuildingRoom br = parseBuildingRoom(gmlBr); BuildingRoom br = parseBuildingRoom(gmlBr);
finishCityObjectConstruction(br);
rooms.add(br); rooms.add(br);
} }
return rooms; return rooms;
...@@ -1304,6 +1320,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -1304,6 +1320,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
continue; continue;
} }
Installation bi = parseBuildingInstallation(gmlBi); Installation bi = parseBuildingInstallation(gmlBi);
finishCityObjectConstruction(bi);
installations.add(bi); installations.add(bi);
} }
return installations; return installations;
......
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