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
c2a12ed4
Commit
c2a12ed4
authored
Mar 12, 2025
by
Riegel
Browse files
Refactor: Simplify Surface geometry mapping
parent
53599b81
Changes
2
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/PatchCollection.java
View file @
c2a12ed4
...
...
@@ -10,7 +10,6 @@ public final class PatchCollection implements Serializable {
@Serial
private
static
final
long
serialVersionUID
=
-
1748657379840997228L
;
private
GmlId
gmlId
;
private
List
<
ConcretePolygon
>
patchMembers
=
new
ArrayList
<>();
...
...
@@ -23,11 +22,4 @@ public final class PatchCollection implements Serializable {
return
new
ArrayList
<>(
patchMembers
);
}
public
void
setGmlId
(
GmlId
gmlId
)
{
this
.
gmlId
=
gmlId
;
}
public
GmlId
getGmlId
()
{
return
gmlId
;
}
}
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/mapper/citygml3/Citygml3GeometryMapper.java
View file @
c2a12ed4
...
...
@@ -69,26 +69,20 @@ public class Citygml3GeometryMapper extends GeometryWalker {
logger
.
warn
(
"Surface {} has no PolygonPatches."
,
surface
.
getId
());
return
;
}
List
<
PolygonPatch
>
polygonPatches
=
new
ArrayList
<>();
PatchCollection
patchCollection
=
new
PatchCollection
();
GeometryWalker
patchCollector
=
new
GeometryWalker
()
{
@Override
public
void
visit
(
PolygonPatch
p
p
)
{
polygonPatch
es
.
add
(
pp
);
public
void
visit
(
PolygonPatch
p
atch
)
{
p
arseP
olygonPatch
(
patch
,
patchCollection
);
}
};
surface
.
getPatches
().
getObjects
().
forEach
(
abstractSurfacePatch
->
abstractSurfacePatch
.
accept
(
patchCollector
));
PatchCollection
patchCollection
=
new
PatchCollection
();
Citygml3GeometryMapper
patchMapper
=
new
Citygml3GeometryMapper
(
config
,
vertexMap
);
for
(
PolygonPatch
patch
:
polygonPatches
)
{
patchMapper
.
parsePolygonPatch
(
patch
.
getExterior
(),
patch
.
getInterior
());
}
List
<
ConcretePolygon
>
patchPolys
=
patchMapper
.
getPolygons
();
patchPolys
.
forEach
(
patchCollection:
:
addPatchMember
);
polygons
.
addAll
(
patchPolys
);
}
private
void
parsePolygonPatch
(
AbstractRingProperty
exterior
,
List
<
AbstractRingProperty
>
interior
)
{
private
void
parsePolygonPatch
(
PolygonPatch
patch
,
PatchCollection
collection
)
{
AbstractRingProperty
exterior
=
patch
.
getExterior
();
List
<
AbstractRingProperty
>
interior
=
patch
.
getInterior
();
if
(
exterior
==
null
||
exterior
.
getObject
()
==
null
)
{
if
(
logger
.
isWarnEnabled
())
{
logger
.
warn
(
Localization
.
getText
(
"GeometryMapper.emptyPolygon"
));
...
...
@@ -110,6 +104,8 @@ public class Citygml3GeometryMapper extends GeometryWalker {
gmlRing
.
accept
(
this
);
conc
.
addInteriorRing
(
currentRing
);
}
collection
.
addPatchMember
(
conc
);
polygons
.
add
(
conc
);
}
private
void
parsePolygon
(
String
id
,
AbstractRingProperty
exterior
,
List
<
AbstractRingProperty
>
interior
)
{
...
...
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