pub struct Edge { /* private fields */ }
Expand description
Half-edge data structure. Represents a Voronoi edge.
Data members:
- id of the corresponding cell
- id of to the vertex that is the starting point of the half-edge (optional)
- id of to the twin edge
- id of of the CCW next edge
- id of to the CCW prev edge
- mutable color member
Implementations§
Source§impl Edge
impl Edge
Sourcepub fn cell(&self) -> Result<CellIndex, BvError>
pub fn cell(&self) -> Result<CellIndex, BvError>
Returns the cell index of this edge, or a BvError
Sourcepub fn vertex0(&self) -> Option<VertexIndex>
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.
Sourcepub fn next(&self) -> Result<EdgeIndex, BvError>
pub fn next(&self) -> Result<EdgeIndex, BvError>
returns the next edge (counter clockwise winding) or an error
Sourcepub fn prev(&self) -> Result<EdgeIndex, BvError>
pub fn prev(&self) -> Result<EdgeIndex, BvError>
returns the previous edge (counter clockwise winding)
Sourcepub fn is_linear(&self) -> bool
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).
Sourcepub fn is_curved(&self) -> bool
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).
Sourcepub fn is_primary(&self) -> bool
pub fn is_primary(&self) -> bool
Returns false if edge goes through the endpoint of the segment. Returns true else.
Sourcepub fn is_secondary(&self) -> bool
pub fn is_secondary(&self) -> bool
Returns true if edge goes through the endpoint of the segment. Returns false else.
Sourcepub fn get_color(&self) -> u32
pub fn get_color(&self) -> u32
get_color returns the custom edge info. (does not contain the reserved bits)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Edge
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more