[][src]Struct voronoice::VoronoiCell

pub struct VoronoiCell<'v> { /* fields omitted */ }

Represents a Voronoi cell. This is an ergonomic way to access cell details.

Use Voronoi::cell() or Voronoi::iter_cells() to obtain an instance of this type.

Implementations

impl<'v> VoronoiCell<'v>[src]

pub fn site_position(&self) -> &Point[src]

Gets a reference to the position of the site associated with this cell.

Examples

 use voronoice::*;
 let sites = vec![Point { x: 0.0, y: 0.0 }, Point { x: 0.5, y: 0.0 }, Point { x: 0.0, y: 0.5 }];
 let v = VoronoiBuilder::default()
     .set_sites(sites.clone())
     .build()
     .unwrap();
 // the first site generated by generate_circle_sites is at the origin
 assert_eq!(&sites[0], v.cell(0).site_position());
 assert_eq!(&sites[1], v.cell(1).site_position());
 assert_eq!(&sites[2], v.cell(2).site_position());

pub fn triangles(&self) -> impl Iterator<Item = usize> + 'v + Clone[src]

Gets an iterator the indices of the triangles of the dual Delauney triangulation that are associated with this cell. The Voronoi cell vertices are the circumcenters of the associated Delauney triangles. This is a way to index into the underlying Delauney triangles.

If this cell is on the hull of the diagram (cell.is_on_hull() == true), or has had one of its edges clipped,

pub fn vertices(&self) -> impl Iterator<Item = &Point>[src]

Gets an iterator for the vertices of

pub fn is_on_hull(&self) -> bool[src]

Returns a boolean indicating whether this cell is on the hull (edge) of the diagram.

Trait Implementations

impl<'v> Clone for VoronoiCell<'v>[src]

impl<'v> Debug for VoronoiCell<'v>[src]

Auto Trait Implementations

impl<'v> RefUnwindSafe for VoronoiCell<'v>[src]

impl<'v> Send for VoronoiCell<'v>[src]

impl<'v> Sync for VoronoiCell<'v>[src]

impl<'v> Unpin for VoronoiCell<'v>[src]

impl<'v> UnwindSafe for VoronoiCell<'v>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.