Commit d1ff5020 authored by Beuster's avatar Beuster
Browse files

Merge remote-tracking branch 'origin/dev' into dev_cpp_code_conversion

parents 06ad5a8e b50c5f13
Pipeline #11130 passed with stage
in 1 minute and 28 seconds
...@@ -18,12 +18,9 @@ ...@@ -18,12 +18,9 @@
*/ */
package de.hft.stuttgart.citydoctor2.datastructure; package de.hft.stuttgart.citydoctor2.datastructure;
import de.hft.stuttgart.citydoctor2.check.Check; import de.hft.stuttgart.citydoctor2.check.CheckableVisitor;
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.parser.ParserConfiguration;
import de.hft.stuttgart.citydoctor2.utils.CopyHandler; import javafx.scene.paint.Color;
import de.hft.stuttgart.citydoctor2.utils.Copyable;
import org.citygml4j.core.model.relief.ReliefFeature; import org.citygml4j.core.model.relief.ReliefFeature;
import org.citygml4j.core.util.geometry.GeometryFactory; import org.citygml4j.core.util.geometry.GeometryFactory;
...@@ -45,7 +42,7 @@ public class ReliefObject extends CityObject { ...@@ -45,7 +42,7 @@ public class ReliefObject extends CityObject {
} }
@Override @Override
public void accept(Check c) { public void accept(CheckableVisitor c) {
super.accept(c); super.accept(c);
if (c.canExecute(this)) { if (c.canExecute(this)) {
c.check(this); c.check(this);
...@@ -56,83 +53,7 @@ public class ReliefObject extends CityObject { ...@@ -56,83 +53,7 @@ public class ReliefObject extends CityObject {
} }
@Override @Override
public void collectInstances(CopyHandler handler) { public void rebuildGeometries(GeometryFactory factory, ParserConfiguration config) {
handler.addInstance(components);
}
@Override
public void fillValues(Copyable original, CopyHandler handler) {
super.fillValues(original, handler);
ReliefObject originalRelief = (ReliefObject) original;
for (TinObject tin : originalRelief.components) {
components.add(handler.getCopyInstance(tin));
}
}
@Override
public Copyable createCopyInstance() {
return new ReliefObject(feature);
}
@Override
public void prepareForChecking() {
for (TinObject component : components) {
component.prepareForChecking();
}
}
@Override
public void clearMetaInformation() {
for (TinObject component : components) {
component.clearMetaInformation();
}
}
@Override
public void clearAllContainedCheckResults() {
for (TinObject component : components) {
component.clearAllContainedCheckResults();
}
}
@Override
public void collectContainedErrors(List<CheckError> errors) {
super.collectContainedErrors(errors);
for (TinObject tin : components) {
tin.collectContainedErrors(errors);
}
}
@Override
public boolean containsAnyError() {
boolean containsError = super.containsAnyError();
if (containsError) {
return true;
}
for (TinObject tin : components) {
if (tin.containsAnyError()) {
return true;
}
}
return false;
}
@Override
public boolean containsError(CheckId checkIdentifier) {
boolean hasError = super.containsError(checkIdentifier);
if (hasError) {
return true;
}
for (TinObject tin : components) {
if (tin.containsError(checkIdentifier)) {
return true;
}
}
return false;
}
@Override
public void reCreateGeometries(GeometryFactory factory, ParserConfiguration config) {
// no geometries // no geometries
} }
...@@ -156,6 +77,15 @@ public class ReliefObject extends CityObject { ...@@ -156,6 +77,15 @@ public class ReliefObject extends CityObject {
return FeatureType.LAND; return FeatureType.LAND;
} }
@Override
public Color getRenderColor() {
return Color.TAN;
}
public void addComponent(TinObject component) {
components.add(component);
}
public List<TinObject> getComponents() { public List<TinObject> getComponents() {
return components; return components;
} }
......
package de.hft.stuttgart.citydoctor2.datastructure; package de.hft.stuttgart.citydoctor2.datastructure;
import de.hft.stuttgart.citydoctor2.check.Check; import de.hft.stuttgart.citydoctor2.check.CheckableVisitor;
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.parser.ParserConfiguration;
import de.hft.stuttgart.citydoctor2.utils.CopyHandler;
import de.hft.stuttgart.citydoctor2.utils.Copyable;
import org.citygml4j.core.util.geometry.GeometryFactory; import org.citygml4j.core.util.geometry.GeometryFactory;
import java.io.Serial; import java.io.Serial;
...@@ -19,113 +15,20 @@ public class Storey extends AbstractBuildingSubdivision { ...@@ -19,113 +15,20 @@ public class Storey extends AbstractBuildingSubdivision {
private final List<BuildingUnit> buildingUnits = new ArrayList<>(); private final List<BuildingUnit> buildingUnits = new ArrayList<>();
@Override
public Copyable createCopyInstance() {
return new Storey();
}
@Override
public void unsetGmlGeometries() {
super.unsetGmlGeometries();
for (BuildingUnit buildingUnit : buildingUnits) {
buildingUnit.unsetGmlGeometries();
}
}
@Override @Override
public void reCreateGeometries(GeometryFactory factory, ParserConfiguration config) { public void rebuildGeometries(GeometryFactory factory, ParserConfiguration config) {
super.reCreateGeometries(factory, config); super.reCreateGeometries(factory, config);
for (BuildingUnit buildingUnit : buildingUnits) {
buildingUnit.reCreateGeometries(factory, config);
}
} }
@Override @Override
public void accept(Check c) { public void accept(CheckableVisitor c) {
super.accept(c); super.accept(c);
for (BuildingUnit buildingUnit : buildingUnits) { for (BuildingUnit buildingUnit : buildingUnits) {
buildingUnit.accept(c); buildingUnit.accept(c);
} }
} }
@Override
public void collectContainedErrors(List<CheckError> errors) {
super.collectContainedErrors(errors);
for (BuildingUnit buildingUnit : buildingUnits) {
buildingUnit.collectContainedErrors(errors);
}
}
@Override
public void clearAllContainedCheckResults() {
super.clearAllContainedCheckResults();
for (BuildingUnit buildingUnit : buildingUnits) {
buildingUnit.clearAllContainedCheckResults();
}
}
@Override
public boolean containsError(CheckId checkIdentifier) {
boolean hasError = super.containsError(checkIdentifier);
if (hasError) {
return true;
}
for (BuildingUnit buildingUnit : buildingUnits) {
if (buildingUnit.containsError(checkIdentifier)) {
return true;
}
}
return false;
}
@Override
public boolean containsAnyError() {
boolean hasError = super.containsAnyError();
if (hasError) {
return true;
}
for (BuildingUnit buildingUnit : buildingUnits) {
if (buildingUnit.containsAnyError()) {
return true;
}
}
return false;
}
@Override
public void prepareForChecking() {
super.prepareForChecking();
for (BuildingUnit buildingUnit : buildingUnits) {
buildingUnit.prepareForChecking();
}
}
@Override
public void clearMetaInformation() {
super.clearMetaInformation();
for (BuildingUnit buildingUnit : buildingUnits) {
buildingUnit.clearMetaInformation();
}
}
@Override
public void collectInstances(CopyHandler handler) {
super.collectInstances(handler);
for (BuildingUnit buildingUnit : buildingUnits) {
buildingUnit.collectInstances(handler);
}
}
@Override
public void fillValues(Copyable original, CopyHandler handler) {
super.fillValues(original, handler);
Storey originalSt = (Storey) original;
for (BuildingUnit buildingUnit : originalSt.buildingUnits) {
buildingUnits.add(handler.getCopyInstance(buildingUnit));
}
this.abs = originalSt.abs;
}
public List<BuildingUnit> getBuildingUnits() { public List<BuildingUnit> getBuildingUnits() {
return buildingUnits; return buildingUnits;
} }
......
...@@ -18,12 +18,14 @@ ...@@ -18,12 +18,14 @@
*/ */
package de.hft.stuttgart.citydoctor2.datastructure; package de.hft.stuttgart.citydoctor2.datastructure;
import de.hft.stuttgart.citydoctor2.check.Check; import de.hft.stuttgart.citydoctor2.check.CheckableVisitor;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration; import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
import de.hft.stuttgart.citydoctor2.utils.CityGmlUtils; import de.hft.stuttgart.citydoctor2.utils.CityGmlUtils;
import javafx.scene.paint.Color;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.citygml4j.core.model.relief.TINRelief; import org.citygml4j.core.model.relief.TINRelief;
import org.citygml4j.core.model.relief.TinProperty;
import org.citygml4j.core.util.geometry.GeometryFactory; import org.citygml4j.core.util.geometry.GeometryFactory;
import org.xmlobjects.gml.model.geometry.primitives.AbstractRingProperty; import org.xmlobjects.gml.model.geometry.primitives.AbstractRingProperty;
import org.xmlobjects.gml.model.geometry.primitives.Triangle; import org.xmlobjects.gml.model.geometry.primitives.Triangle;
...@@ -48,20 +50,16 @@ public class TinObject extends CityObject { ...@@ -48,20 +50,16 @@ public class TinObject extends CityObject {
} }
@Override @Override
public void accept(Check c) { public void accept(CheckableVisitor c) {
super.accept(c); super.accept(c);
if (c.canExecute(this)) { if (c.canExecute(this)) {
c.check(this); c.check(this);
} }
} }
@Override
public TinObject createCopyInstance() {
return new TinObject(gmlRelief);
}
@Override @Override
public void reCreateGeometries(GeometryFactory factory, ParserConfiguration config) { public void rebuildGeometries(GeometryFactory factory, ParserConfiguration config) {
if (getGeometries().isEmpty()) { if (getGeometries().isEmpty()) {
return; return;
} }
...@@ -79,6 +77,8 @@ public class TinObject extends CityObject { ...@@ -79,6 +77,8 @@ public class TinObject extends CityObject {
t.setExterior(new AbstractRingProperty(CityGmlUtils.createGmlRing(factory, config, ring))); t.setExterior(new AbstractRingProperty(CityGmlUtils.createGmlRing(factory, config, ring)));
triangles.add(t); triangles.add(t);
} }
this.gmlRelief.setTin(new TinProperty(surface));
gmlRelief.setLod(geom.getLod().ordinal());
} }
@Override @Override
...@@ -101,4 +101,9 @@ public class TinObject extends CityObject { ...@@ -101,4 +101,9 @@ public class TinObject extends CityObject {
return FeatureType.LAND; return FeatureType.LAND;
} }
@Override
public Color getRenderColor() {
return Color.TAN;
}
} }
package de.hft.stuttgart.citydoctor2.datastructure; package de.hft.stuttgart.citydoctor2.datastructure;
import de.hft.stuttgart.citydoctor2.check.Check; import de.hft.stuttgart.citydoctor2.check.CheckableVisitor;
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.deprecated.transportation.TransportationComplex;
import org.citygml4j.core.model.transportation.Railway; import org.citygml4j.core.model.transportation.Railway;
import org.citygml4j.core.model.transportation.Road; import org.citygml4j.core.model.transportation.Road;
import org.citygml4j.core.model.transportation.Square; import org.citygml4j.core.model.transportation.Square;
import org.citygml4j.core.model.transportation.Track; import org.citygml4j.core.model.transportation.Track;
import org.citygml4j.core.model.transportation.Waterway; import org.citygml4j.core.model.transportation.Waterway;
import org.citygml4j.core.util.geometry.GeometryFactory;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -65,10 +59,12 @@ public class TopLevelTransportFeature extends TransportationSpace { ...@@ -65,10 +59,12 @@ public class TopLevelTransportFeature extends TransportationSpace {
public void addSection(TransportSection section) { public void addSection(TransportSection section) {
sections.add(section); sections.add(section);
section.setParent(this);
} }
public void addIntersection(TransportSection section) { public void addIntersection(TransportSection section) {
intersections.add(section); intersections.add(section);
section.setParent(this);
} }
public List<TransportSection> getSections() { public List<TransportSection> getSections() {
...@@ -80,79 +76,7 @@ public class TopLevelTransportFeature extends TransportationSpace { ...@@ -80,79 +76,7 @@ public class TopLevelTransportFeature extends TransportationSpace {
} }
@Override @Override
public void reCreateGeometries(GeometryFactory factory, ParserConfiguration config) { public void accept(CheckableVisitor c) {
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); super.accept(c);
if (c.canExecute(this)) { if (c.canExecute(this)) {
c.check(this); c.check(this);
...@@ -165,78 +89,9 @@ public class TopLevelTransportFeature extends TransportationSpace { ...@@ -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 @Override
public String toString() { public String toString() {
return "TopLevelTransportFeature [id=" + getGmlId() + "]"; 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; ...@@ -11,6 +11,9 @@ import org.xmlobjects.gml.model.geometry.aggregates.MultiSurfaceProperty;
public class TrafficAreaObject extends TransportationObject { public class TrafficAreaObject extends TransportationObject {
private TrafficSpaceObject parent;
public enum TrafficAreaType { public enum TrafficAreaType {
TRAFFIC_AREA, AUXILIARY_TRAFFIC_AREA TRAFFIC_AREA, AUXILIARY_TRAFFIC_AREA
} }
...@@ -24,7 +27,7 @@ public class TrafficAreaObject extends TransportationObject { ...@@ -24,7 +27,7 @@ public class TrafficAreaObject extends TransportationObject {
} }
@Override @Override
public void reCreateGeometries(GeometryFactory factory, ParserConfiguration config) { public void rebuildGeometries(GeometryFactory factory, ParserConfiguration config) {
for (Geometry geom : getGeometries()) { for (Geometry geom : getGeometries()) {
if (geom instanceof ImplicitGeometryHolder) { if (geom instanceof ImplicitGeometryHolder) {
continue; continue;
...@@ -40,6 +43,7 @@ public class TrafficAreaObject extends TransportationObject { ...@@ -40,6 +43,7 @@ public class TrafficAreaObject extends TransportationObject {
AuxiliaryTrafficArea ata = (AuxiliaryTrafficArea) super.getGmlObject(); AuxiliaryTrafficArea ata = (AuxiliaryTrafficArea) super.getGmlObject();
setMultiSurfaceAccordingToLod(ata, ms, geom.getLod()); setMultiSurfaceAccordingToLod(ata, ms, geom.getLod());
break; break;
} }
} else { } else {
throw new IllegalStateException("Geometry in TransportationObject cannot be of type " + geom.getType() throw new IllegalStateException("Geometry in TransportationObject cannot be of type " + geom.getType()
...@@ -99,6 +103,8 @@ public class TrafficAreaObject extends TransportationObject { ...@@ -99,6 +103,8 @@ public class TrafficAreaObject extends TransportationObject {
switch (type) { switch (type) {
case TRAFFIC_AREA: case TRAFFIC_AREA:
TrafficArea ta = (TrafficArea) super.getGmlObject(); TrafficArea ta = (TrafficArea) super.getGmlObject();
ta.setLod0MultiSurface(null);
ta.setLod1MultiSurface(null);
ta.setLod2MultiSurface(null); ta.setLod2MultiSurface(null);
ta.setLod3MultiSurface(null); ta.setLod3MultiSurface(null);
ta.getDeprecatedProperties().setLod4MultiSurface(null); ta.getDeprecatedProperties().setLod4MultiSurface(null);
...@@ -116,7 +122,15 @@ public class TrafficAreaObject extends TransportationObject { ...@@ -116,7 +122,15 @@ public class TrafficAreaObject extends TransportationObject {
@Override @Override
public CityObject getTopLevelCityObject() { public CityObject getTopLevelCityObject() {
return this; return parent.getTopLevelCityObject();
}
public void setParent(TrafficSpaceObject parent) {
this.parent = parent;
}
public TrafficSpaceObject getParent() {
return parent;
} }
@Override @Override
......
...@@ -2,6 +2,8 @@ package de.hft.stuttgart.citydoctor2.datastructure; ...@@ -2,6 +2,8 @@ package de.hft.stuttgart.citydoctor2.datastructure;
public class TransportSection extends TransportationSpace { public class TransportSection extends TransportationSpace {
private TopLevelTransportFeature parent;
public enum SectionType { public enum SectionType {
SECTION, INTERSECTION SECTION, INTERSECTION
} }
...@@ -13,5 +15,17 @@ public class TransportSection extends TransportationSpace { ...@@ -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();
}
} }
package de.hft.stuttgart.citydoctor2.datastructure; package de.hft.stuttgart.citydoctor2.datastructure;
import de.hft.stuttgart.citydoctor2.utils.Copyable;
import java.io.Serial; import java.io.Serial;
...@@ -13,9 +12,4 @@ public class TunnelFurniture extends AbstractFurniture { ...@@ -13,9 +12,4 @@ public class TunnelFurniture extends AbstractFurniture {
super.setGmlObject(gmlObject); super.setGmlObject(gmlObject);
} }
@Override
public Copyable createCopyInstance() {
return new BuildingRoomFurniture();
}
} }
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