Struct crater::cuboid::CuRegion

source ·
pub struct CuRegion<T, const N: usize>
where T: Ord + Clone + NumRef,
{ pub start: CuPoint<T, N>, pub end: CuPoint<T, N>, }
Expand description

Represents an axis aligned cuboid region in N-dimensional Euclidean space whose coordinates are numeric type T

Fields§

§start: CuPoint<T, N>§end: CuPoint<T, N>

Trait Implementations§

source§

impl<T, const N: usize> Clone for CuRegion<T, N>
where T: Ord + Clone + NumRef + Clone,

source§

fn clone(&self) -> CuRegion<T, N>

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, const N: usize> Debug for CuRegion<T, N>
where T: Ord + Clone + NumRef + Debug,

source§

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

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

impl<T, const N: usize> KdRegion for CuRegion<T, N>
where T: Ord + Clone + NumRef,

§

type Point = CuPoint<T, N>

source§

fn split(&self, point: &Self::Point, layer: usize) -> (Self, Self)

Given a point p in this region A and a layer l, split A into two subregions B and C so that: Read more
source§

fn min_sqdist(&self, point: &Self::Point) -> T

Return the minimal squared distance any point in this region could have to a given point. The return value must be <= KdPoint::sqdist between the given point and any point within this region. It’s safe to return a smaller value, or even always return Distance::zero(), but this degrades performance because we can’t prune subtrees from the search. If B is a subregion of A and p is a point not in A, then B.min_sqdist(p) >= A.min_sqdist(p)
source§

fn max_sqdist(&self, point: &Self::Point) -> Option<T>

Return the maximal squared distance any point in this region could have to a given point, or None if infinite. The return value must be >= KdPoint::sqdist between the given point and any point within this region. None is considered infinitely far away. It’s safe to return a larger value, or even always return None, but this may degrade performace for some queries that cull based on minimal distance. Currently, this only happens for kdtree::KdTree::k_closest where [kdtree::QueryOptions::lower_bound] is kdtree::QueryBound::SqDist. If B is a subregion of A and p is a point not in A, then B.max_sqdist(p) <= A.max_sqdist(p).
source§

fn might_overlap(&self, other: &Self) -> bool

Return true if this region and another region might overlap, or false if they are definitely disjoint. Conservative implementors can always return true. Currently only used by kdtree::KdTree::k_closest if kdtree::QueryOptions::outer_bound is kdtree::QueryBound::Region.
source§

fn is_superset(&self, other: &Self) -> bool

Return true if this region is DEFINITELY a superset of another region, or false if it is not. A may be a superset of B even if B is internally tangent to A or B is A. May return false even if self is a superset of other, if it would be expensive or difficult to compute correctly. Currently only used by kdtree::KdTree::k_closest if kdtree::QueryOptions::inner_bound is kdtree::QueryBound::Region
source§

fn extend(&mut self, point: &Self::Point)

Given a region and a point possibly not in the region, extend the region to include the point if necessary. The concrete requirements this places on the implementation are that self.min_sqdist(q) can only decrease or remain the same for any fixed q, and in particular self.extend(q) should cause self.min_sqdist(q) to be 0 if it wasn’t already
source§

fn single_point(point: &Self::Point) -> Self

Create a region consisting of a single point. For cuboid regions for example, this is represented as a cuboid whose inclusive “start” and “end” points are both the same. Types implementing this trait should be able to represent single points fairly well, but because of the conservative nature of everything, it is acceptable to fudge it by having a very small region containing the point. It’s not necessary for types to be able to represent an empty region well or even at all.
source§

impl<T: Ord + Copy + NumRef, const N: usize> Copy for CuRegion<T, N>

Auto Trait Implementations§

§

impl<T, const N: usize> RefUnwindSafe for CuRegion<T, N>
where T: RefUnwindSafe,

§

impl<T, const N: usize> Send for CuRegion<T, N>
where T: Send,

§

impl<T, const N: usize> Sync for CuRegion<T, N>
where T: Sync,

§

impl<T, const N: usize> Unpin for CuRegion<T, N>
where T: Unpin,

§

impl<T, const N: usize> UnwindSafe for CuRegion<T, N>
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.

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V