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
fb1d1c4f
Commit
fb1d1c4f
authored
Feb 17, 2026
by
Luna Riegel
Browse files
Refactor: Rename methods
parent
218d1387
Changes
3
Show whitespace changes
Inline
Side-by-side
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/HighlightController.java
View file @
fb1d1c4f
...
@@ -71,32 +71,6 @@ public class HighlightController {
...
@@ -71,32 +71,6 @@ public class HighlightController {
addPolygonHighlight
(
p
,
currentTriGeom
,
Color
.
RED
,
Color
.
BLUE
,
Color
.
ORANGE
);
addPolygonHighlight
(
p
,
currentTriGeom
,
Color
.
RED
,
Color
.
BLUE
,
Color
.
ORANGE
);
}
}
public
void
highlightPolygons
(
List
<
List
<
Polygon
>>
components
,
TriangulatedGeometry
currentTriGeom
)
{
clearHighlights
();
for
(
int
i
=
0
;
i
<
components
.
size
();
i
++)
{
Color
extColor
;
Color
intColor
=
switch
(
i
%
3
)
{
case
1
->
{
extColor
=
Color
.
GREEN
;
yield
Color
.
YELLOW
;
}
case
2
->
{
extColor
=
Color
.
BROWN
;
yield
Color
.
VIOLET
;
}
default
->
{
extColor
=
Color
.
RED
;
yield
Color
.
BLUE
;
}
};
// select some color pairs for exterior and inner rings
List
<
Polygon
>
component
=
components
.
get
(
i
);
for
(
Polygon
p
:
component
)
{
addPolygonHighlight
(
p
,
currentTriGeom
,
extColor
,
intColor
,
Color
.
ORANGE
);
}
}
}
public
void
highlight
(
LinearRing
ring
,
TriangulatedGeometry
currentTriGeom
)
{
public
void
highlight
(
LinearRing
ring
,
TriangulatedGeometry
currentTriGeom
)
{
clearHighlights
();
clearHighlights
();
if
(
ring
.
getType
()
==
LinearRingType
.
EXTERIOR
)
{
if
(
ring
.
getType
()
==
LinearRingType
.
EXTERIOR
)
{
...
@@ -106,7 +80,24 @@ public class HighlightController {
...
@@ -106,7 +80,24 @@ public class HighlightController {
}
}
}
}
public
void
highlight
(
List
<
LinearRing
>
rings
,
TriangulatedGeometry
currentTriGeom
)
{
public
void
highlight
(
Edge
e
,
TriangulatedGeometry
currentTriGeom
)
{
clearHighlights
();
addEdgeHighlight
(
e
,
currentTriGeom
);
}
public
void
highlight
(
Vertex
v
,
TriangulatedGeometry
currentTriGeom
)
{
clearHighlights
();
addVertexHighlight
(
v
,
currentTriGeom
,
Color
.
RED
);
}
public
void
highlight
(
Triangle3d
t
,
TriangulatedGeometry
currentTriGeom
)
{
clearHighlights
();
addSegmentHighlight
(
t
.
getP1
(),
t
.
getP2
(),
currentTriGeom
.
getMovedBy
(),
Color
.
ORANGE
);
addSegmentHighlight
(
t
.
getP2
(),
t
.
getP3
(),
currentTriGeom
.
getMovedBy
(),
Color
.
ORANGE
);
addSegmentHighlight
(
t
.
getP3
(),
t
.
getP1
(),
currentTriGeom
.
getMovedBy
(),
Color
.
ORANGE
);
}
public
void
highlightRings
(
List
<
LinearRing
>
rings
,
TriangulatedGeometry
currentTriGeom
)
{
clearHighlights
();
clearHighlights
();
for
(
LinearRing
lr
:
rings
)
{
for
(
LinearRing
lr
:
rings
)
{
if
(
lr
.
getType
()
==
LinearRingType
.
EXTERIOR
)
{
if
(
lr
.
getType
()
==
LinearRingType
.
EXTERIOR
)
{
...
@@ -117,11 +108,6 @@ public class HighlightController {
...
@@ -117,11 +108,6 @@ public class HighlightController {
}
}
}
}
public
void
highlight
(
Edge
e
,
TriangulatedGeometry
currentTriGeom
)
{
clearHighlights
();
addEdgeHighlight
(
e
,
currentTriGeom
);
}
public
void
highlightEdges
(
List
<
Edge
>
errorEdges
,
TriangulatedGeometry
currentTriGeom
)
{
public
void
highlightEdges
(
List
<
Edge
>
errorEdges
,
TriangulatedGeometry
currentTriGeom
)
{
clearHighlights
();
clearHighlights
();
for
(
Edge
e
:
errorEdges
)
{
for
(
Edge
e
:
errorEdges
)
{
...
@@ -129,16 +115,30 @@ public class HighlightController {
...
@@ -129,16 +115,30 @@ public class HighlightController {
}
}
}
}
public
void
highlight
(
Vertex
v
,
TriangulatedGeometry
currentTriGeom
)
{
public
void
highlight
PolygonClusters
(
List
<
List
<
Polygon
>>
components
,
TriangulatedGeometry
currentTriGeom
)
{
clearHighlights
();
clearHighlights
();
addVertexHighlight
(
v
,
currentTriGeom
,
Color
.
RED
);
for
(
int
i
=
0
;
i
<
components
.
size
();
i
++)
{
Color
extColor
;
Color
intColor
=
switch
(
i
%
3
)
{
case
1
->
{
extColor
=
Color
.
GREEN
;
yield
Color
.
YELLOW
;
}
case
2
->
{
extColor
=
Color
.
BROWN
;
yield
Color
.
VIOLET
;
}
default
->
{
extColor
=
Color
.
RED
;
yield
Color
.
BLUE
;
}
};
// select some color pairs for exterior and inner rings
List
<
Polygon
>
component
=
components
.
get
(
i
);
for
(
Polygon
p
:
component
)
{
addPolygonHighlight
(
p
,
currentTriGeom
,
extColor
,
intColor
,
Color
.
ORANGE
);
}
}
}
public
void
highlight
(
Triangle3d
t
,
TriangulatedGeometry
currentTriGeom
)
{
clearHighlights
();
addSegmentHighlight
(
t
.
getP1
(),
t
.
getP2
(),
currentTriGeom
.
getMovedBy
(),
Color
.
ORANGE
);
addSegmentHighlight
(
t
.
getP2
(),
t
.
getP3
(),
currentTriGeom
.
getMovedBy
(),
Color
.
ORANGE
);
addSegmentHighlight
(
t
.
getP3
(),
t
.
getP1
(),
currentTriGeom
.
getMovedBy
(),
Color
.
ORANGE
);
}
}
private
void
addRingHighlight
(
LinearRing
ring
,
TriangulatedGeometry
currentTriGeom
,
Color
pointColor
,
Color
edgeColor
)
{
private
void
addRingHighlight
(
LinearRing
ring
,
TriangulatedGeometry
currentTriGeom
,
Color
pointColor
,
Color
edgeColor
)
{
...
@@ -228,11 +228,25 @@ public class HighlightController {
...
@@ -228,11 +228,25 @@ public class HighlightController {
addPolygonHighlight
(
p
,
currentTriGeom
,
Color
.
RED
,
Color
.
BLUE
,
Color
.
ORANGE
);
addPolygonHighlight
(
p
,
currentTriGeom
,
Color
.
RED
,
Color
.
BLUE
,
Color
.
ORANGE
);
}
}
public
void
highlight
(
Triangle3d
t
,
TriangulatedGeometry
currentTriGeom
)
{
public
void
addCandidateHighlight
(
Polygon
p
,
TriangulatedGeometry
currentTriGeom
)
{
highlightEdge
(
t
.
getP1
(),
t
.
getP2
(),
currentTriGeom
.
getMovedBy
());
highlightEdge
(
t
.
getP2
(),
t
.
getP3
(),
currentTriGeom
.
getMovedBy
());
}
highlightEdge
(
t
.
getP3
(),
t
.
getP1
(),
currentTriGeom
.
getMovedBy
());
public
void
highlightGeometryCollisions
(
CollisionRecord
collRecord
,
TriangulatedGeometry
currentTriGeom
)
{
Map
<
Polygon
,
List
<
Polygon
>>
collisionMap
=
collRecord
.
getCollisionMap
();
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
));
}
}
public
void
highlightTopoPolygonGroups
(
Collection
<
Polygon
>
subjectPolys
,
Collection
<
Polygon
>
candidatePolys
,
TriangulatedGeometry
currentTriGeom
)
{
subjectPolys
.
forEach
(
subject
->
addPolygonHighlight
(
subject
,
currentTriGeom
,
Color
.
RED
,
Color
.
BLUE
,
Color
.
ORANGE
));
candidatePolys
.
forEach
(
subject
->
addPolygonHighlight
(
subject
,
currentTriGeom
,
Color
.
RED
,
Color
.
BLUE
,
Color
.
DARKORANGE
));
}
//TODO: Implement highlighting for FeatureCollisions and other Topological checks
//TODO: Implement highlighting for FeatureCollisions and other Topological checks
}
}
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/ListErrorVisitor.java
View file @
fb1d1c4f
...
@@ -71,7 +71,7 @@ public class ListErrorVisitor implements ErrorVisitor {
...
@@ -71,7 +71,7 @@ public class ListErrorVisitor implements ErrorVisitor {
List
<
LinearRing
>
highlightedRings
=
new
ArrayList
<>();
List
<
LinearRing
>
highlightedRings
=
new
ArrayList
<>();
highlightedRings
.
add
(
err
.
getPolygon
().
getExteriorRing
());
highlightedRings
.
add
(
err
.
getPolygon
().
getExteriorRing
());
highlightedRings
.
addAll
(
err
.
getHolesOutside
());
highlightedRings
.
addAll
(
err
.
getHolesOutside
());
controller
.
highlight
(
highlightedRings
,
geom
);
controller
.
highlight
Rings
(
highlightedRings
,
geom
);
}
}
@Override
@Override
...
@@ -81,7 +81,7 @@ public class ListErrorVisitor implements ErrorVisitor {
...
@@ -81,7 +81,7 @@ public class ListErrorVisitor implements ErrorVisitor {
@Override
@Override
public
void
visit
(
MultipleConnectedComponentsError
err
)
{
public
void
visit
(
MultipleConnectedComponentsError
err
)
{
controller
.
highlightPolygons
(
err
.
getComponents
(),
geom
);
controller
.
highlightPolygon
Cluster
s
(
err
.
getComponents
(),
geom
);
}
}
@Override
@Override
...
@@ -89,12 +89,12 @@ public class ListErrorVisitor implements ErrorVisitor {
...
@@ -89,12 +89,12 @@ public class ListErrorVisitor implements ErrorVisitor {
List
<
LinearRing
>
highlightedRings
=
new
ArrayList
<>();
List
<
LinearRing
>
highlightedRings
=
new
ArrayList
<>();
highlightedRings
.
add
(
err
.
getPolygon
().
getExteriorRing
());
highlightedRings
.
add
(
err
.
getPolygon
().
getExteriorRing
());
highlightedRings
.
add
(
err
.
getInnerRing
());
highlightedRings
.
add
(
err
.
getInnerRing
());
controller
.
highlight
(
highlightedRings
,
geom
);
controller
.
highlight
Rings
(
highlightedRings
,
geom
);
}
}
@Override
@Override
public
void
visit
(
NonManifoldVertexError
err
)
{
public
void
visit
(
NonManifoldVertexError
err
)
{
controller
.
highlightPolygons
(
err
.
getComponents
(),
geom
);
controller
.
highlightPolygon
Cluster
s
(
err
.
getComponents
(),
geom
);
controller
.
addVertexHighlight
(
err
.
getVertex
(),
geom
,
Color
.
BLUEVIOLET
);
controller
.
addVertexHighlight
(
err
.
getVertex
(),
geom
,
Color
.
BLUEVIOLET
);
}
}
...
@@ -108,7 +108,7 @@ public class ListErrorVisitor implements ErrorVisitor {
...
@@ -108,7 +108,7 @@ public class ListErrorVisitor implements ErrorVisitor {
List
<
LinearRing
>
highlightedRings
=
new
ArrayList
<>();
List
<
LinearRing
>
highlightedRings
=
new
ArrayList
<>();
highlightedRings
.
add
(
err
.
getPolygon
().
getExteriorRing
());
highlightedRings
.
add
(
err
.
getPolygon
().
getExteriorRing
());
highlightedRings
.
add
(
err
.
getInnerRing
());
highlightedRings
.
add
(
err
.
getInnerRing
());
controller
.
highlight
(
highlightedRings
,
geom
);
controller
.
highlight
Rings
(
highlightedRings
,
geom
);
}
}
@Override
@Override
...
@@ -145,7 +145,7 @@ public class ListErrorVisitor implements ErrorVisitor {
...
@@ -145,7 +145,7 @@ public class ListErrorVisitor implements ErrorVisitor {
@Override
@Override
public
void
visit
(
PolygonInteriorDisconnectedError
err
)
{
public
void
visit
(
PolygonInteriorDisconnectedError
err
)
{
controller
.
highlight
(
err
.
getConnectedRings
(),
geom
);
controller
.
highlight
Rings
(
err
.
getConnectedRings
(),
geom
);
}
}
@Override
@Override
...
@@ -174,7 +174,7 @@ public class ListErrorVisitor implements ErrorVisitor {
...
@@ -174,7 +174,7 @@ public class ListErrorVisitor implements ErrorVisitor {
List
<
LinearRing
>
rings
=
new
ArrayList
<>();
List
<
LinearRing
>
rings
=
new
ArrayList
<>();
rings
.
add
(
err
.
getIntersectingRings
().
getValue0
());
rings
.
add
(
err
.
getIntersectingRings
().
getValue0
());
rings
.
add
(
err
.
getIntersectingRings
().
getValue1
());
rings
.
add
(
err
.
getIntersectingRings
().
getValue1
());
controller
.
highlight
(
rings
,
geom
);
controller
.
highlight
Rings
(
rings
,
geom
);
}
}
@Override
@Override
...
...
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/Renderer.java
View file @
fb1d1c4f
...
@@ -524,7 +524,7 @@ public class Renderer {
...
@@ -524,7 +524,7 @@ public class Renderer {
}
}
public
void
highlight
(
List
<
LinearRing
>
highlightedRings
)
{
public
void
highlight
(
List
<
LinearRing
>
highlightedRings
)
{
highlightController
.
highlight
(
highlightedRings
,
currentTriGeom
);
highlightController
.
highlight
Rings
(
highlightedRings
,
currentTriGeom
);
}
}
public
void
highlightEdges
(
List
<
Edge
>
edges
)
{
public
void
highlightEdges
(
List
<
Edge
>
edges
)
{
...
@@ -532,7 +532,7 @@ public class Renderer {
...
@@ -532,7 +532,7 @@ public class Renderer {
}
}
public
void
highlightPolygons
(
List
<
List
<
Polygon
>>
components
)
{
public
void
highlightPolygons
(
List
<
List
<
Polygon
>>
components
)
{
highlightController
.
highlightPolygons
(
components
,
currentTriGeom
);
highlightController
.
highlightPolygon
Cluster
s
(
components
,
currentTriGeom
);
}
}
public
void
addHighlight
(
Vertex
vertex
,
Color
c
)
{
public
void
addHighlight
(
Vertex
vertex
,
Color
c
)
{
...
...
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