pub struct LineStringSet2<T: GenericVector2> {
    pub internals: Option<Vec<(Aabb2<T>, Vec<T>)>>,
    /* private fields */
}
Expand description

A set of 2d LineString, an aabb + convex_hull. It also contains a list of aabb & convex_hulls of shapes this set has gobbled up. This can be useful for separating out inner regions of the shape.

This struct is intended to contain related shapes. E.g. outlines of letters with holes

Fields§

§internals: Option<Vec<(Aabb2<T>, Vec<T>)>>

Implementations§

source§

impl<T: GenericVector2> LineStringSet2<T>

source

pub fn steal_from(other: &mut LineStringSet2<T>) -> Self

steal the content of ‘other’ leaving it empty

source

pub fn set(&self) -> &Vec<Vec<T>>

source

pub fn with_capacity(capacity: usize) -> Self

source

pub fn get_internals(&self) -> Option<&Vec<(Aabb2<T>, Vec<T>)>>

source

pub fn is_empty(&self) -> bool

source

pub fn push(&mut self, ls: Vec<T>)

source

pub fn get_convex_hull(&self) -> &Option<Vec<T>>

returns the combined convex hull of all the shapes in self.set

source

pub fn calculate_convex_hull(&mut self) -> Result<&Vec<T>, LinestringError>

calculates the combined convex hull of all the shapes in self.set

source

pub fn get_aabb(&self) -> Aabb2<T>

Returns the axis aligned bounding box of this set.

source

pub fn copy_to_3d(&self, plane: Plane) -> LineStringSet3<T::Vector3>

Copy this linestringset2 into a linestringset3, populating the axes defined by ‘plane’ An axis will always try to keep it’s position (e.g. y goes to y if possible). That way the operation is reversible (with regards to axis positions). The empty axis will be set to zero.

source

pub fn take_from(&mut self, other: Self)

drains the ‘other’ container of all shapes and put them into ‘self’

source

pub fn take_from_internal( &mut self, other: &mut Self ) -> Result<(), LinestringError>

drains the ‘other’ container of all shapes and put them into ‘self’ The other container must be entirely ‘inside’ the convex hull of ‘self’ The ‘other’ container must also contain valid ‘internals’ and ‘convex_hull’ fields

source

pub fn apply<F: Fn(T) -> T>(&mut self, f: &F)

Apply an operation over each coordinate in the contained objects. Useful when you want to round the value of each contained coordinate.

Trait Implementations§

source§

impl<T: Clone + GenericVector2> Clone for LineStringSet2<T>

source§

fn clone(&self) -> LineStringSet2<T>

Returns a copy 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<T: GenericVector2> Default for LineStringSet2<T>

source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for LineStringSet2<T>
where T: RefUnwindSafe,

§

impl<T> Send for LineStringSet2<T>

§

impl<T> Sync for LineStringSet2<T>

§

impl<T> Unpin for LineStringSet2<T>
where T: Unpin,

§

impl<T> UnwindSafe for LineStringSet2<T>
where T: 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

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

§

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

§

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.