Commit 02de0a22 authored by Riegel's avatar Riegel
Browse files

Reformat code

parent ad3589e8
Pipeline #10297 passed with stage
in 1 minute and 5 seconds
...@@ -11,12 +11,18 @@ import de.hft.stuttgart.citydoctor2.utils.CopyHandler; ...@@ -11,12 +11,18 @@ import de.hft.stuttgart.citydoctor2.utils.CopyHandler;
import de.hft.stuttgart.citydoctor2.utils.Copyable; import de.hft.stuttgart.citydoctor2.utils.Copyable;
import java.io.Serial; import java.io.Serial;
import java.util.*; import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/** /**
* Dataholding class for parsing and resolving of CompositeSurfaces. * Pseudo-abstract polygon class for parsing and resolving of CompositeSurfaces and references to them.
* <p>CompositePolygons have no exterior or interior LinearRings themselves and need to be filtered out from
* the polygons of a CityObject geometry before further processing steps.
*
* @author Riegel
*/ */
public final class CompositePolygon extends ConcretePolygon{ public final class CompositePolygon extends ConcretePolygon {
@Serial @Serial
private static final long serialVersionUID = -1867197873443341287L; private static final long serialVersionUID = -1867197873443341287L;
...@@ -32,7 +38,8 @@ public final class CompositePolygon extends ConcretePolygon{ ...@@ -32,7 +38,8 @@ public final class CompositePolygon extends ConcretePolygon{
} }
@Override @Override
public void accept(Check c){} public void accept(Check c) {
}
@Override @Override
public Class<? extends Checkable> getCheckClass() { public Class<? extends Checkable> getCheckClass() {
...@@ -40,24 +47,25 @@ public final class CompositePolygon extends ConcretePolygon{ ...@@ -40,24 +47,25 @@ public final class CompositePolygon extends ConcretePolygon{
} }
@Override @Override
public boolean containsAnyError(){ public boolean containsAnyError() {
return false; return false;
} }
@Override @Override
public void collectContainedErrors(List<CheckError> errors) {} public void collectContainedErrors(List<CheckError> errors) {
}
@Override @Override
public void clearAllContainedCheckResults() { public void clearAllContainedCheckResults() {
} }
public void addCompositeMember(ConcretePolygon p){ public void addCompositeMember(ConcretePolygon p) {
compositeMembers.add(p); compositeMembers.add(p);
p.setPartOfComposite(this); p.setPartOfComposite(this);
} }
public List<ConcretePolygon> getCompositeMembers(){ public List<ConcretePolygon> getCompositeMembers() {
return compositeMembers; return compositeMembers;
} }
...@@ -67,7 +75,6 @@ public final class CompositePolygon extends ConcretePolygon{ ...@@ -67,7 +75,6 @@ public final class CompositePolygon extends ConcretePolygon{
} }
@Override @Override
public Vector3d calculateNormal() { public Vector3d calculateNormal() {
return compositeMembers.get(0).calculateNormal(); return compositeMembers.get(0).calculateNormal();
...@@ -76,7 +83,7 @@ public final class CompositePolygon extends ConcretePolygon{ ...@@ -76,7 +83,7 @@ public final class CompositePolygon extends ConcretePolygon{
@Override @Override
public TesselatedPolygon tesselate() { public TesselatedPolygon tesselate() {
List<Triangle3d> tessPolys = new ArrayList<>(); List<Triangle3d> tessPolys = new ArrayList<>();
return new TesselatedPolygon(tessPolys,this ); return new TesselatedPolygon(tessPolys, this);
} }
@Override @Override
...@@ -190,7 +197,6 @@ public final class CompositePolygon extends ConcretePolygon{ ...@@ -190,7 +197,6 @@ public final class CompositePolygon extends ConcretePolygon{
} }
@Override @Override
public void collectInstances(CopyHandler handler) { public void collectInstances(CopyHandler handler) {
......
...@@ -53,9 +53,7 @@ public class ConcretePolygon extends Polygon { ...@@ -53,9 +53,7 @@ public class ConcretePolygon extends Polygon {
private Geometry parent; private Geometry parent;
private LinkedPolygon linkedFromPolygon; private LinkedPolygon linkedFromPolygon;
public ConcretePolygon() { public ConcretePolygon() {}
// TODO Auto-generated constructor stub
}
/* /*
* (non-Javadoc) * (non-Javadoc)
......
...@@ -18,19 +18,18 @@ ...@@ -18,19 +18,18 @@
*/ */
package de.hft.stuttgart.citydoctor2.datastructure; package de.hft.stuttgart.citydoctor2.datastructure;
import de.hft.stuttgart.citydoctor2.utils.CopyHandler;
import de.hft.stuttgart.citydoctor2.utils.Copyable;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import de.hft.stuttgart.citydoctor2.utils.CopyHandler;
import de.hft.stuttgart.citydoctor2.utils.Copyable;
/** /**
* Representing an edge between two consecutive points of a linear ring * Representing an edge between two consecutive points of a linear ring
* *
* @author Matthias Betz * @author Matthias Betz
*
*/ */
public class Edge implements Serializable, Copyable { public class Edge implements Serializable, Copyable {
......
...@@ -22,7 +22,6 @@ package de.hft.stuttgart.citydoctor2.datastructure; ...@@ -22,7 +22,6 @@ package de.hft.stuttgart.citydoctor2.datastructure;
* Possible feature types in CityGML * Possible feature types in CityGML
* *
* @author Matthias Betz * @author Matthias Betz
*
*/ */
public enum FeatureType { public enum FeatureType {
......
...@@ -24,7 +24,7 @@ import java.util.List; ...@@ -24,7 +24,7 @@ import java.util.List;
/** /**
* *
*/ */
public class GenericCityObject extends CityObject{ public class GenericCityObject extends CityObject {
@Serial @Serial
private static final long serialVersionUID = 5886527664552294353L; private static final long serialVersionUID = 5886527664552294353L;
...@@ -49,7 +49,7 @@ public class GenericCityObject extends CityObject{ ...@@ -49,7 +49,7 @@ public class GenericCityObject extends CityObject{
@Override @Override
public void reCreateGeometries(GeometryFactory factory, ParserConfiguration config) { public void reCreateGeometries(GeometryFactory factory, ParserConfiguration config) {
for (Geometry geom : getGeometries()) { for (Geometry geom : getGeometries()) {
if (geom instanceof ImplicitGeometryHolder){ if (geom instanceof ImplicitGeometryHolder) {
continue; continue;
} }
if (geom.getType() == GeometryType.MULTI_SURFACE) { if (geom.getType() == GeometryType.MULTI_SURFACE) {
...@@ -213,7 +213,7 @@ public class GenericCityObject extends CityObject{ ...@@ -213,7 +213,7 @@ public class GenericCityObject extends CityObject{
} }
} }
public void setGmlObject(org.citygml4j.core.model.generics.GenericOccupiedSpace gos){ public void setGmlObject(org.citygml4j.core.model.generics.GenericOccupiedSpace gos) {
this.cgmlGos = gos; this.cgmlGos = gos;
} }
......
...@@ -18,16 +18,6 @@ ...@@ -18,16 +18,6 @@
*/ */
package de.hft.stuttgart.citydoctor2.datastructure; package de.hft.stuttgart.citydoctor2.datastructure;
import java.io.Serial;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Random;
import java.util.Set;
import de.hft.stuttgart.citydoctor2.check.Check; import de.hft.stuttgart.citydoctor2.check.Check;
import de.hft.stuttgart.citydoctor2.check.CheckError; import de.hft.stuttgart.citydoctor2.check.CheckError;
import de.hft.stuttgart.citydoctor2.check.CheckId; import de.hft.stuttgart.citydoctor2.check.CheckId;
...@@ -39,11 +29,14 @@ import de.hft.stuttgart.citydoctor2.utils.CopyHandler; ...@@ -39,11 +29,14 @@ import de.hft.stuttgart.citydoctor2.utils.CopyHandler;
import de.hft.stuttgart.citydoctor2.utils.Copyable; import de.hft.stuttgart.citydoctor2.utils.Copyable;
import de.hft.stuttgart.citydoctor2.utils.SerializablePair; import de.hft.stuttgart.citydoctor2.utils.SerializablePair;
import java.io.Serial;
import java.util.*;
import java.util.Map.Entry;
/** /**
* Representation of a geometry containing the polygons and edges * Representation of a geometry containing the polygons and edges
* *
* @author Matthias Betz * @author Matthias Betz
*
*/ */
public class Geometry extends GmlElement { public class Geometry extends GmlElement {
......
...@@ -22,7 +22,6 @@ package de.hft.stuttgart.citydoctor2.datastructure; ...@@ -22,7 +22,6 @@ package de.hft.stuttgart.citydoctor2.datastructure;
* Available geometry types * Available geometry types
* *
* @author Matthias Betz * @author Matthias Betz
*
*/ */
public enum GeometryType { public enum GeometryType {
......
...@@ -28,7 +28,6 @@ import java.io.Serial; ...@@ -28,7 +28,6 @@ import java.io.Serial;
* A general GML element that has a gml id * A general GML element that has a gml id
* *
* @author Matthias Betz * @author Matthias Betz
*
*/ */
public abstract class GmlElement extends Checkable implements Copyable { public abstract class GmlElement extends Checkable implements Copyable {
......
...@@ -27,7 +27,6 @@ import java.util.concurrent.atomic.AtomicInteger; ...@@ -27,7 +27,6 @@ import java.util.concurrent.atomic.AtomicInteger;
* generated by city doctor * generated by city doctor
* *
* @author Matthias Betz * @author Matthias Betz
*
*/ */
public class GmlId implements Serializable { public class GmlId implements Serializable {
......
...@@ -2,7 +2,6 @@ package de.hft.stuttgart.citydoctor2.datastructure; ...@@ -2,7 +2,6 @@ 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.math.TransformationMatrix; import de.hft.stuttgart.citydoctor2.math.TransformationMatrix;
import de.hft.stuttgart.citydoctor2.utils.CopyHandler;
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.core.ImplicitGeometry; import org.citygml4j.core.model.core.ImplicitGeometry;
...@@ -10,9 +9,11 @@ import org.citygml4j.core.model.core.ImplicitGeometry; ...@@ -10,9 +9,11 @@ import org.citygml4j.core.model.core.ImplicitGeometry;
import java.io.Serial; import java.io.Serial;
/** /**
* Datastructure for representation of implicit geometries * Datastructure for representation and resolving of implicit geometries
*
* @author Riegel
*/ */
public class ImplicitGeometryHolder extends Geometry{ public class ImplicitGeometryHolder extends Geometry {
private static final Logger logger = LogManager.getLogger(LibraryObject.class); private static final Logger logger = LogManager.getLogger(LibraryObject.class);
@Serial @Serial
...@@ -34,7 +35,7 @@ public class ImplicitGeometryHolder extends Geometry{ ...@@ -34,7 +35,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());
this.libObject = null; this.libObject = null;
this.relativeGeom = relativeGeometry; this.relativeGeom = relativeGeometry;
this.cgmlImplicitGeometry = cgmlImplicitGeometry; this.cgmlImplicitGeometry = cgmlImplicitGeometry;
...@@ -59,15 +60,15 @@ public class ImplicitGeometryHolder extends Geometry{ ...@@ -59,15 +60,15 @@ public class ImplicitGeometryHolder extends Geometry{
* Applies the transformation matrix of the implicit geometry to a copy of the reference geometry and copies the resulting * Applies the transformation matrix of the implicit geometry to a copy of the reference geometry and copies the resulting
* transformed geometry into this object. * transformed geometry into this object.
*/ */
private void applyTransformation(){ private void applyTransformation() {
TransformationMatrix transformMatrix = new TransformationMatrix(cgmlImplicitGeometry); TransformationMatrix transformMatrix = new TransformationMatrix(cgmlImplicitGeometry);
Geometry refGeo = null; Geometry refGeo = null;
if (libObject == null){ if (libObject == null) {
refGeo = relativeGeom; refGeo = relativeGeom;
} else if (relativeGeom == null){ } else if (relativeGeom == null) {
refGeo = libObject; refGeo = libObject;
} }
if (refGeo == null){ if (refGeo == null) {
throw new NullPointerException("Geometry reference object of ImplicitGeometryHolder is null!"); throw new NullPointerException("Geometry reference object of ImplicitGeometryHolder is null!");
} }
Geometry transformedGeom = transformMatrix.transformGeometry(refGeo); Geometry transformedGeom = transformMatrix.transformGeometry(refGeo);
......
...@@ -18,10 +18,13 @@ ...@@ -18,10 +18,13 @@
*/ */
package de.hft.stuttgart.citydoctor2.datastructure; package de.hft.stuttgart.citydoctor2.datastructure;
import java.io.Serial; import de.hft.stuttgart.citydoctor2.check.Check;
import java.util.ArrayList; import de.hft.stuttgart.citydoctor2.check.CheckError;
import java.util.List; import de.hft.stuttgart.citydoctor2.check.CheckId;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
import de.hft.stuttgart.citydoctor2.utils.CityGmlUtils;
import de.hft.stuttgart.citydoctor2.utils.CopyHandler;
import de.hft.stuttgart.citydoctor2.utils.Copyable;
import org.citygml4j.core.model.bridge.BridgeInstallation; import org.citygml4j.core.model.bridge.BridgeInstallation;
import org.citygml4j.core.model.construction.AbstractInstallation; import org.citygml4j.core.model.construction.AbstractInstallation;
import org.citygml4j.core.model.core.AbstractSpaceBoundaryProperty; import org.citygml4j.core.model.core.AbstractSpaceBoundaryProperty;
...@@ -32,13 +35,9 @@ import org.xmlobjects.gml.model.geometry.aggregates.MultiSurfaceProperty; ...@@ -32,13 +35,9 @@ 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.SurfaceProperty; import org.xmlobjects.gml.model.geometry.primitives.SurfaceProperty;
import de.hft.stuttgart.citydoctor2.check.Check; import java.io.Serial;
import de.hft.stuttgart.citydoctor2.check.CheckError; import java.util.ArrayList;
import de.hft.stuttgart.citydoctor2.check.CheckId; import java.util.List;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
import de.hft.stuttgart.citydoctor2.utils.CityGmlUtils;
import de.hft.stuttgart.citydoctor2.utils.CopyHandler;
import de.hft.stuttgart.citydoctor2.utils.Copyable;
public class Installation extends CityObject { public class Installation extends CityObject {
......
...@@ -18,24 +18,22 @@ ...@@ -18,24 +18,22 @@
*/ */
package de.hft.stuttgart.citydoctor2.datastructure; package de.hft.stuttgart.citydoctor2.datastructure;
import de.hft.stuttgart.citydoctor2.check.Check;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
import de.hft.stuttgart.citydoctor2.utils.CityGmlUtils;
import de.hft.stuttgart.citydoctor2.utils.Copyable;
import org.citygml4j.core.model.core.AbstractCityObject; import org.citygml4j.core.model.core.AbstractCityObject;
import org.citygml4j.core.model.landuse.LandUse; import org.citygml4j.core.model.landuse.LandUse;
import org.citygml4j.core.util.geometry.GeometryFactory; import org.citygml4j.core.util.geometry.GeometryFactory;
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 de.hft.stuttgart.citydoctor2.check.Check;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
import de.hft.stuttgart.citydoctor2.utils.CityGmlUtils;
import de.hft.stuttgart.citydoctor2.utils.Copyable;
import java.io.Serial; import java.io.Serial;
/** /**
* Represents a land use CityGML object. * Represents a land use CityGML object.
* *
* @author Matthias Betz * @author Matthias Betz
*
*/ */
public class LandObject extends CityObject { public class LandObject extends CityObject {
......
package de.hft.stuttgart.citydoctor2.datastructure; package de.hft.stuttgart.citydoctor2.datastructure;
import de.hft.stuttgart.citydoctor2.check.Check;
import de.hft.stuttgart.citydoctor2.mapper.citygml3.Citygml3FeatureMapper;
import de.hft.stuttgart.citydoctor2.parser.CityGmlParseException; import de.hft.stuttgart.citydoctor2.parser.CityGmlParseException;
import de.hft.stuttgart.citydoctor2.parser.CityGmlParser; import de.hft.stuttgart.citydoctor2.parser.CityGmlParser;
import de.hft.stuttgart.citydoctor2.parser.InvalidGmlFileException; import de.hft.stuttgart.citydoctor2.parser.InvalidGmlFileException;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration; import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
import de.hft.stuttgart.citydoctor2.utils.CopyHandler;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
...@@ -14,17 +11,20 @@ import java.io.Serial; ...@@ -14,17 +11,20 @@ import java.io.Serial;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
* Reference object for handling of implicit geometries with a library object contained in an external file * Reference object for handling of implicit geometries with a library object contained in an external file
*
* @author Riegel
*/ */
public class LibraryObject extends Geometry{ public class LibraryObject extends Geometry {
private static final Logger logger = LogManager.getLogger(LibraryObject.class); private static final Logger logger = LogManager.getLogger(LibraryObject.class);
@Serial @Serial
private static final long serialVersionUID = -50293435187454911L; private static final long serialVersionUID = -50293435187454911L;
private final String filepath; private final String filepath;
private final ParserConfiguration config; private final ParserConfiguration config;
private static HashMap<String,LibraryObject> libraryObjects = new HashMap<>(); private static HashMap<String, LibraryObject> libraryObjects = new HashMap<>();
public static LibraryObject of(Path path, ParserConfiguration config) { public static LibraryObject of(Path path, ParserConfiguration config) {
if (libraryObjects.containsKey(path.toString())) { if (libraryObjects.containsKey(path.toString())) {
...@@ -34,7 +34,7 @@ public class LibraryObject extends Geometry{ ...@@ -34,7 +34,7 @@ public class LibraryObject extends Geometry{
if (protoGeom == null) { if (protoGeom == null) {
return null; return null;
} }
LibraryObject libOb = new LibraryObject(protoGeom.getType(),protoGeom.getLod(),path, config); LibraryObject libOb = new LibraryObject(protoGeom.getType(), protoGeom.getLod(), path, config);
protoGeom.getPolygons().forEach(libOb::addPolygon); protoGeom.getPolygons().forEach(libOb::addPolygon);
libOb.updateEdgesAndVertices(); libOb.updateEdgesAndVertices();
libraryObjects.put(path.toString(), libOb); libraryObjects.put(path.toString(), libOb);
...@@ -42,7 +42,7 @@ public class LibraryObject extends Geometry{ ...@@ -42,7 +42,7 @@ public class LibraryObject extends Geometry{
} }
private LibraryObject(GeometryType type, Lod lod, Path path, ParserConfiguration config) { private LibraryObject(GeometryType type, Lod lod, Path path, ParserConfiguration config) {
super(type,lod); super(type, lod);
this.filepath = path.toString(); this.filepath = path.toString();
this.config = config; this.config = config;
} }
...@@ -50,28 +50,28 @@ public class LibraryObject extends Geometry{ ...@@ -50,28 +50,28 @@ public class LibraryObject extends Geometry{
private static Geometry parseFile(Path path, ParserConfiguration config) { private static Geometry parseFile(Path path, ParserConfiguration config) {
Geometry geo = null; Geometry geo = null;
if (path.toFile().exists()){ if (path.toFile().exists()) {
try { try {
CityGmlParser.gagLogger(true); CityGmlParser.gagLogger(true);
CityDoctorModel model = CityGmlParser.parseCityGmlFile(path.toString(), config); CityDoctorModel model = CityGmlParser.parseCityGmlFile(path.toString(), config);
List<CityObject> objects = model.createFeatureStream().toList(); List<CityObject> objects = model.createFeatureStream().toList();
if (objects.isEmpty()){ if (objects.isEmpty()) {
throw new InvalidGmlFileException("Referenced library-object's gml file does not contain a CityGML object!"); throw new InvalidGmlFileException("Referenced library-object's gml file does not contain a CityGML object!");
} else if (objects.size() > 1){ } else if (objects.size() > 1) {
throw new InvalidGmlFileException("Referenced library-object's gml file contains more than one CityGML object!"); throw new InvalidGmlFileException("Referenced library-object's gml file contains more than one CityGML object!");
} }
geo = objects.get(0).getHighestLodGeometry(); geo = objects.get(0).getHighestLodGeometry();
} catch (CityGmlParseException e){ } catch (CityGmlParseException e) {
logger.error(String.format( logger.error(String.format(
"Encountered an error while parsing library object %s", path)); "Encountered an error while parsing library object %s", path));
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
} catch (InvalidGmlFileException e){ } catch (InvalidGmlFileException e) {
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
} finally { } finally {
// Failsafe to remove gag should parsing fail // Failsafe to remove gag should parsing fail
CityGmlParser.gagLogger(false); CityGmlParser.gagLogger(false);
} }
} else{ } else {
logger.error(String.format("Implicit geometry references non-existing library object file %s.", path)); logger.error(String.format("Implicit geometry references non-existing library object file %s.", path));
} }
return geo; return geo;
......
...@@ -18,24 +18,19 @@ ...@@ -18,24 +18,19 @@
*/ */
package de.hft.stuttgart.citydoctor2.datastructure; package de.hft.stuttgart.citydoctor2.datastructure;
import java.io.Serial;
import java.util.ArrayList;
import java.util.List;
import de.hft.stuttgart.citydoctor2.check.Check; import de.hft.stuttgart.citydoctor2.check.Check;
import de.hft.stuttgart.citydoctor2.math.ProjectionAxis; import de.hft.stuttgart.citydoctor2.math.*;
import de.hft.stuttgart.citydoctor2.math.Ring2d;
import de.hft.stuttgart.citydoctor2.math.UnitVector3d;
import de.hft.stuttgart.citydoctor2.math.Vector2d;
import de.hft.stuttgart.citydoctor2.math.Vector3d;
import de.hft.stuttgart.citydoctor2.utils.CopyHandler; import de.hft.stuttgart.citydoctor2.utils.CopyHandler;
import de.hft.stuttgart.citydoctor2.utils.Copyable; import de.hft.stuttgart.citydoctor2.utils.Copyable;
import java.io.Serial;
import java.util.ArrayList;
import java.util.List;
/** /**
* Represents a linear ring used in polygons. The ring contains the vertices. * Represents a linear ring used in polygons. The ring contains the vertices.
* *
* @author Matthias Betz * @author Matthias Betz
*
*/ */
public class LinearRing extends GmlElement { public class LinearRing extends GmlElement {
......
...@@ -18,10 +18,6 @@ ...@@ -18,10 +18,6 @@
*/ */
package de.hft.stuttgart.citydoctor2.datastructure; package de.hft.stuttgart.citydoctor2.datastructure;
import java.io.Serial;
import java.util.List;
import java.util.Map;
import de.hft.stuttgart.citydoctor2.check.Check; import de.hft.stuttgart.citydoctor2.check.Check;
import de.hft.stuttgart.citydoctor2.check.CheckError; import de.hft.stuttgart.citydoctor2.check.CheckError;
import de.hft.stuttgart.citydoctor2.check.CheckId; import de.hft.stuttgart.citydoctor2.check.CheckId;
...@@ -31,12 +27,15 @@ import de.hft.stuttgart.citydoctor2.tesselation.TesselatedPolygon; ...@@ -31,12 +27,15 @@ import de.hft.stuttgart.citydoctor2.tesselation.TesselatedPolygon;
import de.hft.stuttgart.citydoctor2.utils.CopyHandler; import de.hft.stuttgart.citydoctor2.utils.CopyHandler;
import de.hft.stuttgart.citydoctor2.utils.Copyable; import de.hft.stuttgart.citydoctor2.utils.Copyable;
import java.io.Serial;
import java.util.List;
import java.util.Map;
/** /**
* A polygon that does not contain the geometry but is only a link to an actual * A polygon that does not contain the geometry but is only a link to an actual
* polygon. Created when href in CityGML are used. * polygon. Created when href in CityGML are used.
* *
* @author Matthias Betz * @author Matthias Betz
*
*/ */
public class LinkedPolygon extends Polygon { public class LinkedPolygon extends Polygon {
...@@ -50,7 +49,6 @@ public class LinkedPolygon extends Polygon { ...@@ -50,7 +49,6 @@ public class LinkedPolygon extends Polygon {
} }
/** /**
*
* @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
*/ */
......
...@@ -22,7 +22,6 @@ package de.hft.stuttgart.citydoctor2.datastructure; ...@@ -22,7 +22,6 @@ package de.hft.stuttgart.citydoctor2.datastructure;
* The different LODs available in CityGML * The different LODs available in CityGML
* *
* @author Matthias Betz * @author Matthias Betz
*
*/ */
public enum Lod { public enum Lod {
......
...@@ -18,17 +18,16 @@ ...@@ -18,17 +18,16 @@
*/ */
package de.hft.stuttgart.citydoctor2.datastructure; package de.hft.stuttgart.citydoctor2.datastructure;
import org.citygml4j.core.model.construction.AbstractFillingSurface;
import org.citygml4j.core.model.core.AbstractCityObject;
import org.citygml4j.core.util.geometry.GeometryFactory;
import org.xmlobjects.gml.model.geometry.aggregates.MultiSurface;
import org.xmlobjects.gml.model.geometry.aggregates.MultiSurfaceProperty;
import de.hft.stuttgart.citydoctor2.check.Check; import de.hft.stuttgart.citydoctor2.check.Check;
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 de.hft.stuttgart.citydoctor2.utils.CopyHandler; import de.hft.stuttgart.citydoctor2.utils.CopyHandler;
import de.hft.stuttgart.citydoctor2.utils.Copyable; import de.hft.stuttgart.citydoctor2.utils.Copyable;
import org.citygml4j.core.model.construction.AbstractFillingSurface;
import org.citygml4j.core.model.core.AbstractCityObject;
import org.citygml4j.core.util.geometry.GeometryFactory;
import org.xmlobjects.gml.model.geometry.aggregates.MultiSurface;
import org.xmlobjects.gml.model.geometry.aggregates.MultiSurfaceProperty;
import java.io.Serial; import java.io.Serial;
...@@ -38,7 +37,6 @@ import java.io.Serial; ...@@ -38,7 +37,6 @@ import java.io.Serial;
* in. * in.
* *
* @author Matthias Betz * @author Matthias Betz
*
*/ */
public class Opening extends CityObject { public class Opening extends CityObject {
......
...@@ -22,7 +22,6 @@ package de.hft.stuttgart.citydoctor2.datastructure; ...@@ -22,7 +22,6 @@ package de.hft.stuttgart.citydoctor2.datastructure;
* The available opening types in CityGML * The available opening types in CityGML
* *
* @author Matthias Betz * @author Matthias Betz
*
*/ */
public enum OpeningType { public enum OpeningType {
......
...@@ -18,17 +18,16 @@ ...@@ -18,17 +18,16 @@
*/ */
package de.hft.stuttgart.citydoctor2.datastructure; package de.hft.stuttgart.citydoctor2.datastructure;
import java.io.Serial;
import java.util.List;
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 java.io.Serial;
import java.util.List;
/** /**
* Interface for concrete and linked polygons. * Interface for concrete and linked polygons.
* *
* @author Matthias Betz * @author Matthias Betz
*
*/ */
public abstract class Polygon extends GmlElement { public abstract class Polygon extends GmlElement {
...@@ -36,6 +35,7 @@ public abstract class Polygon extends GmlElement { ...@@ -36,6 +35,7 @@ public abstract class Polygon extends GmlElement {
private static final long serialVersionUID = -613942946364706513L; private static final long serialVersionUID = -613942946364706513L;
public abstract Vector3d calculateNormalNormalized(); public abstract Vector3d calculateNormalNormalized();
public abstract Vector3d calculateNormal(); public abstract Vector3d calculateNormal();
public abstract TesselatedPolygon tesselate(); public abstract TesselatedPolygon tesselate();
......
package de.hft.stuttgart.citydoctor2.datastructure; package de.hft.stuttgart.citydoctor2.datastructure;
import de.hft.stuttgart.citydoctor2.utils.CopyHandler;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
...@@ -10,6 +9,8 @@ import java.util.HashMap; ...@@ -10,6 +9,8 @@ import java.util.HashMap;
/** /**
* Reference object for handling of implicit geometries with a relative geometry * Reference object for handling of implicit geometries with a relative geometry
*
* @author Riegel
*/ */
public class RelativeGeometry extends Geometry { public class RelativeGeometry extends Geometry {
...@@ -17,16 +18,16 @@ public class RelativeGeometry extends Geometry { ...@@ -17,16 +18,16 @@ public class RelativeGeometry extends Geometry {
@Serial @Serial
private static final long serialVersionUID = -686112245455298977L; private static final long serialVersionUID = -686112245455298977L;
private static HashMap<Geometry,RelativeGeometry> relativeGeometries = new HashMap<>(); private static HashMap<Geometry, RelativeGeometry> relativeGeometries = new HashMap<>();
public static RelativeGeometry of(Geometry geom){ public static RelativeGeometry of(Geometry geom) {
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.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;
} }
......
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