[−][src]Struct building_blocks_core::extent::ExtentN
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]
PointN<N>: Point,
pub fn from_min_and_lub(
minimum: PointN<N>,
least_upper_bound: PointN<N>
) -> Self
[src]
minimum: PointN<N>,
least_upper_bound: PointN<N>
) -> Self
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]
PointN<N>: Ones,
<PointN<N> as Point>::Scalar: Add<Output = <PointN<N> as Point>::Scalar>,
impl<N> ExtentN<N> where
PointN<N>: IntegerPoint,
[src]
PointN<N>: IntegerPoint,
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]
Self: PartialEq,
impl<N> ExtentN<N> where
PointN<N>: Point + Ones,
ExtentN<N>: IntegerExtent<N>,
[src]
PointN<N>: Point + Ones,
ExtentN<N>: IntegerExtent<N>,
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]
PointN<T>: Add<Output = PointN<T>>,
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: PointN<T>) -> Self::Output
[src]
impl<T> AddAssign<PointN<T>> for ExtentN<T> where
Self: Copy + Add<PointN<T>, Output = ExtentN<T>>,
[src]
Self: Copy + Add<PointN<T>, Output = ExtentN<T>>,
fn add_assign(&mut self, rhs: PointN<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]
N: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
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]
N: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
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]
PointN<T>: Sub<Output = PointN<T>>,
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: PointN<T>) -> Self::Output
[src]
impl<T> SubAssign<PointN<T>> for ExtentN<T> where
Self: Copy + Sub<PointN<T>, Output = ExtentN<T>>,
[src]
Self: Copy + Sub<PointN<T>, Output = ExtentN<T>>,
fn sub_assign(&mut self, rhs: PointN<T>)
[src]
Auto Trait Implementations
impl<N> RefUnwindSafe for ExtentN<N> where
N: RefUnwindSafe,
N: RefUnwindSafe,
impl<N> Send for ExtentN<N> where
N: Send,
N: Send,
impl<N> Sync for ExtentN<N> where
N: Sync,
N: Sync,
impl<N> Unpin for ExtentN<N> where
N: Unpin,
N: Unpin,
impl<N> UnwindSafe for ExtentN<N> where
N: UnwindSafe,
N: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,