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
8b2f8ba8
Commit
8b2f8ba8
authored
Dec 16, 2025
by
Luna Riegel
Browse files
Fix: Connect Healer with models CityObjectCache
parent
19f5db34
Changes
3
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/exceptions/CityObjectCacheException.java
0 → 100644
View file @
8b2f8ba8
package
de.hft.stuttgart.citydoctor2.exceptions
;
import
java.io.Serial
;
public
class
CityObjectCacheException
extends
RuntimeException
{
@Serial
private
static
final
long
serialVersionUID
=
-
460467145629964615L
;
public
CityObjectCacheException
(
String
message
)
{
super
(
message
);
}
public
CityObjectCacheException
(
String
message
,
Throwable
cause
)
{
super
(
message
,
cause
);
}
}
CityDoctorParent/Extensions/CityDoctorHealer/src/main/java/de/hft/stuttgart/citydoctor2/healer/Healer.java
View file @
8b2f8ba8
...
@@ -12,6 +12,8 @@ import java.util.List;
...
@@ -12,6 +12,8 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Objects
;
import
de.hft.stuttgart.citydoctor2.database.CityObjectCache
;
import
de.hft.stuttgart.citydoctor2.exceptions.CityObjectCacheException
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
import
org.citygml4j.core.ade.ADEException
;
import
org.citygml4j.core.ade.ADEException
;
...
@@ -64,7 +66,7 @@ public class Healer {
...
@@ -64,7 +66,7 @@ public class Healer {
private
Checker
checker
;
private
Checker
checker
;
private
ModificationListener
l
;
private
ModificationListener
l
;
private
HealingPlan
plan
;
private
HealingPlan
plan
;
private
CityObjectCache
cache
;
static
{
static
{
// CppInitializer.initCpp();
// CppInitializer.initCpp();
}
}
...
@@ -187,6 +189,7 @@ public class Healer {
...
@@ -187,6 +189,7 @@ public class Healer {
}
}
};
};
}
}
cache
=
checker
.
getModel
().
getCache
();
this
.
l
=
l
;
this
.
l
=
l
;
}
}
...
@@ -208,7 +211,12 @@ public class Healer {
...
@@ -208,7 +211,12 @@ public class Healer {
}
}
public
void
healModel
(
CityDoctorModel
model
)
{
public
void
healModel
(
CityDoctorModel
model
)
{
model
.
createFeatureStream
().
forEach
(
this
::
healCityObject
);
try
(
AutoCloseable
checkingContext
=
model
.
getCache
().
startCheckingMode
()){
model
.
createFeatureStream
().
forEach
(
this
::
healCityObject
);
}
catch
(
Exception
e
)
{
throw
new
CityObjectCacheException
(
"Healer critically failed during attempt to heal the model"
,
e
);
}
}
}
public
void
healCityObject
(
CityObject
co
)
{
public
void
healCityObject
(
CityObject
co
)
{
...
@@ -348,6 +356,8 @@ public class Healer {
...
@@ -348,6 +356,8 @@ public class Healer {
if
(
checker
.
getConfig
().
getParserConfiguration
().
useLowMemoryConsumption
())
{
if
(
checker
.
getConfig
().
getParserConfiguration
().
useLowMemoryConsumption
())
{
co
.
clearMetaInformation
();
co
.
clearMetaInformation
();
}
}
//Reinsert object into cache and release locks
cache
.
put
(
co
);
}
}
}
}
...
...
CityDoctorParent/Extensions/CityDoctorHealer/src/test/java/de/hft/stuttgart/citydoctor2/healing/TestUtil.java
View file @
8b2f8ba8
...
@@ -31,7 +31,7 @@ public class TestUtil {
...
@@ -31,7 +31,7 @@ public class TestUtil {
}
}
public
static
CityDoctorModel
loadCityModel
(
String
path
,
ValidationConfiguration
config
)
throws
CityGmlParseException
,
IOException
,
InvalidGmlFileException
{
public
static
CityDoctorModel
loadCityModel
(
String
path
,
ValidationConfiguration
config
)
throws
CityGmlParseException
,
IOException
,
InvalidGmlFileException
{
return
CityGmlParser
.
parse
CityGmlFile
(
path
,
config
.
getParserConfiguration
());
return
CityGmlParser
.
nested
CityGmlFile
Parse
(
path
,
config
.
getParserConfiguration
());
}
}
public
static
Polygon
getPolygonById
(
String
gmlId
,
CityDoctorModel
model
)
{
public
static
Polygon
getPolygonById
(
String
gmlId
,
CityDoctorModel
model
)
{
...
...
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