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
5677924a
Commit
5677924a
authored
Feb 12, 2026
by
Luna Riegel
Browse files
Refactor: Move function
parent
0dd7b9e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/FeatureType.java
View file @
5677924a
...
...
@@ -18,6 +18,8 @@
*/
package
de.hft.stuttgart.citydoctor2.datastructure
;
import
de.hft.stuttgart.quality.model.enums.TopLevelFeatureType
;
/**
* Possible feature types in CityGML
*
...
...
@@ -27,5 +29,17 @@ public enum FeatureType {
BUILDING
,
TRANSPORTATION
,
VEGETATION
,
BRIDGE
,
LAND
,
WATER
,
BOUNDARY_SURFACE
,
INSTALLATION
,
OPENING
,
BUILDING_PART
,
BUILDING_SUBDIVISION
,
BRIDGE_CONSTRUCTION_ELEMENT
,
BRIDGE_INSTALLATION
,
ROOM
,
FURNITURE
,
CITY_FURNITURE
,
OTHER_CITY_OBJECT
,
TUNNEL
,
TUNNEL_PART
,
TUNNEL_CONSTRUCTION_ELEMENT
,
TUNNEL_INSTALLATION
,
OTHER_CITY_OBJECT
,
TUNNEL
,
TUNNEL_PART
,
TUNNEL_CONSTRUCTION_ELEMENT
,
TUNNEL_INSTALLATION
;
public
TopLevelFeatureType
mapToTopLevelFeatureType
()
{
return
switch
(
this
)
{
case
BRIDGE
->
TopLevelFeatureType
.
BRIDGE
;
case
BUILDING
->
TopLevelFeatureType
.
BUILDING
;
case
LAND
->
TopLevelFeatureType
.
LAND
;
case
TRANSPORTATION
->
TopLevelFeatureType
.
TRANSPORTATION
;
case
VEGETATION
->
TopLevelFeatureType
.
VEGETATION
;
case
WATER
->
TopLevelFeatureType
.
WATER
;
default
->
null
;
};
}
}
CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/check/Checker.java
View file @
5677924a
...
...
@@ -150,6 +150,7 @@ public class Checker {
if
(!
model
.
isValidated
()
||
xmlOutput
==
null
)
{
return
;
}
Checker
c
=
new
Checker
(
null
,
null
);
File
xmlFile
=
new
File
(
xmlOutput
);
if
(
xmlFile
.
getParentFile
()
!=
null
&&
xmlFile
.
getParentFile
().
mkdirs
())
{
logger
.
trace
(
"Xml dir created"
);
...
...
@@ -389,12 +390,11 @@ public class Checker {
if
(
excludeFilters
!=
null
)
{
for
(
Filter
f
:
excludeFilters
)
{
if
(
f
instanceof
TypeFilter
tf
)
{
FeatureType
type
=
tf
.
getType
();
TopLevelFeatureType
tlft
=
mapToTopLevelFeatureType
(
type
);
if
(
tlft
==
null
)
{
TopLevelFeatureType
type
=
tf
.
getType
().
mapToTopLevelFeatureType
();
if
(
type
==
null
)
{
continue
;
}
removeFilter
(
t
lft
,
filter
);
removeFilter
(
t
ype
,
filter
);
}
}
}
...
...
@@ -408,13 +408,12 @@ public class Checker {
}
else
{
for
(
Filter
f
:
includeFilters
)
{
if
(
f
instanceof
TypeFilter
tf
)
{
FeatureType
type
=
tf
.
getType
();
TopLevelFeatureType
tlft
=
mapToTopLevelFeatureType
(
type
);
if
(
tlft
==
null
)
{
TopLevelFeatureType
type
=
tf
.
getType
().
mapToTopLevelFeatureType
();
if
(
type
==
null
)
{
continue
;
}
Checking
c
=
new
Checking
();
c
.
setFeatureType
(
t
lft
);
c
.
setFeatureType
(
t
ype
);
filter
.
getChecking
().
add
(
new
CheckingProperty
(
c
));
}
}
...
...
@@ -462,18 +461,6 @@ public class Checker {
}
}
private
TopLevelFeatureType
mapToTopLevelFeatureType
(
FeatureType
type
)
{
return
switch
(
type
)
{
case
BRIDGE
->
TopLevelFeatureType
.
BRIDGE
;
case
BUILDING
->
TopLevelFeatureType
.
BUILDING
;
case
LAND
->
TopLevelFeatureType
.
LAND
;
case
TRANSPORTATION
->
TopLevelFeatureType
.
TRANSPORTATION
;
case
VEGETATION
->
TopLevelFeatureType
.
VEGETATION
;
case
WATER
->
TopLevelFeatureType
.
WATER
;
default
->
null
;
};
}
private
RequirementId
mapToRequirement
(
String
requirementName
)
{
try
{
return
RequirementId
.
valueOf
(
requirementName
);
...
...
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