Struct s2::cell::Cell [−][src]
Cell is an S2 region object that represents a cell. Unlike CellIDs, it supports efficient containment and intersection tests. However, it is also a more expensive representation.
Fields
orientation: u8
id: CellID
uv: Rect
Methods
impl Cell
[src]
impl Cell
pub fn face(&self) -> u8
[src]
pub fn face(&self) -> u8
pub fn level(&self) -> u8
[src]
pub fn level(&self) -> u8
pub fn is_leaf(&self) -> bool
[src]
pub fn is_leaf(&self) -> bool
pub fn size_ij(&self) -> u64
[src]
pub fn size_ij(&self) -> u64
pub fn vertex(&self, k: usize) -> Point
[src]
pub fn vertex(&self, k: usize) -> Point
vertex returns the k-th vertex of the cell (k = 0,1,2,3) in CCW order (lower left, lower right, upper right, upper left in the UV plane).
pub fn vertices(&self) -> [Point; 4]
[src]
pub fn vertices(&self) -> [Point; 4]
pub fn edge(&self, k: usize) -> Point
[src]
pub fn edge(&self, k: usize) -> Point
edge returns the inward-facing normal of the great circle passing through the CCW ordered edge from vertex k to vertex k+1 (mod 4) (for k = 0,1,2,3).
pub fn bound_uv(&self) -> &Rect
[src]
pub fn bound_uv(&self) -> &Rect
bound_uv returns the bounds of this cell in (u,v)-space.
pub fn center(&self) -> Point
[src]
pub fn center(&self) -> Point
center returns the direction vector corresponding to the center in (s,t)-space of the given cell. This is the point at which the cell is divided into four subcells; it is not necessarily the centroid of the cell in (u,v)-space or (x,y,z)-space
pub fn children(&self) -> Option<[Cell; 4]>
[src]
pub fn children(&self) -> Option<[Cell; 4]>
Children returns the four direct children of this cell in traversal order and returns true. If this is a leaf cell, or the children could not be created, false is returned. The C++ method is called Subdivide.
pub fn exact_area(&self) -> f64
[src]
pub fn exact_area(&self) -> f64
exact_area returns the area of this cell as accurately as possible.
pub fn approx_area(&self) -> f64
[src]
pub fn approx_area(&self) -> f64
approx_area returns the approximate area of this cell. This method is accurate to within 3% percent for all cell sizes and accurate to within 0.1% for cells at level 5 or higher (i.e. squares 350km to a side or smaller on the Earth's surface). It is moderately cheap to compute.
pub fn average_area(&self) -> f64
[src]
pub fn average_area(&self) -> f64
average_area returns the average area of cells at the level of this cell. This is accurate to within a factor of 1.7.
pub fn latitude(&self, i: i32, j: i32) -> Angle
[src]
pub fn latitude(&self, i: i32, j: i32) -> Angle
latitude returns the latitude of the cell vertex given by (i,j), where "i" and "j" are either 0 or 1.
pub fn longitude(&self, i: i32, j: i32) -> Angle
[src]
pub fn longitude(&self, i: i32, j: i32) -> Angle
longitude returns the longitude of the cell vertex given by (i,j), where "i" and "j" are either 0 or 1.
pub fn rect_bound(&self) -> Rect
[src]
pub fn rect_bound(&self) -> Rect
rect_bound returns the bounding rectangle of this cell.
pub fn contains_point(&self, p: &Point) -> bool
[src]
pub fn contains_point(&self, p: &Point) -> bool
Trait Implementations
impl Debug for Cell
[src]
impl Debug for Cell
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Cell
[src]
impl Clone for Cell
fn clone(&self) -> Cell
[src]
fn clone(&self) -> Cell
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<'a> From<&'a CellID> for Cell
[src]
impl<'a> From<&'a CellID> for Cell
impl From<CellID> for Cell
[src]
impl From<CellID> for Cell
impl<'a> From<&'a Point> for Cell
[src]
impl<'a> From<&'a Point> for Cell
impl From<Point> for Cell
[src]
impl From<Point> for Cell
impl<'a> From<&'a LatLng> for Cell
[src]
impl<'a> From<&'a LatLng> for Cell
impl From<LatLng> for Cell
[src]
impl From<LatLng> for Cell
impl<'a> From<&'a Cell> for CellID
[src]
impl<'a> From<&'a Cell> for CellID
impl From<Cell> for CellID
[src]
impl From<Cell> for CellID
impl Region for Cell
[src]
impl Region for Cell
fn cap_bound(&self) -> Cap
[src]
fn cap_bound(&self) -> Cap
cap_bound returns the bounding cap of this cell.
fn intersects_cell(&self, other: &Cell) -> bool
[src]
fn intersects_cell(&self, other: &Cell) -> bool
intersects_cell reports whether the intersection of this cell and the other cell is not nil.
fn contains_cell(&self, other: &Cell) -> bool
[src]
fn contains_cell(&self, other: &Cell) -> bool
contains_cell reports whether this cell contains the other cell.
fn rect_bound(&self) -> Rect
[src]
fn rect_bound(&self) -> Rect
rect_bound returns a bounding latitude-longitude rectangle that contains the region. The bounds are not guaranteed to be tight. Read more