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
1b84e3e5
Commit
1b84e3e5
authored
Feb 18, 2026
by
Luna Riegel
Browse files
Feat: Add highlight functions for TopoErrors
parent
766e173e
Changes
1
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/HighlightController.java
View file @
1b84e3e5
...
...
@@ -6,7 +6,10 @@ import java.util.Map;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
de.hft.stuttgart.citydoctor2.check.CheckableUtilsVisitor
;
import
de.hft.stuttgart.citydoctor2.datastructure.CityObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.Edge
;
import
de.hft.stuttgart.citydoctor2.datastructure.Geometry
;
import
de.hft.stuttgart.citydoctor2.datastructure.LinearRing
;
import
de.hft.stuttgart.citydoctor2.datastructure.Polygon
;
import
de.hft.stuttgart.citydoctor2.datastructure.Vertex
;
...
...
@@ -120,6 +123,13 @@ public class HighlightController {
}
}
public
void
highlightPolygons
(
Collection
<
Polygon
>
polygons
,
TriangulatedGeometry
currentTriGeom
)
{
clearHighlights
();
for
(
Polygon
p
:
polygons
)
{
addPolygonHighlight
(
p
,
currentTriGeom
);
}
}
public
void
highlightPolygonClusters
(
List
<
List
<
Polygon
>>
components
,
TriangulatedGeometry
currentTriGeom
)
{
clearHighlights
();
for
(
int
i
=
0
;
i
<
components
.
size
();
i
++)
{
...
...
@@ -229,25 +239,46 @@ public class HighlightController {
edges
.
getChildren
().
add
(
cy
);
}
public
void
addCandidateSkeletonHighlight
(
CityObject
candidate
,
TriangulatedGeometry
currentTriGeom
)
{
candidate
.
accept
(
new
CheckableUtilsVisitor
()
{
@Override
public
void
check
(
Geometry
geom
)
{
geom
.
getPolygons
().
forEach
(
p
->
{
addPolygonHighlight
(
p
,
currentTriGeom
,
Color
.
GRAY
,
Color
.
GRAY
,
Color
.
DARKGRAY
);
});
}
});
}
public
void
addPolygonHighlight
(
Polygon
p
,
TriangulatedGeometry
currentTriGeom
)
{
addPolygonHighlight
(
p
,
currentTriGeom
,
Color
.
RED
,
Color
.
BLUE
,
Color
.
ORANGE
);
}
public
void
addCandidateHighlight
(
Polygon
p
,
TriangulatedGeometry
currentTriGeom
)
{
addPolygonHighlight
(
p
,
currentTriGeom
,
Color
.
DARKRED
,
Color
.
NAVY
,
Color
.
ROSYBROWN
);
}
public
void
addCandidateHighlight
(
Collection
<
Polygon
>
polys
,
TriangulatedGeometry
currentTriGeom
)
{
for
(
Polygon
p
:
polys
)
{
addCandidateHighlight
(
p
,
currentTriGeom
);
}
}
public
void
highlightGeometryCollisions
(
CollisionRecord
collRecord
,
TriangulatedGeometry
currentTriGeom
)
{
Map
<
Polygon
,
List
<
Polygon
>>
collisionMap
=
collRecord
.
collisionMap
();
collisionMap
.
keySet
().
forEach
(
subject
->
addPolygonHighlight
(
subject
,
currentTriGeom
,
Color
.
RED
,
Color
.
BLUE
,
Color
.
ORANGE
));
Set
<
Polygon
>
collidingPolys
=
collisionMap
.
values
().
stream
().
flatMap
(
List:
:
stream
).
collect
(
Collectors
.
toSet
());
collidingPolys
.
forEach
(
poly
->
addPolygonHighlight
(
poly
,
currentTriGeom
,
Color
.
DARKRED
,
Color
.
NAVY
,
Color
.
DARKORANGE
));
highlightTopoPolygonGroups
(
collisionMap
.
keySet
(),
collidingPolys
,
currentTriGeom
);
}
public
void
highlightTopoPolygonPair
(
Polygon
subject
,
Polygon
candidate
,
TriangulatedGeometry
currentTriGeom
)
{
highlight
(
subject
,
currentTriGeom
);
addCandidateHighlight
(
candidate
,
currentTriGeom
);
}
public
void
highlightTopoPolygonGroups
(
Collection
<
Polygon
>
subjectPolys
,
Collection
<
Polygon
>
candidatePolys
,
TriangulatedGeometry
currentTriGeom
)
{
subjectPolys
.
forEach
(
subject
->
addPolygonHighlight
(
subject
,
currentTriGeom
,
Color
.
RED
,
Color
.
BLUE
,
Color
.
ORANGE
)
);
c
andidate
Polys
.
forEach
(
subject
->
addPolygonHighlight
(
subject
,
currentTriGeom
,
Color
.
RED
,
Color
.
BLUE
,
Color
.
DARKORANGE
)
);
highlightPolygons
(
subjectPolys
,
currentTriGeom
);
addC
andidate
Highlight
(
candidatePolys
,
currentTriGeom
);
}
...
...
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