struct TrackIntervals {
intervals: SmallVec<[OccupiedInterval; 2]>,
auto_placement_cursor: Option<OriginZeroLine>,
}Expand description
The occupied cells of a single track, stored as a sorted list of disjoint intervals in OriginZero line coordinates. Gaps between intervals are unoccupied. Touching intervals with the same state are merged.
Fields§
§intervals: SmallVec<[OccupiedInterval; 2]>The sorted, disjoint list of occupied intervals within the track
auto_placement_cursor: Option<OriginZeroLine>The furthest end line of an auto-placed item starting in this secondary-axis track
Implementations§
Source§impl TrackIntervals
impl TrackIntervals
Sourcefn state_at(&self, coordinate: i16) -> CellOccupancyState
fn state_at(&self, coordinate: i16) -> CellOccupancyState
The occupancy state of the cell whose start line is at coordinate
Sourcefn paint(&mut self, range: Range<i16>, state: CellOccupancyState)
fn paint(&mut self, range: Range<i16>, state: CellOccupancyState)
Set the cells covered by range to state, overwriting the state of any already-occupied
cells within the range (matching the overwrite semantics of a dense matrix of cells)
Sourcefn collision_extent(&self, range: &Range<i16>) -> Option<i16>
fn collision_extent(&self, range: &Range<i16>) -> Option<i16>
Find the extent of the occupied interval which an auto-placement search along the track
would collide with last: the end of the last overlapping interval. Returns the extremal
occupied cell of that interval (which may lie outside range: every search position
before the returned extent also collides with the interval), or None if the range is
entirely unoccupied.
Trait Implementations§
Source§impl Clone for TrackIntervals
impl Clone for TrackIntervals
Source§fn clone(&self) -> TrackIntervals
fn clone(&self) -> TrackIntervals
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more