pub struct LayeredCell { /* private fields */ }Expand description
Ordered surface crossings plus sorted, strictly disjoint occupancy spans.
Both channels may be empty, hold one entry, or hold many; a cell never selects a “primary” layer.
Implementations§
Source§impl LayeredCell
impl LayeredCell
Sourcepub const fn empty() -> LayeredCell
pub const fn empty() -> LayeredCell
An empty column.
Sourcepub fn new(occupancy: Vec<Interval>) -> Result<LayeredCell, LayeredFieldError>
pub fn new(occupancy: Vec<Interval>) -> Result<LayeredCell, LayeredFieldError>
Construct an occupancy-only column.
Sourcepub fn with_layers(
surfaces: Vec<SurfaceHit>,
occupancy: Vec<Interval>,
) -> Result<LayeredCell, LayeredFieldError>
pub fn with_layers( surfaces: Vec<SurfaceHit>, occupancy: Vec<Interval>, ) -> Result<LayeredCell, LayeredFieldError>
Construct a validated column with both channels.
Surfaces are sorted by w, then by facing so equal-coordinate ties are
deterministic. Occupancy is sorted and must be strictly disjoint;
touching or overlapping spans are rejected rather than merged, because a
merge would silently erase a topology fact the caller may need.
Sourcepub fn surfaces(&self) -> &[SurfaceHit]
pub fn surfaces(&self) -> &[SurfaceHit]
Crossings in increasing layer order.
Sourcepub fn layer_count(&self) -> usize
pub fn layer_count(&self) -> usize
Total stored layers in both channels.
Sourcepub fn derive_occupancy(
&self,
tolerance: Tolerance,
) -> Result<LayeredCell, LayeredFieldError>
pub fn derive_occupancy( &self, tolerance: Tolerance, ) -> Result<LayeredCell, LayeredFieldError>
Pair alternating crossings into occupancy spans for a closed shell.
The sequence must alternate AgainstNormal (enter) then WithNormal
(exit); anything else is reported as LayeredFieldError::UnbalancedCrossings
rather than guessed. A pair whose span is within the linear tolerance is
reported as LayeredFieldError::DegenerateOccupancy.
Sourcepub fn largest_free_span(&self, search: Interval) -> Option<Interval>
pub fn largest_free_span(&self, search: Interval) -> Option<Interval>
Largest unoccupied span strictly inside search, or None when the
window is fully occupied.
This reports a distance. It does not decide whether that distance is sufficient for any purpose.
Trait Implementations§
Source§impl Clone for LayeredCell
impl Clone for LayeredCell
Source§fn clone(&self) -> LayeredCell
fn clone(&self) -> LayeredCell
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LayeredCell
impl Debug for LayeredCell
Source§impl Default for LayeredCell
impl Default for LayeredCell
Source§fn default() -> LayeredCell
fn default() -> LayeredCell
Source§impl PartialEq for LayeredCell
impl PartialEq for LayeredCell
impl StructuralPartialEq for LayeredCell
Auto Trait Implementations§
impl Freeze for LayeredCell
impl RefUnwindSafe for LayeredCell
impl Send for LayeredCell
impl Sync for LayeredCell
impl Unpin for LayeredCell
impl UnwindSafe for LayeredCell
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more