Struct s2::cellunion::CellUnion[][src]

pub struct CellUnion(pub Vec<CellID>);

A CellUnion is a collection of CellIDs.

It is normalized if it is sorted, and does not contain redundancy. Specifically, it may not contain the same CellID twice, nor a CellID that is contained by another, nor the four sibling CellIDs that are children of a single higher level CellID.

Methods

impl CellUnion
[src]

from_range creates a CellUnion that covers the half-open range of leaf cells [begin, end). If begin == end the resulting union is empty. This requires that begin and end are both leaves, and begin <= end. To create a closed-ended range, pass in end.next().

normalize normalizes the CellUnion.

intersects_cellid reports whether this cell union intersects the given cell ID. This method assumes that the CellUnion has been normalized.

contains_cellid reports whether the cell union contains the given cell ID. Containment is defined with respect to regions, e.g. a cell contains its 4 children.

This method assumes that the CellUnion has been normalized.

denormalize replaces this CellUnion with an expanded version of the CellUnion where any cell whose level is less than minLevel or where (level - minLevel) is not a multiple of levelMod is replaced by its children, until either both of these conditions are satisfied or the maximum level is reached.

leaf_cells_covered reports the number of leaf cells covered by this cell union. This will be no more than 6*2^60 for the whole sphere.

Trait Implementations

impl Debug for CellUnion
[src]

Formats the value using the given formatter. Read more

impl Clone for CellUnion
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for CellUnion
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for CellUnion
[src]

impl Region for CellUnion
[src]

cap_bound returns a bounding spherical cap. This is not guaranteed to be exact.

rect_bound returns a Rect that bounds this entity.

contains_cell reports whether the region completely contains the given region. It returns false if containment could not be determined. Read more

intersects_cell reports whether the region intersects the given cell or if intersection could not be determined. It returns false if the region does not intersect. Read more

Auto Trait Implementations

impl Send for CellUnion

impl Sync for CellUnion