Skip to main content

Triangulation

Struct Triangulation 

Source
pub struct Triangulation<K: RTreeNum, 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: Clone + Eq + Hash + Mul<Output = K> + Ord + PartialOrd + RTreeNum + Sub<Output = K> + Zero, VC: Get<usize, Value = Vertex<VertexWeight<K>>> + Default + Insert<usize> + KeyedCollection + Push<usize>, HEC: Get<usize, Value = HalfEdge<HalfEdgeWeight>> + Default + Insert<usize> + KeyedCollection + Push<usize>, FC: Get<usize, Value = Face<FaceWeight>> + Default + Insert<usize> + KeyedCollection + Push<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> Triangulation<K, VC, HEC, FC, ER, FR>

Source

pub fn with_mesh(mesh: &[Vec<Vector2<K>>]) -> Self

Source

pub fn insert_mesh(&mut self, mesh: &[Vec<Vector2<K>>]) -> Vec<FaceId>

Source§

impl<K: Clone + RTreeNum + Sub<Output = K> + Mul<Output = K> + PartialOrd + Zero, 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> Triangulation<K, VC, HEC, FC, ER, FR>

Source

pub fn with_triangle(supertriangle: [Vector2<K>; 3]) -> Self

Source

pub fn insert_free_vertex(&mut self, 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, obstacle: impl IntoIterator<Item = [K; 2]>, ) -> FaceId

Source

pub fn remove_obstacle(&mut self, face: FaceId)

Source

pub fn vertex_position(&self, vertex: VertexId) -> Vector2<K>

Source

pub fn rtreed_dcel( &self, ) -> &RTreedDcel<[K; 2], VertexWeight<K>, HalfEdgeWeight, FaceWeight, VC, HEC, FC, ER, FR>

Source

pub fn cut_edges(&mut self, from: Vector2<K>, to: Vector2<K>)

Source

pub fn find_edges_under_cut_proper( &self, from: Vector2<K>, to: Vector2<K>, ) -> impl Iterator<Item = EdgeId>

Source

pub fn find_point_face(&self, position: Vector2<K>) -> FaceId

Source

pub fn face_contains_point(&self, face: FaceId, position: Vector2<K>) -> bool

Source§

impl<K: RTreeNum, VC: Clear, HEC: Clear, FC: Clear + Push<usize, Value = Face<FaceWeight>>, ER: Clear, FR: Clear> Triangulation<K, VC, HEC, FC, ER, FR>

Source

pub fn clear(&mut self)

Trait Implementations§

Source§

impl<K: RTreeNum, 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<Triangulation<K, VCD, HECD, FCD, ERD, FRD>> for Triangulation<K, VC, HEC, FC, ER, FR>

Available on crate feature undoredo only.
Source§

fn apply_delta( &mut self, delta: &Delta<Triangulation<K, VCD, HECD, FCD, ERD, FRD>>, )

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

impl<K: Clone + RTreeNum, VC: Clone, HEC: Clone, FC: Clone, ER: Clone, FR: Clone> Clone for Triangulation<K, VC, HEC, FC, ER, FR>

Source§

fn clone(&self) -> Triangulation<K, 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, VC: Debug, HEC: Debug, FC: Debug, ER: Debug, FR: Debug> Debug for Triangulation<K, 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, 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<Triangulation<K, VCD, HECD, FCD, ERD, FRD>> for Triangulation<K, VC, HEC, FC, ER, FR>

Available on crate feature undoredo only.
Source§

fn flush_delta(&mut self) -> Delta<Triangulation<K, 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, VC, HEC, FC, ER, FR> Freeze for Triangulation<K, VC, HEC, FC, ER, FR>
where ER: Freeze, FR: Freeze, VC: Freeze, HEC: Freeze, FC: Freeze,

§

impl<K, VC, HEC, FC, ER, FR> RefUnwindSafe for Triangulation<K, VC, HEC, FC, ER, FR>

§

impl<K, VC, HEC, FC, ER, FR> Send for Triangulation<K, VC, HEC, FC, ER, FR>
where ER: Send, FR: Send, VC: Send, HEC: Send, FC: Send, K: Send,

§

impl<K, VC, HEC, FC, ER, FR> Sync for Triangulation<K, VC, HEC, FC, ER, FR>
where ER: Sync, FR: Sync, VC: Sync, HEC: Sync, FC: Sync, K: Sync,

§

impl<K, VC, HEC, FC, ER, FR> Unpin for Triangulation<K, VC, HEC, FC, ER, FR>
where ER: Unpin, FR: Unpin, VC: Unpin, HEC: Unpin, FC: Unpin, K: Unpin,

§

impl<K, VC, HEC, FC, ER, FR> UnsafeUnpin for Triangulation<K, VC, HEC, FC, ER, FR>

§

impl<K, VC, HEC, FC, ER, FR> UnwindSafe for Triangulation<K, VC, HEC, FC, ER, FR>
where ER: UnwindSafe, FR: UnwindSafe, VC: UnwindSafe, HEC: UnwindSafe, FC: 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.