Skip to content

Commit 0e1b90a

Browse files
committed
Update BentleyOttmann.cs
1 parent 87c9839 commit 0e1b90a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Advanced.Algorithms/Geometry/BentleyOttmann.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class BentleyOttmann
1212
{
1313
private readonly PointComparer pointComparer;
1414

15-
private HashSet<Event> verticalHorizontalLines;
15+
private HashSet<Event> verticalAndHorizontalLines;
1616
private HashSet<Event> otherLines;
1717

1818
private BHeap<Event> eventQueue;
@@ -41,7 +41,7 @@ private void initialize(IEnumerable<Line> lineSegments)
4141
currentlyTrackedLines = new RedBlackTree<Event>(true, pointComparer);
4242
intersectionEvents = new Dictionary<Point, HashSet<Tuple<Event, Event>>>(pointComparer);
4343

44-
verticalHorizontalLines = new HashSet<Event>();
44+
verticalAndHorizontalLines = new HashSet<Event>();
4545
otherLines = new HashSet<Event>();
4646

4747
rightLeftEventLookUp = lineSegments
@@ -82,9 +82,9 @@ public Dictionary<Point, List<Line>> FindIntersections(IEnumerable<Line> lineSeg
8282
case EventType.Start:
8383

8484
//special case
85-
if (verticalHorizontalLines.Count > 0)
85+
if (verticalAndHorizontalLines.Count > 0)
8686
{
87-
foreach (var line in verticalHorizontalLines)
87+
foreach (var line in verticalAndHorizontalLines)
8888
{
8989
var intersection = findIntersection(currentEvent, line);
9090
recordIntersection(currentEvent, line, intersection);
@@ -94,7 +94,7 @@ public Dictionary<Point, List<Line>> FindIntersections(IEnumerable<Line> lineSeg
9494
//special case
9595
if (currentEvent.Segment.IsVertical || currentEvent.Segment.IsHorizontal)
9696
{
97-
verticalHorizontalLines.Add(currentEvent);
97+
verticalAndHorizontalLines.Add(currentEvent);
9898

9999
foreach (var line in otherLines)
100100
{
@@ -129,7 +129,7 @@ public Dictionary<Point, List<Line>> FindIntersections(IEnumerable<Line> lineSeg
129129
//special case
130130
if (currentEvent.Segment.IsVertical || currentEvent.Segment.IsHorizontal)
131131
{
132-
verticalHorizontalLines.Remove(currentEvent);
132+
verticalAndHorizontalLines.Remove(currentEvent);
133133
break;
134134
}
135135

0 commit comments

Comments
 (0)