Struct boostvoronoi::Edge

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

Half-edge data structure. Represents a Voronoi edge.

Data members:

  1. id of the corresponding cell
  2. id of to the vertex that is the starting point of the half-edge (optional)
  3. id of to the twin edge
  4. id of of the CCW next edge
  5. id of to the CCW prev edge
  6. mutable color member

Implementations§

source§

impl Edge

source

pub fn id(&self) -> EdgeIndex

Returns the edge index

source

pub fn cell(&self) -> Result<CellIndex, BvError>

Returns the cell index of this edge, or a BvError

source

pub fn vertex0(&self) -> Option<VertexIndex>

Returns vertex0, it is perfectly ok for an edge to not contain a vertex0 so no Result<..> is needed here.

source

pub fn twin(&self) -> Result<EdgeIndex, BvError>

Returns the twin edge or an error

source

pub fn next(&self) -> Result<EdgeIndex, BvError>

returns the next edge (counter clockwise winding) or an error

source

pub fn prev(&self) -> Result<EdgeIndex, BvError>

returns the previous edge (counter clockwise winding)

source

pub fn is_linear(&self) -> bool

Returns true if the edge is linear (segment, ray, line). Returns false if the edge is curved (parabolic arc).

source

pub fn is_curved(&self) -> bool

Returns true if the edge is curved (parabolic arc). Returns false if the edge is linear (segment, ray, line).

source

pub fn is_primary(&self) -> bool

Returns false if edge goes through the endpoint of the segment. Returns true else.

source

pub fn is_secondary(&self) -> bool

Returns true if edge goes through the endpoint of the segment. Returns false else.

source

pub fn get_color(&self) -> u32

get_color returns the custom edge info. (does not contain the reserved bits)

source

pub fn set_color(&mut self, color: u32) -> u32

set_color sets the custom edge info. (does not affect the reserved bits)

source

pub fn or_color(&mut self, color: u32) -> u32

or_color sets the custom edge info together with the previous value. (does not affect the reserved bits)

Trait Implementations§

source§

impl Clone for Edge

source§

fn clone(&self) -> Edge

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 Edge

source§

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

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

impl Copy for Edge

Auto Trait Implementations§

§

impl RefUnwindSafe for Edge

§

impl Send for Edge

§

impl Sync for Edge

§

impl Unpin for Edge

§

impl UnwindSafe for Edge

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.