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
3c5ade13
Commit
3c5ade13
authored
Feb 13, 2026
by
Luna Riegel
Browse files
Feat: Implement handling of error visitor
parent
57be887c
Changes
2
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/check/error/FeatureCollisionError.java
View file @
3c5ade13
...
...
@@ -33,6 +33,26 @@ public class FeatureCollisionError implements CheckError {
this
.
collisionMap
=
collisionMap
;
}
public
CityObject
getSubjectFeature
()
{
return
subjectFeature
;
}
public
Geometry
getSubjectGeom
()
{
return
subjectGeom
;
}
public
Geometry
getCollidingGeom
()
{
return
collidingGeom
;
}
public
GmlId
getCollidingFeatureId
()
{
return
collidingFeatureId
;
}
public
Map
<
Polygon
,
List
<
Polygon
>>
getCollisionMap
()
{
return
collisionMap
;
}
@Override
public
ErrorType
getType
()
{
return
ErrorType
.
ERROR
;
...
...
@@ -50,6 +70,7 @@ public class FeatureCollisionError implements CheckError {
@Override
public
void
accept
(
ErrorVisitor
errorVisitor
)
{
errorVisitor
.
visit
(
this
);
//TODO: Add this CheckError to the errorVisitor
}
...
...
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/tree/ErrorItemVisitor.java
View file @
3c5ade13
package
de.hft.stuttgart.citydoctor2.gui.tree
;
import
java.util.List
;
import
java.util.Map
;
import
de.hft.stuttgart.citydoctor2.check.AbstractErrorVisitor
;
import
de.hft.stuttgart.citydoctor2.check.CheckError
;
...
...
@@ -48,6 +49,7 @@ import de.hft.stuttgart.citydoctor2.datastructure.Polygon;
import
de.hft.stuttgart.citydoctor2.datastructure.Vertex
;
import
de.hft.stuttgart.citydoctor2.gui.CheckStatus
;
import
de.hft.stuttgart.citydoctor2.gui.tree.node.EdgeNode
;
import
de.hft.stuttgart.citydoctor2.gui.tree.node.GeometryNode
;
import
de.hft.stuttgart.citydoctor2.gui.tree.node.LinearRingNode
;
import
de.hft.stuttgart.citydoctor2.gui.tree.node.PolygonNode
;
import
de.hft.stuttgart.citydoctor2.gui.tree.node.TextNode
;
...
...
@@ -462,7 +464,20 @@ public class ErrorItemVisitor extends AbstractErrorVisitor {
@Override
public
void
visit
(
FeatureCollisionError
err
){
throw
new
NotImplementedException
();
GeometryNode
subjectGeoNode
=
new
GeometryNode
(
err
.
getSubjectGeom
());
TreeItem
<
Renderable
>
subjectGeoItem
=
new
TreeItem
<>(
subjectGeoNode
);
for
(
Map
.
Entry
<
Polygon
,
List
<
Polygon
>>
e:
err
.
getCollisionMap
().
entrySet
()){
PolygonNode
subjectPolyNode
=
new
PolygonNode
(
e
.
getKey
(),
CheckStatus
.
NOT_CHECKED
);
TreeItem
<
Renderable
>
subjectPolyItem
=
new
TreeItem
<>(
subjectPolyNode
);
for
(
Polygon
poly:
e
.
getValue
()){
PolygonNode
collidingPolyNode
=
new
PolygonNode
(
poly
,
CheckStatus
.
NOT_CHECKED
);
TreeItem
<
Renderable
>
collidingPolyItem
=
new
TreeItem
<>(
collidingPolyNode
);
subjectPolyItem
.
getChildren
().
add
(
collidingPolyItem
);
}
subjectGeoItem
.
getChildren
().
add
(
subjectPolyItem
);
}
root
.
getChildren
().
add
(
subjectGeoItem
);
//TODO: Implement handling of error here
// Will require new Error Node-type that is capable of rendering 2 CityObjects
}
...
...
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