@@ -33,7 +33,6 @@ public class FortuneSweep {
3333 }
3434 }
3535 private var firstSiteY : Double ?
36-
3736 private var container : Rectangle ! {
3837 didSet {
3938 watcher? . updateContainer ( rectangle: container)
@@ -49,6 +48,7 @@ public class FortuneSweep {
4948 watcher? . step = currentStep
5049 }
5150 }
51+ private var isTerminated : Bool !
5252 /// Result Data Structure
5353 private( set) var diagram : Diagram !
5454
@@ -98,7 +98,7 @@ public class FortuneSweep {
9898 ascending: true ,
9999 startingValues: events
100100 )
101-
101+ isTerminated = false
102102 logger? . log ( " \n \n Computation started! " , level: . info)
103103
104104 while !eventQueue. isEmpty && currentStep != maxStepsCount {
@@ -116,7 +116,11 @@ public class FortuneSweep {
116116 func debug_step( ) -> Bool {
117117 step ( )
118118 if eventQueue. isEmpty {
119- terminate ( )
119+ if isTerminated == false {
120+ terminate ( )
121+ } else {
122+ logger? . log ( " Algorithm terminated " , level: . info)
123+ }
120124 return true
121125 }
122126 return false
@@ -454,6 +458,7 @@ public class FortuneSweep {
454458 /// 2. Complete incomplete cells
455459 /// 3. Clip cells to clipping rectangle
456460 private func terminate( ) {
461+ isTerminated = true
457462 logger? . log ( " Event Queue is empty. Diagram bounding started. " , level: . info)
458463
459464 // Step 1:
0 commit comments