Struct SyncDiagram

Source
pub struct SyncDiagram<F>
where F: OutputType,
{ /* private fields */ }
Expand description

Sync version of the boostvoronoi::Diagram struct. This is useful when traversing the diagram in a multi threaded environment.

It also comes in an optional serde flavor.

Implementations§

Source§

impl<F> SyncDiagram<F>
where F: OutputType,

Source

pub fn new( cells: Vec<Cell>, vertices: Vec<Vertex<F>>, edges: Vec<Edge>, ) -> SyncDiagram<F>

Source

pub fn cells(&self) -> &Vec<Cell>

Returns a reference to the list of cells

Source

pub fn edge_rot_next_iterator( &self, edge_id: EdgeIndex, ) -> EdgeRotNextIterator<'_, F>

Returns an edge iterator, the edges will all originate at the same vertex as ‘edge_id’. ‘edge_id’ will be the first edge returned by the iterator.

Source

pub fn edge_rot_next(&self, edge_id: EdgeIndex) -> Result<EdgeIndex, BvError>

Returns a pointer to the rotation next edge over the starting point of the half-edge.

Source

pub fn edge_rot_prev(&self, edge_id: EdgeIndex) -> Result<EdgeIndex, BvError>

Returns a pointer to the rotation previous edge over the starting point of the half-edge.

Source

pub fn edge_get_next(&self, edge_id: EdgeIndex) -> Result<EdgeIndex, BvError>

Returns the next edge or an error

Source

pub fn edge_get_prev(&self, edge_id: EdgeIndex) -> Result<EdgeIndex, BvError>

Returns the previous edge or an BvError if it does not exist

Source

pub fn edge_get_twin(&self, edge_id: EdgeIndex) -> Result<EdgeIndex, BvError>

Returns the twin edge or a BvError if it does not exists

Source

pub fn edge_is_finite(&self, edge_id: EdgeIndex) -> Result<bool, BvError>

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

Source

pub fn edge_is_infinite(&self, edge_id: EdgeIndex) -> Result<bool, BvError>

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

Source

pub fn edges(&self) -> &Vec<Edge>

Source

pub fn edge_get(&self, edge_id: EdgeIndex) -> Result<&Edge, BvError>

Source

pub fn edge_get_mut(&mut self, edge_id: EdgeIndex) -> Result<&mut Edge, BvError>

Source

pub fn edge_get_vertex0( &self, edge_id: EdgeIndex, ) -> Result<Option<VertexIndex>, BvError>

Returns the optional vertex0 of the edge

Source

pub fn edge_get_vertex1( &self, edge_id: EdgeIndex, ) -> Result<Option<VertexIndex>, BvError>

Returns the optional vertex1 of the edge

Source

pub fn cell_get(&self, cell_id: CellIndex) -> Result<&Cell, BvError>

Source

pub fn vertices(&self) -> &Vec<Vertex<F>>

Returns a reference to all of the vertices

Source

pub fn vertex_get(&self, vertex_id: VertexIndex) -> Result<&Vertex<F>, BvError>

Returns a reference to a vertex

Source

pub fn vertex_get_mut( &mut self, vertex_id: VertexIndex, ) -> Result<&mut Vertex<F>, BvError>

Returns a mutable reference to a vertex

Trait Implementations§

Source§

impl<F> Debug for SyncDiagram<F>
where F: Debug + OutputType,

Source§

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

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

impl<F> Default for SyncDiagram<F>
where F: Default + OutputType,

Source§

fn default() -> SyncDiagram<F>

Returns the “default value” for a type. Read more
Source§

impl<F> From<Diagram<F>> for SyncDiagram<F>
where F: OutputType,

Source§

fn from(other: Diagram<F>) -> SyncDiagram<F>

Converts a Diagram into a SyncDiagram by dropping the std::cell::Cell and Rc

Auto Trait Implementations§

§

impl<F> Freeze for SyncDiagram<F>

§

impl<F> RefUnwindSafe for SyncDiagram<F>
where F: RefUnwindSafe,

§

impl<F> Send for SyncDiagram<F>
where F: Send,

§

impl<F> Sync for SyncDiagram<F>

§

impl<F> Unpin for SyncDiagram<F>

§

impl<F> UnwindSafe for SyncDiagram<F>
where F: UnwindSafe,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

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

Source§

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>,

Source§

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.