Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
2a68a8f0
Commit
2a68a8f0
authored
Nov 23, 2020
by
Matthias Betz
Browse files
fixing test with different minVertexDistance parameter
parent
f8ac427e
Pipeline
#1343
passed with stage
in 2 minutes and 36 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/utils/BoundingBoxCalculator.java
View file @
2a68a8f0
...
@@ -115,6 +115,9 @@ public class BoundingBoxCalculator {
...
@@ -115,6 +115,9 @@ public class BoundingBoxCalculator {
private
static
void
findMinMax
(
Vector3d
low
,
Vector3d
high
,
CityObject
co
)
{
private
static
void
findMinMax
(
Vector3d
low
,
Vector3d
high
,
CityObject
co
)
{
for
(
Geometry
geom
:
co
.
getGeometries
())
{
for
(
Geometry
geom
:
co
.
getGeometries
())
{
if
(
geom
.
getVertices
()
==
null
)
{
continue
;
}
for
(
Vertex
v
:
geom
.
getVertices
())
{
for
(
Vertex
v
:
geom
.
getVertices
())
{
if
(
v
.
getX
()
<
low
.
getX
())
{
if
(
v
.
getX
()
<
low
.
getX
())
{
low
.
setX
(
v
.
getX
());
low
.
setX
(
v
.
getX
());
...
...
CityDoctorParent/CityDoctorValidation/src/test/java/de/hft/stuttgart/citydoctor2/systemtest/RingSelfIntersectionTest.java
View file @
2a68a8f0
...
@@ -21,8 +21,6 @@ package de.hft.stuttgart.citydoctor2.systemtest;
...
@@ -21,8 +21,6 @@ package de.hft.stuttgart.citydoctor2.systemtest;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.junit.Test
;
import
org.junit.Test
;
...
@@ -35,9 +33,9 @@ import de.hft.stuttgart.citydoctor2.datastructure.CityDoctorModel;
...
@@ -35,9 +33,9 @@ import de.hft.stuttgart.citydoctor2.datastructure.CityDoctorModel;
import
de.hft.stuttgart.citydoctor2.datastructure.LinearRing
;
import
de.hft.stuttgart.citydoctor2.datastructure.LinearRing
;
import
de.hft.stuttgart.citydoctor2.datastructure.Polygon
;
import
de.hft.stuttgart.citydoctor2.datastructure.Polygon
;
import
de.hft.stuttgart.citydoctor2.parser.CityGmlParseException
;
import
de.hft.stuttgart.citydoctor2.parser.CityGmlParseException
;
import
de.hft.stuttgart.citydoctor2.parser.ParserConfiguration
;
import
de.hft.stuttgart.citydoctor2.parser.CityGmlParser
;
import
de.hft.stuttgart.citydoctor2.parser.CityGmlParser
;
import
de.hft.stuttgart.citydoctor2.parser.InvalidGmlFileException
;
import
de.hft.stuttgart.citydoctor2.parser.InvalidGmlFileException
;
import
de.hft.stuttgart.citydoctor2.parser.ParserConfiguration
;
/**
/**
*
*
...
@@ -122,11 +120,7 @@ public class RingSelfIntersectionTest {
...
@@ -122,11 +120,7 @@ public class RingSelfIntersectionTest {
@Test
@Test
public
void
testSelfIntPoints6
()
throws
CityGmlParseException
,
IOException
,
InvalidGmlFileException
{
public
void
testSelfIntPoints6
()
throws
CityGmlParseException
,
IOException
,
InvalidGmlFileException
{
Map
<
String
,
String
>
param
=
new
HashMap
<>();
CityDoctorModel
c
=
TestUtil
.
loadAndCheckCityModel
(
"src/test/resources/SimpleSolid_SrefBS-GE-gml-LR-0004-T0005.gml"
,
8
,
0.1
);
param
.
put
(
"minVertexDistance"
,
"0.1"
);
Map
<
CheckId
,
Map
<
String
,
String
>>
params
=
new
HashMap
<>();
params
.
put
(
CheckId
.
C_GE_R_SELF_INTERSECTION
,
param
);
CityDoctorModel
c
=
TestUtil
.
loadAndCheckCityModel
(
"src/test/resources/SimpleSolid_SrefBS-GE-gml-LR-0004-T0005.gml"
,
params
);
Polygon
p
=
TestUtil
.
getPolygonById
(
"_Simple_BD.1_PG.2"
,
c
);
Polygon
p
=
TestUtil
.
getPolygonById
(
"_Simple_BD.1_PG.2"
,
c
);
LinearRing
r
=
p
.
getExteriorRing
();
LinearRing
r
=
p
.
getExteriorRing
();
CheckResult
cr
=
r
.
getCheckResult
(
CheckId
.
C_GE_R_SELF_INTERSECTION
);
CheckResult
cr
=
r
.
getCheckResult
(
CheckId
.
C_GE_R_SELF_INTERSECTION
);
...
...
CityDoctorParent/CityDoctorValidation/src/test/java/de/hft/stuttgart/citydoctor2/systemtest/TestUtil.java
View file @
2a68a8f0
...
@@ -60,6 +60,18 @@ public class TestUtil {
...
@@ -60,6 +60,18 @@ public class TestUtil {
}
}
public
static
CityDoctorModel
loadAndCheckCityModel
(
String
path
,
int
numberOfRoundingPlaces
,
double
minVertexDistance
)
throws
CityGmlParseException
,
IOException
,
InvalidGmlFileException
{
ValidationConfiguration
config
=
ValidationConfiguration
.
loadStandardValidationConfig
();
config
.
setNumberOfRoundingPlaces
(
numberOfRoundingPlaces
);
config
.
setMinVertexDistance
(
minVertexDistance
);
CityDoctorModel
m
=
CityGmlParser
.
parseCityGmlFile
(
path
,
config
.
getParserConfiguration
());
Checker
c
=
new
Checker
(
config
,
m
);
c
.
runChecks
();
return
m
;
}
public
static
CityDoctorModel
loadAndCheckCityModel
(
String
path
,
Map
<
CheckId
,
Map
<
String
,
String
>>
paramMap
)
public
static
CityDoctorModel
loadAndCheckCityModel
(
String
path
,
Map
<
CheckId
,
Map
<
String
,
String
>>
paramMap
)
throws
CityGmlParseException
,
IOException
,
InvalidGmlFileException
{
throws
CityGmlParseException
,
IOException
,
InvalidGmlFileException
{
ValidationConfiguration
valConfig
=
ValidationConfiguration
.
loadStandardValidationConfig
();
ValidationConfiguration
valConfig
=
ValidationConfiguration
.
loadStandardValidationConfig
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment