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
89433d80
Commit
89433d80
authored
5 months ago
by
Riegel
Browse files
Options
Download
Email Patches
Plain Diff
Add support for GenericCityObject objects
parent
5e5e7ad6
master
107-opengl-view
dev
dev_cpp_code_conversion
dev_gui_features
dev_gui_features_zip_loading
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
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/CityDoctorModel.java
+25
-0
.../stuttgart/citydoctor2/datastructure/CityDoctorModel.java
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/FeatureType.java
+1
-1
.../hft/stuttgart/citydoctor2/datastructure/FeatureType.java
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/mapper/citygml3/Citygml3FeatureMapper.java
+8
-1
...rt/citydoctor2/mapper/citygml3/Citygml3FeatureMapper.java
with
34 additions
and
2 deletions
+34
-2
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/CityDoctorModel.java
+
25
-
0
View file @
89433d80
...
...
@@ -58,6 +58,7 @@ public class CityDoctorModel {
private
final
List
<
Vegetation
>
vegetation
;
private
final
List
<
BridgeObject
>
bridges
;
private
final
List
<
CityFurniture
>
cityfurniture
;
private
final
List
<
GenericCityObject
>
genericObjects
;
private
final
List
<
CityObject
>
land
;
private
final
List
<
TransportationObject
>
roads
;
private
final
List
<
WaterObject
>
water
;
...
...
@@ -84,6 +85,7 @@ public class CityDoctorModel {
roads
=
new
ArrayList
<>();
water
=
new
ArrayList
<>();
cityfurniture
=
new
ArrayList
<>();
genericObjects
=
new
ArrayList
<>();
globalErrors
=
new
ArrayList
<>();
}
...
...
@@ -227,6 +229,7 @@ public class CityDoctorModel {
collectErrorsFromList
(
errors
,
roads
);
collectErrorsFromList
(
errors
,
water
);
collectErrorsFromList
(
errors
,
cityfurniture
);
collectErrorsFromList
(
errors
,
genericObjects
);
return
new
HashSet
<>(
errors
);
}
...
...
@@ -264,6 +267,14 @@ public class CityDoctorModel {
cityfurniture
.
add
(
coFurniture
);
}
public
List
<
GenericCityObject
>
getGenericCityObjects
(){
return
genericObjects
;
}
public
void
addGenericCityObject
(
GenericCityObject
coGenericCityObject
){
genericObjects
.
add
(
coGenericCityObject
);
}
public
void
setCityModel
(
CityModel
cModel
)
{
this
.
cModel
=
cModel
;
}
...
...
@@ -327,6 +338,8 @@ public class CityDoctorModel {
replaceWaterObject
(
currentFeature
,
nextFeature
);
}
else
if
(
nextFeature
instanceof
CityFurniture
)
{
replaceCityFurniture
(
currentFeature
,
nextFeature
);
}
else
if
(
nextFeature
instanceof
GenericCityObject
)
{
replaceGenericCityObject
(
currentFeature
,
nextFeature
);
}
}
...
...
@@ -362,6 +375,14 @@ public class CityDoctorModel {
cityfurniture
.
set
(
index
,
(
CityFurniture
)
nextFeature
);
}
private
void
replaceGenericCityObject
(
CityObject
currentFeature
,
CityObject
nextFeature
)
{
int
index
=
genericObjects
.
indexOf
(
currentFeature
);
if
(
index
==
-
1
)
{
throw
new
IllegalStateException
(
COULD_NOT_FIND_FEATURE
+
currentFeature
+
" in generic city objects"
);
}
genericObjects
.
set
(
index
,
(
GenericCityObject
)
nextFeature
);
}
private
void
replaceTransportationObject
(
CityObject
currentFeature
,
CityObject
nextFeature
)
{
int
index
=
roads
.
indexOf
(
currentFeature
);
if
(
index
==
-
1
)
{
...
...
@@ -403,6 +424,10 @@ public class CityDoctorModel {
land
.
add
(
co
);
}
else
if
(
co
instanceof
TinObject
)
{
land
.
add
(
co
);
}
else
if
(
co
instanceof
CityFurniture
cf
)
{
cityfurniture
.
add
(
cf
);
}
else
if
(
co
instanceof
GenericCityObject
gco
)
{
genericObjects
.
add
(
gco
);
}
}
...
...
This diff is collapsed.
Click to expand it.
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/FeatureType.java
+
1
-
1
View file @
89433d80
...
...
@@ -27,6 +27,6 @@ package de.hft.stuttgart.citydoctor2.datastructure;
public
enum
FeatureType
{
BUILDING
,
TRANSPORTATION
,
VEGETATION
,
BRIDGE
,
LAND
,
WATER
,
BOUNDARY_SURFACE
,
INSTALLATION
,
OPENING
,
BUILDING_PART
,
BRIDGE_CONSTRUCTION_ELEMENT
,
BRIDGE_INSTALLATION
,
ROOM
,
FURNITURE
,
CITY_FURNITURE
BUILDING_PART
,
BRIDGE_CONSTRUCTION_ELEMENT
,
BRIDGE_INSTALLATION
,
ROOM
,
FURNITURE
,
CITY_FURNITURE
,
GENERIC_CITY_OBJECT
}
This diff is collapsed.
Click to expand it.
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/mapper/citygml3/Citygml3FeatureMapper.java
+
8
-
1
View file @
89433d80
...
...
@@ -128,8 +128,15 @@ public class Citygml3FeatureMapper extends ObjectWalker {
model
.
addCityFurniture
(
cf
);
}
@Override
public
void
visit
(
org
.
citygml4j
.
core
.
model
.
generics
.
GenericOccupiedSpace
gos
){
System
.
out
.
println
(
gos
.
toString
());
GenericCityObject
gco
=
new
GenericCityObject
();
gco
.
setGmlObject
(
gos
);
mapAbstractOccupiedSpace
(
gos
,
gco
);
resolveAndClearReferences
();
gco
.
unsetGmlGeometries
();
updateEdgesAndVertices
(
gco
);
model
.
addGenericCityObject
(
gco
);
}
...
...
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