Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
61c6bd73
Commit
61c6bd73
authored
6 months ago
by
Riegel
Browse files
Options
Download
Email Patches
Plain Diff
Add parsing of composite surfaces for ImplicitGeometry
parent
ab203d0b
master
107-opengl-view
dev
dev_cpp_code_conversion
dev_gui_features
dev_gui_features_zip_loading
dev_visitor_rework
3.17.1
3.17.0
3.16.0
archive/dev_gui_features_zip_loading
archive/dev_citygml3
2 merge requests
!11
CityDoctor Release Version 3.16.0
,
!10
CityGML 3.0. Support
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/mapper/citygml3/Citygml3FeatureMapper.java
+35
-0
...rt/citydoctor2/mapper/citygml3/Citygml3FeatureMapper.java
with
35 additions
and
0 deletions
+35
-0
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/mapper/citygml3/Citygml3FeatureMapper.java
+
35
-
0
View file @
61c6bd73
...
...
@@ -63,12 +63,14 @@ import org.citygml4j.core.model.vegetation.PlantCover;
import
org.citygml4j.core.model.vegetation.SolitaryVegetationObject
;
import
org.citygml4j.core.model.waterbody.WaterBody
;
import
org.citygml4j.core.visitor.ObjectWalker
;
import
org.xmlobjects.gml.adapter.geometry.complexes.CompositeSurfaceAdapter
;
import
org.xmlobjects.gml.model.base.AbstractGML
;
import
org.xmlobjects.gml.model.feature.AbstractFeature
;
import
org.xmlobjects.gml.model.geometry.AbstractGeometry
;
import
org.xmlobjects.gml.model.geometry.GeometryProperty
;
import
org.xmlobjects.gml.model.geometry.aggregates.MultiSurface
;
import
org.xmlobjects.gml.model.geometry.aggregates.MultiSurfaceProperty
;
import
org.xmlobjects.gml.model.geometry.complexes.CompositeSurface
;
import
org.xmlobjects.gml.model.geometry.primitives.AbstractSolid
;
import
org.xmlobjects.gml.model.geometry.primitives.AbstractSurface
;
import
org.xmlobjects.gml.model.geometry.primitives.Shell
;
...
...
@@ -233,9 +235,13 @@ public class Citygml3FeatureMapper extends ObjectWalker {
parseAndAddMultiSurface
(
as
.
getLod0MultiSurface
(),
Lod
.
LOD0
,
co
);
parseAndAddMultiSurface
(
as
.
getLod2MultiSurface
(),
Lod
.
LOD2
,
co
);
parseAndAddMultiSurface
(
as
.
getLod3MultiSurface
(),
Lod
.
LOD3
,
co
);
parseAndAddCompositeSurface
(
as
.
getLod0MultiSurface
(),
Lod
.
LOD0
,
co
);
parseAndAddCompositeSurface
(
as
.
getLod2MultiSurface
(),
Lod
.
LOD2
,
co
);
parseAndAddCompositeSurface
(
as
.
getLod3MultiSurface
(),
Lod
.
LOD3
,
co
);
parseAndAddSolid
(
as
.
getLod1Solid
(),
Lod
.
LOD1
,
co
);
parseAndAddSolid
(
as
.
getLod2Solid
(),
Lod
.
LOD2
,
co
);
parseAndAddSolid
(
as
.
getLod3Solid
(),
Lod
.
LOD3
,
co
);
}
...
...
@@ -519,9 +525,13 @@ public class Citygml3FeatureMapper extends ObjectWalker {
parseAndAddMultiSurface
(
as
.
getLod0MultiSurface
(),
Lod
.
LOD0
,
co
);
parseAndAddMultiSurface
(
as
.
getLod2MultiSurface
(),
Lod
.
LOD2
,
co
);
parseAndAddMultiSurface
(
as
.
getLod3MultiSurface
(),
Lod
.
LOD3
,
co
);
parseAndAddCompositeSurface
(
as
.
getLod0MultiSurface
(),
Lod
.
LOD0
,
co
);
parseAndAddCompositeSurface
(
as
.
getLod2MultiSurface
(),
Lod
.
LOD2
,
co
);
parseAndAddCompositeSurface
(
as
.
getLod3MultiSurface
(),
Lod
.
LOD3
,
co
);
parseAndAddSolid
(
as
.
getLod1Solid
(),
Lod
.
LOD1
,
co
);
parseAndAddSolid
(
as
.
getLod2Solid
(),
Lod
.
LOD2
,
co
);
parseAndAddSolid
(
as
.
getLod3Solid
(),
Lod
.
LOD3
,
co
);
}
private
void
parseAndAddMultiSurface
(
MultiSurfaceProperty
msp
,
Lod
lod
,
CityObject
co
)
{
...
...
@@ -542,6 +552,22 @@ public class Citygml3FeatureMapper extends ObjectWalker {
}
}
private
void
parseAndAddCompositeSurface
(
MultiSurfaceProperty
ms
,
Lod
lod
,
CityObject
co
){
if
(
ms
==
null
||
ms
.
getObject
()
==
null
||
ms
.
getObject
().
getSurfaceMember
().
isEmpty
())
{
return
;
}
List
<
SurfaceProperty
>
surfaces
=
ms
.
getObject
().
getSurfaceMember
();
for
(
SurfaceProperty
surface
:
surfaces
)
{
if
(
surface
.
getObject
()
instanceof
CompositeSurface
cs
)
{
Geometry
geom
=
parseCompositeSurface
(
cs
,
lod
);
if
(
geom
!=
null
)
{
co
.
addGeometry
(
geom
);
}
}
}
}
private
void
parseImplicitGeometry
(
AbstractOccupiedSpace
aos
,
CityObject
co
){
for
(
int
i
=
1
;
i
<=
3
;
i
++){
if
(
aos
.
getImplicitRepresentation
(
i
)
==
null
){
...
...
@@ -579,6 +605,8 @@ public class Citygml3FeatureMapper extends ObjectWalker {
geom
=
parseMultiSurface
(
ms
,
lod
);
}
else
if
(
aGeom
instanceof
Solid
s
){
geom
=
parseSolid
(
s
,
lod
);
}
else
if
(
aGeom
instanceof
CompositeSurface
cs
){
geom
=
parseCompositeSurface
(
cs
,
lod
);
}
if
(
geom
!=
null
){
relGeo
=
RelativeGeometry
.
of
(
geom
);
...
...
@@ -948,6 +976,13 @@ public class Citygml3FeatureMapper extends ObjectWalker {
}
}
public
Geometry
parseCompositeSurface
(
CompositeSurface
cs
,
Lod
lod
)
{
Geometry
geom
=
new
Geometry
(
GeometryType
.
COMPOSITE_SURFACE
,
lod
);
Citygml3GeometryMapper
geometryMapper
=
new
Citygml3GeometryMapper
(
config
,
vertexMap
);
readSurfaceMember
(
geom
,
geometryMapper
,
cs
.
getSurfaceMembers
());
return
geom
;
}
private
void
updateEdgesAndVertices
(
CityObject
co
)
{
// searching for neighboring vertices, replacing them with one single vertex to
// avoid later problems with edges and manifold problems
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets