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

Renaming error classes

parent e6b83505
1 merge request!2Resolve "Rename error classes to better represent the error codes"
Pipeline #1255 passed with stage
in 1 minute and 49 seconds
Showing with 70 additions and 158 deletions
+70 -158
......@@ -21,33 +21,32 @@ package de.hft.stuttgart.citydoctor2.check;
import de.hft.stuttgart.citydoctor2.check.error.AllPolygonsWrongOrientationError;
import de.hft.stuttgart.citydoctor2.check.error.ConsecutivePointSameError;
import de.hft.stuttgart.citydoctor2.check.error.DependenciesNotMetError;
import de.hft.stuttgart.citydoctor2.check.error.NonPlanarPolygonDistancePlaneError;
import de.hft.stuttgart.citydoctor2.check.error.DuplicatePointError;
import de.hft.stuttgart.citydoctor2.check.error.EdgeIntersectionError;
import de.hft.stuttgart.citydoctor2.check.error.HoleOutsideError;
import de.hft.stuttgart.citydoctor2.check.error.InteriorDisconnectedError;
import de.hft.stuttgart.citydoctor2.check.error.ManifoldEdgeError;
import de.hft.stuttgart.citydoctor2.check.error.MultipleConnectedComponentsError;
import de.hft.stuttgart.citydoctor2.check.error.NestedRingError;
import de.hft.stuttgart.citydoctor2.check.error.NonManifoldEdgeError;
import de.hft.stuttgart.citydoctor2.check.error.NonManifoldVertexError;
import de.hft.stuttgart.citydoctor2.check.error.NormalDeviationError;
import de.hft.stuttgart.citydoctor2.check.error.NonPlanarPolygonDistancePlaneError;
import de.hft.stuttgart.citydoctor2.check.error.NonPlanarPolygonNormalsDeviation;
import de.hft.stuttgart.citydoctor2.check.error.NotCeilingError;
import de.hft.stuttgart.citydoctor2.check.error.NotFloorError;
import de.hft.stuttgart.citydoctor2.check.error.NotGroundError;
import de.hft.stuttgart.citydoctor2.check.error.NotWallError;
import de.hft.stuttgart.citydoctor2.check.error.NullAreaError;
import de.hft.stuttgart.citydoctor2.check.error.PointTouchesEdgeError;
import de.hft.stuttgart.citydoctor2.check.error.PolygonHoleOutsideError;
import de.hft.stuttgart.citydoctor2.check.error.PolygonInteriorDisconnectedError;
import de.hft.stuttgart.citydoctor2.check.error.PolygonIntersectingRingsError;
import de.hft.stuttgart.citydoctor2.check.error.PolygonSameOrientationError;
import de.hft.stuttgart.citydoctor2.check.error.PolygonWrongOrientationError;
import de.hft.stuttgart.citydoctor2.check.error.RingDuplicatePointError;
import de.hft.stuttgart.citydoctor2.check.error.RingEdgeIntersectionError;
import de.hft.stuttgart.citydoctor2.check.error.RingNotClosedError;
import de.hft.stuttgart.citydoctor2.check.error.RingSelfIntError;
import de.hft.stuttgart.citydoctor2.check.error.SameOrientationError;
import de.hft.stuttgart.citydoctor2.check.error.RingTooFewPointsError;
import de.hft.stuttgart.citydoctor2.check.error.SchematronError;
import de.hft.stuttgart.citydoctor2.check.error.SolidNotClosedError;
import de.hft.stuttgart.citydoctor2.check.error.SolidSelfIntError;
import de.hft.stuttgart.citydoctor2.check.error.SurfaceUnfragmentedError;
import de.hft.stuttgart.citydoctor2.check.error.TinyEdgeError;
import de.hft.stuttgart.citydoctor2.check.error.TooFewPointsError;
import de.hft.stuttgart.citydoctor2.check.error.TooFewPolygonsError;
import de.hft.stuttgart.citydoctor2.check.error.UnknownCheckError;
......@@ -60,9 +59,9 @@ import de.hft.stuttgart.citydoctor2.check.error.UnknownCheckError;
*/
public interface ErrorVisitor {
public void visit(HoleOutsideError err);
public void visit(PolygonHoleOutsideError err);
public void visit(ManifoldEdgeError err);
public void visit(NonManifoldEdgeError err);
public void visit(MultipleConnectedComponentsError err);
......@@ -72,7 +71,7 @@ public interface ErrorVisitor {
public void visit(PolygonWrongOrientationError err);
public void visit(SameOrientationError err);
public void visit(PolygonSameOrientationError err);
public void visit(SolidNotClosedError err);
......@@ -84,17 +83,15 @@ public interface ErrorVisitor {
public void visit(ConsecutivePointSameError err);
public void visit(RingSelfIntError err);
public void visit(AllPolygonsWrongOrientationError err);
public void visit(InteriorDisconnectedError err);
public void visit(PolygonInteriorDisconnectedError err);
public void visit(NullAreaError err);
public void visit(TooFewPointsError err);
public void visit(RingTooFewPointsError err);
public void visit(NormalDeviationError err);
public void visit(NonPlanarPolygonNormalsDeviation err);
public void visit(NonPlanarPolygonDistancePlaneError err);
......@@ -104,9 +101,9 @@ public interface ErrorVisitor {
public void visit(TooFewPolygonsError err);
public void visit(DuplicatePointError err);
public void visit(RingDuplicatePointError err);
public void visit(EdgeIntersectionError err);
public void visit(RingEdgeIntersectionError err);
public void visit(PointTouchesEdgeError err);
......
......@@ -21,33 +21,32 @@ package de.hft.stuttgart.citydoctor2.check;
import de.hft.stuttgart.citydoctor2.check.error.AllPolygonsWrongOrientationError;
import de.hft.stuttgart.citydoctor2.check.error.ConsecutivePointSameError;
import de.hft.stuttgart.citydoctor2.check.error.DependenciesNotMetError;
import de.hft.stuttgart.citydoctor2.check.error.NonPlanarPolygonDistancePlaneError;
import de.hft.stuttgart.citydoctor2.check.error.DuplicatePointError;
import de.hft.stuttgart.citydoctor2.check.error.EdgeIntersectionError;
import de.hft.stuttgart.citydoctor2.check.error.HoleOutsideError;
import de.hft.stuttgart.citydoctor2.check.error.InteriorDisconnectedError;
import de.hft.stuttgart.citydoctor2.check.error.ManifoldEdgeError;
import de.hft.stuttgart.citydoctor2.check.error.MultipleConnectedComponentsError;
import de.hft.stuttgart.citydoctor2.check.error.NestedRingError;
import de.hft.stuttgart.citydoctor2.check.error.NonManifoldEdgeError;
import de.hft.stuttgart.citydoctor2.check.error.NonManifoldVertexError;
import de.hft.stuttgart.citydoctor2.check.error.NormalDeviationError;
import de.hft.stuttgart.citydoctor2.check.error.NonPlanarPolygonDistancePlaneError;
import de.hft.stuttgart.citydoctor2.check.error.NonPlanarPolygonNormalsDeviation;
import de.hft.stuttgart.citydoctor2.check.error.NotCeilingError;
import de.hft.stuttgart.citydoctor2.check.error.NotFloorError;
import de.hft.stuttgart.citydoctor2.check.error.NotGroundError;
import de.hft.stuttgart.citydoctor2.check.error.NotWallError;
import de.hft.stuttgart.citydoctor2.check.error.NullAreaError;
import de.hft.stuttgart.citydoctor2.check.error.PointTouchesEdgeError;
import de.hft.stuttgart.citydoctor2.check.error.PolygonHoleOutsideError;
import de.hft.stuttgart.citydoctor2.check.error.PolygonInteriorDisconnectedError;
import de.hft.stuttgart.citydoctor2.check.error.PolygonIntersectingRingsError;
import de.hft.stuttgart.citydoctor2.check.error.PolygonSameOrientationError;
import de.hft.stuttgart.citydoctor2.check.error.PolygonWrongOrientationError;
import de.hft.stuttgart.citydoctor2.check.error.RingDuplicatePointError;
import de.hft.stuttgart.citydoctor2.check.error.RingEdgeIntersectionError;
import de.hft.stuttgart.citydoctor2.check.error.RingNotClosedError;
import de.hft.stuttgart.citydoctor2.check.error.RingSelfIntError;
import de.hft.stuttgart.citydoctor2.check.error.SameOrientationError;
import de.hft.stuttgart.citydoctor2.check.error.RingTooFewPointsError;
import de.hft.stuttgart.citydoctor2.check.error.SchematronError;
import de.hft.stuttgart.citydoctor2.check.error.SolidNotClosedError;
import de.hft.stuttgart.citydoctor2.check.error.SolidSelfIntError;
import de.hft.stuttgart.citydoctor2.check.error.SurfaceUnfragmentedError;
import de.hft.stuttgart.citydoctor2.check.error.TinyEdgeError;
import de.hft.stuttgart.citydoctor2.check.error.TooFewPointsError;
import de.hft.stuttgart.citydoctor2.check.error.TooFewPolygonsError;
import de.hft.stuttgart.citydoctor2.check.error.UnknownCheckError;
......@@ -69,11 +68,11 @@ public interface HealingMethod {
return false;
}
default boolean visit(EdgeIntersectionError edgeIntersectionError, ModificationListener l) {
default boolean visit(RingEdgeIntersectionError edgeIntersectionError, ModificationListener l) {
return false;
}
default boolean visit(DuplicatePointError duplicatePointError, ModificationListener l) {
default boolean visit(RingDuplicatePointError duplicatePointError, ModificationListener l) {
return false;
}
......@@ -93,15 +92,15 @@ public interface HealingMethod {
return false;
}
default boolean visit(HoleOutsideError err, ModificationListener l) {
default boolean visit(PolygonHoleOutsideError err, ModificationListener l) {
return false;
}
default boolean visit(InteriorDisconnectedError err, ModificationListener l) {
default boolean visit(PolygonInteriorDisconnectedError err, ModificationListener l) {
return false;
}
default boolean visit(ManifoldEdgeError err, ModificationListener l) {
default boolean visit(NonManifoldEdgeError err, ModificationListener l) {
return false;
}
......@@ -117,7 +116,7 @@ public interface HealingMethod {
return false;
}
default boolean visit(NormalDeviationError err, ModificationListener l) {
default boolean visit(NonPlanarPolygonNormalsDeviation err, ModificationListener l) {
return false;
}
......@@ -137,11 +136,7 @@ public interface HealingMethod {
return false;
}
default boolean visit(RingSelfIntError err, ModificationListener l) {
return false;
}
default boolean visit(SameOrientationError err, ModificationListener l) {
default boolean visit(PolygonSameOrientationError err, ModificationListener l) {
return false;
}
......@@ -153,7 +148,7 @@ public interface HealingMethod {
return false;
}
default boolean visit(TooFewPointsError err, ModificationListener l) {
default boolean visit(RingTooFewPointsError err, ModificationListener l) {
return false;
}
......
......@@ -36,14 +36,14 @@ import de.hft.stuttgart.citydoctor2.datastructure.Geometry;
* @author Matthias Betz
*
*/
public class ManifoldEdgeError extends CheckError {
public class NonManifoldEdgeError extends CheckError {
private static final long serialVersionUID = -6742948557014332402L;
private List<Edge> edges;
private Geometry geom;
public ManifoldEdgeError(Geometry geom, List<Edge> edges) {
public NonManifoldEdgeError(Geometry geom, List<Edge> edges) {
super(ErrorId.GE_S_NON_MANIFOLD_EDGE, ErrorType.ERROR, geom);
this.edges = edges;
this.geom = geom;
......
......@@ -34,14 +34,14 @@ import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
* @author Matthias Betz
*
*/
public class NormalDeviationError extends CheckError {
public class NonPlanarPolygonNormalsDeviation extends CheckError {
private static final long serialVersionUID = 69073161885265794L;
private Polygon p;
private double deviation;
public NormalDeviationError(Polygon p, double deviation) {
public NonPlanarPolygonNormalsDeviation(Polygon p, double deviation) {
super(ErrorId.GE_P_NON_PLANAR_POLYGON_NORMALS_DEVIATION, ErrorType.ERROR, p);
this.p = p;
this.deviation = deviation;
......
......@@ -37,14 +37,14 @@ import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
* @author Matthias Betz
*
*/
public class HoleOutsideError extends CheckError {
public class PolygonHoleOutsideError extends CheckError {
private static final long serialVersionUID = -4522153084655775231L;
private List<LinearRing> holesOutside;
private Polygon p;
public HoleOutsideError(Polygon p, List<LinearRing> holesOutside) {
public PolygonHoleOutsideError(Polygon p, List<LinearRing> holesOutside) {
super(ErrorId.GE_P_HOLE_OUTSIDE, ErrorType.ERROR, p);
this.p = p;
this.holesOutside = holesOutside;
......
......@@ -37,14 +37,14 @@ import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
* @author Matthias Betz
*
*/
public class InteriorDisconnectedError extends CheckError {
public class PolygonInteriorDisconnectedError extends CheckError {
private static final long serialVersionUID = 511849016699842395L;
private Polygon p;
private List<LinearRing> connectedRings;
public InteriorDisconnectedError(Polygon p, List<LinearRing> connectedRings) {
public PolygonInteriorDisconnectedError(Polygon p, List<LinearRing> connectedRings) {
super(ErrorId.GE_P_INTERIOR_DISCONNECTED, ErrorType.ERROR, p);
this.p = p;
this.connectedRings = connectedRings;
......
......@@ -35,14 +35,14 @@ import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
* @author Matthias Betz
*
*/
public class SameOrientationError extends CheckError {
public class PolygonSameOrientationError extends CheckError {
private static final long serialVersionUID = -6192337889977667459L;
private Polygon p;
private LinearRing innerRing;
public SameOrientationError(Polygon p, LinearRing inner) {
public PolygonSameOrientationError(Polygon p, LinearRing inner) {
super(ErrorId.GE_P_ORIENTATION_RINGS_SAME, ErrorType.ERROR, p);
this.p = p;
this.innerRing = inner;
......
......@@ -35,7 +35,7 @@ import de.hft.stuttgart.citydoctor2.datastructure.Vertex;
* @author Matthias Betz
*
*/
public class DuplicatePointError extends CheckError {
public class RingDuplicatePointError extends CheckError {
private static final long serialVersionUID = 7208982075173209953L;
......@@ -43,7 +43,7 @@ public class DuplicatePointError extends CheckError {
private Vertex v1;
private Vertex v2;
public DuplicatePointError(LinearRing r, Vertex v1, Vertex v2) {
public RingDuplicatePointError(LinearRing r, Vertex v1, Vertex v2) {
super(ErrorId.GE_R_SELF_INTERSECTION, ErrorType.ERROR, r);
this.r = r;
this.v1 = v1;
......
......@@ -36,7 +36,7 @@ import de.hft.stuttgart.citydoctor2.math.Vector3d;
* @author Matthias Betz
*
*/
public class EdgeIntersectionError extends CheckError {
public class RingEdgeIntersectionError extends CheckError {
private static final long serialVersionUID = 4923311259469198172L;
......@@ -45,7 +45,7 @@ public class EdgeIntersectionError extends CheckError {
private Vector3d intersection;
private LinearRing lr;
public EdgeIntersectionError(LinearRing lr, Edge e1, Edge e2, Vector3d intersection) {
public RingEdgeIntersectionError(LinearRing lr, Edge e1, Edge e2, Vector3d intersection) {
super(ErrorId.GE_R_SELF_INTERSECTION, ErrorType.ERROR, lr);
if (e1 == null || e2 == null || lr == null || intersection == null) {
throw new IllegalArgumentException("Parameters may not be null");
......
/*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package de.hft.stuttgart.citydoctor2.check.error;
import java.util.Set;
import de.hft.stuttgart.citydoctor2.check.CheckError;
import de.hft.stuttgart.citydoctor2.check.ErrorId;
import de.hft.stuttgart.citydoctor2.check.ErrorReport;
import de.hft.stuttgart.citydoctor2.check.ErrorType;
import de.hft.stuttgart.citydoctor2.check.ErrorVisitor;
import de.hft.stuttgart.citydoctor2.check.HealingMethod;
import de.hft.stuttgart.citydoctor2.check.ModificationListener;
import de.hft.stuttgart.citydoctor2.datastructure.Edge;
import de.hft.stuttgart.citydoctor2.datastructure.LinearRing;
/**
* If two edges of the same linear ring are intersecting with each other, this
* error is created.
*
* @author Matthias Betz
*
*/
public class RingSelfIntError extends CheckError {
private static final long serialVersionUID = 8007952264635395514L;
private LinearRing lr;
private Set<Edge> edges;
public RingSelfIntError(LinearRing lr, Set<Edge> intersectingEdges) {
super(ErrorId.GE_R_SELF_INTERSECTION, ErrorType.ERROR, lr);
this.lr = lr;
edges = intersectingEdges;
}
public LinearRing getRing() {
return lr;
}
public Set<Edge> getEdges() {
return edges;
}
@Override
public void report(ErrorReport report) {
report.add(lr);
}
@Override
public void accept(ErrorVisitor errorVisitor) {
errorVisitor.visit(this);
}
@Override
public boolean accept(HealingMethod method, ModificationListener l) {
return method.visit(this, l);
}
@Override
public String toString() {
return "RingSelfIntError [lr=" + lr + ", edges=" + edges + "]";
}
}
......@@ -33,13 +33,13 @@ import de.hft.stuttgart.citydoctor2.datastructure.LinearRing;
* @author Matthias Betz
*
*/
public class TooFewPointsError extends CheckError {
public class RingTooFewPointsError extends CheckError {
private static final long serialVersionUID = 7207518573842743261L;
private LinearRing lr;
public TooFewPointsError(LinearRing lr) {
public RingTooFewPointsError(LinearRing lr) {
super(ErrorId.GE_R_TOO_FEW_POINTS, ErrorType.ERROR, lr);
this.lr = lr;
}
......
......@@ -31,7 +31,7 @@ import de.hft.stuttgart.citydoctor2.check.CheckType;
import de.hft.stuttgart.citydoctor2.check.Checkable;
import de.hft.stuttgart.citydoctor2.check.ResultStatus;
import de.hft.stuttgart.citydoctor2.check.error.ConsecutivePointSameError;
import de.hft.stuttgart.citydoctor2.check.error.DuplicatePointError;
import de.hft.stuttgart.citydoctor2.check.error.RingDuplicatePointError;
import de.hft.stuttgart.citydoctor2.datastructure.LinearRing;
import de.hft.stuttgart.citydoctor2.datastructure.Vertex;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
......@@ -116,7 +116,7 @@ public class DuplicatePointsCheck extends Check {
Vertex point2 = pointList.get(j);
if (point1.equalsWithEpsilon(point2, epsilon)) {
// non consecutive points same
CheckError err = new DuplicatePointError(lr, point1, point2);
CheckError err = new RingDuplicatePointError(lr, point1, point2);
CheckResult cr = new CheckResult(this, ResultStatus.ERROR, err);
lr.addCheckResult(cr);
return;
......
......@@ -29,7 +29,7 @@ import de.hft.stuttgart.citydoctor2.check.CheckResult;
import de.hft.stuttgart.citydoctor2.check.CheckType;
import de.hft.stuttgart.citydoctor2.check.Checkable;
import de.hft.stuttgart.citydoctor2.check.ResultStatus;
import de.hft.stuttgart.citydoctor2.check.error.HoleOutsideError;
import de.hft.stuttgart.citydoctor2.check.error.PolygonHoleOutsideError;
import de.hft.stuttgart.citydoctor2.datastructure.LinearRing;
import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
import de.hft.stuttgart.citydoctor2.datastructure.Vertex;
......@@ -79,7 +79,7 @@ public class HoleOutsideCheck extends Check {
CheckResult cr = new CheckResult(this, ResultStatus.OK, null);
p.addCheckResult(cr);
} else {
CheckError err = new HoleOutsideError(p, holesOutside);
CheckError err = new PolygonHoleOutsideError(p, holesOutside);
CheckResult cr = new CheckResult(this, ResultStatus.ERROR, err);
p.addCheckResult(cr);
}
......
......@@ -33,7 +33,7 @@ import de.hft.stuttgart.citydoctor2.check.Checkable;
import de.hft.stuttgart.citydoctor2.check.DefaultParameter;
import de.hft.stuttgart.citydoctor2.check.ResultStatus;
import de.hft.stuttgart.citydoctor2.check.Unit;
import de.hft.stuttgart.citydoctor2.check.error.InteriorDisconnectedError;
import de.hft.stuttgart.citydoctor2.check.error.PolygonInteriorDisconnectedError;
import de.hft.stuttgart.citydoctor2.datastructure.LinearRing;
import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
import de.hft.stuttgart.citydoctor2.datastructure.Vertex;
......@@ -112,7 +112,7 @@ public class InteriorDisconnectedCheck extends Check {
// collect rings
node.resetVisit();
List<LinearRing> connectedRings = node.getConnectedRings();
CheckError err = new InteriorDisconnectedError(p, connectedRings);
CheckError err = new PolygonInteriorDisconnectedError(p, connectedRings);
CheckResult cr = new CheckResult(this, ResultStatus.ERROR, err);
p.addCheckResult(cr);
return;
......@@ -139,7 +139,7 @@ public class InteriorDisconnectedCheck extends Check {
List<LinearRing> connectedRings = new ArrayList<>();
connectedRings.add(n1.getValue());
connectedRings.add(n2.getValue());
CheckError err = new InteriorDisconnectedError(p, connectedRings);
CheckError err = new PolygonInteriorDisconnectedError(p, connectedRings);
CheckResult cr = new CheckResult(this, ResultStatus.ERROR, err);
p.addCheckResult(cr);
return true;
......
......@@ -29,7 +29,7 @@ import de.hft.stuttgart.citydoctor2.check.CheckResult;
import de.hft.stuttgart.citydoctor2.check.CheckType;
import de.hft.stuttgart.citydoctor2.check.Checkable;
import de.hft.stuttgart.citydoctor2.check.ResultStatus;
import de.hft.stuttgart.citydoctor2.check.error.ManifoldEdgeError;
import de.hft.stuttgart.citydoctor2.check.error.NonManifoldEdgeError;
import de.hft.stuttgart.citydoctor2.datastructure.Edge;
import de.hft.stuttgart.citydoctor2.datastructure.Geometry;
import de.hft.stuttgart.citydoctor2.datastructure.GeometryType;
......@@ -85,7 +85,7 @@ public class NonManifoldEdgeCheck extends Check {
if (errorEdges.isEmpty()) {
cr = new CheckResult(this, ResultStatus.OK, null);
} else {
CheckError err = new ManifoldEdgeError(g, errorEdges);
CheckError err = new NonManifoldEdgeError(g, errorEdges);
cr = new CheckResult(this, ResultStatus.ERROR, err);
}
g.addCheckResult(cr);
......
......@@ -31,7 +31,7 @@ import de.hft.stuttgart.citydoctor2.check.CheckResult;
import de.hft.stuttgart.citydoctor2.check.CheckType;
import de.hft.stuttgart.citydoctor2.check.Checkable;
import de.hft.stuttgart.citydoctor2.check.ResultStatus;
import de.hft.stuttgart.citydoctor2.check.error.TooFewPointsError;
import de.hft.stuttgart.citydoctor2.check.error.RingTooFewPointsError;
import de.hft.stuttgart.citydoctor2.datastructure.LinearRing;
import de.hft.stuttgart.citydoctor2.datastructure.Vertex;
......@@ -90,7 +90,7 @@ public class NumPointsCheck extends Check {
// 2 points or less = always error
if (vertices.size() - numberOfContainingNeighbors < 3) {
CheckError err = new TooFewPointsError(lr);
CheckError err = new RingTooFewPointsError(lr);
CheckResult cr = new CheckResult(this, ResultStatus.ERROR, err);
lr.addCheckResult(cr);
return;
......
......@@ -34,7 +34,7 @@ import de.hft.stuttgart.citydoctor2.check.DefaultParameter;
import de.hft.stuttgart.citydoctor2.check.ResultStatus;
import de.hft.stuttgart.citydoctor2.check.Unit;
import de.hft.stuttgart.citydoctor2.check.error.NonPlanarPolygonDistancePlaneError;
import de.hft.stuttgart.citydoctor2.check.error.NormalDeviationError;
import de.hft.stuttgart.citydoctor2.check.error.NonPlanarPolygonNormalsDeviation;
import de.hft.stuttgart.citydoctor2.check.error.TinyEdgeError;
import de.hft.stuttgart.citydoctor2.datastructure.LinearRing;
import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
......@@ -165,7 +165,7 @@ public class PlanarCheck extends Check {
double deviation = normal.dot(averageNormal);
double radiant = Math.acos(deviation);
if (radiant > rad) {
CheckError err = new NormalDeviationError(p, radiant);
CheckError err = new NonPlanarPolygonNormalsDeviation(p, radiant);
CheckResult cr = new CheckResult(this, ResultStatus.ERROR, err);
p.addCheckResult(cr);
return;
......
......@@ -29,7 +29,7 @@ import de.hft.stuttgart.citydoctor2.check.CheckResult;
import de.hft.stuttgart.citydoctor2.check.CheckType;
import de.hft.stuttgart.citydoctor2.check.Checkable;
import de.hft.stuttgart.citydoctor2.check.ResultStatus;
import de.hft.stuttgart.citydoctor2.check.error.SameOrientationError;
import de.hft.stuttgart.citydoctor2.check.error.PolygonSameOrientationError;
import de.hft.stuttgart.citydoctor2.checks.util.Orientation;
import de.hft.stuttgart.citydoctor2.checks.util.RingOrientationUtil;
import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
......@@ -71,7 +71,7 @@ public class PolygonSameOrientationCheck extends Check {
Orientation extOrientation = RingOrientationUtil.calculateOrientation(poly2d.getExterior());
for (Ring2d inner : poly2d.getInteriorRings()) {
if (RingOrientationUtil.calculateOrientation(inner) == extOrientation) {
CheckError err = new SameOrientationError(p, inner.getOriginal());
CheckError err = new PolygonSameOrientationError(p, inner.getOriginal());
CheckResult cr = new CheckResult(this, ResultStatus.ERROR, err);
p.addCheckResult(cr);
return;
......
......@@ -30,7 +30,7 @@ import de.hft.stuttgart.citydoctor2.check.CheckResult;
import de.hft.stuttgart.citydoctor2.check.CheckType;
import de.hft.stuttgart.citydoctor2.check.Checkable;
import de.hft.stuttgart.citydoctor2.check.ResultStatus;
import de.hft.stuttgart.citydoctor2.check.error.EdgeIntersectionError;
import de.hft.stuttgart.citydoctor2.check.error.RingEdgeIntersectionError;
import de.hft.stuttgart.citydoctor2.check.error.PointTouchesEdgeError;
import de.hft.stuttgart.citydoctor2.datastructure.Edge;
import de.hft.stuttgart.citydoctor2.datastructure.Geometry;
......@@ -105,7 +105,7 @@ public class RingSelfIntCheck extends Check {
DistanceResult dr = s1.getDistanceResult(s2);
if (dr.getDistance() < epsilon) {
// intersection
CheckError err = new EdgeIntersectionError(lr, e1, e2, dr.getPoint1());
CheckError err = new RingEdgeIntersectionError(lr, e1, e2, dr.getPoint1());
CheckResult cr = new CheckResult(this, ResultStatus.ERROR, err);
lr.addCheckResult(cr);
return;
......
......@@ -29,7 +29,7 @@ import org.junit.Test;
import de.hft.stuttgart.citydoctor2.check.CheckResult;
import de.hft.stuttgart.citydoctor2.check.ResultStatus;
import de.hft.stuttgart.citydoctor2.check.error.EdgeIntersectionError;
import de.hft.stuttgart.citydoctor2.check.error.RingEdgeIntersectionError;
import de.hft.stuttgart.citydoctor2.datastructure.ConcretePolygon;
import de.hft.stuttgart.citydoctor2.datastructure.Geometry;
import de.hft.stuttgart.citydoctor2.datastructure.GeometryType;
......@@ -78,8 +78,8 @@ public class RingSelfIntCheckTest {
check.check(lr);
CheckResult cr = lr.getCheckResult(check);
assertSame(ResultStatus.ERROR, cr.getResultStatus());
assertTrue(cr.getError() instanceof EdgeIntersectionError);
EdgeIntersectionError err = (EdgeIntersectionError) cr.getError();
assertTrue(cr.getError() instanceof RingEdgeIntersectionError);
RingEdgeIntersectionError err = (RingEdgeIntersectionError) cr.getError();
assertNotNull(err.getIntersection());
assertEquals(5d, err.getIntersection().getX(), 0.00001);
assertEquals(5d, err.getIntersection().getY(), 0.00001);
......
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