Skip to main content

Triangulator

Struct Triangulator 

Source
pub struct Triangulator<K: RTreeNum, PC: KeyedCollection = Vec<Polygon<K, FaceId>>, PR: KeyedCollection = AsRefRTree<GeomWithData<Rectangle<[K; 2]>, usize>>, UFPC = Vec<usize>, UFRC = Vec<usize>, VC = StableVec<Vertex<VertexWeight<K>>>, HEC = StableVec<HalfEdge<HalfEdgeWeight>>, FC = StableVec<Face<FaceWeight>>, ER = AsRefRTree<GeomWithData<Rectangle<[K; 2]>, EdgeId>>, FR = AsRefRTree<GeomWithData<Rectangle<[K; 2]>, FaceId>>> { /* private fields */ }

Implementations§

Source§

impl<K: FromPrimitive + RTreeNum + ToPrimitive + Hash + Ord + Eq, PC: Clone + IntoIter<usize> + Get<usize, Value = Polygon<K, FaceId>> + Default + Push<usize> + Set<usize>, PR: AsRef<RTree<GeomWithData<Rectangle<[K; 2]>, usize>>> + Default + Insert<GeomWithData<Rectangle<[K; 2]>, usize>, Value = ()>, UFPC: Get<usize, Value = usize> + Insert<usize, Value = usize> + Default + Push<usize> + Set<usize>, UFRC: Get<usize, Value = usize> + Insert<usize, Value = usize> + Default + Push<usize> + Set<usize>, VC: Get<usize, Value = Vertex<VertexWeight<K>>> + Default + Insert<usize> + KeyedCollection + Push<usize> + StableRemove<usize>, HEC: Get<usize, Value = HalfEdge<HalfEdgeWeight>> + Default + Insert<usize> + KeyedCollection + Push<usize> + StableRemove<usize>, FC: Get<usize, Value = Face<FaceWeight>> + Default + Insert<usize> + KeyedCollection + Push<usize> + StableRemove<usize>, ER: AsRef<RTree<GeomWithData<Rectangle<[K; 2]>, EdgeId>>> + Get<GeomWithData<Rectangle<[K; 2]>, EdgeId>, Value = ()> + Default + Insert<GeomWithData<Rectangle<[K; 2]>, EdgeId>> + Remove<GeomWithData<Rectangle<[K; 2]>, EdgeId>> + KeyedCollection, FR: AsRef<RTree<GeomWithData<Rectangle<[K; 2]>, FaceId>>> + Get<GeomWithData<Rectangle<[K; 2]>, FaceId>, Value = ()> + Default + Insert<GeomWithData<Rectangle<[K; 2]>, FaceId>> + Remove<GeomWithData<Rectangle<[K; 2]>, FaceId>> + KeyedCollection> Triangulator<K, PC, PR, UFPC, UFRC, VC, HEC, FC, ER, FR>

Source

pub fn new() -> Self

Source

pub fn insert_free_vertex(&mut self, position: [K; 2]) -> VertexId

Source

pub fn insert_free_vertex_in_obstacle( &mut self, obstacle: usize, position: [K; 2], ) -> VertexId

Source

pub fn insert_free_vertex_in_face( &mut self, face: FaceId, position: [K; 2], ) -> VertexId

Source

pub fn insert_obstacle( &mut self, vertices: impl IntoIterator<Item = [K; 2]>, ) -> usize

Source

pub fn insert_obstacles( &mut self, obstacles: impl IntoIterator<Item = impl IntoIterator<Item = [K; 2]>>, ) -> impl IntoIterator<Item = usize>

Source

pub fn obstacles(&mut self) -> impl Iterator<Item = &Polygon<K, FaceId>>

Source

pub fn triangulation(&self) -> &Triangulation<K, VC, HEC, FC, ER, FR>

Source

pub fn bounding_rectangle(&mut self) -> [[K; 2]; 4]

Source§

impl<K: FromPrimitive + RTreeNum + ToPrimitive + Hash + Ord + Eq, PC: Clear + Clone + IntoIter<usize> + Get<usize, Value = Polygon<K, FaceId>> + Default + Push<usize> + Set<usize>, PR: Clear + AsRef<RTree<GeomWithData<Rectangle<[K; 2]>, usize>>> + Default + Insert<GeomWithData<Rectangle<[K; 2]>, usize>, Value = ()>, UFPC: Clear + Get<usize, Value = usize> + Insert<usize, Value = usize> + Default + Push<usize> + Set<usize>, UFRC: Clear + Get<usize, Value = usize> + Insert<usize, Value = usize> + Default + Push<usize> + Set<usize>, VC: Clear + Get<usize, Value = Vertex<VertexWeight<K>>> + Default + Insert<usize> + KeyedCollection + Push<usize> + StableRemove<usize>, HEC: Clear + Get<usize, Value = HalfEdge<HalfEdgeWeight>> + Default + Insert<usize> + KeyedCollection + Push<usize> + StableRemove<usize>, FC: Clear + Get<usize, Value = Face<FaceWeight>> + Default + Insert<usize> + KeyedCollection + Push<usize> + StableRemove<usize>, ER: Clear + AsRef<RTree<GeomWithData<Rectangle<[K; 2]>, EdgeId>>> + Get<GeomWithData<Rectangle<[K; 2]>, EdgeId>, Value = ()> + Default + Insert<GeomWithData<Rectangle<[K; 2]>, EdgeId>> + Remove<GeomWithData<Rectangle<[K; 2]>, EdgeId>> + KeyedCollection, FR: Clear + AsRef<RTree<GeomWithData<Rectangle<[K; 2]>, FaceId>>> + Get<GeomWithData<Rectangle<[K; 2]>, FaceId>, Value = ()> + Default + Insert<GeomWithData<Rectangle<[K; 2]>, FaceId>> + Remove<GeomWithData<Rectangle<[K; 2]>, FaceId>> + KeyedCollection> Triangulator<K, PC, PR, UFPC, UFRC, VC, HEC, FC, ER, FR>

Source

pub fn insert_obstacle_and_rebuild( &mut self, obstacle: impl IntoIterator<Item = [K; 2]>, superpolygon: impl IntoIterator<Item = [K; 2]>, ) -> usize

Source

pub fn insert_obstacles_and_rebuild( &mut self, obstacles: impl IntoIterator<Item = impl IntoIterator<Item = [K; 2]>>, superpolygon: impl IntoIterator<Item = [K; 2]>, ) -> impl IntoIterator<Item = usize>

Source§

impl<K: RTreeNum, PC: Clear, PR: Clear, UFPC: Clear, UFRC: Clear, VC: Clear, HEC: Clear, FC: Clear + Push<usize, Value = Face<FaceWeight>>, ER: Clear, FR: Clear> Triangulator<K, PC, PR, UFPC, UFRC, VC, HEC, FC, ER, FR>

Source

pub fn clear(&mut self)

Trait Implementations§

Source§

impl<K: RTreeNum, PCD: Clone + KeyedCollection, PC: Clone + KeyedCollection + ApplyDelta<PCD>, PRD: Clone + KeyedCollection, PR: Clone + KeyedCollection + ApplyDelta<PRD>, UFPCD: Clone + KeyedCollection, UFPC: Clone + KeyedCollection + ApplyDelta<UFPCD>, UFRCD: Clone + KeyedCollection, UFRC: Clone + KeyedCollection + ApplyDelta<UFRCD>, VCD: Clone + KeyedCollection, VC: Clone + KeyedCollection + ApplyDelta<VCD>, HECD: Clone + KeyedCollection, HEC: Clone + KeyedCollection + ApplyDelta<HECD>, FCD: Clone + KeyedCollection, FC: Clone + KeyedCollection + ApplyDelta<FCD>, ERD: Clone + KeyedCollection, ER: Clone + KeyedCollection + ApplyDelta<ERD>, FRD: Clone + KeyedCollection, FR: Clone + KeyedCollection + ApplyDelta<FRD>> ApplyDelta<Triangulator<K, PCD, PRD, UFPCD, UFRCD, VCD, HECD, FCD, ERD, FRD>> for Triangulator<K, PC, PR, UFPC, UFRC, VC, HEC, FC, ER, FR>

Available on crate feature undoredo only.
Source§

fn apply_delta( &mut self, delta: &Delta<Triangulator<K, PCD, PRD, UFPCD, UFRCD, VCD, HECD, FCD, ERD, FRD>>, )

Apply the changes in an delta to a collection. Read more
Source§

impl<K: Clone + RTreeNum, PC: Clone + KeyedCollection, PR: Clone + KeyedCollection, UFPC: Clone, UFRC: Clone, VC: Clone, HEC: Clone, FC: Clone, ER: Clone, FR: Clone> Clone for Triangulator<K, PC, PR, UFPC, UFRC, VC, HEC, FC, ER, FR>

Source§

fn clone(&self) -> Triangulator<K, PC, PR, UFPC, UFRC, VC, HEC, FC, ER, FR>

Returns a duplicate 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<K: Debug + RTreeNum, PC: Debug + KeyedCollection, PR: Debug + KeyedCollection, UFPC: Debug, UFRC: Debug, VC: Debug, HEC: Debug, FC: Debug, ER: Debug, FR: Debug> Debug for Triangulator<K, PC, PR, UFPC, UFRC, VC, HEC, FC, ER, FR>

Source§

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

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

impl<K: RTreeNum, PCD: Clone + KeyedCollection, PC: Clone + KeyedCollection + FlushDelta<PCD>, PRD: Clone + KeyedCollection, PR: Clone + KeyedCollection + FlushDelta<PRD>, UFPCD: Clone + KeyedCollection, UFPC: Clone + KeyedCollection + FlushDelta<UFPCD>, UFRCD: Clone + KeyedCollection, UFRC: Clone + KeyedCollection + FlushDelta<UFRCD>, VCD: Clone + KeyedCollection, VC: Clone + KeyedCollection + FlushDelta<VCD>, HECD: Clone + KeyedCollection, HEC: Clone + KeyedCollection + FlushDelta<HECD>, FCD: Clone + KeyedCollection, FC: Clone + KeyedCollection + FlushDelta<FCD>, ERD: Clone + KeyedCollection, ER: Clone + KeyedCollection + FlushDelta<ERD>, FRD: Clone + KeyedCollection, FR: Clone + KeyedCollection + FlushDelta<FRD>> FlushDelta<Triangulator<K, PCD, PRD, UFPCD, UFRCD, VCD, HECD, FCD, ERD, FRD>> for Triangulator<K, PC, PR, UFPC, UFRC, VC, HEC, FC, ER, FR>

Available on crate feature undoredo only.
Source§

fn flush_delta( &mut self, ) -> Delta<Triangulator<K, PCD, PRD, UFPCD, UFRCD, VCD, HECD, FCD, ERD, FRD>>

Flush the recorder, returning the recorded delta and replacing it with a new empty one.

Auto Trait Implementations§

§

impl<K, PC, PR, UFPC, UFRC, VC, HEC, FC, ER, FR> Freeze for Triangulator<K, PC, PR, UFPC, UFRC, VC, HEC, FC, ER, FR>
where PC: Freeze, PR: Freeze, UFPC: Freeze, UFRC: Freeze, ER: Freeze, FR: Freeze, VC: Freeze, HEC: Freeze, FC: Freeze,

§

impl<K, PC, PR, UFPC, UFRC, VC, HEC, FC, ER, FR> RefUnwindSafe for Triangulator<K, PC, PR, UFPC, UFRC, VC, HEC, FC, ER, FR>

§

impl<K, PC, PR, UFPC, UFRC, VC, HEC, FC, ER, FR> Send for Triangulator<K, PC, PR, UFPC, UFRC, VC, HEC, FC, ER, FR>
where PC: Send, PR: Send, UFPC: Send, UFRC: Send, K: Send, ER: Send, FR: Send, VC: Send, HEC: Send, FC: Send,

§

impl<K, PC, PR, UFPC, UFRC, VC, HEC, FC, ER, FR> Sync for Triangulator<K, PC, PR, UFPC, UFRC, VC, HEC, FC, ER, FR>
where PC: Sync, PR: Sync, UFPC: Sync, UFRC: Sync, K: Sync, ER: Sync, FR: Sync, VC: Sync, HEC: Sync, FC: Sync,

§

impl<K, PC, PR, UFPC, UFRC, VC, HEC, FC, ER, FR> Unpin for Triangulator<K, PC, PR, UFPC, UFRC, VC, HEC, FC, ER, FR>
where PC: Unpin, PR: Unpin, UFPC: Unpin, UFRC: Unpin, K: Unpin, ER: Unpin, FR: Unpin, VC: Unpin, HEC: Unpin, FC: Unpin,

§

impl<K, PC, PR, UFPC, UFRC, VC, HEC, FC, ER, FR> UnsafeUnpin for Triangulator<K, PC, PR, UFPC, UFRC, VC, HEC, FC, ER, FR>

§

impl<K, PC, PR, UFPC, UFRC, VC, HEC, FC, ER, FR> UnwindSafe for Triangulator<K, PC, PR, UFPC, UFRC, VC, HEC, FC, ER, FR>
where PC: UnwindSafe, PR: UnwindSafe, UFPC: UnwindSafe, UFRC: UnwindSafe, K: UnwindSafe, ER: UnwindSafe, FR: UnwindSafe, VC: UnwindSafe, HEC: UnwindSafe, FC: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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

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.