pub struct BentleyOttmannEvents { /* private fields */ }Expand description
Event queue for the Bentley-Ottmann sweep line. Events are ordered by x then by y (ties broken by event type).
Implementations§
Source§impl BentleyOttmannEvents
impl BentleyOttmannEvents
Sourcepub fn new(segs: &[(Point2D, Point2D)]) -> Self
pub fn new(segs: &[(Point2D, Point2D)]) -> Self
Create the event queue from a list of segments.
Sourcepub fn add_intersection(&mut self, x: f64, y: f64, seg_a: usize, seg_b: usize)
pub fn add_intersection(&mut self, x: f64, y: f64, seg_a: usize, seg_b: usize)
Insert an intersection event (for future processing)
Sourcepub fn pop(&mut self) -> Option<SweepEvent>
pub fn pop(&mut self) -> Option<SweepEvent>
Pop the next event from the queue
Sourcepub fn all_intersections(&self) -> Vec<Point2D>
pub fn all_intersections(&self) -> Vec<Point2D>
Report all pairwise intersection points among the segments (naive O(n²)). This uses the event queue structure to report events in sweep order.
Auto Trait Implementations§
impl Freeze for BentleyOttmannEvents
impl RefUnwindSafe for BentleyOttmannEvents
impl Send for BentleyOttmannEvents
impl Sync for BentleyOttmannEvents
impl Unpin for BentleyOttmannEvents
impl UnsafeUnpin for BentleyOttmannEvents
impl UnwindSafe for BentleyOttmannEvents
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more