Commit 297334ab authored by Matthias Betz's avatar Matthias Betz
Browse files

Add design spec for OpenGL 3D view



Replaces the JavaFX SubScene/MeshView rendering with an OpenGL viewport
(openglfx-jogl, GL 3.3 core), single global VBO, GPU color-picking, and
baked fake shading. Windows/Linux targets; JavaFX 3D path removed.

Co-Authored-By: default avatarClaude Opus 4.8 <noreply@anthropic.com>
parents 5c2847ef bd40b396
......@@ -34,6 +34,7 @@ import de.hft.stuttgart.citydoctor2.datastructure.LinearRing.LinearRingType;
import de.hft.stuttgart.citydoctor2.datastructure.Lod;
import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
import de.hft.stuttgart.citydoctor2.datastructure.Vertex;
import de.hft.stuttgart.citydoctor2.datastructure.Geometry.Orientation;
/**
*
......@@ -44,7 +45,7 @@ public class PolygonSameOrientationCheckTest {
@Test
public void testSameOrientation() {
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1, Orientation.OUTWARD);
Vertex v0 = GeometryTestUtils.createVertex(0, 0, 0, geom);
Vertex v1 = GeometryTestUtils.createVertex(6, 0, 0, geom);
......@@ -76,7 +77,7 @@ public class PolygonSameOrientationCheckTest {
@Test
public void testGoodPoly() {
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1, Orientation.OUTWARD);
Vertex v0 = GeometryTestUtils.createVertex(0, 0, 0, geom);
Vertex v1 = GeometryTestUtils.createVertex(6, 0, 0, geom);
......
......@@ -33,6 +33,7 @@ import de.hft.stuttgart.citydoctor2.datastructure.LinearRing.LinearRingType;
import de.hft.stuttgart.citydoctor2.datastructure.Lod;
import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
import de.hft.stuttgart.citydoctor2.datastructure.Vertex;
import de.hft.stuttgart.citydoctor2.datastructure.Geometry.Orientation;
/**
*
......@@ -45,7 +46,7 @@ public class PolygonSelfIntCheckTest {
@Test
public void testPolygonInteriorIntersectExterior() {
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1, Orientation.OUTWARD);
Polygon poly = new ConcretePolygon();
geom.addPolygon(poly);
......@@ -95,7 +96,7 @@ public class PolygonSelfIntCheckTest {
@Test
public void testPolygonGood() {
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1, Orientation.OUTWARD);
Polygon poly = new ConcretePolygon();
geom.addPolygon(poly);
......@@ -143,7 +144,7 @@ public class PolygonSelfIntCheckTest {
@Test
public void test2InteriorRingsIntersecting() {
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1, Orientation.OUTWARD);
Polygon poly = new ConcretePolygon();
geom.addPolygon(poly);
......@@ -211,7 +212,7 @@ public class PolygonSelfIntCheckTest {
@Test
public void test2InteriorRingsNotIntersecting() {
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1, Orientation.OUTWARD);
Polygon poly = new ConcretePolygon();
geom.addPolygon(poly);
......
......@@ -38,6 +38,7 @@ import de.hft.stuttgart.citydoctor2.datastructure.LinearRing.LinearRingType;
import de.hft.stuttgart.citydoctor2.datastructure.Lod;
import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
import de.hft.stuttgart.citydoctor2.datastructure.Vertex;
import de.hft.stuttgart.citydoctor2.datastructure.Geometry.Orientation;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
/**
......@@ -49,7 +50,7 @@ public class RingSelfIntCheckTest {
@Test
public void testIntersect() {
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1, Orientation.OUTWARD);
Polygon poly = new ConcretePolygon();
geom.addPolygon(poly);
......@@ -88,7 +89,7 @@ public class RingSelfIntCheckTest {
@Test
public void testNonIntersect() {
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1, Orientation.OUTWARD);
Polygon poly = new ConcretePolygon();
geom.addPolygon(poly);
......@@ -121,7 +122,7 @@ public class RingSelfIntCheckTest {
@Test
public void testTouching() {
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1, Orientation.OUTWARD);
Polygon poly = new ConcretePolygon();
geom.addPolygon(poly);
......@@ -159,7 +160,7 @@ public class RingSelfIntCheckTest {
@Test
public void testNotTouching() {
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1, Orientation.OUTWARD);
Polygon poly = new ConcretePolygon();
geom.addPolygon(poly);
......
......@@ -35,7 +35,7 @@ public class SolidSelfIntCheckFalsePositiveBigMeshTest {
CityDoctorModel m = CityGmlParser.parseCityGmlFile(gml_filepath, config.getParserConfiguration());
Checker c = new Checker(config, m);
c.runChecks();
Building building = m.getBuildings().get(0);
Building building = m.getBuildings().toList().get(0);
/*
* The examples have no actual self-intersections, but can contain other actual model defects.
* If an error is detected, it is thus required to check if the
......
......@@ -25,14 +25,18 @@ import static org.junit.Assert.assertNotNull;
import org.junit.Assert;
import org.junit.Test;
import de.hft.stuttgart.citydoctor2.check.CheckId;
import de.hft.stuttgart.citydoctor2.check.CheckResult;
import de.hft.stuttgart.citydoctor2.check.Checker;
import de.hft.stuttgart.citydoctor2.check.ResultStatus;
import de.hft.stuttgart.citydoctor2.check.ValidationConfiguration;
import de.hft.stuttgart.citydoctor2.check.error.NonPlanarPolygonDistancePlaneError;
import de.hft.stuttgart.citydoctor2.checks.util.GeometryTestUtils;
import de.hft.stuttgart.citydoctor2.datastructure.Building;
import de.hft.stuttgart.citydoctor2.datastructure.CityDoctorModel;
import de.hft.stuttgart.citydoctor2.datastructure.ConcretePolygon;
import de.hft.stuttgart.citydoctor2.datastructure.Geometry;
import de.hft.stuttgart.citydoctor2.datastructure.Geometry.Orientation;
import de.hft.stuttgart.citydoctor2.datastructure.GeometryType;
import de.hft.stuttgart.citydoctor2.datastructure.Lod;
import de.hft.stuttgart.citydoctor2.parser.CityGmlParseException;
......@@ -46,6 +50,22 @@ import de.hft.stuttgart.citydoctor2.parser.InvalidGmlFileException;
*/
public class SolidSelfIntCheckTest {
@Test
public void testDependencyChecking() {
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2, Orientation.OUTWARD);
ConcretePolygon p = new ConcretePolygon();
geom.addPolygon(p);
NonPlanarPolygonDistancePlaneError err = new NonPlanarPolygonDistancePlaneError(p, 2, null, null);
CheckResult cr = new CheckResult(CheckId.C_GE_P_NON_PLANAR, ResultStatus.ERROR, err);
p.addCheckResult(cr);
SolidSelfIntCheck selfIntCheck = new SolidSelfIntCheck();
boolean canExecute = selfIntCheck.canExecute(geom);
assertFalse(canExecute);
}
@Test
public void testGoodGeometry() {
SolidSelfIntCheck check = new SolidSelfIntCheck();
......@@ -75,7 +95,7 @@ public class SolidSelfIntCheckTest {
CityDoctorModel m = CityGmlParser.parseCityGmlFile("src/test/resources/SolidSelfIntTest1.gml", config.getParserConfiguration());
Checker c = new Checker(config, m);
c.runChecks();
assertFalse(m.getBuildings().get(0).containsAnyError());
assertFalse(m.getBuildings().toList().get(0).containsAnyError());
}
......@@ -85,7 +105,7 @@ public class SolidSelfIntCheckTest {
CityDoctorModel m = CityGmlParser.parseCityGmlFile(gml_filepath, config.getParserConfiguration());
Checker c = new Checker(config, m);
c.runChecks();
Building building = m.getBuildings().get(0);
Building building = m.getBuildings().toList().get(0);
/*
* The examples have no actual self-intersections, but can contain other actual model defects.
* If an error is detected, it is thus required to check if the
......
......@@ -38,6 +38,7 @@ import de.hft.stuttgart.citydoctor2.datastructure.LinearRing.LinearRingType;
import de.hft.stuttgart.citydoctor2.datastructure.Lod;
import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
import de.hft.stuttgart.citydoctor2.datastructure.Vertex;
import de.hft.stuttgart.citydoctor2.datastructure.Geometry.Orientation;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
/**
......@@ -64,7 +65,7 @@ public class IsWallCheckTest {
Polygon p = new ConcretePolygon();
p.setExteriorRing(lr);
Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, Lod.LOD2);
Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, Lod.LOD2, Orientation.OUTWARD);
geom.addPolygon(p);
BoundarySurface bs = new BoundarySurface(null);
......@@ -97,7 +98,7 @@ public class IsWallCheckTest {
Polygon p = new ConcretePolygon();
p.setExteriorRing(lr);
Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, Lod.LOD2);
Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, Lod.LOD2, Orientation.OUTWARD);
geom.addPolygon(p);
BoundarySurface bs = new BoundarySurface(null);
......@@ -129,7 +130,7 @@ public class IsWallCheckTest {
Polygon p = new ConcretePolygon();
p.setExteriorRing(lr);
Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, Lod.LOD2);
Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, Lod.LOD2, Orientation.OUTWARD);
geom.addPolygon(p);
BoundarySurface bs = new BoundarySurface(null);
......@@ -162,7 +163,7 @@ public class IsWallCheckTest {
Polygon p = new ConcretePolygon();
p.setExteriorRing(lr);
Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, Lod.LOD2);
Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, Lod.LOD2, Orientation.OUTWARD);
geom.addPolygon(p);
BoundarySurface bs = new BoundarySurface(null);
......
......@@ -20,12 +20,13 @@ import de.hft.stuttgart.citydoctor2.datastructure.Geometry;
import de.hft.stuttgart.citydoctor2.datastructure.GeometryType;
import de.hft.stuttgart.citydoctor2.datastructure.Lod;
import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
import de.hft.stuttgart.citydoctor2.datastructure.Geometry.Orientation;
public class PolygonWithoutSurfaceCheckTest {
@Test
public void testPolygonWithoutSurface() {
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2, Orientation.OUTWARD);
Polygon poly = new ConcretePolygon();
geom.addPolygon(poly);
PolygonWithoutSurfaceCheck check = new PolygonWithoutSurfaceCheck();
......@@ -44,7 +45,7 @@ public class PolygonWithoutSurfaceCheckTest {
@Test
public void testPolygonWithSurface() {
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2, Orientation.OUTWARD);
Polygon poly = new ConcretePolygon();
BoundarySurface bs = new BoundarySurface(null);
bs.addGeometry(geom);
......@@ -61,7 +62,7 @@ public class PolygonWithoutSurfaceCheckTest {
@Test
public void testPolygonWithWrongLod() {
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1, Orientation.OUTWARD);
Polygon poly = new ConcretePolygon();
BoundarySurface bs = new BoundarySurface(null);
bs.addGeometry(geom);
......
......@@ -30,6 +30,7 @@ import de.hft.stuttgart.citydoctor2.datastructure.LinearRing.LinearRingType;
import de.hft.stuttgart.citydoctor2.datastructure.Lod;
import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
import de.hft.stuttgart.citydoctor2.datastructure.Vertex;
import de.hft.stuttgart.citydoctor2.datastructure.Geometry.Orientation;
/**
*
......@@ -39,7 +40,7 @@ import de.hft.stuttgart.citydoctor2.datastructure.Vertex;
public class GeometryTestUtils {
public static Geometry createGoodGeometry() {
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1, Orientation.OUTWARD);
Vertex v0 = createVertex(0, 0, 0, geom);
Vertex v1 = createVertex(10, 0, 0, geom);
......@@ -65,7 +66,7 @@ public class GeometryTestUtils {
}
public static Geometry createBadGeometry() {
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1, Orientation.OUTWARD);
Vertex v0 = createVertex(0, 0, 0, geom);
Vertex v1 = createVertex(10, 0, 0, geom);
......
......@@ -37,6 +37,7 @@ import de.hft.stuttgart.citydoctor2.datastructure.LinearRing.LinearRingType;
import de.hft.stuttgart.citydoctor2.datastructure.Lod;
import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
import de.hft.stuttgart.citydoctor2.datastructure.Vertex;
import de.hft.stuttgart.citydoctor2.datastructure.Geometry.Orientation;
import de.hft.stuttgart.citydoctor2.math.Segment3d;
import de.hft.stuttgart.citydoctor2.math.Vector3d;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
......@@ -56,7 +57,9 @@ public class SelfIntersectionUtilTest {
Vertex v1 = new Vertex(10, 0, 0);
Vertex v2 = new Vertex(10, 10, 0);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2, Orientation.OUTWARD);
Polygon p1 = new ConcretePolygon();
geom.addPolygon(p1);
LinearRing r1 = new LinearRing(LinearRingType.EXTERIOR);
p1.setExteriorRing(r1);
......@@ -70,6 +73,7 @@ public class SelfIntersectionUtilTest {
Vertex v5 = new Vertex(10, 10, 1);
Polygon p2 = new ConcretePolygon();
geom.addPolygon(p2);
LinearRing r2 = new LinearRing(LinearRingType.EXTERIOR);
p2.setExteriorRing(r2);
......@@ -89,7 +93,9 @@ public class SelfIntersectionUtilTest {
Vertex v1 = new Vertex(10, 0, 0);
Vertex v2 = new Vertex(10, 10, 0);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2, Orientation.OUTWARD);
Polygon p1 = new ConcretePolygon();
geom.addPolygon(p1);
LinearRing r1 = new LinearRing(LinearRingType.EXTERIOR);
p1.setExteriorRing(r1);
......@@ -103,6 +109,7 @@ public class SelfIntersectionUtilTest {
Vertex v5 = new Vertex(10, 10, -1);
Polygon p2 = new ConcretePolygon();
geom.addPolygon(p2);
LinearRing r2 = new LinearRing(LinearRingType.EXTERIOR);
p2.setExteriorRing(r2);
......@@ -122,7 +129,9 @@ public class SelfIntersectionUtilTest {
Vertex v1 = new Vertex(10, 0, 0);
Vertex v2 = new Vertex(10, 10, 0);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2, Orientation.OUTWARD);
Polygon p1 = new ConcretePolygon();
geom.addPolygon(p1);
LinearRing r1 = new LinearRing(LinearRingType.EXTERIOR);
p1.setExteriorRing(r1);
......@@ -136,6 +145,7 @@ public class SelfIntersectionUtilTest {
Vertex v5 = new Vertex(7, 7, -5);
Polygon p2 = new ConcretePolygon();
geom.addPolygon(p2);
LinearRing r2 = new LinearRing(LinearRingType.EXTERIOR);
p2.setExteriorRing(r2);
......@@ -158,7 +168,9 @@ public class SelfIntersectionUtilTest {
Vertex v1 = new Vertex(10, 0, 0);
Vertex v2 = new Vertex(10, 10, 0);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2, Orientation.OUTWARD);
Polygon p1 = new ConcretePolygon();
geom.addPolygon(p1);
LinearRing r1 = new LinearRing(LinearRingType.EXTERIOR);
p1.setExteriorRing(r1);
......@@ -172,6 +184,7 @@ public class SelfIntersectionUtilTest {
Vertex v5 = new Vertex(10, 10, 0);
Polygon p2 = new ConcretePolygon();
geom.addPolygon(p2);
LinearRing r2 = new LinearRing(LinearRingType.EXTERIOR);
p2.setExteriorRing(r2);
......@@ -191,7 +204,9 @@ public class SelfIntersectionUtilTest {
Vertex v1 = new Vertex(10, 0, 0);
Vertex v2 = new Vertex(10, 10, 0);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2, Orientation.OUTWARD);
Polygon p1 = new ConcretePolygon();
geom.addPolygon(p1);
LinearRing r1 = new LinearRing(LinearRingType.EXTERIOR);
p1.setExteriorRing(r1);
......@@ -205,6 +220,7 @@ public class SelfIntersectionUtilTest {
Vertex v5 = new Vertex(7, 7, -5);
Polygon p2 = new ConcretePolygon();
geom.addPolygon(p2);
LinearRing r2 = new LinearRing(LinearRingType.EXTERIOR);
p2.setExteriorRing(r2);
......@@ -232,7 +248,9 @@ public class SelfIntersectionUtilTest {
Vertex v1 = new Vertex(10, 0, 0);
Vertex v2 = new Vertex(10, 10, 0);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2, Orientation.OUTWARD);
Polygon p1 = new ConcretePolygon();
geom.addPolygon(p1);
LinearRing r1 = new LinearRing(LinearRingType.EXTERIOR);
p1.setExteriorRing(r1);
......@@ -246,6 +264,7 @@ public class SelfIntersectionUtilTest {
Vertex v5 = new Vertex(7, 7, -5);
Polygon p2 = new ConcretePolygon();
geom.addPolygon(p2);
LinearRing r2 = new LinearRing(LinearRingType.EXTERIOR);
p2.setExteriorRing(r2);
......@@ -275,7 +294,9 @@ public class SelfIntersectionUtilTest {
Vertex v1 = new Vertex(10, 0, 0);
Vertex v2 = new Vertex(10, 10, 0);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2, Orientation.OUTWARD);
Polygon p1 = new ConcretePolygon();
geom.addPolygon(p1);
LinearRing r1 = new LinearRing(LinearRingType.EXTERIOR);
p1.setExteriorRing(r1);
......@@ -291,6 +312,7 @@ public class SelfIntersectionUtilTest {
Vertex v7 = new Vertex(9, 2, -3);
Polygon p2 = new ConcretePolygon();
geom.addPolygon(p2);
LinearRing r2 = new LinearRing(LinearRingType.EXTERIOR);
p2.setExteriorRing(r2);
......@@ -330,7 +352,9 @@ public class SelfIntersectionUtilTest {
Vertex v1 = new Vertex(10, 0, 0);
Vertex v2 = new Vertex(10, 10, 0);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2, Orientation.OUTWARD);
Polygon p1 = new ConcretePolygon();
geom.addPolygon(p1);
LinearRing r1 = new LinearRing(LinearRingType.EXTERIOR);
p1.setExteriorRing(r1);
......@@ -358,6 +382,7 @@ public class SelfIntersectionUtilTest {
Vertex v7 = new Vertex(9, 2, -3);
Polygon p2 = new ConcretePolygon();
geom.addPolygon(p2);
LinearRing r2 = new LinearRing(LinearRingType.EXTERIOR);
p2.setExteriorRing(r2);
......@@ -405,7 +430,9 @@ public class SelfIntersectionUtilTest {
Vertex v1 = new Vertex(10, 0, 0);
Vertex v2 = new Vertex(10, 10, 0);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2, Orientation.OUTWARD);
Polygon p1 = new ConcretePolygon();
geom.addPolygon(p1);
LinearRing r1 = new LinearRing(LinearRingType.EXTERIOR);
p1.setExteriorRing(r1);
......@@ -433,6 +460,7 @@ public class SelfIntersectionUtilTest {
Vertex v7 = new Vertex(9, 2, -3);
Polygon p2 = new ConcretePolygon();
geom.addPolygon(p2);
LinearRing r2 = new LinearRing(LinearRingType.EXTERIOR);
p2.setExteriorRing(r2);
......@@ -464,7 +492,9 @@ public class SelfIntersectionUtilTest {
Vertex v1 = new Vertex(10, 0, 0);
Vertex v2 = new Vertex(10, 10, 0);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2, Orientation.OUTWARD);
Polygon p1 = new ConcretePolygon();
geom.addPolygon(p1);
LinearRing r1 = new LinearRing(LinearRingType.EXTERIOR);
p1.setExteriorRing(r1);
......@@ -478,6 +508,7 @@ public class SelfIntersectionUtilTest {
Vertex v5 = new Vertex(10, 10, 0);
Polygon p2 = new ConcretePolygon();
geom.addPolygon(p2);
LinearRing r2 = new LinearRing(LinearRingType.EXTERIOR);
p2.setExteriorRing(r2);
r2.addVertex(v3);
......@@ -496,7 +527,9 @@ public class SelfIntersectionUtilTest {
Vertex v1 = new Vertex(10, 0, 0);
Vertex v2 = new Vertex(10, 10, 0);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2, Orientation.OUTWARD);
Polygon p1 = new ConcretePolygon();
geom.addPolygon(p1);
LinearRing r1 = new LinearRing(LinearRingType.EXTERIOR);
p1.setExteriorRing(r1);
......@@ -510,6 +543,7 @@ public class SelfIntersectionUtilTest {
Vertex v5 = new Vertex(9, 10, 0);
Polygon p2 = new ConcretePolygon();
geom.addPolygon(p2);
LinearRing r2 = new LinearRing(LinearRingType.EXTERIOR);
p2.setExteriorRing(r2);
r2.addVertex(v3);
......@@ -528,7 +562,9 @@ public class SelfIntersectionUtilTest {
Vertex v1 = new Vertex(10, 0, 0);
Vertex v2 = new Vertex(10, 10, 0);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2, Orientation.OUTWARD);
Polygon p1 = new ConcretePolygon();
geom.addPolygon(p1);
LinearRing r1 = new LinearRing(LinearRingType.EXTERIOR);
p1.setExteriorRing(r1);
......@@ -542,6 +578,7 @@ public class SelfIntersectionUtilTest {
Vertex v5 = new Vertex(10, 11, 0);
Polygon p2 = new ConcretePolygon();
geom.addPolygon(p2);
LinearRing r2 = new LinearRing(LinearRingType.EXTERIOR);
p2.setExteriorRing(r2);
r2.addVertex(v3);
......@@ -560,7 +597,9 @@ public class SelfIntersectionUtilTest {
Vertex v1 = new Vertex(10, 0, 0);
Vertex v2 = new Vertex(10, 10, 10);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2, Orientation.OUTWARD);
Polygon p1 = new ConcretePolygon();
geom.addPolygon(p1);
LinearRing r1 = new LinearRing(LinearRingType.EXTERIOR);
p1.setExteriorRing(r1);
......@@ -575,6 +614,7 @@ public class SelfIntersectionUtilTest {
Vertex v6 = new Vertex(8, 5, 5);
Polygon p2 = new ConcretePolygon();
geom.addPolygon(p2);
LinearRing r2 = new LinearRing(LinearRingType.EXTERIOR);
p2.setExteriorRing(r2);
r2.addVertex(v3);
......@@ -599,7 +639,9 @@ public class SelfIntersectionUtilTest {
Vertex v1 = new Vertex(10, 0, 0);
Vertex v2 = new Vertex(10, 0, 10);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2, Orientation.OUTWARD);
Polygon p1 = new ConcretePolygon();
geom.addPolygon(p1);
LinearRing r1 = new LinearRing(LinearRingType.EXTERIOR);
p1.setExteriorRing(r1);
......@@ -614,6 +656,7 @@ public class SelfIntersectionUtilTest {
Vertex v6 = new Vertex(8, 0, 5);
Polygon p2 = new ConcretePolygon();
geom.addPolygon(p2);
LinearRing r2 = new LinearRing(LinearRingType.EXTERIOR);
p2.setExteriorRing(r2);
r2.addVertex(v3);
......@@ -638,7 +681,9 @@ public class SelfIntersectionUtilTest {
Vertex v1 = new Vertex(0, 10, 0);
Vertex v2 = new Vertex(0, 10, 10);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2, Orientation.OUTWARD);
Polygon p1 = new ConcretePolygon();
geom.addPolygon(p1);
LinearRing r1 = new LinearRing(LinearRingType.EXTERIOR);
p1.setExteriorRing(r1);
......@@ -653,6 +698,7 @@ public class SelfIntersectionUtilTest {
Vertex v6 = new Vertex(0, 8, 5);
Polygon p2 = new ConcretePolygon();
geom.addPolygon(p2);
LinearRing r2 = new LinearRing(LinearRingType.EXTERIOR);
p2.setExteriorRing(r2);
r2.addVertex(v3);
......@@ -677,7 +723,9 @@ public class SelfIntersectionUtilTest {
Vertex v1 = new Vertex(10, 10, 0);
Vertex v2 = new Vertex(10, 0, 0);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2, Orientation.OUTWARD);
Polygon p1 = new ConcretePolygon();
geom.addPolygon(p1);
LinearRing r1 = new LinearRing(LinearRingType.EXTERIOR);
p1.setExteriorRing(r1);
......@@ -692,6 +740,7 @@ public class SelfIntersectionUtilTest {
Vertex v6 = new Vertex(8, 2, 0);
Polygon p2 = new ConcretePolygon();
geom.addPolygon(p2);
LinearRing r2 = new LinearRing(LinearRingType.EXTERIOR);
p2.setExteriorRing(r2);
r2.addVertex(v3);
......@@ -736,7 +785,9 @@ public class SelfIntersectionUtilTest {
Vertex v1 = new Vertex(10, 10, 0);
Vertex v2 = new Vertex(10, 0, 0);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2, Orientation.OUTWARD);
Polygon p1 = new ConcretePolygon();
geom.addPolygon(p1);
LinearRing r1 = new LinearRing(LinearRingType.EXTERIOR);
p1.setExteriorRing(r1);
......@@ -751,6 +802,7 @@ public class SelfIntersectionUtilTest {
Vertex v6 = new Vertex(8, 2, 0);
Polygon p2 = new ConcretePolygon();
geom.addPolygon(p2);
LinearRing r2 = new LinearRing(LinearRingType.EXTERIOR);
p2.setExteriorRing(r2);
r2.addVertex(v3);
......@@ -806,7 +858,7 @@ public class SelfIntersectionUtilTest {
@Test
public void testIsSimpleGood() {
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1, Orientation.OUTWARD);
Polygon poly = new ConcretePolygon();
geom.addPolygon(poly);
......@@ -837,7 +889,7 @@ public class SelfIntersectionUtilTest {
@Test
public void testIsSimpleFail() {
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1, Orientation.OUTWARD);
Polygon poly = new ConcretePolygon();
geom.addPolygon(poly);
......@@ -867,7 +919,7 @@ public class SelfIntersectionUtilTest {
@Test
public void testIsSimpleGood2() {
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1);
Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1, Orientation.OUTWARD);
Polygon poly = new ConcretePolygon();
geom.addPolygon(poly);
......
......@@ -48,7 +48,7 @@ public class AllPolygonWrongOrientedTest {
Checker c = new Checker(config, model);
c.runChecks();
Building b = model.getBuildings().get(0);
Building b = model.getBuildings().toList().get(0);
assertFalse(b.containsError(CheckId.C_GE_S_ALL_POLYGONS_WRONG_ORIENTATION));
}
......
......@@ -51,7 +51,7 @@ public class ConCompCheckTest extends TestCleanUp {
Checker c = new Checker(m);
c.runChecks();
Geometry geom = m.getBuildings().get(0).getGeometries().get(0);
Geometry geom = m.getBuildings().toList().get(0).getGeometries().get(0);
CheckResult cr = geom.getCheckResult(CheckId.C_GE_S_MULTIPLE_CONNECTED_COMPONENTS);
assertNotNull(cr);
assertEquals(ResultStatus.ERROR, cr.getResultStatus());
......@@ -65,7 +65,7 @@ public class ConCompCheckTest extends TestCleanUp {
Checker c = new Checker(m);
c.runChecks();
Geometry geom = m.getBuildings().get(0).getGeometries().get(0);
Geometry geom = m.getBuildings().toList().get(0).getGeometries().get(0);
CheckResult cr = geom.getCheckResult(CheckId.C_GE_S_MULTIPLE_CONNECTED_COMPONENTS);
assertNotNull(cr);
assertEquals(ResultStatus.ERROR, cr.getResultStatus());
......
......@@ -79,7 +79,7 @@ public class DupPointsCheckTest {
@Test
public void testDupPoints3() throws CityGmlParseException, IOException, InvalidGmlFileException {
CityDoctorModel m = TestUtil.loadAndCheckCityModel("src/test/resources/SimpleSolid_SrefBS.gml");
for (Polygon p : m.getBuildings().get(0).getGeometries().get(0).getPolygons()) {
for (Polygon p : m.getBuildings().toList().get(0).getGeometries().get(0).getPolygons()) {
LinearRing r = p.getExteriorRing();
CheckResult cr = r.getCheckResult(CheckId.C_GE_R_DUPLICATE_POINT);
assertEquals(ResultStatus.OK, cr.getResultStatus());
......
......@@ -43,7 +43,7 @@ public class HoleOutsideSystemTest {
@Test
public void testHoleOutside1() throws CityGmlParseException, IOException, InvalidGmlFileException {
CityDoctorModel c = TestUtil.loadAndCheckCityModel("src/test/resources/SimpleSolid_SrefBS-GE-gml-PO-0001-T0002.gml");
for (Polygon p : c.getBuildings().get(0).getGeometries().get(0).getPolygons()) {
for (Polygon p : c.getBuildings().toList().get(0).getGeometries().get(0).getPolygons()) {
CheckResult cr = p.getCheckResult(CheckId.C_GE_P_HOLE_OUTSIDE);
assertEquals(ResultStatus.OK, cr.getResultStatus());
}
......
......@@ -43,7 +43,7 @@ public class InnerRingsNestedSystemTest {
@Test
public void innerRingsNested1() throws CityGmlParseException, IOException, InvalidGmlFileException {
CityDoctorModel c = TestUtil.loadAndCheckCityModel("src/test/resources/SimpleSolid_SrefBS-GE-gml-PO-0001-T0002.gml");
for (Polygon p : c.getBuildings().get(0).getGeometries().get(0).getPolygons()) {
for (Polygon p : c.getBuildings().toList().get(0).getGeometries().get(0).getPolygons()) {
CheckResult cr = p.getCheckResult(CheckId.C_GE_P_INNER_RINGS_NESTED);
assertEquals(ResultStatus.OK, cr.getResultStatus());
}
......
......@@ -43,7 +43,7 @@ public class InteriorDisconnectedSystemTest {
@Test
public void testInteriorDisconnected1() throws CityGmlParseException, IOException, InvalidGmlFileException {
CityDoctorModel c = TestUtil.loadAndCheckCityModel("src/test/resources/SimpleSolid_SrefBS-GE-gml-PO-0001-T0002.gml");
for (Polygon p : c.getBuildings().get(0).getGeometries().get(0).getPolygons()) {
for (Polygon p : c.getBuildings().toList().get(0).getGeometries().get(0).getPolygons()) {
CheckResult cr = p.getCheckResult(CheckId.C_GE_P_INTERIOR_DISCONNECTED);
assertEquals(ResultStatus.OK, cr.getResultStatus());
}
......
......@@ -43,7 +43,7 @@ public class MultipleComponentTest {
@Test
public void testNoMultipleComponents() throws CityGmlParseException, IOException, InvalidGmlFileException {
CityDoctorModel c = TestUtil.loadAndCheckCityModel("src/test/resources/SimpleSolid_SrefBS.gml");
Geometry g = c.getBuildings().get(0).getGeometries().get(0);
Geometry g = c.getBuildings().toList().get(0).getGeometries().get(0);
CheckResult cr = g.getCheckResult(CheckId.C_GE_S_MULTIPLE_CONNECTED_COMPONENTS);
assertEquals(ResultStatus.OK, cr.getResultStatus());
}
......@@ -51,7 +51,7 @@ public class MultipleComponentTest {
@Test
public void testMultipleComponents() throws CityGmlParseException, IOException, InvalidGmlFileException {
CityDoctorModel c = TestUtil.loadAndCheckCityModel("src/test/resources/SimpleSolid_SrefBS-GE-gml-SO-0005-T0001.gml");
Geometry g = c.getBuildings().get(0).getGeometries().get(0);
Geometry g = c.getBuildings().toList().get(0).getGeometries().get(0);
CheckResult cr = g.getCheckResult(CheckId.C_GE_S_MULTIPLE_CONNECTED_COMPONENTS);
assertEquals(ResultStatus.ERROR, cr.getResultStatus());
assertEquals(ErrorId.GE_S_MULTIPLE_CONNECTED_COMPONENTS, cr.getError().getErrorId());
......
......@@ -46,7 +46,7 @@ public class NonManifoldEdgeSystemTest {
@Test
public void testNonManifoldEdge1() throws CityGmlParseException, IOException, InvalidGmlFileException {
CityDoctorModel c = TestUtil.loadAndCheckCityModel("src/test/resources/SimpleSolid_SrefBS.gml");
Geometry g = c.getBuildings().get(0).getGeometries().get(0);
Geometry g = c.getBuildings().toList().get(0).getGeometries().get(0);
CheckResult cr = g.getCheckResult(CheckId.C_GE_S_NON_MANIFOLD_EDGE);
assertEquals(ResultStatus.OK, cr.getResultStatus());
}
......@@ -59,7 +59,7 @@ public class NonManifoldEdgeSystemTest {
paramMap.put(RequirementId.R_GE_P_NON_PLANAR.toString(), parameter);
CityDoctorModel c = TestUtil.loadAndCheckCityModel("src/test/resources/SimpleSolid_SrefBS-GE-gml-SO-0004-T0001.gml",
paramMap);
Geometry g = c.getBuildings().get(0).getGeometries().get(0);
Geometry g = c.getBuildings().toList().get(0).getGeometries().get(0);
CheckResult cr = g.getCheckResult(CheckId.C_GE_S_NON_MANIFOLD_EDGE);
assertEquals(ResultStatus.ERROR, cr.getResultStatus());
assertEquals(ErrorId.GE_S_NON_MANIFOLD_EDGE, cr.getError().getErrorId());
......
......@@ -43,7 +43,7 @@ public class NonManifoldVertexSystemTest {
@Test
public void testNonManifoldVertex1() throws CityGmlParseException, IOException, InvalidGmlFileException {
CityDoctorModel c = TestUtil.loadAndCheckCityModel("src/test/resources/SimpleSolid_SrefBS.gml");
Geometry g = c.getBuildings().get(0).getGeometries().get(0);
Geometry g = c.getBuildings().toList().get(0).getGeometries().get(0);
CheckResult cr = g.getCheckResult(CheckId.C_GE_S_NON_MANIFOLD_VERTEX);
assertEquals(ResultStatus.OK, cr.getResultStatus());
}
......@@ -51,7 +51,7 @@ public class NonManifoldVertexSystemTest {
@Test
public void testNonManifoldVertex2() throws CityGmlParseException, IOException, InvalidGmlFileException {
CityDoctorModel c = TestUtil.loadAndCheckCityModel("src/test/resources/SimpleSolid_SrefBS-GE-gml-SO-0003-T0001.gml");
Geometry g = c.getBuildings().get(0).getGeometries().get(0);
Geometry g = c.getBuildings().toList().get(0).getGeometries().get(0);
CheckResult cr = g.getCheckResult(CheckId.C_GE_S_NON_MANIFOLD_VERTEX);
assertEquals(ResultStatus.ERROR, cr.getResultStatus());
assertEquals(ErrorId.GE_S_NON_MANIFOLD_VERTEX, cr.getError().getErrorId());
......
......@@ -80,7 +80,7 @@ public class NumPointsCheckTest {
public void testNumPoints3() throws CityGmlParseException, IOException, InvalidGmlFileException {
CityDoctorModel c = TestUtil.loadAndCheckCityModel("src/test/resources/SimpleSolid_SrefBS.gml");
for (Polygon p : c.getBuildings().get(0).getGeometries().get(0).getPolygons()) {
for (Polygon p : c.getBuildings().toList().get(0).getGeometries().get(0).getPolygons()) {
LinearRing r = p.getExteriorRing();
assertEquals(ResultStatus.OK, r.getCheckResult(CheckId.C_GE_R_TOO_FEW_POINTS).getResultStatus());
}
......
......@@ -43,7 +43,7 @@ public class OrientationSameSystemTest {
@Test
public void testOrientationSame1() throws CityGmlParseException, IOException, InvalidGmlFileException {
CityDoctorModel c = TestUtil.loadAndCheckCityModel("src/test/resources/SimpleSolid_SrefBS-GE-gml-PO-0001-T0002.gml");
for (Polygon p : c.getBuildings().get(0).getGeometries().get(0).getPolygons()) {
for (Polygon p : c.getBuildings().toList().get(0).getGeometries().get(0).getPolygons()) {
CheckResult cr = p.getCheckResult(CheckId.C_GE_P_ORIENTATION_RINGS_SAME);
assertEquals(ResultStatus.OK, cr.getResultStatus());
}
......
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