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
efa04ffb
Commit
efa04ffb
authored
Apr 16, 2025
by
Riegel
Browse files
Refactor: Rework clearMetaInformation with Visitor
parent
79a65e32
Pipeline
#11063
failed with stage
in 46 seconds
Changes
28
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/Checkable.java
View file @
efa04ffb
...
...
@@ -26,6 +26,7 @@ import java.util.Map;
import
de.hft.stuttgart.citydoctor2.utils.CheckErrorFound
;
import
de.hft.stuttgart.citydoctor2.utils.visitors.CheckableErrorCollector
;
import
de.hft.stuttgart.citydoctor2.utils.visitors.ClearMetaInformationVisitor
;
import
de.hft.stuttgart.citydoctor2.utils.visitors.ContainsAnyErrorVisitor
;
import
de.hft.stuttgart.citydoctor2.utils.visitors.ContainsErrorVisitor
;
import
de.hft.stuttgart.citydoctor2.utils.visitors.PrepareForCheckingVisitor
;
...
...
@@ -102,7 +103,9 @@ public abstract class Checkable implements Serializable {
* This should be called after checking has been done. This should remove any
* created meta information like edges to free up additional memory space
*/
public
abstract
void
clearMetaInformation
();
public
void
clearMetaInformation
()
{
this
.
accept
(
new
ClearMetaInformationVisitor
());
}
/**
* This method checks if the object or any object contained within this
...
...
@@ -231,7 +234,7 @@ public abstract class Checkable implements Serializable {
* @return false if the checkable or all checkables contained in this one don't
* have any error.
*/
public
boolean
containsAnyError
()
{
public
final
boolean
containsAnyError
()
{
try
{
ContainsAnyErrorVisitor
.
checkObject
(
this
);
}
catch
(
CheckErrorFound
c
)
{
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/AbstractBuilding.java
View file @
efa04ffb
...
...
@@ -285,28 +285,6 @@ public abstract class AbstractBuilding extends CityObject {
return
buildingUnits
;
}
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
Installation
bi
:
buildingInstallations
)
{
bi
.
clearMetaInformation
();
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
clearMetaInformation
();
}
for
(
BuildingRoom
br
:
buildingRooms
)
{
br
.
clearMetaInformation
();
}
for
(
BuildingRoomFurniture
bfr
:
buildingRoomFurnitureList
)
{
bfr
.
clearMetaInformation
();
}
for
(
Storey
storey
:
buildingStoreys
)
{
storey
.
clearMetaInformation
();
}
for
(
BuildingUnit
bu
:
buildingUnits
)
{
bu
.
clearMetaInformation
();
}
}
@Override
public
void
collectInstances
(
CopyHandler
handler
)
{
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/AbstractBuildingSubdivision.java
View file @
efa04ffb
...
...
@@ -228,23 +228,6 @@ public abstract class AbstractBuildingSubdivision extends CityObject {
}
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
Installation
bi
:
buildingInstallations
)
{
bi
.
clearMetaInformation
();
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
clearMetaInformation
();
}
for
(
BuildingRoom
br
:
buildingRooms
)
{
br
.
clearMetaInformation
();
}
for
(
BuildingRoomFurniture
bfr
:
buildingRoomFurnitureList
)
{
bfr
.
clearMetaInformation
();
}
}
@Override
public
void
collectInstances
(
CopyHandler
handler
)
{
super
.
collectInstances
(
handler
);
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/AbstractFurniture.java
View file @
efa04ffb
...
...
@@ -145,15 +145,6 @@ public abstract class AbstractFurniture extends CityObject {
}
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
boundarySurface
.
clearMetaInformation
();
}
}
@Override
public
FeatureType
getFeatureType
()
{
return
FeatureType
.
FURNITURE
;
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/AbstractRoom.java
View file @
efa04ffb
...
...
@@ -125,18 +125,6 @@ public abstract class AbstractRoom extends CityObject {
cgmlRoom
.
setLod3Solid
(
null
);
}
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
Installation
roomInstallation
:
roomInstallations
)
{
roomInstallation
.
clearMetaInformation
();
}
for
(
BoundarySurface
boundarySurface
:
boundarySurfaceList
)
{
boundarySurface
.
clearMetaInformation
();
}
}
@Override
public
AbstractCityObject
getGmlObject
()
{
return
cgmlRoom
;
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/AbstractTunnel.java
View file @
efa04ffb
...
...
@@ -267,30 +267,6 @@ public abstract class AbstractTunnel extends CityObject {
return
tunnelConstructiveElements
;
}
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
Installation
bi
:
tunnelInstallations
)
{
bi
.
clearMetaInformation
();
}
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
clearMetaInformation
();
}
for
(
TunnelHollow
th
:
tunnelHollows
)
{
th
.
clearMetaInformation
();
}
for
(
TunnelFurniture
tfr
:
tunnelFurnitureList
)
{
tfr
.
clearMetaInformation
();
}
for
(
TunnelConstructiveElement
te
:
tunnelConstructiveElements
)
{
te
.
clearMetaInformation
();
}
for
(
TunnelPart
tp
:
tunnelParts
)
{
tp
.
clearMetaInformation
();
}
}
@Override
public
void
collectInstances
(
CopyHandler
handler
)
{
super
.
collectInstances
(
handler
);
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/BoundarySurface.java
View file @
efa04ffb
...
...
@@ -219,15 +219,6 @@ public class BoundarySurface extends CityObject {
opening
.
setPartOfSurface
(
this
);
}
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
Opening
o
:
openings
)
{
o
.
clearMetaInformation
();
}
}
@Override
public
Copyable
createCopyInstance
()
{
return
new
BoundarySurface
(
gmlObject
);
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/BridgeConstructiveElement.java
View file @
efa04ffb
...
...
@@ -237,15 +237,6 @@ public class BridgeConstructiveElement extends CityObject {
return
boundarySurfaceList
;
}
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
clearMetaInformation
();
}
}
@Override
public
void
collectInstances
(
CopyHandler
handler
)
{
super
.
collectInstances
(
handler
);
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/BridgeObject.java
View file @
efa04ffb
...
...
@@ -298,34 +298,6 @@ public class BridgeObject extends CityObject {
}
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
BoundarySurface
bs
:
boundarySurfaces
)
{
bs
.
clearMetaInformation
();
}
for
(
Installation
bi
:
bridgeInstallations
)
{
bi
.
clearMetaInformation
();
}
for
(
BridgeObject
part
:
parts
)
{
part
.
clearMetaInformation
();
}
for
(
BridgeConstructiveElement
ele
:
elements
)
{
ele
.
clearMetaInformation
();
}
for
(
BridgeRoom
br
:
bridgeRooms
)
{
br
.
clearMetaInformation
();
}
for
(
BridgeRoomFurniture
bri
:
bridgeFurniture
)
{
bri
.
clearMetaInformation
();
}
}
@Override
public
void
collectInstances
(
CopyHandler
handler
)
{
super
.
collectInstances
(
handler
);
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/Building.java
View file @
efa04ffb
...
...
@@ -101,14 +101,6 @@ public class Building extends AbstractBuilding {
setCityGmlBuilding
(
gmlB
);
}
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
BuildingPart
part
:
buildingParts
)
{
part
.
clearMetaInformation
();
}
}
@Override
public
void
fillValues
(
Copyable
original
,
CopyHandler
handler
)
{
super
.
fillValues
(
original
,
handler
);
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/BuildingUnit.java
View file @
efa04ffb
...
...
@@ -49,14 +49,6 @@ public class BuildingUnit extends AbstractBuildingSubdivision {
}
}
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
Storey
storey
:
storeys
)
{
storey
.
clearMetaInformation
();
}
}
@Override
public
void
collectInstances
(
CopyHandler
handler
)
{
super
.
collectInstances
(
handler
);
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/CityObject.java
View file @
efa04ffb
...
...
@@ -165,13 +165,6 @@ public abstract class CityObject extends GmlElement {
return
null
;
}
@Override
public
void
clearMetaInformation
()
{
for
(
Geometry
geom
:
geometryList
)
{
geom
.
clearMetaInformation
();
}
}
@Override
public
void
collectInstances
(
CopyHandler
handler
)
{
for
(
Geometry
geom
:
geometryList
)
{
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/ConcretePolygon.java
View file @
efa04ffb
...
...
@@ -413,11 +413,7 @@ public class ConcretePolygon extends Polygon {
public
void
prepareLowMemoryUsageMode
()
{
parent
.
updateEdgesAndVertices
();
}
@Override
public
void
clearMetaInformation
()
{
parent
.
clearMetaInformation
();
}
@Override
public
void
collectInstances
(
CopyHandler
handler
)
{
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/GenericCityObject.java
View file @
efa04ffb
...
...
@@ -128,14 +128,6 @@ public class GenericCityObject extends CityObject {
}
}
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
BoundarySurface
bs
:
boundarySurfaceList
)
{
bs
.
clearMetaInformation
();
}
}
@Override
public
void
collectInstances
(
CopyHandler
handler
)
{
super
.
collectInstances
(
handler
);
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/Geometry.java
View file @
efa04ffb
...
...
@@ -343,8 +343,7 @@ public class Geometry extends GmlElement {
}
@Override
public
void
clearMetaInformation
()
{
public
void
clearMetaData
()
{
if
(
vertices
!=
null
)
{
for
(
Vertex
v
:
vertices
)
{
v
.
clearAdjacentRings
();
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/Installation.java
View file @
efa04ffb
...
...
@@ -218,15 +218,6 @@ public class Installation extends CityObject {
return
boundarySurfaces
;
}
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
BoundarySurface
bs
:
boundarySurfaces
)
{
bs
.
clearMetaInformation
();
}
}
@Override
public
void
fillValues
(
Copyable
original
,
CopyHandler
handler
)
{
super
.
fillValues
(
original
,
handler
);
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/LinearRing.java
View file @
efa04ffb
...
...
@@ -317,11 +317,6 @@ public class LinearRing extends GmlElement {
parent
.
prepareLowMemoryUsageMode
();
}
@Override
public
void
clearMetaInformation
()
{
parent
.
getParent
().
clearMetaInformation
();
}
@Override
public
void
fillValues
(
Copyable
original
,
CopyHandler
handler
)
{
super
.
fillValues
(
original
,
handler
);
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/LinkedPolygon.java
View file @
efa04ffb
...
...
@@ -117,11 +117,6 @@ public class LinkedPolygon extends Polygon {
poly
.
addCheckResult
(
cr
);
}
@Override
public
boolean
containsAnyError
()
{
return
poly
.
containsAnyError
();
}
@Override
public
boolean
containsError
(
CheckId
checkIdentifier
)
{
return
poly
.
containsError
(
checkIdentifier
);
...
...
@@ -257,11 +252,6 @@ public class LinkedPolygon extends Polygon {
poly
.
prepareLowMemoryUsageMode
();
}
@Override
public
void
clearMetaInformation
()
{
poly
.
clearMetaInformation
();
}
@Override
public
boolean
isLinkedTo
()
{
return
false
;
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/ReliefObject.java
View file @
efa04ffb
...
...
@@ -74,13 +74,6 @@ public class ReliefObject extends CityObject {
return
new
ReliefObject
(
feature
);
}
@Override
public
void
clearMetaInformation
()
{
for
(
TinObject
component
:
components
)
{
component
.
clearMetaInformation
();
}
}
@Override
public
void
clearAllContainedCheckResults
()
{
for
(
TinObject
component
:
components
)
{
...
...
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/Storey.java
View file @
efa04ffb
...
...
@@ -48,14 +48,6 @@ public class Storey extends AbstractBuildingSubdivision {
}
}
@Override
public
void
clearMetaInformation
()
{
super
.
clearMetaInformation
();
for
(
BuildingUnit
buildingUnit
:
buildingUnits
)
{
buildingUnit
.
clearMetaInformation
();
}
}
@Override
public
void
collectInstances
(
CopyHandler
handler
)
{
super
.
collectInstances
(
handler
);
...
...
Prev
1
2
Next
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