Commit 97a65114 authored by Riegel's avatar Riegel
Browse files

Merge branch 'dev' into 'master'

Version 3.15.0

See merge request !8
parents 99c8f6a8 5950ea5f
Pipeline #10106 passed with stage
in 3 minutes and 15 seconds
...@@ -23,7 +23,7 @@ import java.util.List; ...@@ -23,7 +23,7 @@ import java.util.List;
public class PolyLine2d extends BaseEntity { public class PolyLine2d extends BaseEntity {
private PolyLineSegment2d mpFirst; private final PolyLineSegment2d mpFirst;
private PolyLineSegment2d mpLast; private PolyLineSegment2d mpLast;
public PolyLine2d(PolyLineSegment2d pStart) { public PolyLine2d(PolyLineSegment2d pStart) {
......
...@@ -25,8 +25,8 @@ public class PolyLineSegment extends BaseEntity { ...@@ -25,8 +25,8 @@ public class PolyLineSegment extends BaseEntity {
private static final Logger logger = LogManager.getLogger(PolyLineSegment.class); private static final Logger logger = LogManager.getLogger(PolyLineSegment.class);
private Coordinate3d mpStart; private final Coordinate3d mpStart;
private Coordinate3d mpEnd; private final Coordinate3d mpEnd;
private PolyLineSegment mpNext; private PolyLineSegment mpNext;
......
...@@ -104,16 +104,14 @@ public class Polygon2d extends BaseEntity { ...@@ -104,16 +104,14 @@ public class Polygon2d extends BaseEntity {
point = halfEdge.getStart().getPoint(); point = halfEdge.getStart().getPoint();
lowerU = (point.getX() < lowerU) ? point.getX() : lowerU; lowerU = Math.min(point.getX(), lowerU);
lowerV = (point.getY() < lowerV) ? point.getY() : lowerV; lowerV = Math.min(point.getY(), lowerV);
upperU = (point.getX() > upperU) ? point.getX() : upperU; upperU = Math.max(point.getX(), upperU);
upperV = (point.getY() > upperV) ? point.getY() : upperV; upperV = Math.max(point.getY(), upperV);
} }
Box2d box = new Box2d(new Point2d(lowerU, lowerV), new Point2d(upperU, upperV)); return new Box2d(new Point2d(lowerU, lowerV), new Point2d(upperU, upperV));
return box;
} }
public static void connectHalfEdges(List<HalfEdge2d> rHalfEdges) { public static void connectHalfEdges(List<HalfEdge2d> rHalfEdges) {
......
/*- /*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart * Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
* *
* This file is part of CityDoctor2. * This file is part of CityDoctor2.
* *
* CityDoctor2 is free software: you can redistribute it and/or modify * 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 * 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 * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* CityDoctor2 is distributed in the hope that it will be useful, * CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>. * along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/ */
package de.hft.stuttgart.citydoctor2.edge; package de.hft.stuttgart.citydoctor2.edge;
public class Polygon2dPolygon2dInt {
public class Polygon2dPolygon2dInt {
private Polygon2d mcpPolygon1;
private Polygon2d mcpPolygon2; private final Polygon2d mcpPolygon1;
private PolyLine2d line; private final Polygon2d mcpPolygon2;
private IntersectionType intType; private final PolyLine2d line;
private final IntersectionType intType;
public Polygon2dPolygon2dInt(Polygon2d mcpPolygon1, Polygon2d mcpPolygon2, PolyLine2d line,
IntersectionType intType) { public Polygon2dPolygon2dInt(Polygon2d mcpPolygon1, Polygon2d mcpPolygon2, PolyLine2d line,
this.mcpPolygon1 = mcpPolygon1; IntersectionType intType) {
this.mcpPolygon2 = mcpPolygon2; this.mcpPolygon1 = mcpPolygon1;
this.line = line; this.mcpPolygon2 = mcpPolygon2;
this.intType = intType; this.line = line;
} this.intType = intType;
}
public PolyLine2d getPolyLine2d() {
return line; public PolyLine2d getPolyLine2d() {
} return line;
}
public IntersectionType getIntType() {
return intType; public IntersectionType getIntType() {
} return intType;
}
public Polygon2d getPolygon1() {
return mcpPolygon1; public Polygon2d getPolygon1() {
} return mcpPolygon1;
}
public Polygon2d getPolygon2() {
return mcpPolygon2; public Polygon2d getPolygon2() {
} return mcpPolygon2;
}
@Override
public String toString() { @Override
return "Polygon2dPolygon2dInt [mcpPolygon1=" + mcpPolygon1 + ", mcpPolygon2=" + mcpPolygon2 + ", line=" + line public String toString() {
+ ", intType=" + intType + "]"; return "Polygon2dPolygon2dInt [mcpPolygon1=" + mcpPolygon1 + ", mcpPolygon2=" + mcpPolygon2 + ", line=" + line
} + ", intType=" + intType + "]";
} }
}
/*- /*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart * Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
* *
* This file is part of CityDoctor2. * This file is part of CityDoctor2.
* *
* CityDoctor2 is free software: you can redistribute it and/or modify * 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 * 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 * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* CityDoctor2 is distributed in the hope that it will be useful, * CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>. * along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/ */
package de.hft.stuttgart.citydoctor2.edge; package de.hft.stuttgart.citydoctor2.edge;
public class PolygonPolygonIntersection {
public class PolygonPolygonIntersection {
private EdgePolygon p1;
private EdgePolygon p2; private final EdgePolygon p1;
private PolyLine polyLine; private final EdgePolygon p2;
private IntersectionType type; private final PolyLine polyLine;
private final IntersectionType type;
public PolygonPolygonIntersection(EdgePolygon p1, EdgePolygon p2, PolyLine polyLine, IntersectionType type) {
this.p1 = p1; public PolygonPolygonIntersection(EdgePolygon p1, EdgePolygon p2, PolyLine polyLine, IntersectionType type) {
this.p2 = p2; this.p1 = p1;
this.polyLine = polyLine; this.p2 = p2;
this.type = type; this.polyLine = polyLine;
} this.type = type;
}
public PolygonPolygonIntersection(EdgePolygon p1, EdgePolygon p2, PolyLine polyLine) {
this(p1, p2, polyLine, IntersectionType.NORMAL_INTERSECTION); public PolygonPolygonIntersection(EdgePolygon p1, EdgePolygon p2, PolyLine polyLine) {
} this(p1, p2, polyLine, IntersectionType.NORMAL_INTERSECTION);
}
public PolyLine getPolyLine() {
return polyLine; public PolyLine getPolyLine() {
} return polyLine;
}
public IntersectionType getIntersectionType() {
return type; public IntersectionType getIntersectionType() {
} return type;
}
public EdgePolygon getPolygon1() {
return p1; public EdgePolygon getPolygon1() {
} return p1;
}
public EdgePolygon getPolygon2() {
return p2; public EdgePolygon getPolygon2() {
} return p2;
}
@Override
public String toString() { @Override
return "PolygonPolygonIntersection [p1=" + p1 + ", p2=" + p2 + ", polyLine=" + polyLine + ", type=" + type public String toString() {
+ "]"; return "PolygonPolygonIntersection [p1=" + p1 + ", p2=" + p2 + ", polyLine=" + polyLine + ", type=" + type
} + "]";
}
}
}
/*- /*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart * Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
* *
* This file is part of CityDoctor2. * This file is part of CityDoctor2.
* *
* CityDoctor2 is free software: you can redistribute it and/or modify * 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 * 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 * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* CityDoctor2 is distributed in the hope that it will be useful, * CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>. * along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/ */
package de.hft.stuttgart.citydoctor2.edge; package de.hft.stuttgart.citydoctor2.edge;
public class ProjectedPoint3d {
public class ProjectedPoint3d {
private Point3d point;
private double parameter; private final Point3d point;
private final double parameter;
public ProjectedPoint3d(Point3d point, double d) {
this.point = point; public ProjectedPoint3d(Point3d point, double d) {
this.parameter = d; this.point = point;
} this.parameter = d;
}
public Point3d getPoint() {
return point; public Point3d getPoint() {
} return point;
}
public double getParameter() {
return parameter; public double getParameter() {
} return parameter;
}
}
}
/*- /*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart * Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
* *
* This file is part of CityDoctor2. * This file is part of CityDoctor2.
* *
* CityDoctor2 is free software: you can redistribute it and/or modify * 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 * 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 * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* CityDoctor2 is distributed in the hope that it will be useful, * CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>. * along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/ */
package de.hft.stuttgart.citydoctor2.edge; package de.hft.stuttgart.citydoctor2.edge;
public class UnitVector3d extends Vector3d {
public class UnitVector3d extends Vector3d {
public static UnitVector3d of(Vector3d vec) {
UnitVector3d unitVec = new UnitVector3d(vec.getX(), vec.getY(), vec.getZ()); public static UnitVector3d of(Vector3d vec) {
unitVec.normalize(); UnitVector3d unitVec = new UnitVector3d(vec.getX(), vec.getY(), vec.getZ());
return unitVec; unitVec.normalize();
} return unitVec;
}
public static UnitVector3d of(double x, double y, double z) {
double length = Math.sqrt(x * x + y * y + z * z); public static UnitVector3d of(double x, double y, double z) {
return new UnitVector3d(x / length, y / length, z / length); double length = Math.sqrt(x * x + y * y + z * z);
} return new UnitVector3d(x / length, y / length, z / length);
}
private UnitVector3d(double x, double y, double z) {
super(x, y, z); private UnitVector3d(double x, double y, double z) {
} super(x, y, z);
}
public double dot(UnitVector3d other) {
double scalar = getX() * other.getX() + getY() * other.getY() + getZ() * other.getZ(); public double dot(UnitVector3d other) {
if (scalar > 1.0) { double scalar = getX() * other.getX() + getY() * other.getY() + getZ() * other.getZ();
return 1.0; return (scalar >= 0) ? Math.min(scalar, 1.0) : Math.max(scalar, -1.0);
} }
if (scalar < -1.0) {
return -1.0;
}
return scalar; }
}
}
/*- /*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart * Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
* *
* This file is part of CityDoctor2. * This file is part of CityDoctor2.
* *
* CityDoctor2 is free software: you can redistribute it and/or modify * 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 * 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 * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* CityDoctor2 is distributed in the hope that it will be useful, * CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>. * along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/ */
package de.hft.stuttgart.citydoctor2.edge; package de.hft.stuttgart.citydoctor2.edge;
public class Vector2d {
public class Vector2d {
private double x;
private double y; private final double x;
private final double y;
public Vector2d(double x, double y) {
this.x = x; public Vector2d(double x, double y) {
this.y = y; this.x = x;
} this.y = y;
}
public Vector2d getPerpendicularVector() {
return new Vector2d(y, -x); @SuppressWarnings("SuspiciousNameCombination")
} public Vector2d getPerpendicularVector() {
return new Vector2d(y, -x);
public double dot(Vector2d other) { }
return (getX() * other.getX() + getY() * other.getY());
} public double dot(Vector2d other) {
return (getX() * other.getX() + getY() * other.getY());
public Vector2d mult(double scalar) { }
return new Vector2d(x * scalar, y * scalar);
} public Vector2d mult(double scalar) {
return new Vector2d(x * scalar, y * scalar);
public double getX() { }
return x;
} public double getX() {
return x;
public double getY() { }
return y;
} public double getY() {
return y;
public UnitVector2d normalize() { }
return UnitVector2d.convertFrom(this);
} public UnitVector2d normalize() {
return UnitVector2d.convertFrom(this);
public double getLength() { }
return Math.sqrt(getLength2());
} public double getLength() {
return Math.sqrt(getLength2());
public double getLength2() { }
return x * x + y * y;
} public double getLength2() {
return x * x + y * y;
@Override }
public String toString() {
return "Vector2d [x=" + x + ", y=" + y + "]"; @Override
} public String toString() {
return "Vector2d [x=" + x + ", y=" + y + "]";
} }
}
/*- /*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart * Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
* *
* This file is part of CityDoctor2. * This file is part of CityDoctor2.
* *
* CityDoctor2 is free software: you can redistribute it and/or modify * 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 * 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 * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* CityDoctor2 is distributed in the hope that it will be useful, * CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>. * along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/ */
package de.hft.stuttgart.citydoctor2.edge; package de.hft.stuttgart.citydoctor2.edge;
import java.util.Arrays;
import java.util.Arrays;
public class Vector3d {
public class Vector3d {
private double[] val = new double[3];
private final double[] val = new double[3];
public Vector3d(double x, double y, double z) {
val[0] = x; public Vector3d(double x, double y, double z) {
val[1] = y; val[0] = x;
val[2] = z; val[1] = y;
} val[2] = z;
}
public Vector3d(Point3d point) {
this(point.getX(), point.getY(), point.getZ()); public Vector3d(Point3d point) {
} this(point.getX(), point.getY(), point.getZ());
}
public double getLength() {
double value = val[0] * val[0] + val[1] * val[1] + val[2] * val[2]; public double getLength() {
return Math.sqrt(value); double value = val[0] * val[0] + val[1] * val[1] + val[2] * val[2];
} return Math.sqrt(value);
}
public void normalize() {
double length = getLength(); public void normalize() {
if (length < Global.getHighAccuracyTolerance()) { double length = getLength();
val[0] = 0; if (length < Global.getHighAccuracyTolerance()) {
val[1] = 0; val[0] = 0;
val[2] = 0; val[1] = 0;
} else { val[2] = 0;
val[0] = val[0] /= length; } else {
val[1] = val[1] /= length; val[0] /= length;
val[2] = val[2] /= length; val[1] /= length;
} val[2] /= length;
} }
}
public Vector3d cross(Vector3d crV2) {
return new Vector3d(getY() * crV2.getZ() - crV2.getY() * getZ(), getZ() * crV2.getX() - crV2.getZ() * getX(), public Vector3d cross(Vector3d crV2) {
getX() * crV2.getY() - crV2.getX() * getY()); return new Vector3d(getY() * crV2.getZ() - crV2.getY() * getZ(), getZ() * crV2.getX() - crV2.getZ() * getX(),
} getX() * crV2.getY() - crV2.getX() * getY());
}
public UnitVector3d toUnitVector() {
return UnitVector3d.of(this); public UnitVector3d toUnitVector() {
} return UnitVector3d.of(this);
}
public Vector3d mult(double d) {
return new Vector3d(val[0] * d, val[1] * d, val[2] * d); public Vector3d mult(double d) {
} return new Vector3d(val[0] * d, val[1] * d, val[2] * d);
}
public Vector3d plus(Vector3d other) {
return new Vector3d(getX() + other.getX(), getY() + other.getY(), getZ() + other.getZ()); public Vector3d plus(Vector3d other) {
} return new Vector3d(getX() + other.getX(), getY() + other.getY(), getZ() + other.getZ());
}
public double getX() {
return val[0]; public double getX() {
} return val[0];
}
public double getY() {
return val[1]; public double getY() {
} return val[1];
}
public double getZ() {
return val[2]; public double getZ() {
} return val[2];
}
public double getLength2() {
return val[0] * val[0] + val[1] * val[1] + val[2] * val[2]; public double getLength2() {
} return val[0] * val[0] + val[1] * val[1] + val[2] * val[2];
}
public double dot(Vector3d crVector) {
return this.val[0] * crVector.getX() + this.val[1] * crVector.getY() + this.val[2] * crVector.getZ(); public double dot(Vector3d crVector) {
} return this.val[0] * crVector.getX() + this.val[1] * crVector.getY() + this.val[2] * crVector.getZ();
}
public static boolean areParallel(Vector3d crV1, Vector3d crV2, double angleEpsilon) {
return Math.abs((crV1.dot(crV2)) - (crV1.getLength() * crV2.getLength())) < angleEpsilon; public static boolean areParallel(Vector3d crV1, Vector3d crV2, double angleEpsilon) {
} return Math.abs((crV1.dot(crV2)) - (crV1.getLength() * crV2.getLength())) < angleEpsilon;
}
public static boolean areAntiParallel(Vector3d crV1, Vector3d crV2, double angleEpsilon) {
return Math.abs((crV1.dot(crV2)) + (crV1.getLength() * crV2.getLength())) < angleEpsilon; public static boolean areAntiParallel(Vector3d crV1, Vector3d crV2, double angleEpsilon) {
} return Math.abs((crV1.dot(crV2)) + (crV1.getLength() * crV2.getLength())) < angleEpsilon;
}
public static boolean areAntiParallel(Vector3d rDir1, Vector3d rDir2) {
return areAntiParallel(rDir1, rDir2, Global.getTolVectorsParallel()); public static boolean areAntiParallel(Vector3d rDir1, Vector3d rDir2) {
} return areAntiParallel(rDir1, rDir2, Global.getTolVectorsParallel());
}
public static boolean areParallel(Vector3d rDir1, Vector3d rDir2) {
return areParallel(rDir1, rDir2, Global.getTolVectorsParallel()); public static boolean areParallel(Vector3d rDir1, Vector3d rDir2) {
} return areParallel(rDir1, rDir2, Global.getTolVectorsParallel());
}
public double[] toArray() {
return Arrays.copyOf(val, 3); public double[] toArray() {
} return Arrays.copyOf(val, 3);
}
@Override
public String toString() { @Override
return "Vector3d [val=" + Arrays.toString(val) + "]"; public String toString() {
} return "Vector3d [val=" + Arrays.toString(val) + "]";
} }
}
...@@ -103,11 +103,11 @@ public class IntersectionErrorsTest { ...@@ -103,11 +103,11 @@ public class IntersectionErrorsTest {
} }
MeshSurface meshSurface = MeshSurface.of(geom); MeshSurface meshSurface = MeshSurface.of(geom);
List<CDPolygonNs> polygons = meshSurface.getPolygons(); List<CDPolygonNs> polygons = meshSurface.polygons();
assertEquals(2, polygons.size()); assertEquals(2, polygons.size());
CDPolygonNs edgePoly1 = meshSurface.getPolygons().get(0); CDPolygonNs edgePoly1 = meshSurface.polygons().get(0);
CDPolygonNs edgePoly2 = meshSurface.getPolygons().get(1); CDPolygonNs edgePoly2 = meshSurface.polygons().get(1);
List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1, edgePoly2, 0.000001, 0.001); List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1, edgePoly2, 0.000001, 0.001);
......
...@@ -77,7 +77,7 @@ public class MeshSurfaceUtilsTest { ...@@ -77,7 +77,7 @@ public class MeshSurfaceUtilsTest {
ext.addVertex(v1); ext.addVertex(v1);
MeshSurface meshSurface = MeshSurface.of(geom); MeshSurface meshSurface = MeshSurface.of(geom);
List<CDPolygonNs> polygons = meshSurface.getPolygons(); List<CDPolygonNs> polygons = meshSurface.polygons();
assertEquals(2, polygons.size()); assertEquals(2, polygons.size());
CDPolygonNs edgePoly1 = polygons.get(0); CDPolygonNs edgePoly1 = polygons.get(0);
List<Coordinate3d> coordinates = edgePoly1.getCoordinates(); List<Coordinate3d> coordinates = edgePoly1.getCoordinates();
...@@ -147,7 +147,7 @@ public class MeshSurfaceUtilsTest { ...@@ -147,7 +147,7 @@ public class MeshSurfaceUtilsTest {
List<Coordinate3d> coordChildren = firstHalfEdge.getChildren(Coordinate3d.class); List<Coordinate3d> coordChildren = firstHalfEdge.getChildren(Coordinate3d.class);
assertEquals(2, coordChildren.size()); assertEquals(2, coordChildren.size());
CDPolygonNs edgePoly2 = meshSurface.getPolygons().get(1); CDPolygonNs edgePoly2 = meshSurface.polygons().get(1);
List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1, List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1,
edgePoly2, 0.000001, 0.001); edgePoly2, 0.000001, 0.001);
assertNotNull(intersectPolygons); assertNotNull(intersectPolygons);
...@@ -195,11 +195,11 @@ public class MeshSurfaceUtilsTest { ...@@ -195,11 +195,11 @@ public class MeshSurfaceUtilsTest {
ext.addVertex(v6); ext.addVertex(v6);
MeshSurface meshSurface = MeshSurface.of(geom); MeshSurface meshSurface = MeshSurface.of(geom);
List<CDPolygonNs> polygons = meshSurface.getPolygons(); List<CDPolygonNs> polygons = meshSurface.polygons();
assertEquals(2, polygons.size()); assertEquals(2, polygons.size());
CDPolygonNs edgePoly1 = meshSurface.getPolygons().get(0); CDPolygonNs edgePoly1 = meshSurface.polygons().get(0);
CDPolygonNs edgePoly2 = meshSurface.getPolygons().get(1); CDPolygonNs edgePoly2 = meshSurface.polygons().get(1);
List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1, List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1,
edgePoly2, 0.000001, 0.001); edgePoly2, 0.000001, 0.001);
assertNotNull(intersectPolygons); assertNotNull(intersectPolygons);
...@@ -248,11 +248,11 @@ public class MeshSurfaceUtilsTest { ...@@ -248,11 +248,11 @@ public class MeshSurfaceUtilsTest {
ext.addVertex(v6); ext.addVertex(v6);
MeshSurface meshSurface = MeshSurface.of(geom); MeshSurface meshSurface = MeshSurface.of(geom);
List<CDPolygonNs> polygons = meshSurface.getPolygons(); List<CDPolygonNs> polygons = meshSurface.polygons();
assertEquals(2, polygons.size()); assertEquals(2, polygons.size());
CDPolygonNs edgePoly1 = meshSurface.getPolygons().get(0); CDPolygonNs edgePoly1 = meshSurface.polygons().get(0);
CDPolygonNs edgePoly2 = meshSurface.getPolygons().get(1); CDPolygonNs edgePoly2 = meshSurface.polygons().get(1);
List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1, List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1,
edgePoly2, 0.000001, 0.001); edgePoly2, 0.000001, 0.001);
...@@ -311,11 +311,11 @@ public class MeshSurfaceUtilsTest { ...@@ -311,11 +311,11 @@ public class MeshSurfaceUtilsTest {
ext.addVertex(v2); ext.addVertex(v2);
MeshSurface meshSurface = MeshSurface.of(geom); MeshSurface meshSurface = MeshSurface.of(geom);
List<CDPolygonNs> polygons = meshSurface.getPolygons(); List<CDPolygonNs> polygons = meshSurface.polygons();
assertEquals(2, polygons.size()); assertEquals(2, polygons.size());
CDPolygonNs edgePoly1 = meshSurface.getPolygons().get(0); CDPolygonNs edgePoly1 = meshSurface.polygons().get(0);
CDPolygonNs edgePoly2 = meshSurface.getPolygons().get(1); CDPolygonNs edgePoly2 = meshSurface.polygons().get(1);
List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1, List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1,
edgePoly2, 0.000001, 0.001); edgePoly2, 0.000001, 0.001);
...@@ -375,11 +375,11 @@ public class MeshSurfaceUtilsTest { ...@@ -375,11 +375,11 @@ public class MeshSurfaceUtilsTest {
ext.addVertex(v6); ext.addVertex(v6);
MeshSurface meshSurface = MeshSurface.of(geom); MeshSurface meshSurface = MeshSurface.of(geom);
List<CDPolygonNs> polygons = meshSurface.getPolygons(); List<CDPolygonNs> polygons = meshSurface.polygons();
assertEquals(2, polygons.size()); assertEquals(2, polygons.size());
CDPolygonNs edgePoly1 = meshSurface.getPolygons().get(0); CDPolygonNs edgePoly1 = meshSurface.polygons().get(0);
CDPolygonNs edgePoly2 = meshSurface.getPolygons().get(1); CDPolygonNs edgePoly2 = meshSurface.polygons().get(1);
List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1, List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1,
edgePoly2, 0.000001, 0.001); edgePoly2, 0.000001, 0.001);
...@@ -429,11 +429,11 @@ public class MeshSurfaceUtilsTest { ...@@ -429,11 +429,11 @@ public class MeshSurfaceUtilsTest {
ext.addVertex(v6); ext.addVertex(v6);
MeshSurface meshSurface = MeshSurface.of(geom); MeshSurface meshSurface = MeshSurface.of(geom);
List<CDPolygonNs> polygons = meshSurface.getPolygons(); List<CDPolygonNs> polygons = meshSurface.polygons();
assertEquals(2, polygons.size()); assertEquals(2, polygons.size());
CDPolygonNs edgePoly1 = meshSurface.getPolygons().get(0); CDPolygonNs edgePoly1 = meshSurface.polygons().get(0);
CDPolygonNs edgePoly2 = meshSurface.getPolygons().get(1); CDPolygonNs edgePoly2 = meshSurface.polygons().get(1);
List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1, List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1,
edgePoly2, 0.000001, 0.001); edgePoly2, 0.000001, 0.001);
...@@ -482,11 +482,11 @@ public class MeshSurfaceUtilsTest { ...@@ -482,11 +482,11 @@ public class MeshSurfaceUtilsTest {
ext.addVertex(v6); ext.addVertex(v6);
MeshSurface meshSurface = MeshSurface.of(geom); MeshSurface meshSurface = MeshSurface.of(geom);
List<CDPolygonNs> polygons = meshSurface.getPolygons(); List<CDPolygonNs> polygons = meshSurface.polygons();
assertEquals(2, polygons.size()); assertEquals(2, polygons.size());
CDPolygonNs edgePoly1 = meshSurface.getPolygons().get(0); CDPolygonNs edgePoly1 = meshSurface.polygons().get(0);
CDPolygonNs edgePoly2 = meshSurface.getPolygons().get(1); CDPolygonNs edgePoly2 = meshSurface.polygons().get(1);
DebugUtils.printGeoknechtPolygon(edgePoly1, edgePoly2); DebugUtils.printGeoknechtPolygon(edgePoly1, edgePoly2);
...@@ -543,11 +543,11 @@ public class MeshSurfaceUtilsTest { ...@@ -543,11 +543,11 @@ public class MeshSurfaceUtilsTest {
ext.addVertex(v6); ext.addVertex(v6);
MeshSurface meshSurface = MeshSurface.of(geom); MeshSurface meshSurface = MeshSurface.of(geom);
List<CDPolygonNs> polygons = meshSurface.getPolygons(); List<CDPolygonNs> polygons = meshSurface.polygons();
assertEquals(2, polygons.size()); assertEquals(2, polygons.size());
CDPolygonNs edgePoly1 = meshSurface.getPolygons().get(0); CDPolygonNs edgePoly1 = meshSurface.polygons().get(0);
CDPolygonNs edgePoly2 = meshSurface.getPolygons().get(1); CDPolygonNs edgePoly2 = meshSurface.polygons().get(1);
List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1, List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1,
edgePoly2, 0.000001, 0.001); edgePoly2, 0.000001, 0.001);
...@@ -596,11 +596,11 @@ public class MeshSurfaceUtilsTest { ...@@ -596,11 +596,11 @@ public class MeshSurfaceUtilsTest {
ext.addVertex(v4); ext.addVertex(v4);
MeshSurface meshSurface = MeshSurface.of(geom); MeshSurface meshSurface = MeshSurface.of(geom);
List<CDPolygonNs> polygons = meshSurface.getPolygons(); List<CDPolygonNs> polygons = meshSurface.polygons();
assertEquals(2, polygons.size()); assertEquals(2, polygons.size());
CDPolygonNs edgePoly1 = meshSurface.getPolygons().get(0); CDPolygonNs edgePoly1 = meshSurface.polygons().get(0);
CDPolygonNs edgePoly2 = meshSurface.getPolygons().get(1); CDPolygonNs edgePoly2 = meshSurface.polygons().get(1);
DebugUtils.printGeoknechtPolygon(edgePoly1, edgePoly2); DebugUtils.printGeoknechtPolygon(edgePoly1, edgePoly2);
...@@ -652,11 +652,11 @@ public class MeshSurfaceUtilsTest { ...@@ -652,11 +652,11 @@ public class MeshSurfaceUtilsTest {
ext.addVertex(v6); ext.addVertex(v6);
MeshSurface meshSurface = MeshSurface.of(geom); MeshSurface meshSurface = MeshSurface.of(geom);
List<CDPolygonNs> polygons = meshSurface.getPolygons(); List<CDPolygonNs> polygons = meshSurface.polygons();
assertEquals(2, polygons.size()); assertEquals(2, polygons.size());
CDPolygonNs edgePoly1 = meshSurface.getPolygons().get(0); CDPolygonNs edgePoly1 = meshSurface.polygons().get(0);
CDPolygonNs edgePoly2 = meshSurface.getPolygons().get(1); CDPolygonNs edgePoly2 = meshSurface.polygons().get(1);
List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1, List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1,
edgePoly2, 0.000001, 0.001); edgePoly2, 0.000001, 0.001);
...@@ -706,11 +706,11 @@ public class MeshSurfaceUtilsTest { ...@@ -706,11 +706,11 @@ public class MeshSurfaceUtilsTest {
ext.addVertex(v6); ext.addVertex(v6);
MeshSurface meshSurface = MeshSurface.of(geom); MeshSurface meshSurface = MeshSurface.of(geom);
List<CDPolygonNs> polygons = meshSurface.getPolygons(); List<CDPolygonNs> polygons = meshSurface.polygons();
assertEquals(2, polygons.size()); assertEquals(2, polygons.size());
CDPolygonNs edgePoly1 = meshSurface.getPolygons().get(0); CDPolygonNs edgePoly1 = meshSurface.polygons().get(0);
CDPolygonNs edgePoly2 = meshSurface.getPolygons().get(1); CDPolygonNs edgePoly2 = meshSurface.polygons().get(1);
List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1, List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1,
edgePoly2, 0.000001, 0.001); edgePoly2, 0.000001, 0.001);
...@@ -760,11 +760,11 @@ public class MeshSurfaceUtilsTest { ...@@ -760,11 +760,11 @@ public class MeshSurfaceUtilsTest {
ext.addVertex(v6); ext.addVertex(v6);
MeshSurface meshSurface = MeshSurface.of(geom); MeshSurface meshSurface = MeshSurface.of(geom);
List<CDPolygonNs> polygons = meshSurface.getPolygons(); List<CDPolygonNs> polygons = meshSurface.polygons();
assertEquals(2, polygons.size()); assertEquals(2, polygons.size());
CDPolygonNs edgePoly1 = meshSurface.getPolygons().get(0); CDPolygonNs edgePoly1 = meshSurface.polygons().get(0);
CDPolygonNs edgePoly2 = meshSurface.getPolygons().get(1); CDPolygonNs edgePoly2 = meshSurface.polygons().get(1);
List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1, List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1,
edgePoly2, 0.000001, 0.001); edgePoly2, 0.000001, 0.001);
...@@ -810,11 +810,11 @@ public class MeshSurfaceUtilsTest { ...@@ -810,11 +810,11 @@ public class MeshSurfaceUtilsTest {
ext.addVertex(v6); ext.addVertex(v6);
MeshSurface meshSurface = MeshSurface.of(geom); MeshSurface meshSurface = MeshSurface.of(geom);
List<CDPolygonNs> polygons = meshSurface.getPolygons(); List<CDPolygonNs> polygons = meshSurface.polygons();
assertEquals(2, polygons.size()); assertEquals(2, polygons.size());
CDPolygonNs edgePoly1 = meshSurface.getPolygons().get(0); CDPolygonNs edgePoly1 = meshSurface.polygons().get(0);
CDPolygonNs edgePoly2 = meshSurface.getPolygons().get(1); CDPolygonNs edgePoly2 = meshSurface.polygons().get(1);
List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1, List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1,
edgePoly2, 0.000001, 0.001); edgePoly2, 0.000001, 0.001);
...@@ -866,11 +866,11 @@ public class MeshSurfaceUtilsTest { ...@@ -866,11 +866,11 @@ public class MeshSurfaceUtilsTest {
ext.addVertex(v6); ext.addVertex(v6);
MeshSurface meshSurface = MeshSurface.of(geom); MeshSurface meshSurface = MeshSurface.of(geom);
List<CDPolygonNs> polygons = meshSurface.getPolygons(); List<CDPolygonNs> polygons = meshSurface.polygons();
assertEquals(2, polygons.size()); assertEquals(2, polygons.size());
CDPolygonNs edgePoly1 = meshSurface.getPolygons().get(0); CDPolygonNs edgePoly1 = meshSurface.polygons().get(0);
CDPolygonNs edgePoly2 = meshSurface.getPolygons().get(1); CDPolygonNs edgePoly2 = meshSurface.polygons().get(1);
List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1, List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1,
edgePoly2, 0.000001, 0.001); edgePoly2, 0.000001, 0.001);
...@@ -922,11 +922,11 @@ public class MeshSurfaceUtilsTest { ...@@ -922,11 +922,11 @@ public class MeshSurfaceUtilsTest {
ext.addVertex(v6); ext.addVertex(v6);
MeshSurface meshSurface = MeshSurface.of(geom); MeshSurface meshSurface = MeshSurface.of(geom);
List<CDPolygonNs> polygons = meshSurface.getPolygons(); List<CDPolygonNs> polygons = meshSurface.polygons();
assertEquals(2, polygons.size()); assertEquals(2, polygons.size());
CDPolygonNs edgePoly1 = meshSurface.getPolygons().get(0); CDPolygonNs edgePoly1 = meshSurface.polygons().get(0);
CDPolygonNs edgePoly2 = meshSurface.getPolygons().get(1); CDPolygonNs edgePoly2 = meshSurface.polygons().get(1);
List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1, List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1,
edgePoly2, 0.000001, 0.001); edgePoly2, 0.000001, 0.001);
...@@ -978,11 +978,11 @@ public class MeshSurfaceUtilsTest { ...@@ -978,11 +978,11 @@ public class MeshSurfaceUtilsTest {
ext.addVertex(v6); ext.addVertex(v6);
MeshSurface meshSurface = MeshSurface.of(geom); MeshSurface meshSurface = MeshSurface.of(geom);
List<CDPolygonNs> polygons = meshSurface.getPolygons(); List<CDPolygonNs> polygons = meshSurface.polygons();
assertEquals(2, polygons.size()); assertEquals(2, polygons.size());
CDPolygonNs edgePoly1 = meshSurface.getPolygons().get(0); CDPolygonNs edgePoly1 = meshSurface.polygons().get(0);
CDPolygonNs edgePoly2 = meshSurface.getPolygons().get(1); CDPolygonNs edgePoly2 = meshSurface.polygons().get(1);
List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1, List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1,
edgePoly2, 0.000001, 0.001); edgePoly2, 0.000001, 0.001);
...@@ -1049,11 +1049,11 @@ public class MeshSurfaceUtilsTest { ...@@ -1049,11 +1049,11 @@ public class MeshSurfaceUtilsTest {
ext.addVertex(v5); ext.addVertex(v5);
MeshSurface meshSurface = MeshSurface.of(geom); MeshSurface meshSurface = MeshSurface.of(geom);
List<CDPolygonNs> polygons = meshSurface.getPolygons(); List<CDPolygonNs> polygons = meshSurface.polygons();
assertEquals(2, polygons.size()); assertEquals(2, polygons.size());
CDPolygonNs edgePoly1 = meshSurface.getPolygons().get(0); CDPolygonNs edgePoly1 = meshSurface.polygons().get(0);
CDPolygonNs edgePoly2 = meshSurface.getPolygons().get(1); CDPolygonNs edgePoly2 = meshSurface.polygons().get(1);
List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1, List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1,
edgePoly2, 0.000001, 0.001); edgePoly2, 0.000001, 0.001);
...@@ -1110,11 +1110,11 @@ public class MeshSurfaceUtilsTest { ...@@ -1110,11 +1110,11 @@ public class MeshSurfaceUtilsTest {
ext.addVertex(v11); ext.addVertex(v11);
MeshSurface meshSurface = MeshSurface.of(geom); MeshSurface meshSurface = MeshSurface.of(geom);
List<CDPolygonNs> polygons = meshSurface.getPolygons(); List<CDPolygonNs> polygons = meshSurface.polygons();
assertEquals(2, polygons.size()); assertEquals(2, polygons.size());
CDPolygonNs edgePoly1 = meshSurface.getPolygons().get(0); CDPolygonNs edgePoly1 = meshSurface.polygons().get(0);
CDPolygonNs edgePoly2 = meshSurface.getPolygons().get(1); CDPolygonNs edgePoly2 = meshSurface.polygons().get(1);
List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1, List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1,
edgePoly2, 0.000001, 0.001); edgePoly2, 0.000001, 0.001);
...@@ -1173,11 +1173,11 @@ public class MeshSurfaceUtilsTest { ...@@ -1173,11 +1173,11 @@ public class MeshSurfaceUtilsTest {
ext.addVertex(v11); ext.addVertex(v11);
MeshSurface meshSurface = MeshSurface.of(geom); MeshSurface meshSurface = MeshSurface.of(geom);
List<CDPolygonNs> polygons = meshSurface.getPolygons(); List<CDPolygonNs> polygons = meshSurface.polygons();
assertEquals(2, polygons.size()); assertEquals(2, polygons.size());
CDPolygonNs edgePoly1 = meshSurface.getPolygons().get(0); CDPolygonNs edgePoly1 = meshSurface.polygons().get(0);
CDPolygonNs edgePoly2 = meshSurface.getPolygons().get(1); CDPolygonNs edgePoly2 = meshSurface.polygons().get(1);
List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1, List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1,
edgePoly2, 0.000001, 0.001); edgePoly2, 0.000001, 0.001);
...@@ -1238,11 +1238,11 @@ public class MeshSurfaceUtilsTest { ...@@ -1238,11 +1238,11 @@ public class MeshSurfaceUtilsTest {
ext.addVertex(v5); ext.addVertex(v5);
MeshSurface meshSurface = MeshSurface.of(geom); MeshSurface meshSurface = MeshSurface.of(geom);
List<CDPolygonNs> polygons = meshSurface.getPolygons(); List<CDPolygonNs> polygons = meshSurface.polygons();
assertEquals(2, polygons.size()); assertEquals(2, polygons.size());
CDPolygonNs edgePoly1 = meshSurface.getPolygons().get(0); CDPolygonNs edgePoly1 = meshSurface.polygons().get(0);
CDPolygonNs edgePoly2 = meshSurface.getPolygons().get(1); CDPolygonNs edgePoly2 = meshSurface.polygons().get(1);
List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1, List<PolygonPolygonIntersection> intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1,
edgePoly2, 0.000001, 0.001); edgePoly2, 0.000001, 0.001);
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion>
<modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>de.hft.stuttgart</groupId> <groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorParent</artifactId> <artifactId>CityDoctorParent</artifactId>
<version>3.14.1</version> <version>3.15.0</version>
</parent> </parent>
<properties> <properties>
<versionString>${project.version}-${git.commit.id.abbrev}</versionString> <versionString>${project.version}-${git.commit.id.abbrev}</versionString>
......
...@@ -67,7 +67,7 @@ import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration; ...@@ -67,7 +67,7 @@ import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
*/ */
public abstract class Check { public abstract class Check {
private List<Class<Checkable>> applicableToClasses = new ArrayList<>(2); private final List<Class<Checkable>> applicableToClasses = new ArrayList<>(2);
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
protected Check() { protected Check() {
......
...@@ -39,7 +39,7 @@ public interface CheckError extends Serializable { ...@@ -39,7 +39,7 @@ public interface CheckError extends Serializable {
* *
* @return the error type * @return the error type
*/ */
public ErrorType getType(); public ErrorType getType();
/** /**
* Getter for the error id * Getter for the error id
...@@ -79,7 +79,7 @@ public interface CheckError extends Serializable { ...@@ -79,7 +79,7 @@ public interface CheckError extends Serializable {
* implementor of the error decides which information is written into the report * implementor of the error decides which information is written into the report
* or shown on the GUI. * or shown on the GUI.
* *
* @param report * @param report the ErrorReport.
*/ */
public void report(ErrorReport report); public void report(ErrorReport report);
......
...@@ -18,12 +18,14 @@ ...@@ -18,12 +18,14 @@
*/ */
package de.hft.stuttgart.citydoctor2.check; package de.hft.stuttgart.citydoctor2.check;
import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
public class CheckId implements Serializable { public record CheckId(String name) implements Serializable {
@Serial
private static final long serialVersionUID = -6267337828874296004L; private static final long serialVersionUID = -6267337828874296004L;
public static final CheckId C_GE_R_TOO_FEW_POINTS = new CheckId("C_GE_R_TOO_FEW_POINTS"); public static final CheckId C_GE_R_TOO_FEW_POINTS = new CheckId("C_GE_R_TOO_FEW_POINTS");
public static final CheckId C_GE_R_NOT_CLOSED = new CheckId("C_GE_R_NOT_CLOSED"); public static final CheckId C_GE_R_NOT_CLOSED = new CheckId("C_GE_R_NOT_CLOSED");
public static final CheckId C_GE_S_MULTIPLE_CONNECTED_COMPONENTS = new CheckId( public static final CheckId C_GE_S_MULTIPLE_CONNECTED_COMPONENTS = new CheckId(
...@@ -54,24 +56,7 @@ public class CheckId implements Serializable { ...@@ -54,24 +56,7 @@ public class CheckId implements Serializable {
public static final CheckId C_GE_S_NOT_CLOSED = new CheckId("C_GE_S_NOT_CLOSED"); public static final CheckId C_GE_S_NOT_CLOSED = new CheckId("C_GE_S_NOT_CLOSED");
public static final CheckId C_GE_P_ORIENTATION_RINGS_SAME = new CheckId("C_GE_P_ORIENTATION_RINGS_SAME"); public static final CheckId C_GE_P_ORIENTATION_RINGS_SAME = new CheckId("C_GE_P_ORIENTATION_RINGS_SAME");
public static final CheckId C_SE_POLYGON_WITHOUT_SURFACE = new CheckId("C_SE_POLYGON_WITHOUT_SURFACE"); public static final CheckId C_SE_POLYGON_WITHOUT_SURFACE = new CheckId("C_SE_POLYGON_WITHOUT_SURFACE");
private String name;
public CheckId(String name) {
this.name = name;
}
public String getName() {
return name;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
}
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
...@@ -83,12 +68,9 @@ public class CheckId implements Serializable { ...@@ -83,12 +68,9 @@ public class CheckId implements Serializable {
return false; return false;
CheckId other = (CheckId) obj; CheckId other = (CheckId) obj;
if (name == null) { if (name == null) {
if (other.name != null) return other.name == null;
return false; } else return name.equals(other.name);
} else if (!name.equals(other.name)) }
return false;
return true;
}
@Override @Override
public String toString() { public String toString() {
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
package de.hft.stuttgart.citydoctor2.check; package de.hft.stuttgart.citydoctor2.check;
import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
/** /**
...@@ -29,6 +30,7 @@ import java.io.Serializable; ...@@ -29,6 +30,7 @@ import java.io.Serializable;
*/ */
public class CheckResult implements Serializable { public class CheckResult implements Serializable {
@Serial
private static final long serialVersionUID = -8775678793477525693L; private static final long serialVersionUID = -8775678793477525693L;
private final CheckId id; private final CheckId id;
...@@ -38,7 +40,7 @@ public class CheckResult implements Serializable { ...@@ -38,7 +40,7 @@ public class CheckResult implements Serializable {
/** /**
* Constructor for this container * Constructor for this container
* *
* @param c the check which produced this result * @param id the check which produced this result
* @param s the status of the result * @param s the status of the result
* @param err an optional error object * @param err an optional error object
*/ */
...@@ -66,15 +68,7 @@ public class CheckResult implements Serializable { ...@@ -66,15 +68,7 @@ public class CheckResult implements Serializable {
@Override @Override
public String toString() { public String toString() {
StringBuilder builder = new StringBuilder(); return String.format("CheckResult [id=%s, status=%s, error=%s]", id, status, err);
builder.append("CheckResult [id=");
builder.append(id);
builder.append(", status=");
builder.append(status);
builder.append(", error=");
builder.append(err);
builder.append("]");
return builder.toString();
} }
} }
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
package de.hft.stuttgart.citydoctor2.check; package de.hft.stuttgart.citydoctor2.check;
import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -36,11 +37,12 @@ import de.hft.stuttgart.citydoctor2.datastructure.GmlId; ...@@ -36,11 +37,12 @@ import de.hft.stuttgart.citydoctor2.datastructure.GmlId;
*/ */
public abstract class Checkable implements Serializable { public abstract class Checkable implements Serializable {
@Serial
private static final long serialVersionUID = -1707871839265057882L; private static final long serialVersionUID = -1707871839265057882L;
private static final Logger logger = LogManager.getLogger(Checkable.class); private static final Logger logger = LogManager.getLogger(Checkable.class);
private Map<CheckId, CheckResult> checkResults = new HashMap<>(); private final Map<CheckId, CheckResult> checkResults = new HashMap<>();
private boolean isValidated = false; private boolean isValidated = false;
protected void setValidated(boolean validated) { protected void setValidated(boolean validated) {
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
package de.hft.stuttgart.citydoctor2.check; package de.hft.stuttgart.citydoctor2.check;
import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
/** /**
...@@ -30,11 +31,12 @@ import java.io.Serializable; ...@@ -30,11 +31,12 @@ import java.io.Serializable;
*/ */
public class DefaultParameter implements Serializable { public class DefaultParameter implements Serializable {
@Serial
private static final long serialVersionUID = -4587211298078974066L; private static final long serialVersionUID = -4587211298078974066L;
private String name; private final String name;
private String value; private final String value;
private Unit unitType; private final Unit unitType;
public DefaultParameter(String name, String defaultValue, Unit unitType) { public DefaultParameter(String name, String defaultValue, Unit unitType) {
this.name = name; this.name = name;
...@@ -71,13 +73,7 @@ public class DefaultParameter implements Serializable { ...@@ -71,13 +73,7 @@ public class DefaultParameter implements Serializable {
*/ */
@Override @Override
public String toString() { public String toString() {
StringBuilder builder = new StringBuilder(); return "DefaultParameter [name=" + name + ", value=" + value + "]";
builder.append("DefaultParameter [name=");
builder.append(name);
builder.append(", value=");
builder.append(value);
builder.append("]");
return builder.toString();
} }
} }
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
package de.hft.stuttgart.citydoctor2.check; package de.hft.stuttgart.citydoctor2.check;
import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
/** /**
...@@ -27,8 +28,9 @@ import java.io.Serializable; ...@@ -27,8 +28,9 @@ import java.io.Serializable;
* @author Matthias Betz * @author Matthias Betz
* *
*/ */
public class ErrorId implements Serializable { public record ErrorId(String name) implements Serializable {
@Serial
private static final long serialVersionUID = -2598466667746276560L; private static final long serialVersionUID = -2598466667746276560L;
public static final ErrorId DEPENDENCIES_NOT_MET = new ErrorId("Dependencies_not_met"); public static final ErrorId DEPENDENCIES_NOT_MET = new ErrorId("Dependencies_not_met");
...@@ -65,11 +67,8 @@ public class ErrorId implements Serializable { ...@@ -65,11 +67,8 @@ public class ErrorId implements Serializable {
public static final ErrorId GE_P_DEGENERATED_RING = new ErrorId("GE_P_DEGENERATED_POLYGON"); public static final ErrorId GE_P_DEGENERATED_RING = new ErrorId("GE_P_DEGENERATED_POLYGON");
public static final ErrorId SE_POLYGON_WITHOUT_SURFACE = new ErrorId("SE_POLYGON_WITHOUT_SURFACE"); public static final ErrorId SE_POLYGON_WITHOUT_SURFACE = new ErrorId("SE_POLYGON_WITHOUT_SURFACE");
private String name;
public ErrorId(String name) {
this.name = name;
}
@Override @Override
public int hashCode() { public int hashCode() {
...@@ -89,12 +88,9 @@ public class ErrorId implements Serializable { ...@@ -89,12 +88,9 @@ public class ErrorId implements Serializable {
return false; return false;
ErrorId other = (ErrorId) obj; ErrorId other = (ErrorId) obj;
if (name == null) { if (name == null) {
if (other.name != null) return other.name == null;
return false; } else return name.equals(other.name);
} else if (!name.equals(other.name)) }
return false;
return true;
}
@Override @Override
public String toString() { public String toString() {
......
...@@ -18,52 +18,17 @@ ...@@ -18,52 +18,17 @@
*/ */
package de.hft.stuttgart.citydoctor2.check; package de.hft.stuttgart.citydoctor2.check;
import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import de.hft.stuttgart.citydoctor2.datastructure.Polygon; import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
import de.hft.stuttgart.citydoctor2.math.Triangle3d; import de.hft.stuttgart.citydoctor2.math.Triangle3d;
public class GeometrySelfIntersection implements Serializable { public record GeometrySelfIntersection(Polygon p1, Polygon p2, Triangle3d t1, Triangle3d t2) implements Serializable {
@Serial
private static final long serialVersionUID = -6308847898942670140L; private static final long serialVersionUID = -6308847898942670140L;
private Polygon p1;
private Polygon p2;
private Triangle3d t1;
private Triangle3d t2;
public GeometrySelfIntersection(Polygon p1, Polygon p2, Triangle3d t1, Triangle3d t2) {
super();
this.p1 = p1;
this.p2 = p2;
this.t1 = t1;
this.t2 = t2;
}
public Polygon getP1() {
return p1;
}
public void setP1(Polygon p1) {
this.p1 = p1;
}
public Polygon getP2() {
return p2;
}
public void setP2(Polygon p2) {
this.p2 = p2;
}
public Triangle3d getT1() {
return t1;
}
public Triangle3d getT2() {
return t2;
}
@Override @Override
public String toString() { public String toString() {
......
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