Commit 87dba3fa authored by Riegel's avatar Riegel
Browse files

Merge branch 'dev' into 'master'

CityDoctor Version 3.17.3

See merge request !34
parents 0d2e9fd5 aa9c2a95
Pipeline #11660 passed with stage
in 1 minute and 26 seconds
...@@ -18,8 +18,7 @@ ...@@ -18,8 +18,7 @@
*/ */
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.math.Triangle3d; import de.hft.stuttgart.citydoctor2.math.Triangle3d;
import de.hft.stuttgart.citydoctor2.math.Vector3d; import de.hft.stuttgart.citydoctor2.math.Vector3d;
import de.hft.stuttgart.citydoctor2.tesselation.TesselatedPolygon; import de.hft.stuttgart.citydoctor2.tesselation.TesselatedPolygon;
...@@ -41,6 +40,10 @@ public class Geometry extends GmlElement { ...@@ -41,6 +40,10 @@ public class Geometry extends GmlElement {
@Serial @Serial
private static final long serialVersionUID = 2539031030917731575L; private static final long serialVersionUID = 2539031030917731575L;
public enum Orientation {
INWARD, OUTWARD
}
private static final Random r = new Random(); private static final Random r = new Random();
...@@ -53,11 +56,20 @@ public class Geometry extends GmlElement { ...@@ -53,11 +56,20 @@ public class Geometry extends GmlElement {
private List<Edge> edges; private List<Edge> edges;
private Map<SerializablePair<Vertex, Vertex>, Edge> edgeMap; private Map<SerializablePair<Vertex, Vertex>, Edge> edgeMap;
private List<Vertex> vertices; private List<Vertex> vertices;
private Orientation orientation;
public Geometry(GeometryType type, Lod lod) { public Geometry(GeometryType type, Lod lod, Orientation orientation) {
this.lod = lod; this.lod = lod;
this.type = type; this.type = type;
if (type == GeometryType.SOLID) {
Objects.requireNonNull(orientation);
}
this.orientation = orientation;
} }
public Orientation getOrientation() {
return orientation;
}
void setParent(CityObject parent) { void setParent(CityObject parent) {
this.parent = parent; this.parent = parent;
...@@ -206,7 +218,7 @@ public class Geometry extends GmlElement { ...@@ -206,7 +218,7 @@ public class Geometry extends GmlElement {
@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);
......
package de.hft.stuttgart.citydoctor2.datastructure; package de.hft.stuttgart.citydoctor2.datastructure;
import java.io.Serial; import java.io.Serial;
import java.util.List;
import de.hft.stuttgart.citydoctor2.check.CheckableVisitor;
import org.citygml4j.core.model.core.ImplicitGeometry; import org.citygml4j.core.model.core.ImplicitGeometry;
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.math.TransformationMatrix; import de.hft.stuttgart.citydoctor2.math.TransformationMatrix;
/** /**
...@@ -26,7 +23,7 @@ public class ImplicitGeometryHolder extends Geometry { ...@@ -26,7 +23,7 @@ public class ImplicitGeometryHolder extends Geometry {
private final Geometry prototypeGeometry; private final Geometry prototypeGeometry;
public ImplicitGeometryHolder(ImplicitGeometry cgmlImplicitGeometry, LibraryObject libObject) { public ImplicitGeometryHolder(ImplicitGeometry cgmlImplicitGeometry, LibraryObject libObject) {
super(libObject.getType(), libObject.getLod()); super(libObject.getType(), libObject.getLod(), libObject.getOrientation());
prototypeGeometry = libObject; prototypeGeometry = libObject;
type = PrototypeGeometryType.LIBRARY_OBJECT; type = PrototypeGeometryType.LIBRARY_OBJECT;
this.cgmlImplicitGeometry = cgmlImplicitGeometry; this.cgmlImplicitGeometry = cgmlImplicitGeometry;
...@@ -34,7 +31,7 @@ public class ImplicitGeometryHolder extends Geometry { ...@@ -34,7 +31,7 @@ public class ImplicitGeometryHolder extends Geometry {
} }
public ImplicitGeometryHolder(ImplicitGeometry cgmlImplicitGeometry, RelativeGeometry relativeGeometry) { public ImplicitGeometryHolder(ImplicitGeometry cgmlImplicitGeometry, RelativeGeometry relativeGeometry) {
super(relativeGeometry.getType(), relativeGeometry.getLod()); super(relativeGeometry.getType(), relativeGeometry.getLod(), relativeGeometry.getOrientation());
prototypeGeometry = relativeGeometry; prototypeGeometry = relativeGeometry;
type = PrototypeGeometryType.RELATIVE_GEOMETRY; type = PrototypeGeometryType.RELATIVE_GEOMETRY;
this.cgmlImplicitGeometry = cgmlImplicitGeometry; this.cgmlImplicitGeometry = cgmlImplicitGeometry;
...@@ -58,7 +55,7 @@ public class ImplicitGeometryHolder extends Geometry { ...@@ -58,7 +55,7 @@ public class ImplicitGeometryHolder extends Geometry {
} }
@Override @Override
public void accept(Check c) { public void accept(CheckableVisitor c) {
prototypeGeometry.accept(c); prototypeGeometry.accept(c);
} }
......
...@@ -18,8 +18,7 @@ ...@@ -18,8 +18,7 @@
*/ */
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 javafx.scene.paint.Color;
...@@ -130,7 +129,7 @@ public class Installation extends CityObject { ...@@ -130,7 +129,7 @@ public class Installation 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);
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
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 javafx.scene.paint.Color;
...@@ -89,7 +89,7 @@ public class LandObject extends CityObject { ...@@ -89,7 +89,7 @@ public class LandObject 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);
......
...@@ -37,7 +37,7 @@ public class LibraryObject extends Geometry { ...@@ -37,7 +37,7 @@ public class LibraryObject extends Geometry {
if (protoGeom == null) { if (protoGeom == null) {
return null; return null;
} }
LibraryObject libOb = new LibraryObject(protoGeom.getType(), protoGeom.getLod()); LibraryObject libOb = new LibraryObject(protoGeom.getType(), protoGeom.getLod(), protoGeom.getOrientation());
protoGeom.getPolygons().forEach(libOb::addPolygon); protoGeom.getPolygons().forEach(libOb::addPolygon);
libOb.updateEdgesAndVertices(); libOb.updateEdgesAndVertices();
libraryObjects.put(path.toString(), libOb); libraryObjects.put(path.toString(), libOb);
...@@ -53,15 +53,15 @@ public class LibraryObject extends Geometry { ...@@ -53,15 +53,15 @@ public class LibraryObject extends Geometry {
if (protoGeom == null) { if (protoGeom == null) {
return null; return null;
} }
LibraryObject libOb = new LibraryObject(protoGeom.getType(), protoGeom.getLod()); LibraryObject libOb = new LibraryObject(protoGeom.getType(), protoGeom.getLod(), protoGeom.getOrientation());
protoGeom.getPolygons().forEach(libOb::addPolygon); protoGeom.getPolygons().forEach(libOb::addPolygon);
libOb.updateEdgesAndVertices(); libOb.updateEdgesAndVertices();
libraryObjects.put(fileName, libOb); libraryObjects.put(fileName, libOb);
return libOb; return libOb;
} }
private LibraryObject(GeometryType type, Lod lod) { private LibraryObject(GeometryType type, Lod lod, Orientation orientation) {
super(type, lod); super(type, lod, orientation);
} }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
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.math.*; import de.hft.stuttgart.citydoctor2.math.*;
import java.io.Serial; import java.io.Serial;
...@@ -226,7 +226,7 @@ public class LinearRing extends GmlElement { ...@@ -226,7 +226,7 @@ public class LinearRing extends GmlElement {
} }
@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);
......
...@@ -21,6 +21,7 @@ package de.hft.stuttgart.citydoctor2.datastructure; ...@@ -21,6 +21,7 @@ package de.hft.stuttgart.citydoctor2.datastructure;
import de.hft.stuttgart.citydoctor2.check.Check; import de.hft.stuttgart.citydoctor2.check.Check;
import de.hft.stuttgart.citydoctor2.check.CheckId; import de.hft.stuttgart.citydoctor2.check.CheckId;
import de.hft.stuttgart.citydoctor2.check.CheckResult; import de.hft.stuttgart.citydoctor2.check.CheckResult;
import de.hft.stuttgart.citydoctor2.check.CheckableVisitor;
import de.hft.stuttgart.citydoctor2.math.Vector3d; import de.hft.stuttgart.citydoctor2.math.Vector3d;
import de.hft.stuttgart.citydoctor2.tesselation.TesselatedPolygon; import de.hft.stuttgart.citydoctor2.tesselation.TesselatedPolygon;
import javafx.scene.paint.Color; import javafx.scene.paint.Color;
...@@ -43,9 +44,6 @@ public class LinkedPolygon extends Polygon { ...@@ -43,9 +44,6 @@ public class LinkedPolygon extends Polygon {
private Geometry parent; private Geometry parent;
private ConcretePolygon poly; private ConcretePolygon poly;
private LinkedPolygon() {
}
/** /**
* @param poly polygon this is linked to * @param poly polygon this is linked to
* @param parent the parent of the linked polygon * @param parent the parent of the linked polygon
...@@ -105,7 +103,7 @@ public class LinkedPolygon extends Polygon { ...@@ -105,7 +103,7 @@ public class LinkedPolygon extends Polygon {
} }
@Override @Override
public void accept(Check c) { public void accept(CheckableVisitor c) {
// linked polygons are not checked // linked polygons are not checked
setValidated(true); setValidated(true);
} }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
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 javafx.scene.paint.Color;
...@@ -114,7 +114,7 @@ public class Opening extends CityObject { ...@@ -114,7 +114,7 @@ public class Opening 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);
......
...@@ -20,14 +20,14 @@ public class RelativeGeometry extends Geometry { ...@@ -20,14 +20,14 @@ public class RelativeGeometry extends Geometry {
if (relativeGeometries.containsKey(geom)) { if (relativeGeometries.containsKey(geom)) {
return relativeGeometries.get(geom); return relativeGeometries.get(geom);
} }
RelativeGeometry relGeo = new RelativeGeometry(geom.getType(), geom.getLod()); RelativeGeometry relGeo = new RelativeGeometry(geom.getType(), geom.getLod(), geom.getOrientation());
geom.getPolygons().forEach(relGeo::addPolygon); geom.getPolygons().forEach(relGeo::addPolygon);
relGeo.updateEdgesAndVertices(); relGeo.updateEdgesAndVertices();
relativeGeometries.put(geom, relGeo); relativeGeometries.put(geom, relGeo);
return relGeo; return relGeo;
} }
private RelativeGeometry(GeometryType type, Lod lod) { private RelativeGeometry(GeometryType type, Lod lod, Orientation orientation) {
super(type, lod); super(type, lod, orientation);
} }
} }
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
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 javafx.scene.paint.Color; import javafx.scene.paint.Color;
import org.citygml4j.core.model.relief.ReliefFeature; import org.citygml4j.core.model.relief.ReliefFeature;
...@@ -42,7 +42,7 @@ public class ReliefObject extends CityObject { ...@@ -42,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);
......
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 org.citygml4j.core.util.geometry.GeometryFactory; import org.citygml4j.core.util.geometry.GeometryFactory;
...@@ -22,7 +22,7 @@ public class Storey extends AbstractBuildingSubdivision { ...@@ -22,7 +22,7 @@ public class Storey extends AbstractBuildingSubdivision {
} }
@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);
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
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 javafx.scene.paint.Color;
...@@ -50,7 +50,7 @@ public class TinObject extends CityObject { ...@@ -50,7 +50,7 @@ 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);
......
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 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;
...@@ -76,7 +76,7 @@ public class TopLevelTransportFeature extends TransportationSpace { ...@@ -76,7 +76,7 @@ public class TopLevelTransportFeature extends TransportationSpace {
} }
@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);
......
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 org.citygml4j.core.model.core.AbstractSpace; import org.citygml4j.core.model.core.AbstractSpace;
...@@ -95,7 +95,7 @@ public class TrafficSpaceObject extends TransportationObject { ...@@ -95,7 +95,7 @@ public class TrafficSpaceObject extends TransportationObject {
} }
@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);
......
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 org.citygml4j.core.model.core.AbstractSpace; import org.citygml4j.core.model.core.AbstractSpace;
...@@ -121,7 +121,7 @@ public abstract class TransportationSpace extends TransportationObject { ...@@ -121,7 +121,7 @@ public abstract class TransportationSpace extends TransportationObject {
} }
@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);
......
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 org.citygml4j.core.model.core.AbstractSpaceBoundaryProperty; import org.citygml4j.core.model.core.AbstractSpaceBoundaryProperty;
import org.citygml4j.core.model.tunnel.TunnelInstallation; import org.citygml4j.core.model.tunnel.TunnelInstallation;
import org.citygml4j.core.model.tunnel.TunnelInstallationProperty; import org.citygml4j.core.model.tunnel.TunnelInstallationProperty;
...@@ -27,7 +27,7 @@ public class Tunnel extends AbstractTunnel { ...@@ -27,7 +27,7 @@ public class Tunnel extends AbstractTunnel {
} }
@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);
......
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 javafx.scene.paint.Color;
...@@ -87,7 +87,7 @@ public class TunnelConstructiveElement extends CityObject { ...@@ -87,7 +87,7 @@ public class TunnelConstructiveElement 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);
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
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 javafx.scene.paint.Color;
...@@ -27,15 +27,12 @@ import org.citygml4j.core.model.vegetation.AbstractVegetationObject; ...@@ -27,15 +27,12 @@ import org.citygml4j.core.model.vegetation.AbstractVegetationObject;
import org.citygml4j.core.model.vegetation.PlantCover; import org.citygml4j.core.model.vegetation.PlantCover;
import org.citygml4j.core.model.vegetation.SolitaryVegetationObject; import org.citygml4j.core.model.vegetation.SolitaryVegetationObject;
import org.citygml4j.core.util.geometry.GeometryFactory; import org.citygml4j.core.util.geometry.GeometryFactory;
import org.xmlobjects.gml.model.geometry.aggregates.MultiSolid;
import org.xmlobjects.gml.model.geometry.aggregates.MultiSolidProperty;
import org.xmlobjects.gml.model.geometry.aggregates.MultiSurface; import org.xmlobjects.gml.model.geometry.aggregates.MultiSurface;
import org.xmlobjects.gml.model.geometry.aggregates.MultiSurfaceProperty; import org.xmlobjects.gml.model.geometry.aggregates.MultiSurfaceProperty;
import org.xmlobjects.gml.model.geometry.primitives.Solid; import org.xmlobjects.gml.model.geometry.primitives.Solid;
import org.xmlobjects.gml.model.geometry.primitives.SolidProperty; import org.xmlobjects.gml.model.geometry.primitives.SolidProperty;
import java.io.Serial; import java.io.Serial;
import java.util.Collections;
/** /**
* Representation of CityGML vegetation objects * Representation of CityGML vegetation objects
...@@ -172,7 +169,7 @@ public class Vegetation extends CityObject { ...@@ -172,7 +169,7 @@ public class Vegetation 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);
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
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 javafx.scene.paint.Color;
...@@ -141,7 +141,7 @@ public class WaterObject extends CityObject { ...@@ -141,7 +141,7 @@ public class WaterObject 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);
......
...@@ -18,32 +18,45 @@ ...@@ -18,32 +18,45 @@
*/ */
package de.hft.stuttgart.citydoctor2.mapper.citygml3; package de.hft.stuttgart.citydoctor2.mapper.citygml3;
import de.hft.stuttgart.citydoctor2.datastructure.AbstractBuilding; import java.nio.file.Path;
import de.hft.stuttgart.citydoctor2.datastructure.AbstractTunnel; import java.util.ArrayList;
import de.hft.stuttgart.citydoctor2.datastructure.BridgeConstructiveElement; import java.util.HashMap;
import de.hft.stuttgart.citydoctor2.datastructure.*; import java.util.List;
import de.hft.stuttgart.citydoctor2.datastructure.Building; import java.util.Map;
import de.hft.stuttgart.citydoctor2.datastructure.BuildingPart;
import de.hft.stuttgart.citydoctor2.datastructure.BuildingRoom;
import de.hft.stuttgart.citydoctor2.datastructure.LinearRing;
import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
import de.hft.stuttgart.citydoctor2.datastructure.TunnelConstructiveElement;
import de.hft.stuttgart.citydoctor2.datastructure.TunnelFurniture;
import de.hft.stuttgart.citydoctor2.datastructure.TunnelPart;
import de.hft.stuttgart.citydoctor2.datastructure.Vegetation.VegetationType;
import de.hft.stuttgart.citydoctor2.math.graph.KDTree;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
import de.hft.stuttgart.citydoctor2.utils.Localization;
import de.hft.stuttgart.citydoctor2.zip.CityGmlZipEntry;
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.CityGMLVersion; import org.citygml4j.core.model.CityGMLVersion;
import org.citygml4j.core.model.bridge.*; import org.citygml4j.core.model.bridge.AbstractBridge;
import org.citygml4j.core.model.bridge.Bridge;
import org.citygml4j.core.model.bridge.BridgeConstructiveElementProperty;
import org.citygml4j.core.model.bridge.BridgeInstallation;
import org.citygml4j.core.model.bridge.BridgeInstallationProperty;
import org.citygml4j.core.model.bridge.BridgePart;
import org.citygml4j.core.model.bridge.BridgePartProperty;
import org.citygml4j.core.model.building.AbstractBuildingSubdivisionProperty;
import org.citygml4j.core.model.building.BuildingConstructiveElement;
import org.citygml4j.core.model.building.BuildingConstructiveElementProperty;
import org.citygml4j.core.model.building.BuildingFurniture;
import org.citygml4j.core.model.building.BuildingFurnitureProperty;
import org.citygml4j.core.model.building.BuildingInstallationProperty;
import org.citygml4j.core.model.building.BuildingPartProperty;
import org.citygml4j.core.model.building.BuildingRoomProperty;
import org.citygml4j.core.model.building.BuildingUnit; import org.citygml4j.core.model.building.BuildingUnit;
import org.citygml4j.core.model.building.Storey; import org.citygml4j.core.model.building.Storey;
import org.citygml4j.core.model.building.*;
import org.citygml4j.core.model.construction.AbstractConstruction; import org.citygml4j.core.model.construction.AbstractConstruction;
import org.citygml4j.core.model.core.*; import org.citygml4j.core.model.core.AbstractCityObject;
import org.citygml4j.core.model.core.AbstractFeatureWithLifespan;
import org.citygml4j.core.model.core.AbstractGenericAttributeProperty;
import org.citygml4j.core.model.core.AbstractOccupiedSpace;
import org.citygml4j.core.model.core.AbstractPhysicalSpace;
import org.citygml4j.core.model.core.AbstractSpace;
import org.citygml4j.core.model.core.AbstractSpaceBoundary;
import org.citygml4j.core.model.core.AbstractSpaceBoundaryProperty;
import org.citygml4j.core.model.core.AbstractThematicSurface;
import org.citygml4j.core.model.core.AbstractUnoccupiedSpace;
import org.citygml4j.core.model.core.CityModel;
import org.citygml4j.core.model.core.ImplicitGeometry;
import org.citygml4j.core.model.deprecated.transportation.TransportationComplex; import org.citygml4j.core.model.deprecated.transportation.TransportationComplex;
import org.citygml4j.core.model.landuse.LandUse; import org.citygml4j.core.model.landuse.LandUse;
import org.citygml4j.core.model.relief.AbstractReliefComponentProperty; import org.citygml4j.core.model.relief.AbstractReliefComponentProperty;
...@@ -52,9 +65,28 @@ import org.citygml4j.core.model.relief.MassPointRelief; ...@@ -52,9 +65,28 @@ import org.citygml4j.core.model.relief.MassPointRelief;
import org.citygml4j.core.model.relief.RasterRelief; import org.citygml4j.core.model.relief.RasterRelief;
import org.citygml4j.core.model.relief.ReliefFeature; import org.citygml4j.core.model.relief.ReliefFeature;
import org.citygml4j.core.model.relief.TINRelief; import org.citygml4j.core.model.relief.TINRelief;
import org.citygml4j.core.model.transportation.*; import org.citygml4j.core.model.transportation.AbstractTransportationSpace;
import org.citygml4j.core.model.transportation.AuxiliaryTrafficArea;
import org.citygml4j.core.model.transportation.AuxiliaryTrafficSpace;
import org.citygml4j.core.model.transportation.AuxiliaryTrafficSpaceProperty;
import org.citygml4j.core.model.transportation.IntersectionProperty;
import org.citygml4j.core.model.transportation.Railway;
import org.citygml4j.core.model.transportation.Road;
import org.citygml4j.core.model.transportation.SectionProperty;
import org.citygml4j.core.model.transportation.Square;
import org.citygml4j.core.model.transportation.Track;
import org.citygml4j.core.model.transportation.TrafficArea;
import org.citygml4j.core.model.transportation.TrafficSpace;
import org.citygml4j.core.model.transportation.TrafficSpaceProperty;
import org.citygml4j.core.model.transportation.Waterway;
import org.citygml4j.core.model.tunnel.HollowSpace;
import org.citygml4j.core.model.tunnel.HollowSpaceProperty;
import org.citygml4j.core.model.tunnel.Tunnel; import org.citygml4j.core.model.tunnel.Tunnel;
import org.citygml4j.core.model.tunnel.*; import org.citygml4j.core.model.tunnel.TunnelConstructiveElementProperty;
import org.citygml4j.core.model.tunnel.TunnelFurnitureProperty;
import org.citygml4j.core.model.tunnel.TunnelInstallation;
import org.citygml4j.core.model.tunnel.TunnelInstallationProperty;
import org.citygml4j.core.model.tunnel.TunnelPartProperty;
import org.citygml4j.core.model.vegetation.AbstractVegetationObject; import org.citygml4j.core.model.vegetation.AbstractVegetationObject;
import org.citygml4j.core.model.vegetation.PlantCover; import org.citygml4j.core.model.vegetation.PlantCover;
import org.citygml4j.core.model.vegetation.SolitaryVegetationObject; import org.citygml4j.core.model.vegetation.SolitaryVegetationObject;
...@@ -67,13 +99,65 @@ import org.xmlobjects.gml.model.geometry.GeometryProperty; ...@@ -67,13 +99,65 @@ import org.xmlobjects.gml.model.geometry.GeometryProperty;
import org.xmlobjects.gml.model.geometry.aggregates.MultiSurface; import org.xmlobjects.gml.model.geometry.aggregates.MultiSurface;
import org.xmlobjects.gml.model.geometry.aggregates.MultiSurfaceProperty; import org.xmlobjects.gml.model.geometry.aggregates.MultiSurfaceProperty;
import org.xmlobjects.gml.model.geometry.complexes.CompositeSurface; import org.xmlobjects.gml.model.geometry.complexes.CompositeSurface;
import org.xmlobjects.gml.model.geometry.primitives.*; import org.xmlobjects.gml.model.geometry.primitives.AbstractSolid;
import org.xmlobjects.gml.model.geometry.primitives.AbstractSurface;
import org.xmlobjects.gml.model.geometry.primitives.Shell;
import org.xmlobjects.gml.model.geometry.primitives.ShellProperty;
import org.xmlobjects.gml.model.geometry.primitives.Solid;
import org.xmlobjects.gml.model.geometry.primitives.SolidProperty;
import org.xmlobjects.gml.model.geometry.primitives.SurfaceProperty;
import java.nio.file.Path; import de.hft.stuttgart.citydoctor2.datastructure.AbstractBuilding;
import java.util.ArrayList; import de.hft.stuttgart.citydoctor2.datastructure.AbstractTunnel;
import java.util.HashMap; import de.hft.stuttgart.citydoctor2.datastructure.BoundarySurface;
import java.util.List; import de.hft.stuttgart.citydoctor2.datastructure.BridgeConstructiveElement;
import java.util.Map; import de.hft.stuttgart.citydoctor2.datastructure.BridgeObject;
import de.hft.stuttgart.citydoctor2.datastructure.Building;
import de.hft.stuttgart.citydoctor2.datastructure.BuildingPart;
import de.hft.stuttgart.citydoctor2.datastructure.BuildingRoom;
import de.hft.stuttgart.citydoctor2.datastructure.BuildingRoomFurniture;
import de.hft.stuttgart.citydoctor2.datastructure.CityDoctorModel;
import de.hft.stuttgart.citydoctor2.datastructure.CityFurniture;
import de.hft.stuttgart.citydoctor2.datastructure.CityObject;
import de.hft.stuttgart.citydoctor2.datastructure.CompositeCollection;
import de.hft.stuttgart.citydoctor2.datastructure.ConcretePolygon;
import de.hft.stuttgart.citydoctor2.datastructure.GenericAttribute;
import de.hft.stuttgart.citydoctor2.datastructure.GenericCityObject;
import de.hft.stuttgart.citydoctor2.datastructure.Geometry;
import de.hft.stuttgart.citydoctor2.datastructure.Geometry.Orientation;
import de.hft.stuttgart.citydoctor2.datastructure.GeometryType;
import de.hft.stuttgart.citydoctor2.datastructure.GmlElement;
import de.hft.stuttgart.citydoctor2.datastructure.GmlId;
import de.hft.stuttgart.citydoctor2.datastructure.ImplicitGeometryHolder;
import de.hft.stuttgart.citydoctor2.datastructure.Installation;
import de.hft.stuttgart.citydoctor2.datastructure.LandObject;
import de.hft.stuttgart.citydoctor2.datastructure.LibraryObject;
import de.hft.stuttgart.citydoctor2.datastructure.LinearRing;
import de.hft.stuttgart.citydoctor2.datastructure.LinkedPolygon;
import de.hft.stuttgart.citydoctor2.datastructure.Lod;
import de.hft.stuttgart.citydoctor2.datastructure.Opening;
import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
import de.hft.stuttgart.citydoctor2.datastructure.RelativeGeometry;
import de.hft.stuttgart.citydoctor2.datastructure.ReliefObject;
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.TransportSection;
import de.hft.stuttgart.citydoctor2.datastructure.TransportationObject;
import de.hft.stuttgart.citydoctor2.datastructure.TransportationSpace;
import de.hft.stuttgart.citydoctor2.datastructure.TunnelConstructiveElement;
import de.hft.stuttgart.citydoctor2.datastructure.TunnelFurniture;
import de.hft.stuttgart.citydoctor2.datastructure.TunnelHollow;
import de.hft.stuttgart.citydoctor2.datastructure.TunnelPart;
import de.hft.stuttgart.citydoctor2.datastructure.Vegetation;
import de.hft.stuttgart.citydoctor2.datastructure.Vegetation.VegetationType;
import de.hft.stuttgart.citydoctor2.datastructure.Vertex;
import de.hft.stuttgart.citydoctor2.datastructure.WaterObject;
import de.hft.stuttgart.citydoctor2.math.graph.KDTree;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
import de.hft.stuttgart.citydoctor2.utils.Localization;
import de.hft.stuttgart.citydoctor2.zip.CityGmlZipEntry;
public class Citygml3FeatureMapper extends ObjectWalker { public class Citygml3FeatureMapper extends ObjectWalker {
...@@ -123,7 +207,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -123,7 +207,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
public void visit(org.citygml4j.core.model.cityfurniture.CityFurniture gmlCityFurniture) { public void visit(org.citygml4j.core.model.cityfurniture.CityFurniture gmlCityFurniture) {
CityFurniture cf = new CityFurniture(); CityFurniture cf = new CityFurniture();
cf.setGmlObject(gmlCityFurniture); cf.setGmlObject(gmlCityFurniture);
mapAbstractOccupiedSpace(gmlCityFurniture, cf); mapAbstractOccupiedSpace(gmlCityFurniture, cf, Orientation.OUTWARD);
finishCityObjectConstruction(cf); finishCityObjectConstruction(cf);
model.addCityFurniture(cf); model.addCityFurniture(cf);
} }
...@@ -141,10 +225,10 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -141,10 +225,10 @@ public class Citygml3FeatureMapper extends ObjectWalker {
if (agLod4.getObject() instanceof MultiSurface ms) { if (agLod4.getObject() instanceof MultiSurface ms) {
gco.addGeometry(parseMultiSurface(ms, Lod.LOD4)); gco.addGeometry(parseMultiSurface(ms, Lod.LOD4));
} else if (agLod4.getObject() instanceof AbstractSolid solid) { } else if (agLod4.getObject() instanceof AbstractSolid solid) {
gco.addGeometry(parseSolid(solid, Lod.LOD4)); gco.addGeometry(parseSolid(solid, Lod.LOD4, Orientation.OUTWARD));
} }
} }
mapAbstractOccupiedSpace(gos, gco); mapAbstractOccupiedSpace(gos, gco, Orientation.OUTWARD);
finishCityObjectConstruction(gco); finishCityObjectConstruction(gco);
model.addGenericCityObject(gco); model.addGenericCityObject(gco);
} }
...@@ -168,9 +252,9 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -168,9 +252,9 @@ public class Citygml3FeatureMapper extends ObjectWalker {
public void visit(WaterBody waterBody) { public void visit(WaterBody waterBody) {
WaterObject wo = new WaterObject(); WaterObject wo = new WaterObject();
wo.setGmlObject(waterBody); wo.setGmlObject(waterBody);
mapAbstractOccupiedSpace(waterBody, wo); mapAbstractOccupiedSpace(waterBody, wo, Orientation.OUTWARD);
parseAndAddMultiSurface(waterBody.getDeprecatedProperties().getLod1MultiSurface(), Lod.LOD1, wo); parseAndAddMultiSurface(waterBody.getDeprecatedProperties().getLod1MultiSurface(), Lod.LOD1, wo);
parseAndAddSolid(waterBody.getDeprecatedProperties().getLod4Solid(), Lod.LOD4, wo); parseAndAddSolid(waterBody.getDeprecatedProperties().getLod4Solid(), Lod.LOD4, wo, Orientation.OUTWARD);
SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config); SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config);
for (AbstractSpaceBoundaryProperty surfaceProp : waterBody.getBoundaries()) { for (AbstractSpaceBoundaryProperty surfaceProp : waterBody.getBoundaries()) {
...@@ -257,7 +341,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -257,7 +341,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
reliefObject.addComponent(to); reliefObject.addComponent(to);
Citygml3GeometryMapper tinMapper = new Citygml3GeometryMapper(config, vertexMap); Citygml3GeometryMapper tinMapper = new Citygml3GeometryMapper(config, vertexMap);
relief.getTin().getObject().accept(tinMapper); relief.getTin().getObject().accept(tinMapper);
Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, reliefLod); Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, reliefLod, Orientation.OUTWARD);
tinMapper.getPolygons().forEach(geom::addPolygon); tinMapper.getPolygons().forEach(geom::addPolygon);
to.addGeometry(geom); to.addGeometry(geom);
} }
...@@ -282,39 +366,39 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -282,39 +366,39 @@ public class Citygml3FeatureMapper extends ObjectWalker {
mapAbstractVegetationObject(solitaryVegetationObject, veg); mapAbstractVegetationObject(solitaryVegetationObject, veg);
parseAndAddAbstractGeometry(solitaryVegetationObject.getDeprecatedProperties().getLod1Geometry(), Lod.LOD1, parseAndAddAbstractGeometry(solitaryVegetationObject.getDeprecatedProperties().getLod1Geometry(), Lod.LOD1,
veg); veg, Orientation.OUTWARD);
parseAndAddAbstractGeometry(solitaryVegetationObject.getDeprecatedProperties().getLod2Geometry(), Lod.LOD2, parseAndAddAbstractGeometry(solitaryVegetationObject.getDeprecatedProperties().getLod2Geometry(), Lod.LOD2,
veg); veg, Orientation.OUTWARD);
parseAndAddAbstractGeometry(solitaryVegetationObject.getDeprecatedProperties().getLod3Geometry(), Lod.LOD3, parseAndAddAbstractGeometry(solitaryVegetationObject.getDeprecatedProperties().getLod3Geometry(), Lod.LOD3,
veg); veg, Orientation.OUTWARD);
parseAndAddAbstractGeometry(solitaryVegetationObject.getDeprecatedProperties().getLod4Geometry(), Lod.LOD4, parseAndAddAbstractGeometry(solitaryVegetationObject.getDeprecatedProperties().getLod4Geometry(), Lod.LOD4,
veg); veg, Orientation.OUTWARD);
finishCityObjectConstruction(veg); finishCityObjectConstruction(veg);
model.addVegetation(veg); model.addVegetation(veg);
} }
private void mapAbstractVegetationObject(AbstractVegetationObject avo, Vegetation veg) { private void mapAbstractVegetationObject(AbstractVegetationObject avo, Vegetation veg) {
mapAbstractOccupiedSpace(avo, veg); mapAbstractOccupiedSpace(avo, veg, Orientation.OUTWARD);
} }
private void mapAbstractOccupiedSpace(AbstractOccupiedSpace aos, CityObject co) { private void mapAbstractOccupiedSpace(AbstractOccupiedSpace aos, CityObject co, Orientation orientation) {
mapAbstractPhysicalSpace(aos, co); mapAbstractPhysicalSpace(aos, co, orientation);
parseImplicitGeometry(aos, co); parseImplicitGeometry(aos, co, orientation);
} }
private void mapAbstractPhysicalSpace(AbstractPhysicalSpace aps, CityObject co) { private void mapAbstractPhysicalSpace(AbstractPhysicalSpace aps, CityObject co, Orientation orientation) {
mapAbstractSpace(aps, co); mapAbstractSpace(aps, co, orientation);
} }
private void mapAbstractSpace(AbstractSpace as, CityObject co) { private void mapAbstractSpace(AbstractSpace as, CityObject co, Orientation orientation) {
mapAbstractFeature(as, co); mapAbstractFeature(as, co);
parseAndAddMultiSurface(as.getLod0MultiSurface(), Lod.LOD0, co); parseAndAddMultiSurface(as.getLod0MultiSurface(), Lod.LOD0, co);
parseAndAddMultiSurface(as.getLod2MultiSurface(), Lod.LOD2, co); parseAndAddMultiSurface(as.getLod2MultiSurface(), Lod.LOD2, co);
parseAndAddMultiSurface(as.getLod3MultiSurface(), Lod.LOD3, co); parseAndAddMultiSurface(as.getLod3MultiSurface(), Lod.LOD3, co);
parseAndAddSolid(as.getLod1Solid(), Lod.LOD1, co); parseAndAddSolid(as.getLod1Solid(), Lod.LOD1, co, orientation);
parseAndAddSolid(as.getLod2Solid(), Lod.LOD2, co); parseAndAddSolid(as.getLod2Solid(), Lod.LOD2, co, orientation);
parseAndAddSolid(as.getLod3Solid(), Lod.LOD3, co); parseAndAddSolid(as.getLod3Solid(), Lod.LOD3, co, orientation);
parseAndAddGenericAttributes(as, co); parseAndAddGenericAttributes(as, co);
} }
...@@ -331,7 +415,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -331,7 +415,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
// parse deprecated geometries // parse deprecated geometries
parseAndAddMultiSurface(bridge.getDeprecatedProperties().getLod1MultiSurface(), Lod.LOD1, bo); parseAndAddMultiSurface(bridge.getDeprecatedProperties().getLod1MultiSurface(), Lod.LOD1, bo);
parseAndAddMultiSurface(bridge.getDeprecatedProperties().getLod4MultiSurface(), Lod.LOD4, bo); parseAndAddMultiSurface(bridge.getDeprecatedProperties().getLod4MultiSurface(), Lod.LOD4, bo);
parseAndAddSolid(bridge.getDeprecatedProperties().getLod4Solid(), Lod.LOD4, bo); parseAndAddSolid(bridge.getDeprecatedProperties().getLod4Solid(), Lod.LOD4, bo, Orientation.OUTWARD);
mapAbstractBridge(bridge, bo); mapAbstractBridge(bridge, bo);
for (BridgePartProperty bPartProperty : bridge.getBridgeParts()) { for (BridgePartProperty bPartProperty : bridge.getBridgeParts()) {
...@@ -403,13 +487,13 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -403,13 +487,13 @@ public class Citygml3FeatureMapper extends ObjectWalker {
private Installation mapBridgeInstallation(BridgeInstallation gmlBi) { private Installation mapBridgeInstallation(BridgeInstallation gmlBi) {
Installation bi = new Installation(); Installation bi = new Installation();
bi.setGmlObject(gmlBi); bi.setGmlObject(gmlBi);
mapAbstractOccupiedSpace(gmlBi, bi); mapAbstractOccupiedSpace(gmlBi, bi, Orientation.OUTWARD);
GeometryProperty<?> lod2Prop = gmlBi.getDeprecatedProperties().getLod2Geometry(); GeometryProperty<?> lod2Prop = gmlBi.getDeprecatedProperties().getLod2Geometry();
parseAndAddAbstractGeometry(lod2Prop, Lod.LOD2, bi); parseAndAddAbstractGeometry(lod2Prop, Lod.LOD2, bi, Orientation.OUTWARD);
GeometryProperty<?> lod3Prop = gmlBi.getDeprecatedProperties().getLod3Geometry(); GeometryProperty<?> lod3Prop = gmlBi.getDeprecatedProperties().getLod3Geometry();
parseAndAddAbstractGeometry(lod3Prop, Lod.LOD3, bi); parseAndAddAbstractGeometry(lod3Prop, Lod.LOD3, bi, Orientation.OUTWARD);
GeometryProperty<?> lod4Prop = gmlBi.getDeprecatedProperties().getLod4Geometry(); GeometryProperty<?> lod4Prop = gmlBi.getDeprecatedProperties().getLod4Geometry();
parseAndAddAbstractGeometry(lod4Prop, Lod.LOD4, bi); parseAndAddAbstractGeometry(lod4Prop, Lod.LOD4, bi, Orientation.OUTWARD);
SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config); SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config);
for (AbstractSpaceBoundaryProperty surfaceProp : gmlBi.getBoundaries()) { for (AbstractSpaceBoundaryProperty surfaceProp : gmlBi.getBoundaries()) {
...@@ -459,13 +543,13 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -459,13 +543,13 @@ public class Citygml3FeatureMapper extends ObjectWalker {
} }
private void readAbstractTunnel(org.citygml4j.core.model.tunnel.AbstractTunnel gmlTunnel, AbstractTunnel cdTunnel) { private void readAbstractTunnel(org.citygml4j.core.model.tunnel.AbstractTunnel gmlTunnel, AbstractTunnel cdTunnel) {
mapAbstractOccupiedSpace(gmlTunnel, cdTunnel); mapAbstractOccupiedSpace(gmlTunnel, cdTunnel, Orientation.OUTWARD);
cdTunnel.setGmlObject(gmlTunnel); cdTunnel.setGmlObject(gmlTunnel);
// parse deprecated geometries // parse deprecated geometries
parseAndAddMultiSurface(gmlTunnel.getDeprecatedProperties().getLod1MultiSurface(), Lod.LOD1, cdTunnel); parseAndAddMultiSurface(gmlTunnel.getDeprecatedProperties().getLod1MultiSurface(), Lod.LOD1, cdTunnel);
parseAndAddMultiSurface(gmlTunnel.getDeprecatedProperties().getLod4MultiSurface(), Lod.LOD4, cdTunnel); parseAndAddMultiSurface(gmlTunnel.getDeprecatedProperties().getLod4MultiSurface(), Lod.LOD4, cdTunnel);
parseAndAddSolid(gmlTunnel.getDeprecatedProperties().getLod4Solid(), Lod.LOD4, cdTunnel); parseAndAddSolid(gmlTunnel.getDeprecatedProperties().getLod4Solid(), Lod.LOD4, cdTunnel, Orientation.OUTWARD);
parseTunnelInstallations(gmlTunnel, cdTunnel); parseTunnelInstallations(gmlTunnel, cdTunnel);
parseHollowSpaces(gmlTunnel, cdTunnel); parseHollowSpaces(gmlTunnel, cdTunnel);
...@@ -540,21 +624,21 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -540,21 +624,21 @@ public class Citygml3FeatureMapper extends ObjectWalker {
// ignore empty properties // ignore empty properties
continue; continue;
} }
Installation ti = mapTunnelInstallation(gmlTi); Installation ti = mapTunnelInstallation(gmlTi, Orientation.OUTWARD);
cdTunnel.addTunnelInstallation(ti); cdTunnel.addTunnelInstallation(ti);
} }
} }
private Installation mapTunnelInstallation(TunnelInstallation gmlTi) { private Installation mapTunnelInstallation(TunnelInstallation gmlTi, Orientation orientation) {
Installation ti = new Installation(); Installation ti = new Installation();
ti.setGmlObject(gmlTi); ti.setGmlObject(gmlTi);
mapAbstractOccupiedSpace(gmlTi, ti); mapAbstractOccupiedSpace(gmlTi, ti, Orientation.OUTWARD);
GeometryProperty<?> lod2Prop = gmlTi.getDeprecatedProperties().getLod2Geometry(); GeometryProperty<?> lod2Prop = gmlTi.getDeprecatedProperties().getLod2Geometry();
parseAndAddAbstractGeometry(lod2Prop, Lod.LOD2, ti); parseAndAddAbstractGeometry(lod2Prop, Lod.LOD2, ti, orientation);
GeometryProperty<?> lod3Prop = gmlTi.getDeprecatedProperties().getLod3Geometry(); GeometryProperty<?> lod3Prop = gmlTi.getDeprecatedProperties().getLod3Geometry();
parseAndAddAbstractGeometry(lod3Prop, Lod.LOD3, ti); parseAndAddAbstractGeometry(lod3Prop, Lod.LOD3, ti, orientation);
GeometryProperty<?> lod4Prop = gmlTi.getDeprecatedProperties().getLod4Geometry(); GeometryProperty<?> lod4Prop = gmlTi.getDeprecatedProperties().getLod4Geometry();
parseAndAddAbstractGeometry(lod4Prop, Lod.LOD4, ti); parseAndAddAbstractGeometry(lod4Prop, Lod.LOD4, ti, orientation);
SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config); SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config);
...@@ -586,7 +670,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -586,7 +670,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
private TunnelHollow mapTunnelHollow(HollowSpace gmlHo) { private TunnelHollow mapTunnelHollow(HollowSpace gmlHo) {
TunnelHollow tHollow = new TunnelHollow(); TunnelHollow tHollow = new TunnelHollow();
tHollow.setGmlObject(gmlHo); tHollow.setGmlObject(gmlHo);
mapAbstractUnoccupiedSpace(gmlHo, tHollow); mapAbstractUnoccupiedSpace(gmlHo, tHollow, Orientation.INWARD);
SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config); SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config);
for (AbstractSpaceBoundaryProperty surfaceProp : gmlHo.getBoundaries()) { for (AbstractSpaceBoundaryProperty surfaceProp : gmlHo.getBoundaries()) {
...@@ -610,7 +694,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -610,7 +694,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
// ignore empty properties // ignore empty properties
continue; continue;
} }
Installation bi = mapTunnelInstallation(gmlTi); Installation bi = mapTunnelInstallation(gmlTi, Orientation.INWARD);
tHollow.addRoomInstallation(bi); tHollow.addRoomInstallation(bi);
} }
for (TunnelFurnitureProperty tfProp : gmlHo.getTunnelFurniture()) { for (TunnelFurnitureProperty tfProp : gmlHo.getTunnelFurniture()) {
...@@ -626,7 +710,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -626,7 +710,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
private TunnelFurniture mapTunnelFurniture(org.citygml4j.core.model.tunnel.TunnelFurniture gmlTf) { private TunnelFurniture mapTunnelFurniture(org.citygml4j.core.model.tunnel.TunnelFurniture gmlTf) {
TunnelFurniture tf = new TunnelFurniture(); TunnelFurniture tf = new TunnelFurniture();
tf.setGmlObject(gmlTf); tf.setGmlObject(gmlTf);
mapAbstractOccupiedSpace(gmlTf, tf); mapAbstractOccupiedSpace(gmlTf, tf, Orientation.OUTWARD);
SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config); SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config);
for (AbstractSpaceBoundaryProperty surfaceProp : gmlTf.getBoundaries()) { for (AbstractSpaceBoundaryProperty surfaceProp : gmlTf.getBoundaries()) {
...@@ -650,7 +734,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -650,7 +734,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
private TunnelConstructiveElement mapTunnelConstructiveElement( private TunnelConstructiveElement mapTunnelConstructiveElement(
org.citygml4j.core.model.tunnel.TunnelConstructiveElement gmlTe) { org.citygml4j.core.model.tunnel.TunnelConstructiveElement gmlTe) {
TunnelConstructiveElement te = new TunnelConstructiveElement(gmlTe); TunnelConstructiveElement te = new TunnelConstructiveElement(gmlTe);
mapAbstractOccupiedSpace(gmlTe, te); mapAbstractOccupiedSpace(gmlTe, te, Orientation.OUTWARD);
SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config); SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config);
for (AbstractSpaceBoundaryProperty surfaceProp : gmlTe.getBoundaries()) { for (AbstractSpaceBoundaryProperty surfaceProp : gmlTe.getBoundaries()) {
if (!surfaceProp.isSetObject()) { if (!surfaceProp.isSetObject()) {
...@@ -700,11 +784,11 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -700,11 +784,11 @@ public class Citygml3FeatureMapper extends ObjectWalker {
private void mapAbstractConstructiveElement(org.citygml4j.core.model.bridge.BridgeConstructiveElement ele, private void mapAbstractConstructiveElement(org.citygml4j.core.model.bridge.BridgeConstructiveElement ele,
BridgeConstructiveElement bce) { BridgeConstructiveElement bce) {
mapAbstractOccupiedSpace(ele, bce); mapAbstractOccupiedSpace(ele, bce, Orientation.OUTWARD);
} }
private void mapAbstractConstruction(AbstractConstruction ac, BridgeObject bo) { private void mapAbstractConstruction(AbstractConstruction ac, BridgeObject bo) {
mapAbstractOccupiedSpace(ac, bo); mapAbstractOccupiedSpace(ac, bo, Orientation.OUTWARD);
} }
@Override @Override
...@@ -839,7 +923,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -839,7 +923,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
private void mapTrafficSpace(TrafficSpace ts, TrafficSpaceObject tso) { private void mapTrafficSpace(TrafficSpace ts, TrafficSpaceObject tso) {
tso.setGmlObject(ts); tso.setGmlObject(ts);
mapAbstractUnoccupiedSpace(ts, tso); mapAbstractUnoccupiedSpace(ts, tso, Orientation.OUTWARD);
for (AbstractSpaceBoundaryProperty boundary : ts.getBoundaries()) { for (AbstractSpaceBoundaryProperty boundary : ts.getBoundaries()) {
if (boundary.isSetObject()) { if (boundary.isSetObject()) {
TrafficArea area = (TrafficArea) boundary.getObject(); TrafficArea area = (TrafficArea) boundary.getObject();
...@@ -853,7 +937,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -853,7 +937,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
private void mapAuxiliaryTrafficSpace(AuxiliaryTrafficSpace ats, TrafficSpaceObject tso) { private void mapAuxiliaryTrafficSpace(AuxiliaryTrafficSpace ats, TrafficSpaceObject tso) {
tso.setGmlObject(ats); tso.setGmlObject(ats);
mapAbstractUnoccupiedSpace(ats, tso); mapAbstractUnoccupiedSpace(ats, tso, Orientation.OUTWARD);
for (AbstractSpaceBoundaryProperty boundary : ats.getBoundaries()) { for (AbstractSpaceBoundaryProperty boundary : ats.getBoundaries()) {
if (boundary.isSetObject()) { if (boundary.isSetObject()) {
AuxiliaryTrafficArea area = (AuxiliaryTrafficArea) boundary.getObject(); AuxiliaryTrafficArea area = (AuxiliaryTrafficArea) boundary.getObject();
...@@ -885,8 +969,8 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -885,8 +969,8 @@ public class Citygml3FeatureMapper extends ObjectWalker {
finishCityObjectConstruction(tao); finishCityObjectConstruction(tao);
} }
private void mapAbstractUnoccupiedSpace(AbstractUnoccupiedSpace aus, CityObject co) { private void mapAbstractUnoccupiedSpace(AbstractUnoccupiedSpace aus, CityObject co, Orientation orientation) {
mapAbstractPhysicalSpace(aus, co); mapAbstractPhysicalSpace(aus, co, orientation);
} }
private void parseAbstractTransportationSpaceGeometries(AbstractTransportationSpace space, CityObject co) { private void parseAbstractTransportationSpaceGeometries(AbstractTransportationSpace space, CityObject co) {
...@@ -894,16 +978,6 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -894,16 +978,6 @@ public class Citygml3FeatureMapper extends ObjectWalker {
parseAndAddMultiSurface(space.getDeprecatedProperties().getLod4MultiSurface(), Lod.LOD4, co); parseAndAddMultiSurface(space.getDeprecatedProperties().getLod4MultiSurface(), Lod.LOD4, co);
} }
private void parseAbstractSpaceGeometries(AbstractSpace as, CityObject co) {
parseAndAddMultiSurface(as.getLod0MultiSurface(), Lod.LOD0, co);
parseAndAddMultiSurface(as.getLod2MultiSurface(), Lod.LOD2, co);
parseAndAddMultiSurface(as.getLod3MultiSurface(), Lod.LOD3, co);
parseAndAddSolid(as.getLod1Solid(), Lod.LOD1, co);
parseAndAddSolid(as.getLod2Solid(), Lod.LOD2, co);
parseAndAddSolid(as.getLod3Solid(), Lod.LOD3, co);
}
private void parseAndAddMultiSurface(MultiSurfaceProperty msp, Lod lod, CityObject co) { private void parseAndAddMultiSurface(MultiSurfaceProperty msp, Lod lod, CityObject co) {
if (msp == null || msp.getObject() == null) { if (msp == null || msp.getObject() == null) {
return; return;
...@@ -912,24 +986,24 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -912,24 +986,24 @@ public class Citygml3FeatureMapper extends ObjectWalker {
co.addGeometry(geom); co.addGeometry(geom);
} }
private void parseAndAddSolid(SolidProperty sp, Lod lod, CityObject co) { private void parseAndAddSolid(SolidProperty sp, Lod lod, CityObject co, Orientation orientation) {
if (sp == null || sp.getObject() == null) { if (sp == null || sp.getObject() == null) {
return; return;
} }
Geometry geom = parseSolid(sp.getObject(), lod); Geometry geom = parseSolid(sp.getObject(), lod, orientation);
if (geom != null) { if (geom != null) {
co.addGeometry(geom); co.addGeometry(geom);
} }
} }
private void parseImplicitGeometry(AbstractOccupiedSpace aos, CityObject co) { private void parseImplicitGeometry(AbstractOccupiedSpace aos, CityObject co, Orientation orientation) {
for (int i = 1; i <= 3; i++) { for (int i = 1; i <= 3; i++) {
if (aos.getImplicitRepresentation(i) == null) { if (aos.getImplicitRepresentation(i) == null) {
continue; continue;
} }
if (aos.getImplicitRepresentation(i).getObject() != null) { if (aos.getImplicitRepresentation(i).getObject() != null) {
ImplicitGeometry impGeom = aos.getImplicitRepresentation(i).getObject(); ImplicitGeometry impGeom = aos.getImplicitRepresentation(i).getObject();
ImplicitGeometryHolder igh = resolveImplicitGeometry(impGeom, i); ImplicitGeometryHolder igh = resolveImplicitGeometry(impGeom, i, orientation);
if (igh != null) { if (igh != null) {
co.addGeometry(igh); co.addGeometry(igh);
} }
...@@ -943,7 +1017,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -943,7 +1017,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
} }
private ImplicitGeometryHolder resolveImplicitGeometry(ImplicitGeometry ig, int lodInt) { private ImplicitGeometryHolder resolveImplicitGeometry(ImplicitGeometry ig, int lodInt, Orientation orientation) {
ImplicitGeometryHolder igh = null; ImplicitGeometryHolder igh = null;
if (ig.getLibraryObject() != null) { if (ig.getLibraryObject() != null) {
LibraryObject libObj = null; LibraryObject libObj = null;
...@@ -967,7 +1041,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -967,7 +1041,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
if (aGeom instanceof MultiSurface ms) { if (aGeom instanceof MultiSurface ms) {
geom = parseMultiSurface(ms, lod); geom = parseMultiSurface(ms, lod);
} else if (aGeom instanceof Solid s) { } else if (aGeom instanceof Solid s) {
geom = parseSolid(s, lod); geom = parseSolid(s, lod, orientation);
} else if (aGeom instanceof CompositeSurface cs) { } else if (aGeom instanceof CompositeSurface cs) {
geom = parseCompositeSurface(cs, lod); geom = parseCompositeSurface(cs, lod);
} }
...@@ -1024,13 +1098,14 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -1024,13 +1098,14 @@ public class Citygml3FeatureMapper extends ObjectWalker {
private void readAbstractBuilding(org.citygml4j.core.model.building.AbstractBuilding gmlAb, private void readAbstractBuilding(org.citygml4j.core.model.building.AbstractBuilding gmlAb,
AbstractBuilding cdBuilding) { AbstractBuilding cdBuilding) {
mapAbstractOccupiedSpace(gmlAb, cdBuilding); mapAbstractOccupiedSpace(gmlAb, cdBuilding, Orientation.OUTWARD);
cdBuilding.setGmlObject(gmlAb); cdBuilding.setGmlObject(gmlAb);
// parse deprecated geometries // parse deprecated geometries
parseAndAddMultiSurface(gmlAb.getDeprecatedProperties().getLod1MultiSurface(), Lod.LOD1, cdBuilding); parseAndAddMultiSurface(gmlAb.getDeprecatedProperties().getLod1MultiSurface(), Lod.LOD1, cdBuilding);
parseAndAddMultiSurface(gmlAb.getDeprecatedProperties().getLod4MultiSurface(), Lod.LOD4, cdBuilding); parseAndAddMultiSurface(gmlAb.getDeprecatedProperties().getLod4MultiSurface(), Lod.LOD4, cdBuilding);
parseAndAddSolid(gmlAb.getDeprecatedProperties().getLod4Solid(), Lod.LOD4, cdBuilding); parseAndAddSolid(gmlAb.getDeprecatedProperties().getLod4Solid(), Lod.LOD4, cdBuilding, Orientation.OUTWARD);
parseBuildingConstructiveElements(gmlAb, cdBuilding);
parseBuildingInstallations(gmlAb, cdBuilding); parseBuildingInstallations(gmlAb, cdBuilding);
parseBuildingRooms(gmlAb, cdBuilding); parseBuildingRooms(gmlAb, cdBuilding);
parseBuildingSubdivisions(gmlAb, cdBuilding); parseBuildingSubdivisions(gmlAb, cdBuilding);
...@@ -1084,6 +1159,19 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -1084,6 +1159,19 @@ public class Citygml3FeatureMapper extends ObjectWalker {
} }
} }
private void parseBuildingConstructiveElements(org.citygml4j.core.model.building.AbstractBuilding gmlAb, AbstractBuilding cdBuilding) {
for (BuildingConstructiveElementProperty bceProp : gmlAb.getBuildingConstructiveElements()) {
var gmlBCE = bceProp.getObject();
if (gmlBCE == null) {
continue;
}
de.hft.stuttgart.citydoctor2.datastructure.BuildingConstructiveElement bce =
new de.hft.stuttgart.citydoctor2.datastructure.BuildingConstructiveElement(gmlBCE);
mapBuildingConstructiveElement(bce, gmlBCE);
cdBuilding.addConstructiveElement(bce);
}
}
private void parseBuildingRooms(org.citygml4j.core.model.building.AbstractBuilding gmlAb, AbstractBuilding cdBuilding) { private void parseBuildingRooms(org.citygml4j.core.model.building.AbstractBuilding gmlAb, AbstractBuilding cdBuilding) {
for (BuildingRoomProperty brProp : gmlAb.getBuildingRooms()) { for (BuildingRoomProperty brProp : gmlAb.getBuildingRooms()) {
var gmlBr = brProp.getObject(); var gmlBr = brProp.getObject();
...@@ -1120,7 +1208,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -1120,7 +1208,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
BuildingRoom br = new BuildingRoom(); BuildingRoom br = new BuildingRoom();
br.setGmlObject(gmlBr); br.setGmlObject(gmlBr);
mapAbstractUnoccupiedSpace(gmlBr, br); mapAbstractUnoccupiedSpace(gmlBr, br, Orientation.INWARD);
SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config); SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config);
for (AbstractSpaceBoundaryProperty surfaceProp : gmlBr.getBoundaries()) { for (AbstractSpaceBoundaryProperty surfaceProp : gmlBr.getBoundaries()) {
...@@ -1161,7 +1249,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -1161,7 +1249,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
private BuildingRoomFurniture mapBuildingFurniture(BuildingFurniture gmlAF) { private BuildingRoomFurniture mapBuildingFurniture(BuildingFurniture gmlAF) {
BuildingRoomFurniture bf = new BuildingRoomFurniture(); BuildingRoomFurniture bf = new BuildingRoomFurniture();
bf.setGmlObject(gmlAF); bf.setGmlObject(gmlAF);
mapAbstractOccupiedSpace(gmlAF, bf); mapAbstractOccupiedSpace(gmlAF, bf, Orientation.OUTWARD);
SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config); SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config);
for (AbstractSpaceBoundaryProperty surfaceProp : gmlAF.getBoundaries()) { for (AbstractSpaceBoundaryProperty surfaceProp : gmlAF.getBoundaries()) {
if (!surfaceProp.isSetObject()) { if (!surfaceProp.isSetObject()) {
...@@ -1182,10 +1270,25 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -1182,10 +1270,25 @@ public class Citygml3FeatureMapper extends ObjectWalker {
} }
private void mapBuildingConstructiveElement(de.hft.stuttgart.citydoctor2.datastructure.BuildingConstructiveElement bce, BuildingConstructiveElement ele) {
mapAbstractOccupiedSpace(ele, bce, Orientation.OUTWARD);
SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config);
for (AbstractSpaceBoundaryProperty surfaceProp : ele.getBoundaries()) {
if (!surfaceProp.isSetObject()) {
continue;
}
AbstractSpaceBoundary surface = surfaceProp.getObject();
surface.accept(surfaceMapper);
}
for (BoundarySurface bs : surfaceMapper.getSurfaces()) {
bce.addBoundarySurface(bs);
}
}
private de.hft.stuttgart.citydoctor2.datastructure.Storey mapBuildingStorey(Storey gmlStorey) { private de.hft.stuttgart.citydoctor2.datastructure.Storey mapBuildingStorey(Storey gmlStorey) {
de.hft.stuttgart.citydoctor2.datastructure.Storey storey = new de.hft.stuttgart.citydoctor2.datastructure.Storey(); de.hft.stuttgart.citydoctor2.datastructure.Storey storey = new de.hft.stuttgart.citydoctor2.datastructure.Storey();
storey.setGmlObject(gmlStorey); storey.setGmlObject(gmlStorey);
mapAbstractSpace(gmlStorey, storey); mapAbstractSpace(gmlStorey, storey, Orientation.INWARD);
SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config); SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config);
for (AbstractSpaceBoundaryProperty surfaceProp : gmlStorey.getBoundaries()) { for (AbstractSpaceBoundaryProperty surfaceProp : gmlStorey.getBoundaries()) {
if (!surfaceProp.isSetObject()) { if (!surfaceProp.isSetObject()) {
...@@ -1208,7 +1311,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -1208,7 +1311,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
private de.hft.stuttgart.citydoctor2.datastructure.BuildingUnit mapBuildingUnit(BuildingUnit gmlBU) { private de.hft.stuttgart.citydoctor2.datastructure.BuildingUnit mapBuildingUnit(BuildingUnit gmlBU) {
de.hft.stuttgart.citydoctor2.datastructure.BuildingUnit bu = new de.hft.stuttgart.citydoctor2.datastructure.BuildingUnit(); de.hft.stuttgart.citydoctor2.datastructure.BuildingUnit bu = new de.hft.stuttgart.citydoctor2.datastructure.BuildingUnit();
bu.setGmlObject(gmlBU); bu.setGmlObject(gmlBU);
mapAbstractSpace(gmlBU, bu); mapAbstractSpace(gmlBU, bu, Orientation.OUTWARD);
SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config); SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config);
for (AbstractSpaceBoundaryProperty surfaceProp : gmlBU.getBoundaries()) { for (AbstractSpaceBoundaryProperty surfaceProp : gmlBU.getBoundaries()) {
if (!surfaceProp.isSetObject()) { if (!surfaceProp.isSetObject()) {
...@@ -1242,13 +1345,13 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -1242,13 +1345,13 @@ public class Citygml3FeatureMapper extends ObjectWalker {
private Installation mapBuildingInstallation(org.citygml4j.core.model.building.BuildingInstallation gmlBi) { private Installation mapBuildingInstallation(org.citygml4j.core.model.building.BuildingInstallation gmlBi) {
Installation bi = new Installation(); Installation bi = new Installation();
bi.setGmlObject(gmlBi); bi.setGmlObject(gmlBi);
mapAbstractOccupiedSpace(gmlBi, bi); mapAbstractOccupiedSpace(gmlBi, bi, Orientation.OUTWARD);
GeometryProperty<?> lod2Prop = gmlBi.getDeprecatedProperties().getLod2Geometry(); GeometryProperty<?> lod2Prop = gmlBi.getDeprecatedProperties().getLod2Geometry();
parseAndAddAbstractGeometry(lod2Prop, Lod.LOD2, bi); parseAndAddAbstractGeometry(lod2Prop, Lod.LOD2, bi, Orientation.OUTWARD);
GeometryProperty<?> lod3Prop = gmlBi.getDeprecatedProperties().getLod3Geometry(); GeometryProperty<?> lod3Prop = gmlBi.getDeprecatedProperties().getLod3Geometry();
parseAndAddAbstractGeometry(lod3Prop, Lod.LOD3, bi); parseAndAddAbstractGeometry(lod3Prop, Lod.LOD3, bi, Orientation.OUTWARD);
GeometryProperty<?> lod4Prop = gmlBi.getDeprecatedProperties().getLod4Geometry(); GeometryProperty<?> lod4Prop = gmlBi.getDeprecatedProperties().getLod4Geometry();
parseAndAddAbstractGeometry(lod4Prop, Lod.LOD4, bi); parseAndAddAbstractGeometry(lod4Prop, Lod.LOD4, bi, Orientation.OUTWARD);
SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config); SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config);
for (AbstractSpaceBoundaryProperty surfaceProp : gmlBi.getBoundaries()) { for (AbstractSpaceBoundaryProperty surfaceProp : gmlBi.getBoundaries()) {
...@@ -1276,7 +1379,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -1276,7 +1379,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
return bi; return bi;
} }
private void parseAndAddAbstractGeometry(GeometryProperty<?> geomProp, Lod lod, CityObject co) { private void parseAndAddAbstractGeometry(GeometryProperty<?> geomProp, Lod lod, CityObject co, Orientation orientation) {
if (geomProp == null || geomProp.getObject() == null) { if (geomProp == null || geomProp.getObject() == null) {
return; return;
} }
...@@ -1285,7 +1388,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -1285,7 +1388,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
Geometry geom = parseMultiSurface(ms, lod); Geometry geom = parseMultiSurface(ms, lod);
co.addGeometry(geom); co.addGeometry(geom);
} else if (abstractGeometry instanceof Solid solid) { } else if (abstractGeometry instanceof Solid solid) {
Geometry geom = parseSolid(solid, lod); Geometry geom = parseSolid(solid, lod, orientation);
if (geom != null) { if (geom != null) {
co.addGeometry(geom); co.addGeometry(geom);
} }
...@@ -1294,9 +1397,9 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -1294,9 +1397,9 @@ public class Citygml3FeatureMapper extends ObjectWalker {
} }
} }
private Geometry parseSolid(AbstractSolid abstractSolid, Lod lod) { private Geometry parseSolid(AbstractSolid abstractSolid, Lod lod, Orientation orientation) {
if (abstractSolid instanceof Solid s) { if (abstractSolid instanceof Solid s) {
return handleSolidGeometry(s, lod); return handleSolidGeometry(s, lod, orientation);
} else { } else {
logger.warn("Cannot handle solid class {}, can only process pure solids", logger.warn("Cannot handle solid class {}, can only process pure solids",
abstractSolid.getClass().getSimpleName()); abstractSolid.getClass().getSimpleName());
...@@ -1304,13 +1407,13 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -1304,13 +1407,13 @@ public class Citygml3FeatureMapper extends ObjectWalker {
} }
} }
private Geometry handleSolidGeometry(Solid solid, Lod lod) { private Geometry handleSolidGeometry(Solid solid, Lod lod, Orientation orientation) {
ShellProperty exteriorProperty = solid.getExterior(); ShellProperty exteriorProperty = solid.getExterior();
if (exteriorProperty == null || exteriorProperty.getObject() == null) { if (exteriorProperty == null || exteriorProperty.getObject() == null) {
logger.warn("Found solid {} without exterior hull, ignoring", solid.getId()); logger.warn("Found solid {} without exterior hull, ignoring", solid.getId());
return null; return null;
} }
Geometry geom = new Geometry(GeometryType.SOLID, lod); Geometry geom = new Geometry(GeometryType.SOLID, lod, orientation);
Shell exterior = solid.getExterior().getObject(); Shell exterior = solid.getExterior().getObject();
Citygml3GeometryMapper geometryMapper = new Citygml3GeometryMapper(config, vertexMap); Citygml3GeometryMapper geometryMapper = new Citygml3GeometryMapper(config, vertexMap);
readSurfaceMember(geom, geometryMapper, exterior.getSurfaceMembers()); readSurfaceMember(geom, geometryMapper, exterior.getSurfaceMembers());
...@@ -1318,7 +1421,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -1318,7 +1421,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
} }
private Geometry parseMultiSurface(MultiSurface ms, Lod lod) { private Geometry parseMultiSurface(MultiSurface ms, Lod lod) {
Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, lod); Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, lod, null);
Citygml3GeometryMapper geometryMapper = new Citygml3GeometryMapper(config, vertexMap); Citygml3GeometryMapper geometryMapper = new Citygml3GeometryMapper(config, vertexMap);
readSurfaceMember(geom, geometryMapper, ms.getSurfaceMember()); readSurfaceMember(geom, geometryMapper, ms.getSurfaceMember());
return geom; return geom;
...@@ -1348,7 +1451,7 @@ public class Citygml3FeatureMapper extends ObjectWalker { ...@@ -1348,7 +1451,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
} }
private Geometry parseCompositeSurface(CompositeSurface cs, Lod lod) { private Geometry parseCompositeSurface(CompositeSurface cs, Lod lod) {
Geometry geom = new Geometry(GeometryType.COMPOSITE_SURFACE, lod); Geometry geom = new Geometry(GeometryType.COMPOSITE_SURFACE, lod, null);
Citygml3GeometryMapper geometryMapper = new Citygml3GeometryMapper(config, vertexMap); Citygml3GeometryMapper geometryMapper = new Citygml3GeometryMapper(config, vertexMap);
readSurfaceMember(geom, geometryMapper, cs.getSurfaceMembers()); readSurfaceMember(geom, geometryMapper, cs.getSurfaceMembers());
return geom; return geom;
......
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