Struct boostvoronoi::Cell

source ·
pub struct Cell { /* private fields */ }
Expand description

Represents a Voronoi cell.

Data members:

  1. index of the source within the initial input set
  2. id of the incident edge
  3. mutable color member Cell may contain point or segment site inside.

Implementations§

source§

impl Cell

source

pub fn new(id: CellIndex, source_index: usize, source_category: u32) -> Cell

source

pub fn source_category(&self) -> SourceCategory

source

pub fn contains_point(&self) -> bool

Returns true if the cell contains point site, false else.

source

pub fn contains_segment(&self) -> bool

Returns true if the cell contains segment site, false otherwise.

source

pub fn contains_segment_startpoint(&self) -> bool

Returns true if the cell contains segment start point, false otherwise.

source

pub fn contains_segment_endpoint(&self) -> bool

Returns true if the cell contains segment end point, false otherwise.

source

pub fn id(&self) -> CellIndex

source

pub fn source_index(&self) -> usize

Returns the origin index of the cell.

source

pub fn source_index_2(&self) -> (usize, SourceCategory)

Returns the origin index of the point that created this cell. It also returns the source category

source

pub fn is_degenerate(&self) -> bool

Degenerate cells don’t have any incident edges.

source

pub fn get_incident_edge(&self) -> Option<EdgeIndex>

returns a random edge defined by this cell.

Trait Implementations§

source§

impl Clone for Cell

source§

fn clone(&self) -> Cell

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Cell

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Copy for Cell

Auto Trait Implementations§

§

impl RefUnwindSafe for Cell

§

impl Send for Cell

§

impl Sync for Cell

§

impl Unpin for Cell

§

impl UnwindSafe for Cell

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.