[−][src]Struct voronoice::VoronoiCell
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]
pub fn clone(&self) -> VoronoiCell<'v>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,