Commit f78213de authored by Matthias Betz's avatar Matthias Betz
Browse files

Merge remote-tracking branch 'remotes/origin/dev' into 120-portierung-sweep-algorithmen

parents b8bac3e6 c2329310
Pipeline #12386 passed with stage
in 1 minute and 57 seconds
...@@ -37,7 +37,7 @@ import de.hft.stuttgart.citydoctor2.check.error.SchematronError; ...@@ -37,7 +37,7 @@ import de.hft.stuttgart.citydoctor2.check.error.SchematronError;
import de.hft.stuttgart.citydoctor2.check.error.SolidError; import de.hft.stuttgart.citydoctor2.check.error.SolidError;
import de.hft.stuttgart.citydoctor2.check.error.SolidNotClosedError; import de.hft.stuttgart.citydoctor2.check.error.SolidNotClosedError;
import de.hft.stuttgart.citydoctor2.check.error.SolidSelfIntError; import de.hft.stuttgart.citydoctor2.check.error.SolidSelfIntError;
import de.hft.stuttgart.citydoctor2.check.error.SurfaceUnfragmentedError; import de.hft.stuttgart.citydoctor2.check.error.SurfaceFragmentedError;
import de.hft.stuttgart.citydoctor2.check.error.TooFewPolygonsError; import de.hft.stuttgart.citydoctor2.check.error.TooFewPolygonsError;
import de.hft.stuttgart.citydoctor2.check.error.UnknownCheckError; import de.hft.stuttgart.citydoctor2.check.error.UnknownCheckError;
import de.hft.stuttgart.citydoctor2.check.error.XMLValidationError; import de.hft.stuttgart.citydoctor2.check.error.XMLValidationError;
...@@ -181,7 +181,7 @@ public abstract class AbstractErrorVisitor implements ErrorVisitor { ...@@ -181,7 +181,7 @@ public abstract class AbstractErrorVisitor implements ErrorVisitor {
} }
@Override @Override
public void visit(SurfaceUnfragmentedError err) { public void visit(SurfaceFragmentedError err) {
} }
@Override @Override
......
...@@ -55,7 +55,7 @@ import de.hft.stuttgart.citydoctor2.check.error.SchematronError; ...@@ -55,7 +55,7 @@ import de.hft.stuttgart.citydoctor2.check.error.SchematronError;
import de.hft.stuttgart.citydoctor2.check.error.SolidError; import de.hft.stuttgart.citydoctor2.check.error.SolidError;
import de.hft.stuttgart.citydoctor2.check.error.SolidNotClosedError; import de.hft.stuttgart.citydoctor2.check.error.SolidNotClosedError;
import de.hft.stuttgart.citydoctor2.check.error.SolidSelfIntError; import de.hft.stuttgart.citydoctor2.check.error.SolidSelfIntError;
import de.hft.stuttgart.citydoctor2.check.error.SurfaceUnfragmentedError; import de.hft.stuttgart.citydoctor2.check.error.SurfaceFragmentedError;
import de.hft.stuttgart.citydoctor2.check.error.TooFewPolygonsError; import de.hft.stuttgart.citydoctor2.check.error.TooFewPolygonsError;
import de.hft.stuttgart.citydoctor2.check.error.UnknownCheckError; import de.hft.stuttgart.citydoctor2.check.error.UnknownCheckError;
import de.hft.stuttgart.citydoctor2.check.error.XMLValidationError; import de.hft.stuttgart.citydoctor2.check.error.XMLValidationError;
...@@ -135,7 +135,7 @@ public interface ErrorVisitor { ...@@ -135,7 +135,7 @@ public interface ErrorVisitor {
public void visit(SchematronError err); public void visit(SchematronError err);
public void visit(SurfaceUnfragmentedError err); public void visit(SurfaceFragmentedError err);
public void visit(DegeneratedRingError err); public void visit(DegeneratedRingError err);
......
...@@ -48,7 +48,7 @@ import de.hft.stuttgart.citydoctor2.check.error.RingTooFewPointsError; ...@@ -48,7 +48,7 @@ import de.hft.stuttgart.citydoctor2.check.error.RingTooFewPointsError;
import de.hft.stuttgart.citydoctor2.check.error.SchematronError; import de.hft.stuttgart.citydoctor2.check.error.SchematronError;
import de.hft.stuttgart.citydoctor2.check.error.SolidNotClosedError; import de.hft.stuttgart.citydoctor2.check.error.SolidNotClosedError;
import de.hft.stuttgart.citydoctor2.check.error.SolidSelfIntError; import de.hft.stuttgart.citydoctor2.check.error.SolidSelfIntError;
import de.hft.stuttgart.citydoctor2.check.error.SurfaceUnfragmentedError; import de.hft.stuttgart.citydoctor2.check.error.SurfaceFragmentedError;
import de.hft.stuttgart.citydoctor2.check.error.TooFewPolygonsError; import de.hft.stuttgart.citydoctor2.check.error.TooFewPolygonsError;
import de.hft.stuttgart.citydoctor2.check.error.UnknownCheckError; import de.hft.stuttgart.citydoctor2.check.error.UnknownCheckError;
import de.hft.stuttgart.citydoctor2.check.error.XMLValidationError; import de.hft.stuttgart.citydoctor2.check.error.XMLValidationError;
...@@ -189,7 +189,7 @@ public interface HealingMethod { ...@@ -189,7 +189,7 @@ public interface HealingMethod {
return false; return false;
} }
default boolean visit(SurfaceUnfragmentedError err, ModificationListener l) { default boolean visit(SurfaceFragmentedError err, ModificationListener l) {
return false; return false;
} }
......
...@@ -55,7 +55,7 @@ import de.hft.stuttgart.citydoctor2.check.error.RingTooFewPointsError; ...@@ -55,7 +55,7 @@ import de.hft.stuttgart.citydoctor2.check.error.RingTooFewPointsError;
import de.hft.stuttgart.citydoctor2.check.error.SchematronError; import de.hft.stuttgart.citydoctor2.check.error.SchematronError;
import de.hft.stuttgart.citydoctor2.check.error.SolidNotClosedError; import de.hft.stuttgart.citydoctor2.check.error.SolidNotClosedError;
import de.hft.stuttgart.citydoctor2.check.error.SolidSelfIntError; import de.hft.stuttgart.citydoctor2.check.error.SolidSelfIntError;
import de.hft.stuttgart.citydoctor2.check.error.SurfaceUnfragmentedError; import de.hft.stuttgart.citydoctor2.check.error.SurfaceFragmentedError;
import de.hft.stuttgart.citydoctor2.check.error.TooFewPolygonsError; import de.hft.stuttgart.citydoctor2.check.error.TooFewPolygonsError;
import de.hft.stuttgart.citydoctor2.check.error.UnknownCheckError; import de.hft.stuttgart.citydoctor2.check.error.UnknownCheckError;
import de.hft.stuttgart.citydoctor2.check.error.XMLValidationError; import de.hft.stuttgart.citydoctor2.check.error.XMLValidationError;
...@@ -367,7 +367,7 @@ public class QualityAdeErrorVisitor extends AbstractErrorVisitor { ...@@ -367,7 +367,7 @@ public class QualityAdeErrorVisitor extends AbstractErrorVisitor {
} }
@Override @Override
public void visit(SurfaceUnfragmentedError err) { public void visit(SurfaceFragmentedError err) {
// not translated // not translated
} }
......
...@@ -63,7 +63,7 @@ public class Requirement implements Serializable { ...@@ -63,7 +63,7 @@ public class Requirement implements Serializable {
public static final Requirement R_GE_R_NULL_AREA = new Requirement("R_GE_R_NULL_AREA", RequirementType.GEOMETRY); public static final Requirement R_GE_R_NULL_AREA = new Requirement("R_GE_R_NULL_AREA", RequirementType.GEOMETRY);
public static final Requirement R_SE_BS_GROUND_UNFRAGMENTED = new Requirement("R_SE_BS_GROUND_UNFRAGMENTED", RequirementType.SEMANTIC); public static final Requirement R_SE_BS_GROUND_UNFRAGMENTED = new Requirement("R_SE_BS_GROUND_UNFRAGMENTED", RequirementType.SEMANTIC);
public static final Requirement R_SE_BS_ROOF_UNFRAGMENTED = new Requirement("R_SE_BS_GROUND_UNFRAGMENTED", RequirementType.SEMANTIC); public static final Requirement R_SE_BS_ROOF_UNFRAGMENTED = new Requirement("R_SE_BS_ROOF_UNFRAGMENTED", RequirementType.SEMANTIC);
public static final Requirement R_SE_BS_IS_CEILING = new Requirement("R_SE_BS_IS_CEILING", RequirementType.SEMANTIC); public static final Requirement R_SE_BS_IS_CEILING = new Requirement("R_SE_BS_IS_CEILING", RequirementType.SEMANTIC);
public static final Requirement R_SE_BS_IS_FLOOR = new Requirement("R_SE_BS_IS_FLOOR", RequirementType.SEMANTIC); public static final Requirement R_SE_BS_IS_FLOOR = new Requirement("R_SE_BS_IS_FLOOR", RequirementType.SEMANTIC);
public static final Requirement R_SE_BS_IS_WALL = new Requirement("R_SE_BS_IS_WALL", RequirementType.SEMANTIC); public static final Requirement R_SE_BS_IS_WALL = new Requirement("R_SE_BS_IS_WALL", RequirementType.SEMANTIC);
...@@ -83,6 +83,7 @@ public class Requirement implements Serializable { ...@@ -83,6 +83,7 @@ public class Requirement implements Serializable {
defaultParameters.add(new DefaultParameter(UPPER_ANGLE_NAME, "135", Unit.DEGREE)); defaultParameters.add(new DefaultParameter(UPPER_ANGLE_NAME, "135", Unit.DEGREE));
R_SE_BS_IS_WALL.parameters = Collections.unmodifiableList(defaultParameters); R_SE_BS_IS_WALL.parameters = Collections.unmodifiableList(defaultParameters);
defaultParameters = new ArrayList<>();
defaultParameters.add(new DefaultParameter(MAX_ANGLE_DEVIATION, "1", Unit.DEGREE)); defaultParameters.add(new DefaultParameter(MAX_ANGLE_DEVIATION, "1", Unit.DEGREE));
R_SE_BS_ROOF_UNFRAGMENTED.parameters = Collections.unmodifiableList(defaultParameters); R_SE_BS_ROOF_UNFRAGMENTED.parameters = Collections.unmodifiableList(defaultParameters);
......
...@@ -36,7 +36,7 @@ import java.io.Serial; ...@@ -36,7 +36,7 @@ import java.io.Serial;
* @author Matthias Betz * @author Matthias Betz
* *
*/ */
public class SurfaceUnfragmentedError implements CheckError { public class SurfaceFragmentedError implements CheckError {
@Serial @Serial
private static final long serialVersionUID = 3146243879393474196L; private static final long serialVersionUID = 3146243879393474196L;
...@@ -44,7 +44,7 @@ public class SurfaceUnfragmentedError implements CheckError { ...@@ -44,7 +44,7 @@ public class SurfaceUnfragmentedError implements CheckError {
private final BoundarySurface bs; private final BoundarySurface bs;
private final double angleDeviation; private final double angleDeviation;
public SurfaceUnfragmentedError(BoundarySurface bs, double angleDerivation) { public SurfaceFragmentedError(BoundarySurface bs, double angleDerivation) {
this.bs = bs; this.bs = bs;
this.angleDeviation = angleDerivation; this.angleDeviation = angleDerivation;
} }
......
...@@ -118,13 +118,15 @@ public class AllPolygonsWrongOrientationCheck extends Check { ...@@ -118,13 +118,15 @@ public class AllPolygonsWrongOrientationCheck extends Check {
// find the centroid of a triangle // find the centroid of a triangle
Vector3d centroid = t.getCentroid(); Vector3d centroid = t.getCentroid();
// create a point outside of the geometry // create a point outside of the geometry
Vector3d outsidePoint = bbox[0].minus(Vector3d.X, 5).minus(Vector3d.Y, 5).minus(Vector3d.Z, 5); Vector3d outsideDif1 = new Vector3d(5, 5, 5);
Vector3d outsidePoint = bbox[0].minus(outsideDif1);
// create a second point outside of the geometry // create a second point outside of the geometry
// the check can fail if the building is exactly oriented so that the ray is // the check can fail if the building is exactly oriented so that the ray is
// parallel to a side of the building // parallel to a side of the building
// in order to avoid this we check two rays, if one of those says it is oriented // in order to avoid this we check two rays, if one of those says it is oriented
// correctly it is oriented correctly // correctly it is oriented correctly
Vector3d secondOutsidePoint = bbox[0].minus(Vector3d.X, 5).minus(Vector3d.Y, 10).minus(Vector3d.Z, 5); Vector3d outsideDif2 = new Vector3d(7, 10, 5);
Vector3d secondOutsidePoint = bbox[0].minus(outsideDif2);
return checkIfGeometryIsWrongOriented(tessPolygons, centroid, outsidePoint) return checkIfGeometryIsWrongOriented(tessPolygons, centroid, outsidePoint)
|| checkIfGeometryIsWrongOriented(tessPolygons, centroid, secondOutsidePoint); || checkIfGeometryIsWrongOriented(tessPolygons, centroid, secondOutsidePoint);
} }
...@@ -164,8 +166,8 @@ public class AllPolygonsWrongOrientationCheck extends Check { ...@@ -164,8 +166,8 @@ public class AllPolygonsWrongOrientationCheck extends Check {
} }
private Triangle3d findSuitableTriangle(TesselatedPolygon p1) { private Triangle3d findSuitableTriangle(TesselatedPolygon p1) {
Triangle3d t = p1.getTriangles().get(0); Triangle3d t = null;
double maxArea = t.getArea(); double maxArea = Double.NEGATIVE_INFINITY;
for (Triangle3d tri : p1.getTriangles()) { for (Triangle3d tri : p1.getTriangles()) {
double area = tri.getArea(); double area = tri.getArea();
if (area > maxArea) { if (area > maxArea) {
...@@ -173,6 +175,9 @@ public class AllPolygonsWrongOrientationCheck extends Check { ...@@ -173,6 +175,9 @@ public class AllPolygonsWrongOrientationCheck extends Check {
t = tri; t = tri;
} }
} }
if (t == null) {
throw new IllegalStateException("No suitable triangle found");
}
return t; return t;
} }
......
...@@ -29,6 +29,7 @@ import de.hft.stuttgart.citydoctor2.check.CheckId; ...@@ -29,6 +29,7 @@ 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.Requirement; import de.hft.stuttgart.citydoctor2.check.Requirement;
import de.hft.stuttgart.citydoctor2.check.RequirementType; import de.hft.stuttgart.citydoctor2.check.RequirementType;
import de.hft.stuttgart.citydoctor2.check.ResultStatus;
import de.hft.stuttgart.citydoctor2.checks.util.CollectionUtils; import de.hft.stuttgart.citydoctor2.checks.util.CollectionUtils;
import de.hft.stuttgart.citydoctor2.checks.util.UnfragmentedCheck; import de.hft.stuttgart.citydoctor2.checks.util.UnfragmentedCheck;
import de.hft.stuttgart.citydoctor2.datastructure.BoundarySurface; import de.hft.stuttgart.citydoctor2.datastructure.BoundarySurface;
...@@ -80,6 +81,10 @@ public class RoofSurfaceUnfragmentedCheck extends Check { ...@@ -80,6 +81,10 @@ public class RoofSurfaceUnfragmentedCheck extends Check {
} }
// only use lod1 and lod2 polygons // only use lod1 and lod2 polygons
CheckResult cr = UnfragmentedCheck.checkForFragmentedBoundarySurfaces(this, bs, maxAngleDeviation); CheckResult cr = UnfragmentedCheck.checkForFragmentedBoundarySurfaces(this, bs, maxAngleDeviation);
if (cr.getResultStatus() == ResultStatus.OK) {
// check if neighboring roof surfaces have the same average normal
// they should be merged
}
bs.addCheckResult(cr); bs.addCheckResult(cr);
} }
......
...@@ -24,7 +24,7 @@ import java.util.List; ...@@ -24,7 +24,7 @@ import java.util.List;
import de.hft.stuttgart.citydoctor2.check.Check; import de.hft.stuttgart.citydoctor2.check.Check;
import de.hft.stuttgart.citydoctor2.check.CheckResult; import de.hft.stuttgart.citydoctor2.check.CheckResult;
import de.hft.stuttgart.citydoctor2.check.ResultStatus; import de.hft.stuttgart.citydoctor2.check.ResultStatus;
import de.hft.stuttgart.citydoctor2.check.error.SurfaceUnfragmentedError; import de.hft.stuttgart.citydoctor2.check.error.SurfaceFragmentedError;
import de.hft.stuttgart.citydoctor2.datastructure.BoundarySurface; import de.hft.stuttgart.citydoctor2.datastructure.BoundarySurface;
import de.hft.stuttgart.citydoctor2.datastructure.Geometry; import de.hft.stuttgart.citydoctor2.datastructure.Geometry;
import de.hft.stuttgart.citydoctor2.datastructure.Polygon; import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
...@@ -75,7 +75,7 @@ public class UnfragmentedCheck { ...@@ -75,7 +75,7 @@ public class UnfragmentedCheck {
double dot = averageNormal.dot(n); double dot = averageNormal.dot(n);
double acos = Math.acos(dot); double acos = Math.acos(dot);
if (acos > delta) { if (acos > delta) {
SurfaceUnfragmentedError err = new SurfaceUnfragmentedError(bs, acos); SurfaceFragmentedError err = new SurfaceFragmentedError(bs, acos);
return new CheckResult(c, ResultStatus.ERROR, err); return new CheckResult(c, ResultStatus.ERROR, err);
} }
} }
......
...@@ -39,7 +39,7 @@ import de.hft.stuttgart.citydoctor2.check.error.SchematronError; ...@@ -39,7 +39,7 @@ import de.hft.stuttgart.citydoctor2.check.error.SchematronError;
import de.hft.stuttgart.citydoctor2.check.error.SolidError; import de.hft.stuttgart.citydoctor2.check.error.SolidError;
import de.hft.stuttgart.citydoctor2.check.error.SolidNotClosedError; import de.hft.stuttgart.citydoctor2.check.error.SolidNotClosedError;
import de.hft.stuttgart.citydoctor2.check.error.SolidSelfIntError; import de.hft.stuttgart.citydoctor2.check.error.SolidSelfIntError;
import de.hft.stuttgart.citydoctor2.check.error.SurfaceUnfragmentedError; import de.hft.stuttgart.citydoctor2.check.error.SurfaceFragmentedError;
import de.hft.stuttgart.citydoctor2.check.error.TooFewPolygonsError; import de.hft.stuttgart.citydoctor2.check.error.TooFewPolygonsError;
import de.hft.stuttgart.citydoctor2.check.error.UnknownCheckError; import de.hft.stuttgart.citydoctor2.check.error.UnknownCheckError;
import de.hft.stuttgart.citydoctor2.check.error.XMLValidationError; import de.hft.stuttgart.citydoctor2.check.error.XMLValidationError;
...@@ -186,7 +186,7 @@ public class GlobalErrorVisitor implements ErrorVisitor { ...@@ -186,7 +186,7 @@ public class GlobalErrorVisitor implements ErrorVisitor {
} }
@Override @Override
public void visit(SurfaceUnfragmentedError err) { public void visit(SurfaceFragmentedError err) {
} }
@Override @Override
......
...@@ -41,7 +41,7 @@ import de.hft.stuttgart.citydoctor2.check.error.SchematronError; ...@@ -41,7 +41,7 @@ import de.hft.stuttgart.citydoctor2.check.error.SchematronError;
import de.hft.stuttgart.citydoctor2.check.error.SolidError; import de.hft.stuttgart.citydoctor2.check.error.SolidError;
import de.hft.stuttgart.citydoctor2.check.error.SolidNotClosedError; import de.hft.stuttgart.citydoctor2.check.error.SolidNotClosedError;
import de.hft.stuttgart.citydoctor2.check.error.SolidSelfIntError; import de.hft.stuttgart.citydoctor2.check.error.SolidSelfIntError;
import de.hft.stuttgart.citydoctor2.check.error.SurfaceUnfragmentedError; import de.hft.stuttgart.citydoctor2.check.error.SurfaceFragmentedError;
import de.hft.stuttgart.citydoctor2.check.error.DegeneratedRingError; import de.hft.stuttgart.citydoctor2.check.error.DegeneratedRingError;
import de.hft.stuttgart.citydoctor2.check.error.TooFewPolygonsError; import de.hft.stuttgart.citydoctor2.check.error.TooFewPolygonsError;
import de.hft.stuttgart.citydoctor2.check.error.UnknownCheckError; import de.hft.stuttgart.citydoctor2.check.error.UnknownCheckError;
...@@ -243,7 +243,7 @@ public class ListErrorVisitor implements ErrorVisitor { ...@@ -243,7 +243,7 @@ public class ListErrorVisitor implements ErrorVisitor {
} }
@Override @Override
public void visit(SurfaceUnfragmentedError err) { public void visit(SurfaceFragmentedError err) {
// nothing to display // nothing to display
} }
......
...@@ -36,7 +36,7 @@ import de.hft.stuttgart.citydoctor2.check.error.RingTooFewPointsError; ...@@ -36,7 +36,7 @@ import de.hft.stuttgart.citydoctor2.check.error.RingTooFewPointsError;
import de.hft.stuttgart.citydoctor2.check.error.SchematronError; import de.hft.stuttgart.citydoctor2.check.error.SchematronError;
import de.hft.stuttgart.citydoctor2.check.error.SolidNotClosedError; import de.hft.stuttgart.citydoctor2.check.error.SolidNotClosedError;
import de.hft.stuttgart.citydoctor2.check.error.SolidSelfIntError; import de.hft.stuttgart.citydoctor2.check.error.SolidSelfIntError;
import de.hft.stuttgart.citydoctor2.check.error.SurfaceUnfragmentedError; import de.hft.stuttgart.citydoctor2.check.error.SurfaceFragmentedError;
import de.hft.stuttgart.citydoctor2.check.error.TooFewPolygonsError; import de.hft.stuttgart.citydoctor2.check.error.TooFewPolygonsError;
import de.hft.stuttgart.citydoctor2.check.error.UnknownCheckError; import de.hft.stuttgart.citydoctor2.check.error.UnknownCheckError;
import de.hft.stuttgart.citydoctor2.datastructure.ConcretePolygon; import de.hft.stuttgart.citydoctor2.datastructure.ConcretePolygon;
...@@ -396,7 +396,7 @@ public class ErrorItemVisitor extends AbstractErrorVisitor { ...@@ -396,7 +396,7 @@ public class ErrorItemVisitor extends AbstractErrorVisitor {
} }
@Override @Override
public void visit(SurfaceUnfragmentedError err) { public void visit(SurfaceFragmentedError err) {
TextNode textNode = new TextNode( TextNode textNode = new TextNode(
Localization.getText("ErrorItemVisitor.deviation") + ": " + err.getAngleDeviation()); Localization.getText("ErrorItemVisitor.deviation") + ": " + err.getAngleDeviation());
TreeItem<Renderable> textItem = new TreeItem<>(textNode); TreeItem<Renderable> textItem = new TreeItem<>(textNode);
......
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