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
ed6f4158
Commit
ed6f4158
authored
Aug 12, 2024
by
Riegel
Browse files
Removed unnecessary instanceof casts. Ref
#69
parent
7b16c17e
Changes
2
Show whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/checks/util/SelfIntersectionUtil.java
View file @
ed6f4158
...
@@ -213,12 +213,10 @@ public class SelfIntersectionUtil {
...
@@ -213,12 +213,10 @@ public class SelfIntersectionUtil {
// intersection is only an edge, not a polygon
// intersection is only an edge, not a polygon
// edge intersections are allowed
// edge intersections are allowed
return
PolygonIntersection
.
none
();
return
PolygonIntersection
.
none
();
}
else
if
(
intersection
instanceof
GeometryCollection
)
{
}
else
if
(
intersection
instanceof
GeometryCollection
col
)
{
GeometryCollection
col
=
(
GeometryCollection
)
intersection
;
for
(
int
i
=
0
;
i
<
col
.
getNumGeometries
();
i
++)
{
for
(
int
i
=
0
;
i
<
col
.
getNumGeometries
();
i
++)
{
org
.
locationtech
.
jts
.
geom
.
Geometry
interGeom
=
col
.
getGeometryN
(
i
);
org
.
locationtech
.
jts
.
geom
.
Geometry
interGeom
=
col
.
getGeometryN
(
i
);
if
(
interGeom
instanceof
org
.
locationtech
.
jts
.
geom
.
Polygon
)
{
if
(
interGeom
instanceof
org
.
locationtech
.
jts
.
geom
.
Polygon
intPoly
)
{
org
.
locationtech
.
jts
.
geom
.
Polygon
intPoly
=
(
org
.
locationtech
.
jts
.
geom
.
Polygon
)
interGeom
;
ConcretePolygon
poly
=
convertToPolygon
(
plane1
,
projectionAxis
,
intPoly
);
ConcretePolygon
poly
=
convertToPolygon
(
plane1
,
projectionAxis
,
intPoly
);
return
PolygonIntersection
.
polygon
(
poly
,
p1
.
getOriginal
(),
p2
.
getOriginal
());
return
PolygonIntersection
.
polygon
(
poly
,
p1
.
getOriginal
(),
p2
.
getOriginal
());
}
}
...
@@ -226,8 +224,7 @@ public class SelfIntersectionUtil {
...
@@ -226,8 +224,7 @@ public class SelfIntersectionUtil {
// no polygon in collection, so no intersection
// no polygon in collection, so no intersection
return
PolygonIntersection
.
none
();
return
PolygonIntersection
.
none
();
}
}
if
(
intersection
instanceof
org
.
locationtech
.
jts
.
geom
.
Polygon
)
{
if
(
intersection
instanceof
org
.
locationtech
.
jts
.
geom
.
Polygon
intPoly
)
{
org
.
locationtech
.
jts
.
geom
.
Polygon
intPoly
=
(
org
.
locationtech
.
jts
.
geom
.
Polygon
)
intersection
;
ConcretePolygon
poly
=
convertToPolygon
(
plane1
,
projectionAxis
,
intPoly
);
ConcretePolygon
poly
=
convertToPolygon
(
plane1
,
projectionAxis
,
intPoly
);
return
PolygonIntersection
.
polygon
(
poly
,
p1
.
getOriginal
(),
p2
.
getOriginal
());
return
PolygonIntersection
.
polygon
(
poly
,
p1
.
getOriginal
(),
p2
.
getOriginal
());
}
else
{
}
else
{
...
...
CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/reporting/XmlStreamReporter.java
View file @
ed6f4158
...
@@ -141,18 +141,18 @@ public class XmlStreamReporter implements StreamReporter {
...
@@ -141,18 +141,18 @@ public class XmlStreamReporter implements StreamReporter {
@Override
@Override
public
void
report
(
CityObject
co
)
{
public
void
report
(
CityObject
co
)
{
if
(
co
instanceof
Building
)
{
if
(
co
instanceof
Building
bu
)
{
reportBuilding
(
(
Building
)
co
);
reportBuilding
(
bu
);
}
else
if
(
co
instanceof
Vegetation
)
{
}
else
if
(
co
instanceof
Vegetation
ve
)
{
reportVegetation
(
(
Vegetation
)
co
);
reportVegetation
(
ve
);
}
else
if
(
co
instanceof
TransportationObject
)
{
}
else
if
(
co
instanceof
TransportationObject
to
)
{
reportTrans
(
(
TransportationObject
)
c
o
);
reportTrans
(
t
o
);
}
else
if
(
co
instanceof
BridgeObject
)
{
}
else
if
(
co
instanceof
BridgeObject
bo
)
{
reportBridge
(
(
BridgeObject
)
c
o
);
reportBridge
(
b
o
);
}
else
if
(
co
instanceof
WaterObject
)
{
}
else
if
(
co
instanceof
WaterObject
wo
)
{
reportWater
(
(
WaterObject
)
c
o
);
reportWater
(
w
o
);
}
else
if
(
co
instanceof
LandObject
)
{
}
else
if
(
co
instanceof
LandObject
lo
)
{
reportLand
(
(
LandObject
)
c
o
);
reportLand
(
l
o
);
}
else
{
}
else
{
throw
new
IllegalStateException
(
"Not reportable CityObject found: "
+
co
.
getClass
().
getSimpleName
());
throw
new
IllegalStateException
(
"Not reportable CityObject found: "
+
co
.
getClass
().
getSimpleName
());
}
}
...
...
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