Commit 3f3f5672 authored by Riegel's avatar Riegel
Browse files

Refactor: Implement prepareForChecking with Visitor

parent 67214f92
......@@ -92,7 +92,9 @@ public abstract class Checkable implements Serializable {
* method has been enabled. This should create edges and additional meta
* information necessary to perform checks.
*/
public abstract void prepareForChecking();
public void prepareForChecking() {
this.accept(new PrepareForCheckingVisitor());
}
/**
* This should be called after checking has been done. This should remove any
......
......@@ -387,29 +387,6 @@ public abstract class AbstractBuilding extends CityObject {
return buildingUnits;
}
@Override
public void prepareForChecking() {
super.prepareForChecking();
for (Installation bi : buildingInstallations) {
bi.prepareForChecking();
}
for (BoundarySurface bs : boundarySurfaceList) {
bs.prepareForChecking();
}
for (BuildingRoom br : buildingRooms) {
br.prepareForChecking();
}
for (BuildingRoomFurniture bfr : buildingRoomFurnitureList) {
bfr.prepareForChecking();
}
for (Storey storey : buildingStoreys) {
storey.prepareForChecking();
}
for (BuildingUnit bu : buildingUnits) {
bu.prepareForChecking();
}
}
@Override
public void clearMetaInformation() {
super.clearMetaInformation();
......
......@@ -302,22 +302,6 @@ public abstract class AbstractBuildingSubdivision extends CityObject {
return buildingRoomFurnitureList;
}
@Override
public void prepareForChecking() {
super.prepareForChecking();
for (Installation bi : buildingInstallations) {
bi.prepareForChecking();
}
for (BoundarySurface bs : boundarySurfaceList) {
bs.prepareForChecking();
}
for (BuildingRoom br : buildingRooms) {
br.prepareForChecking();
}
for (BuildingRoomFurniture bfr : buildingRoomFurnitureList) {
bfr.prepareForChecking();
}
}
@Override
public void clearMetaInformation() {
......
......@@ -183,14 +183,6 @@ public abstract class AbstractFurniture extends CityObject {
}
@Override
public void prepareForChecking() {
super.prepareForChecking();
for (BoundarySurface boundarySurface : boundarySurfaceList) {
boundarySurface.prepareForChecking();
}
}
@Override
public void clearMetaInformation() {
super.clearMetaInformation();
......
......@@ -175,17 +175,6 @@ public abstract class AbstractRoom extends CityObject {
cgmlRoom.setLod3Solid(null);
}
@Override
public void prepareForChecking() {
super.prepareForChecking();
for (Installation roomInstallation : roomInstallations) {
roomInstallation.prepareForChecking();
}
for (BoundarySurface boundarySurface : boundarySurfaceList) {
boundarySurface.prepareForChecking();
}
}
@Override
public void clearMetaInformation() {
super.clearMetaInformation();
......
......@@ -368,28 +368,6 @@ public abstract class AbstractTunnel extends CityObject {
return tunnelConstructiveElements;
}
@Override
public void prepareForChecking() {
super.prepareForChecking();
for (Installation bi : tunnelInstallations) {
bi.prepareForChecking();
}
for (BoundarySurface bs : boundarySurfaceList) {
bs.prepareForChecking();
}
for (TunnelHollow th : tunnelHollows) {
th.prepareForChecking();
}
for (TunnelFurniture tfr : tunnelFurnitureList) {
tfr.prepareForChecking();
}
for (TunnelConstructiveElement te : tunnelConstructiveElements) {
te.prepareForChecking();
}
for (TunnelPart tp : tunnelParts) {
tp.prepareForChecking();
}
}
@Override
public void clearMetaInformation() {
......
......@@ -256,13 +256,6 @@ public class BoundarySurface extends CityObject {
opening.setPartOfSurface(this);
}
@Override
public void prepareForChecking() {
super.prepareForChecking();
for (Opening o : openings) {
o.prepareForChecking();
}
}
@Override
public void clearMetaInformation() {
......
......@@ -274,13 +274,6 @@ public class BridgeConstructiveElement extends CityObject {
return boundarySurfaceList;
}
@Override
public void prepareForChecking() {
super.prepareForChecking();
for (BoundarySurface bs : boundarySurfaceList) {
bs.prepareForChecking();
}
}
@Override
public void clearMetaInformation() {
......
......@@ -415,32 +415,6 @@ public class BridgeObject extends CityObject {
return "BridgeObject [type=" + type + ", id=" + getGmlId() + "]";
}
@Override
public void prepareForChecking() {
super.prepareForChecking();
for (BridgeConstructiveElement e : elements) {
e.prepareForChecking();
}
for (BridgeObject part : parts) {
part.prepareForChecking();
}
for (BoundarySurface bs : boundarySurfaces) {
bs.prepareForChecking();
}
for (Installation bi : bridgeInstallations) {
bi.prepareForChecking();
}
for (BridgeObject part : parts) {
part.prepareForChecking();
}
for (BridgeRoom br : bridgeRooms) {
br.prepareForChecking();
}
for (BridgeRoomFurniture bri : bridgeFurniture) {
bri.prepareForChecking();
}
}
@Override
public void clearMetaInformation() {
......
......@@ -146,14 +146,6 @@ public class Building extends AbstractBuilding {
}
}
@Override
public void prepareForChecking() {
super.prepareForChecking();
for (BuildingPart part : buildingParts) {
part.prepareForChecking();
}
}
@Override
public void fillValues(Copyable original, CopyHandler handler) {
super.fillValues(original, handler);
......
......@@ -86,14 +86,6 @@ public class BuildingUnit extends AbstractBuildingSubdivision {
return false;
}
@Override
public void prepareForChecking() {
super.prepareForChecking();
for (Storey storey : storeys) {
storey.prepareForChecking();
}
}
@Override
public void clearMetaInformation() {
super.clearMetaInformation();
......
......@@ -202,13 +202,6 @@ public abstract class CityObject extends GmlElement {
return null;
}
@Override
public void prepareForChecking() {
for (Geometry geom : geometryList) {
geom.prepareForChecking();
}
}
@Override
public void clearMetaInformation() {
for (Geometry geom : geometryList) {
......
......@@ -195,7 +195,6 @@ public class ConcretePolygon extends Polygon {
lr.accept(c);
}
}
setValidated(true);
}
@Override
......@@ -479,8 +478,8 @@ public class ConcretePolygon extends Polygon {
}
@Override
public void prepareForChecking() {
parent.prepareForChecking();
public void prepareLowMemoryUsageMode() {
parent.updateEdgesAndVertices();
}
@Override
......
......@@ -165,14 +165,6 @@ public class GenericCityObject extends CityObject {
return false;
}
@Override
public void prepareForChecking() {
super.prepareForChecking();
for (BoundarySurface bs : boundarySurfaceList) {
bs.prepareForChecking();
}
}
@Override
public void clearMetaInformation() {
super.clearMetaInformation();
......
......@@ -378,10 +378,6 @@ public class Geometry extends GmlElement {
return false;
}
@Override
public void prepareForChecking() {
updateEdgesAndVertices();
}
@Override
public void clearMetaInformation() {
......
......@@ -82,11 +82,6 @@ public class ImplicitGeometryHolder extends Geometry {
return prototypeGeometry.containsAnyError();
}
@Override
public void prepareForChecking() {
this.updateEdgesAndVertices();
prototypeGeometry.prepareForChecking();
}
@Override
public boolean isValidated() {
......
......@@ -263,13 +263,6 @@ public class Installation extends CityObject {
}
}
@Override
public void prepareForChecking() {
super.prepareForChecking();
for (BoundarySurface bs : boundarySurfaces) {
bs.prepareForChecking();
}
}
@Override
public void fillValues(Copyable original, CopyHandler handler) {
......
......@@ -313,9 +313,8 @@ public class LinearRing extends GmlElement {
vertices.addAll(extRing);
}
@Override
public void prepareForChecking() {
parent.getParent().prepareForChecking();
public void prepareLowMemoryUsageMode() {
parent.prepareLowMemoryUsageMode();
}
@Override
......
......@@ -258,8 +258,8 @@ public class LinkedPolygon extends Polygon {
}
@Override
public void prepareForChecking() {
poly.prepareForChecking();
public void prepareLowMemoryUsageMode() {
poly.prepareLowMemoryUsageMode();
}
@Override
......
......@@ -80,6 +80,8 @@ public abstract class Polygon extends GmlElement {
public abstract ConcretePolygon getOriginal();
public abstract void prepareLowMemoryUsageMode();
public abstract void remove();
public abstract double getArea();
......
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