Commit 0d2e9fd5 authored by Riegel's avatar Riegel
Browse files

Merge branch 'dev' into 'master'

Version 3.17.2

See merge request !32
parents 491a5dfd e0e40fdd
Pipeline #11127 canceled with stage
package de.hft.stuttgart.citydoctor2.datastructure;
import de.hft.stuttgart.citydoctor2.check.Check;
import de.hft.stuttgart.citydoctor2.check.CheckError;
import de.hft.stuttgart.citydoctor2.check.CheckId;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
import de.hft.stuttgart.citydoctor2.utils.CopyHandler;
import de.hft.stuttgart.citydoctor2.utils.Copyable;
import org.citygml4j.core.model.deprecated.transportation.TransportationComplex;
import org.citygml4j.core.model.transportation.Railway;
import org.citygml4j.core.model.transportation.Road;
import org.citygml4j.core.model.transportation.Square;
import org.citygml4j.core.model.transportation.Track;
import org.citygml4j.core.model.transportation.Waterway;
import org.citygml4j.core.util.geometry.GeometryFactory;
import java.util.ArrayList;
import java.util.List;
......@@ -65,10 +59,12 @@ public class TopLevelTransportFeature extends TransportationSpace {
public void addSection(TransportSection section) {
sections.add(section);
section.setParent(this);
}
public void addIntersection(TransportSection section) {
intersections.add(section);
section.setParent(this);
}
public List<TransportSection> getSections() {
......@@ -79,78 +75,6 @@ public class TopLevelTransportFeature extends TransportationSpace {
return intersections;
}
@Override
public void reCreateGeometries(GeometryFactory factory, ParserConfiguration config) {
super.reCreateGeometries(factory, config);
for (TransportSection section : sections) {
section.reCreateGeometries(factory, config);
}
for (TransportSection section : intersections) {
section.reCreateGeometries(factory, config);
}
}
@Override
public boolean containsError(CheckId checkIdentifier) {
boolean hasError = super.containsError(checkIdentifier);
if (hasError) {
return true;
}
for (TransportSection section : sections) {
if (section.containsError(checkIdentifier)) {
return true;
}
}
for (TransportSection section : intersections) {
if (section.containsError(checkIdentifier)) {
return true;
}
}
return false;
}
@Override
public void clearAllContainedCheckResults() {
super.clearAllContainedCheckResults();
for (TransportSection section : sections) {
section.clearAllContainedCheckResults();
}
for (TransportSection section : intersections) {
section.clearAllContainedCheckResults();
}
}
@Override
public void collectContainedErrors(List<CheckError> errors) {
super.collectContainedErrors(errors);
for (TransportSection section : sections) {
section.collectContainedErrors(errors);
}
for (TransportSection section : intersections) {
section.collectContainedErrors(errors);
}
}
@Override
public boolean containsAnyError() {
boolean hasError = super.containsAnyError();
if (hasError) {
return true;
}
for (TransportSection section : sections) {
if (section.containsAnyError()) {
return true;
}
}
for (TransportSection section : intersections) {
if (section.containsAnyError()) {
return true;
}
}
return false;
}
@Override
public void accept(Check c) {
super.accept(c);
......@@ -165,78 +89,9 @@ public class TopLevelTransportFeature extends TransportationSpace {
}
}
@Override
public void unsetGmlGeometries() {
super.unsetGmlGeometries();
for (TransportSection section : sections) {
section.unsetGmlGeometries();
}
for (TransportSection section : intersections) {
section.unsetGmlGeometries();
}
}
@Override
public CityObject getTopLevelCityObject() {
return this;
}
@Override
public String toString() {
return "TopLevelTransportFeature [id=" + getGmlId() + "]";
}
@Override
public void prepareForChecking() {
super.prepareForChecking();
for (TransportSection section : sections) {
section.prepareForChecking();
}
for (TransportSection section : intersections) {
section.prepareForChecking();
}
}
@Override
public void clearMetaInformation() {
super.clearMetaInformation();
for (TransportSection section : sections) {
section.clearMetaInformation();
}
for (TransportSection section : intersections) {
section.clearMetaInformation();
}
}
@Override
public void collectInstances(CopyHandler handler) {
super.collectInstances(handler);
for (TransportSection section : sections) {
section.collectInstances(handler);
}
for (TransportSection section : intersections) {
section.collectInstances(handler);
}
}
@Override
public void fillValues(Copyable original, CopyHandler handler) {
super.fillValues(original, handler);
TransportationObject originalTo = (TransportationObject) original;
for (TransportSection section : sections) {
section.fillValues(originalTo, handler);
}
for (TransportSection section : intersections) {
section.fillValues(originalTo, handler);
}
}
@Override
public Copyable createCopyInstance() {
return new TopLevelTransportFeature(type);
}
}
......@@ -11,6 +11,9 @@ import org.xmlobjects.gml.model.geometry.aggregates.MultiSurfaceProperty;
public class TrafficAreaObject extends TransportationObject {
private TrafficSpaceObject parent;
public enum TrafficAreaType {
TRAFFIC_AREA, AUXILIARY_TRAFFIC_AREA
}
......@@ -24,7 +27,7 @@ public class TrafficAreaObject extends TransportationObject {
}
@Override
public void reCreateGeometries(GeometryFactory factory, ParserConfiguration config) {
public void rebuildGeometries(GeometryFactory factory, ParserConfiguration config) {
for (Geometry geom : getGeometries()) {
if (geom instanceof ImplicitGeometryHolder) {
continue;
......@@ -40,6 +43,7 @@ public class TrafficAreaObject extends TransportationObject {
AuxiliaryTrafficArea ata = (AuxiliaryTrafficArea) super.getGmlObject();
setMultiSurfaceAccordingToLod(ata, ms, geom.getLod());
break;
}
} else {
throw new IllegalStateException("Geometry in TransportationObject cannot be of type " + geom.getType()
......@@ -99,6 +103,8 @@ public class TrafficAreaObject extends TransportationObject {
switch (type) {
case TRAFFIC_AREA:
TrafficArea ta = (TrafficArea) super.getGmlObject();
ta.setLod0MultiSurface(null);
ta.setLod1MultiSurface(null);
ta.setLod2MultiSurface(null);
ta.setLod3MultiSurface(null);
ta.getDeprecatedProperties().setLod4MultiSurface(null);
......@@ -116,7 +122,15 @@ public class TrafficAreaObject extends TransportationObject {
@Override
public CityObject getTopLevelCityObject() {
return this;
return parent.getTopLevelCityObject();
}
public void setParent(TrafficSpaceObject parent) {
this.parent = parent;
}
public TrafficSpaceObject getParent() {
return parent;
}
@Override
......
package de.hft.stuttgart.citydoctor2.datastructure;
import de.hft.stuttgart.citydoctor2.check.Check;
import de.hft.stuttgart.citydoctor2.check.CheckError;
import de.hft.stuttgart.citydoctor2.check.CheckId;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
import de.hft.stuttgart.citydoctor2.utils.CityGmlUtils;
import de.hft.stuttgart.citydoctor2.utils.CopyHandler;
import de.hft.stuttgart.citydoctor2.utils.Copyable;
import org.citygml4j.core.model.core.AbstractSpace;
import org.citygml4j.core.util.geometry.GeometryFactory;
import org.xmlobjects.gml.model.geometry.aggregates.MultiSurface;
import org.xmlobjects.gml.model.geometry.aggregates.MultiSurfaceProperty;
import org.xmlobjects.gml.model.geometry.primitives.Solid;
import org.xmlobjects.gml.model.geometry.primitives.SolidProperty;
import java.util.ArrayList;
import java.util.List;
......@@ -19,6 +17,8 @@ public class TrafficSpaceObject extends TransportationObject {
private final List<TrafficAreaObject> trafficAreas = new ArrayList<>();
private TransportationSpace parent;
public enum TrafficSpaceType {
TRAFFIC_SPACE, AUXILIARY_TRAFFIC_SPACE
}
......@@ -37,20 +37,26 @@ public class TrafficSpaceObject extends TransportationObject {
public void addTrafficArea(TrafficAreaObject trafficAreaObject) {
trafficAreas.add(trafficAreaObject);
trafficAreaObject.setParent(this);
}
@Override
public void reCreateGeometries(GeometryFactory factory, ParserConfiguration config) {
public void rebuildGeometries(GeometryFactory factory, ParserConfiguration config) {
for (Geometry geom : getGeometries()) {
if (geom instanceof ImplicitGeometryHolder) {
continue;
}
MultiSurface ms = CityGmlUtils.createMultiSurface(geom, factory, config);
AbstractSpace ats = (AbstractSpace) super.getGmlObject();
setMultiSurfaceAccordingToLod(ats, ms, geom.getLod());
}
for (TrafficAreaObject tao : trafficAreas) {
tao.reCreateGeometries(factory, config);
if (geom.getType() == GeometryType.MULTI_SURFACE || geom.getType() == GeometryType.COMPOSITE_SURFACE) {
MultiSurface ms = CityGmlUtils.createMultiSurface(geom, factory, config);
setMultiSurfaceAccordingToLod(ats, ms, geom.getLod());
} else if (geom.getType() == GeometryType.SOLID) {
Solid solid = CityGmlUtils.createSolid(geom, factory, config);
setSolidAccordingtoLod(ats, solid, geom.getLod());
} else {
throw new IllegalArgumentException("Unsupported geometry type: " + geom.getType());
}
}
}
......@@ -66,52 +72,26 @@ public class TrafficSpaceObject extends TransportationObject {
ats.setLod3MultiSurface(new MultiSurfaceProperty(ms));
break;
default:
throw new IllegalStateException("cannot set geometry with LOD for AuxiliaryTrafficSpace: " + lod);
throw new IllegalStateException(String.format("Cannot set MultiSurface with LOD %s for " +
"[GML]AbstractSpace in TrafficSpaceObject ", lod));
}
}
@Override
public boolean containsError(CheckId checkIdentifier) {
boolean hasError = super.containsError(checkIdentifier);
if (hasError) {
return true;
}
for (TrafficAreaObject tao : trafficAreas) {
if (tao.containsError(checkIdentifier)) {
return true;
}
}
return false;
}
@Override
public void clearAllContainedCheckResults() {
super.clearAllContainedCheckResults();
for (TrafficAreaObject tao : trafficAreas) {
tao.clearAllContainedCheckResults();
}
}
@Override
public void collectContainedErrors(List<CheckError> errors) {
super.collectContainedErrors(errors);
for (TrafficAreaObject tao : trafficAreas) {
tao.collectContainedErrors(errors);
}
}
@Override
public boolean containsAnyError() {
boolean hasError = super.containsAnyError();
if (hasError) {
return true;
}
for (TrafficAreaObject tao : trafficAreas) {
if (tao.containsAnyError()) {
return true;
}
private void setSolidAccordingtoLod(AbstractSpace ats, Solid solid, Lod lod) {
switch (lod) {
case LOD1:
ats.setLod1Solid(new SolidProperty(solid));
break;
case LOD2:
ats.setLod2Solid(new SolidProperty(solid));
break;
case LOD3:
ats.setLod3Solid(new SolidProperty(solid));
break;
default:
throw new IllegalStateException(String.format("Cannot set MultiSurface with LOD %s for " +
"[GML]AbstractSpace in TrafficSpaceObject ", lod));
}
return false;
}
@Override
......@@ -131,60 +111,28 @@ public class TrafficSpaceObject extends TransportationObject {
ats.setLod0MultiSurface(null);
ats.setLod2MultiSurface(null);
ats.setLod3MultiSurface(null);
for (TrafficAreaObject tao : trafficAreas) {
tao.unsetGmlGeometries();
}
ats.setLod1Solid(null);
ats.setLod2Solid(null);
ats.setLod3Solid(null);
}
@Override
public CityObject getTopLevelCityObject() {
return this;
return parent.getTopLevelCityObject();
}
@Override
public String toString() {
return "TransportationSpaceObject [id=" + getGmlId() + "]";
public void setParent(TransportationSpace parent) {
this.parent = parent;
}
@Override
public void prepareForChecking() {
super.prepareForChecking();
for (TrafficAreaObject tao : trafficAreas) {
tao.prepareForChecking();
}
public TransportationSpace getParent() {
return parent;
}
@Override
public void clearMetaInformation() {
super.clearMetaInformation();
for (TrafficAreaObject tao : trafficAreas) {
tao.clearMetaInformation();
}
}
@Override
public void collectInstances(CopyHandler handler) {
super.collectInstances(handler);
for (TrafficAreaObject tao : trafficAreas) {
handler.addInstance(tao);
}
}
@Override
public void fillValues(Copyable original, CopyHandler handler) {
super.fillValues(original, handler);
TrafficSpaceObject originalTao = (TrafficSpaceObject) original;
for (TrafficAreaObject tao : originalTao.trafficAreas) {
trafficAreas.add(handler.getCopyInstance(tao));
}
super.setGmlObject(originalTao.getGmlObject());
}
@Override
public Copyable createCopyInstance() {
return new TrafficSpaceObject(null);
public String toString() {
return "TransportationSpaceObject [id=" + getGmlId() + "]";
}
}
......@@ -2,6 +2,8 @@ package de.hft.stuttgart.citydoctor2.datastructure;
public class TransportSection extends TransportationSpace {
private TopLevelTransportFeature parent;
public enum SectionType {
SECTION, INTERSECTION
}
......@@ -13,5 +15,17 @@ public class TransportSection extends TransportationSpace {
}
}
public void setParent(TopLevelTransportFeature parent) {
this.parent = parent;
}
public TopLevelTransportFeature getParent() {
return parent;
}
@Override
public CityObject getTopLevelCityObject() {
return parent.getTopLevelCityObject();
}
}
......@@ -18,21 +18,9 @@
*/
package de.hft.stuttgart.citydoctor2.datastructure;
import de.hft.stuttgart.citydoctor2.check.Check;
import de.hft.stuttgart.citydoctor2.check.CheckError;
import de.hft.stuttgart.citydoctor2.check.CheckId;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
import de.hft.stuttgart.citydoctor2.utils.CityGmlUtils;
import de.hft.stuttgart.citydoctor2.utils.CopyHandler;
import de.hft.stuttgart.citydoctor2.utils.Copyable;
import javafx.scene.paint.Color;
import org.citygml4j.core.model.core.AbstractCityObject;
import org.citygml4j.core.model.core.AbstractSpace;
import org.citygml4j.core.model.transportation.AbstractTransportationSpace;
import org.citygml4j.core.model.transportation.AuxiliaryTrafficArea;
import org.citygml4j.core.model.transportation.TrafficArea;
import org.citygml4j.core.util.geometry.GeometryFactory;
import org.xmlobjects.gml.model.geometry.aggregates.MultiSurface;
import org.xmlobjects.gml.model.geometry.aggregates.MultiSurfaceProperty;
import java.io.Serial;
import java.util.ArrayList;
......@@ -77,6 +65,17 @@ public abstract class TransportationObject extends CityObject {
return ato;
}
@Override
public Color getRenderColor() {
return switch (type) {
case TRACK -> Color.BROWN;
case WATERWAY -> Color.NAVY;
case SQUARE -> Color.DARKSLATEGRAY;
case AUXILLIARY_TRAFFIC_AREA, AUXILLIARY_TRAFFIC_SPACE -> Color.LIGHTSLATEGREY;
default -> Color.DIMGRAY;
};
}
public void setGmlObject(AbstractCityObject tc) {
ato = tc;
......@@ -92,17 +91,9 @@ public abstract class TransportationObject extends CityObject {
return "TransportationObject [id=" + getGmlId() + "]";
}
@Override
public void fillValues(Copyable original, CopyHandler handler) {
super.fillValues(original, handler);
TransportationObject originalTo = (TransportationObject) original;
ato = originalTo.ato;
}
@Override
public Copyable createCopyInstance() {
return null;
public String getDisplayText() {
return String.format("[%s] %s", this.type.name(), this.getGmlId().toString());
}
}
package de.hft.stuttgart.citydoctor2.datastructure;
import de.hft.stuttgart.citydoctor2.check.Check;
import de.hft.stuttgart.citydoctor2.check.CheckError;
import de.hft.stuttgart.citydoctor2.check.CheckId;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
import de.hft.stuttgart.citydoctor2.utils.CityGmlUtils;
import de.hft.stuttgart.citydoctor2.utils.CopyHandler;
import de.hft.stuttgart.citydoctor2.utils.Copyable;
import org.citygml4j.core.model.core.AbstractSpace;
import org.citygml4j.core.model.transportation.AbstractTransportationSpace;
import org.citygml4j.core.util.geometry.GeometryFactory;
import org.xmlobjects.gml.model.geometry.aggregates.MultiSurface;
import org.xmlobjects.gml.model.geometry.aggregates.MultiSurfaceProperty;
import org.xmlobjects.gml.model.geometry.primitives.Solid;
import org.xmlobjects.gml.model.geometry.primitives.SolidProperty;
import java.util.ArrayList;
import java.util.List;
......@@ -35,37 +33,42 @@ public abstract class TransportationSpace extends TransportationObject {
public void addTrafficSpace(TrafficSpaceObject t) {
trafficSpaces.add(t);
t.setParent(this);
}
public void addAuxTrafficSpace(TrafficSpaceObject t) {
auxTrafficSpaces.add(t);
t.setParent(this);
}
@Override
public void reCreateGeometries(GeometryFactory factory, ParserConfiguration config) {
public void rebuildGeometries(GeometryFactory factory, ParserConfiguration config) {
for (Geometry geom : getGeometries()) {
if (geom instanceof ImplicitGeometryHolder) {
continue;
}
if (geom.getType() == GeometryType.MULTI_SURFACE) {
MultiSurface ms = CityGmlUtils.createMultiSurface(geom, factory, config);
if (super.getGmlObject() instanceof AbstractTransportationSpace ats) {
if (super.getGmlObject() instanceof AbstractTransportationSpace ats) {
if (geom.getType() == GeometryType.MULTI_SURFACE || geom.getType() == GeometryType.COMPOSITE_SURFACE) {
MultiSurface ms = CityGmlUtils.createMultiSurface(geom, factory, config);
setMultiSurfaceAccordingToLod(ats, ms, geom.getLod());
} else if (geom.getType() == GeometryType.SOLID) {
Solid solid = CityGmlUtils.createSolid(geom, factory, config);
setSolidAccordingToLod(ats, solid, geom.getLod());
} else {
AbstractSpace as = (AbstractSpace) super.getGmlObject();
throw new IllegalArgumentException("Unsupported geometry type: " + geom.getType());
}
} else if (super.getGmlObject() instanceof AbstractSpace as) {
if (geom.getType() == GeometryType.MULTI_SURFACE || geom.getType() == GeometryType.COMPOSITE_SURFACE) {
MultiSurface ms = CityGmlUtils.createMultiSurface(geom, factory, config);
setMultiSurfaceAccordingToLod(as, ms, geom.getLod());
} else if (geom.getType() == GeometryType.SOLID) {
Solid solid = CityGmlUtils.createSolid(geom, factory, config);
setSolidAccordingToLod(as, solid, geom.getLod());
} else {
throw new IllegalArgumentException("Unsupported geometry type: " + geom.getType());
}
} else {
throw new IllegalStateException("Geometry in TransportationObject cannot be of type " + geom.getType()
+ ". Only MultiSurface allowed");
}
}
for (TrafficSpaceObject spaces : trafficSpaces) {
spaces.reCreateGeometries(factory, config);
}
for (TrafficSpaceObject spaces : auxTrafficSpaces) {
spaces.reCreateGeometries(factory, config);
}
}
private void setMultiSurfaceAccordingToLod(AbstractTransportationSpace ats, MultiSurface ms, Lod lod) {
......@@ -75,8 +78,8 @@ public abstract class TransportationSpace extends TransportationObject {
case LOD2 -> ats.setLod2MultiSurface(new MultiSurfaceProperty(ms));
case LOD3 -> ats.setLod3MultiSurface(new MultiSurfaceProperty(ms));
case LOD4 -> ats.getDeprecatedProperties().setLod4MultiSurface(new MultiSurfaceProperty(ms));
default ->
throw new IllegalStateException("cannot set geometry with LOD for AuxiliaryTrafficSpace: " + lod);
default -> throw new IllegalStateException(String.format("Cannot set MultiSurface with LOD %s for " +
"[GML]AbstractTransportationSpace in TransportationSpace ", lod));
}
}
......@@ -92,69 +95,29 @@ public abstract class TransportationSpace extends TransportationObject {
as.setLod3MultiSurface(new MultiSurfaceProperty(ms));
break;
default:
throw new IllegalStateException("cannot set geometry with LOD for AuxiliaryTrafficSpace: " + lod);
}
}
@Override
public boolean containsError(CheckId checkIdentifier) {
boolean hasError = super.containsError(checkIdentifier);
if (hasError) {
return true;
throw new IllegalStateException(String.format("Cannot set MultiSurface with LOD %s for [GML]AbstractSpace in TransportationSpace ", lod));
}
for (TrafficSpaceObject to : trafficSpaces) {
if (to.containsError(checkIdentifier)) {
return true;
}
}
for (TrafficSpaceObject to : auxTrafficSpaces) {
if (to.containsError(checkIdentifier)) {
return true;
}
}
return false;
}
@Override
public void clearAllContainedCheckResults() {
super.clearAllContainedCheckResults();
for (TrafficSpaceObject to : trafficSpaces) {
to.clearAllContainedCheckResults();
}
for (TrafficSpaceObject to : auxTrafficSpaces) {
to.clearAllContainedCheckResults();
}
}
@Override
public void collectContainedErrors(List<CheckError> errors) {
super.collectContainedErrors(errors);
for (TrafficSpaceObject to : trafficSpaces) {
to.collectContainedErrors(errors);
}
for (TrafficSpaceObject to : auxTrafficSpaces) {
to.collectContainedErrors(errors);
private void setSolidAccordingToLod(AbstractTransportationSpace ats, Solid solid, Lod lod) {
switch (lod) {
case LOD1 -> ats.setLod1Solid(new SolidProperty(solid));
case LOD2 -> ats.setLod2Solid(new SolidProperty(solid));
case LOD3 -> ats.setLod3Solid(new SolidProperty(solid));
default -> throw new IllegalStateException(String.format("Cannot set Solid with LOD %s for " +
"[GML]AbstractTransportationSpace in TransportationSpace ", lod));
}
}
@Override
public boolean containsAnyError() {
boolean hasError = super.containsAnyError();
if (hasError) {
return true;
}
for (TrafficSpaceObject to : trafficSpaces) {
if (to.containsAnyError()) {
return true;
}
}
for (TrafficSpaceObject to : auxTrafficSpaces) {
if (to.containsAnyError()) {
return true;
}
private void setSolidAccordingToLod(AbstractSpace ats, Solid solid, Lod lod) {
switch (lod) {
case LOD1 -> ats.setLod1Solid(new SolidProperty(solid));
case LOD2 -> ats.setLod2Solid(new SolidProperty(solid));
case LOD3 -> ats.setLod3Solid(new SolidProperty(solid));
default ->
throw new IllegalStateException(String.format("Cannot set Solid with LOD %s for [GML]AbstractSpace" +
" in TransportationSpace ", lod));
}
return false;
}
@Override
......@@ -178,12 +141,9 @@ public abstract class TransportationSpace extends TransportationObject {
ats.setLod0MultiSurface(null);
ats.setLod2MultiSurface(null);
ats.setLod3MultiSurface(null);
for (TrafficSpaceObject to : trafficSpaces) {
to.unsetGmlGeometries();
}
for (TrafficSpaceObject to : auxTrafficSpaces) {
to.unsetGmlGeometries();
}
ats.setLod1Solid(null);
ats.setLod2Solid(null);
ats.setLod3Solid(null);
}
@Override
......@@ -197,50 +157,4 @@ public abstract class TransportationSpace extends TransportationObject {
return "TransportationSpace [id=" + getGmlId() + "]";
}
@Override
public void prepareForChecking() {
super.prepareForChecking();
for (TrafficSpaceObject to : trafficSpaces) {
to.prepareForChecking();
}
for (TrafficSpaceObject to : auxTrafficSpaces) {
to.prepareForChecking();
}
}
@Override
public void clearMetaInformation() {
super.clearMetaInformation();
for (TrafficSpaceObject to : trafficSpaces) {
to.clearMetaInformation();
}
for (TrafficSpaceObject to : auxTrafficSpaces) {
to.clearMetaInformation();
}
}
@Override
public void collectInstances(CopyHandler handler) {
super.collectInstances(handler);
for (TrafficSpaceObject to : trafficSpaces) {
to.collectInstances(handler);
}
for (TrafficSpaceObject to : auxTrafficSpaces) {
to.collectInstances(handler);
}
}
@Override
public void fillValues(Copyable original, CopyHandler handler) {
super.fillValues(original, handler);
TransportationObject originalTo = (TransportationObject) original;
for (TrafficSpaceObject to : trafficSpaces) {
to.fillValues(originalTo, handler);
}
for (TrafficSpaceObject to : auxTrafficSpaces) {
to.fillValues(originalTo, handler);
}
}
}
package de.hft.stuttgart.citydoctor2.datastructure;
import de.hft.stuttgart.citydoctor2.utils.Copyable;
import java.io.Serial;
......@@ -13,9 +12,4 @@ public class TunnelFurniture extends AbstractFurniture {
super.setGmlObject(gmlObject);
}
@Override
public Copyable createCopyInstance() {
return new BuildingRoomFurniture();
}
}
package de.hft.stuttgart.citydoctor2.datastructure;
import de.hft.stuttgart.citydoctor2.utils.CopyHandler;
import de.hft.stuttgart.citydoctor2.utils.Copyable;
import javafx.scene.paint.Color;
import org.citygml4j.core.model.tunnel.TunnelFurnitureProperty;
import java.io.Serial;
......@@ -36,26 +35,13 @@ public class TunnelHollow extends AbstractRoom {
}
@Override
public void fillValues(Copyable original, CopyHandler handler) {
super.fillValues(original, handler);
TunnelHollow oHollow = (TunnelHollow) original;
parent = handler.getCopyInstance(oHollow.getParent());
public Color getRenderColor() {
return parent.getRenderColor();
}
@Override
public CityObject getTopLevelCityObject() {
return getParent().getTopLevelCityObject();
}
@Override
public void collectInstances(CopyHandler handler) {
super.collectInstances(handler);
handler.addInstance(parent);
return parent.getTopLevelCityObject();
}
@Override
public Copyable createCopyInstance() {
return new TunnelHollow();
}
}
package de.hft.stuttgart.citydoctor2.utils;
/**
* This Throwable signals that a requested CheckError was found.
*/
public class CheckErrorFound extends Throwable {
public CheckErrorFound() {
super("CheckError was found", null, true, false);
}
}
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