Skip to main content

PolygonUnionFind

Struct PolygonUnionFind 

Source
pub struct PolygonUnionFind<K: RTreeNum, PC: KeyedCollection = Vec<Vec<Point2<K>>>, PR: KeyedCollection = AsRefRTree<GeomWithData<Rectangle<[K; 2]>, usize>>, UFPC = Vec<usize>, UFRC = Vec<usize>> { /* private fields */ }

Implementations§

Source§

impl<K: RTreeNum, PC: Default + KeyedCollection, PR: Default + KeyedCollection, UFPC: Default, UFRC: Default> PolygonUnionFind<K, PC, PR, UFPC, UFRC>

Source

pub fn new() -> Self

Source§

impl<K: RTreeNum, PC: KeyedCollection, PR: KeyedCollection, UFPC, UFRC> PolygonUnionFind<K, PC, PR, UFPC, UFRC>

Source

pub fn raw_polygons(&self) -> &PC

Source

pub fn rtree(&self) -> &PR

Source

pub fn unionfind(&self) -> &UnionFind<UFPC, UFRC>

Source

pub fn dissolve(self) -> (PC, PR, UnionFind<UFPC, UFRC>)

Dissolve the polygon-union-find, returning its internal polygons, R-tree, and union-find, ceding ownership over them.

Source§

impl<K: FromPrimitive + RTreeNum + ToPrimitive, PC: Clone + IntoIter<usize> + Get<usize, Value = Vec<Point2<K>>> + Push<usize> + Set<usize>, PR: AsRef<RTree<GeomWithData<Rectangle<[K; 2]>, usize>>> + Insert<GeomWithData<Rectangle<[K; 2]>, usize>, Value = ()>, UFPC: Get<usize, Value = usize> + Push<usize> + Set<usize>, UFRC: Get<usize, Value = usize> + Push<usize> + Set<usize>> PolygonUnionFind<K, PC, PR, UFPC, UFRC>
where Point2<K>: Copy,

Source

pub fn polygons(&mut self) -> impl Iterator<Item = PC::Value>

Source§

impl<K: FromPrimitive + RTreeNum + ToPrimitive, PC: Get<usize, Value = Vec<Point2<K>>> + Push<usize> + Set<usize>, PR: AsRef<RTree<GeomWithData<Rectangle<[K; 2]>, usize>>> + Insert<GeomWithData<Rectangle<[K; 2]>, usize>, Value = ()>, UFPC: Get<usize, Value = usize> + Push<usize> + Set<usize>, UFRC: Get<usize, Value = usize> + Push<usize> + Set<usize>> PolygonUnionFind<K, PC, PR, UFPC, UFRC>
where Point2<K>: Copy,

Source

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

Source§

impl<K: RTreeNum, PC: Clear, PR: Clear, UFPC: Clear, UFRC: Clear> PolygonUnionFind<K, PC, PR, UFPC, UFRC>

Source

pub fn clear(&mut self)

Trait Implementations§

Source§

impl<K: RTreeNum, PCE: Clone + KeyedCollection, PC: KeyedCollection + Clone + ApplyDelta<PCE>, PRE: Clone + KeyedCollection, PR: KeyedCollection + Clone + ApplyDelta<PRE>, UFPCE: Clone + KeyedCollection, UFPC: Clone + ApplyDelta<UFPCE>, UFRCE: Clone + KeyedCollection, UFRC: Clone + ApplyDelta<UFRCE>> ApplyDelta<PolygonUnionFind<K, PCE, PRE, UFPCE, UFRCE>> for PolygonUnionFind<K, PC, PR, UFPC, UFRC>

Available on crate feature undoredo only.
Source§

fn apply_delta( &mut self, delta: &Delta<PolygonUnionFind<K, PCE, PRE, UFPCE, UFRCE>>, )

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> Clone for PolygonUnionFind<K, PC, PR, UFPC, UFRC>

Source§

fn clone(&self) -> PolygonUnionFind<K, PC, PR, UFPC, UFRC>

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> Debug for PolygonUnionFind<K, PC, PR, UFPC, UFRC>

Source§

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

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

impl<K: RTreeNum, PCE: Clone + KeyedCollection, PC: KeyedCollection + FlushDelta<PCE>, PRE: Clone + KeyedCollection, PR: KeyedCollection + FlushDelta<PRE>, UFPCE: Clone + KeyedCollection, UFPC: FlushDelta<UFPCE>, UFRCE: Clone + KeyedCollection, UFRC: FlushDelta<UFRCE>> FlushDelta<PolygonUnionFind<K, PCE, PRE, UFPCE, UFRCE>> for PolygonUnionFind<K, PC, PR, UFPC, UFRC>

Available on crate feature undoredo only.
Source§

fn flush_delta(&mut self) -> Delta<PolygonUnionFind<K, PCE, PRE, UFPCE, UFRCE>>

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

Auto Trait Implementations§

§

impl<K, PC, PR, UFPC, UFRC> Freeze for PolygonUnionFind<K, PC, PR, UFPC, UFRC>
where PC: Freeze, PR: Freeze, UFPC: Freeze, UFRC: Freeze,

§

impl<K, PC, PR, UFPC, UFRC> RefUnwindSafe for PolygonUnionFind<K, PC, PR, UFPC, UFRC>

§

impl<K, PC, PR, UFPC, UFRC> Send for PolygonUnionFind<K, PC, PR, UFPC, UFRC>
where PC: Send, PR: Send, UFPC: Send, UFRC: Send, K: Send,

§

impl<K, PC, PR, UFPC, UFRC> Sync for PolygonUnionFind<K, PC, PR, UFPC, UFRC>
where PC: Sync, PR: Sync, UFPC: Sync, UFRC: Sync, K: Sync,

§

impl<K, PC, PR, UFPC, UFRC> Unpin for PolygonUnionFind<K, PC, PR, UFPC, UFRC>
where PC: Unpin, PR: Unpin, UFPC: Unpin, UFRC: Unpin, K: Unpin,

§

impl<K, PC, PR, UFPC, UFRC> UnsafeUnpin for PolygonUnionFind<K, PC, PR, UFPC, UFRC>
where PC: UnsafeUnpin, PR: UnsafeUnpin, UFPC: UnsafeUnpin, UFRC: UnsafeUnpin,

§

impl<K, PC, PR, UFPC, UFRC> UnwindSafe for PolygonUnionFind<K, PC, PR, UFPC, UFRC>
where PC: UnwindSafe, PR: UnwindSafe, UFPC: UnwindSafe, UFRC: UnwindSafe, K: 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.