Struct taffy::compute::grid::types::grid_track_counts::TrackCounts
source · pub(crate) struct TrackCounts {
pub negative_implicit: u16,
pub explicit: u16,
pub positive_implicit: u16,
}
Expand description
Stores the number of tracks in a given dimension. Stores separately the number of tracks in the implicit and explicit grids
Fields§
§negative_implicit: u16
The number of track in the implicit grid before the explicit grid
explicit: u16
The number of tracks in the explicit grid
positive_implicit: u16
The number of tracks in the implicit grid after the explicit grid
Implementations§
source§impl TrackCounts
impl TrackCounts
sourcepub fn from_raw(
negative_implicit: u16,
explicit: u16,
positive_implicit: u16,
) -> Self
pub fn from_raw( negative_implicit: u16, explicit: u16, positive_implicit: u16, ) -> Self
Create a TrackCounts instance from raw track count numbers
sourcepub fn implicit_start_line(&self) -> OriginZeroLine
pub fn implicit_start_line(&self) -> OriginZeroLine
The OriginZeroLine representing the start of the implicit grid
sourcepub fn implicit_end_line(&self) -> OriginZeroLine
pub fn implicit_end_line(&self) -> OriginZeroLine
The OriginZeroLine representing the end of the implicit grid
source§impl TrackCounts
impl TrackCounts
Conversion functions between OriginZero coordinates and CellOccupancyMatrix track indexes
sourcepub fn oz_line_to_next_track(&self, index: OriginZeroLine) -> i16
pub fn oz_line_to_next_track(&self, index: OriginZeroLine) -> i16
Converts a grid line in OriginZero coordinates into the track immediately following that grid line as an index into the CellOccupancyMatrix.
sourcepub fn oz_line_range_to_track_range(
&self,
input: Line<OriginZeroLine>,
) -> Range<i16>
pub fn oz_line_range_to_track_range( &self, input: Line<OriginZeroLine>, ) -> Range<i16>
Converts start and end grid lines in OriginZero coordinates into a range of tracks as indexes into the CellOccupancyMatrix
sourcepub fn track_to_prev_oz_line(&self, index: u16) -> OriginZeroLine
pub fn track_to_prev_oz_line(&self, index: u16) -> OriginZeroLine
Converts a track as an index into the CellOccupancyMatrix into the grid line immediately preceding that track in OriginZero coordinates.
sourcepub fn track_range_to_oz_line_range(
&self,
input: Range<i16>,
) -> Line<OriginZeroLine>
pub fn track_range_to_oz_line_range( &self, input: Range<i16>, ) -> Line<OriginZeroLine>
Converts a range of tracks as indexes into the CellOccupancyMatrix into start and end grid lines in OriginZero coordinates
Trait Implementations§
source§impl Clone for TrackCounts
impl Clone for TrackCounts
source§fn clone(&self) -> TrackCounts
fn clone(&self) -> TrackCounts
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TrackCounts
impl Debug for TrackCounts
source§impl Default for TrackCounts
impl Default for TrackCounts
source§fn default() -> TrackCounts
fn default() -> TrackCounts
source§impl PartialEq for TrackCounts
impl PartialEq for TrackCounts
impl Copy for TrackCounts
impl StructuralPartialEq for TrackCounts
Auto Trait Implementations§
impl Freeze for TrackCounts
impl RefUnwindSafe for TrackCounts
impl Send for TrackCounts
impl Sync for TrackCounts
impl Unpin for TrackCounts
impl UnwindSafe for TrackCounts
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)