[][src]Struct building_blocks_core::extent::ExtentN

pub struct ExtentN<N> {
    pub minimum: PointN<N>,
    pub shape: PointN<N>,
}

An N-dimensional extent. This is mathematically a half-closed interval [a, b) in each dimension.

Fields

minimum: PointN<N>

The least point contained in the extent.

shape: PointN<N>

The length of each dimension.

Implementations

impl<N> ExtentN<N>[src]

pub fn from_min_and_shape(minimum: PointN<N>, shape: PointN<N>) -> Self[src]

The default representation of an extent as the minimum point and shape.

impl<N> ExtentN<N> where
    PointN<N>: Point
[src]

pub fn from_min_and_lub(
    minimum: PointN<N>,
    least_upper_bound: PointN<N>
) -> Self
[src]

An alternative representation of an extent as the minimum point and least upper bound.

pub fn with_minimum(&self, new_min: PointN<N>) -> Self[src]

Translate the extent such that it has new_min as it's new minimum.

pub fn least_upper_bound(&self) -> PointN<N>[src]

The least point p for which all points q in the extent satisfy q < p.

pub fn contains(&self, p: &PointN<N>) -> bool[src]

Returns true iff the point p is contained in this extent.

pub fn add_to_shape(&self, delta: PointN<N>) -> Self[src]

pub fn padded(&self, pad_amount: <PointN<N> as Point>::Scalar) -> Self where
    PointN<N>: Ones,
    <PointN<N> as Point>::Scalar: Add<Output = <PointN<N> as Point>::Scalar>, 
[src]

impl<N> ExtentN<N> where
    PointN<N>: IntegerPoint
[src]

pub fn intersection(&self, other: &Self) -> Self[src]

Returns the extent containing only the points in both self and other.

pub fn is_subset_of(&self, other: &Self) -> bool where
    Self: PartialEq
[src]

impl<N> ExtentN<N> where
    PointN<N>: Point + Ones,
    ExtentN<N>: IntegerExtent<N>, 
[src]

pub fn from_min_and_max(minimum: PointN<N>, max: PointN<N>) -> Self[src]

An alternative representation of an integer extent as the minimum point and maximum point. This only works for integer extents, where there is a unique maximum point.

pub fn max(&self) -> PointN<N>[src]

The unique greatest point in the extent.

Trait Implementations

impl<T> Add<PointN<T>> for ExtentN<T> where
    PointN<T>: Add<Output = PointN<T>>, 
[src]

type Output = Self

The resulting type after applying the + operator.

impl<T> AddAssign<PointN<T>> for ExtentN<T> where
    Self: Copy + Add<PointN<T>, Output = ExtentN<T>>, 
[src]

impl<N: Clone> Clone for ExtentN<N>[src]

impl<N: Copy> Copy for ExtentN<N>[src]

impl<N: Debug> Debug for ExtentN<N>[src]

impl<'de, N> Deserialize<'de> for ExtentN<N> where
    N: Deserialize<'de>, 
[src]

impl<N: Eq> Eq for ExtentN<N>[src]

impl<N: PartialEq> PartialEq<ExtentN<N>> for ExtentN<N>[src]

impl<N> Serialize for ExtentN<N> where
    N: Serialize
[src]

impl<N> StructuralEq for ExtentN<N>[src]

impl<N> StructuralPartialEq for ExtentN<N>[src]

impl<T> Sub<PointN<T>> for ExtentN<T> where
    PointN<T>: Sub<Output = PointN<T>>, 
[src]

type Output = Self

The resulting type after applying the - operator.

impl<T> SubAssign<PointN<T>> for ExtentN<T> where
    Self: Copy + Sub<PointN<T>, Output = ExtentN<T>>, 
[src]

Auto Trait Implementations

impl<N> RefUnwindSafe for ExtentN<N> where
    N: RefUnwindSafe

impl<N> Send for ExtentN<N> where
    N: Send

impl<N> Sync for ExtentN<N> where
    N: Sync

impl<N> Unpin for ExtentN<N> where
    N: Unpin

impl<N> UnwindSafe for ExtentN<N> where
    N: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.