pub struct CachedEnvelope<T: RTreeObject> { /* private fields */ }
Expand description
An RTreeObject with an inner geometry whose envelope is cached to improve efficiency.
For complex geometry like polygons, computing the envelope can become a bottleneck during tree construction and querying. Hence this combinator computes it once during creation, stores it and then returns a copy.
Note: the container itself implements RTreeObject and inner geometry T
can be
accessed via an implementation of Deref<Target=T>
.
Implementations§
Source§impl<T: RTreeObject> CachedEnvelope<T>
impl<T: RTreeObject> CachedEnvelope<T>
Sourcepub fn new(inner: T) -> Self
pub fn new(inner: T) -> Self
Create a new CachedEnvelope struct using the provided geometry.
Trait Implementations§
Source§impl<T: Clone + RTreeObject> Clone for CachedEnvelope<T>
impl<T: Clone + RTreeObject> Clone for CachedEnvelope<T>
Source§fn clone(&self) -> CachedEnvelope<T>
fn clone(&self) -> CachedEnvelope<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug + RTreeObject> Debug for CachedEnvelope<T>
impl<T: Debug + RTreeObject> Debug for CachedEnvelope<T>
Source§impl<T: Default + RTreeObject> Default for CachedEnvelope<T>
impl<T: Default + RTreeObject> Default for CachedEnvelope<T>
Source§fn default() -> CachedEnvelope<T>
fn default() -> CachedEnvelope<T>
Returns the “default value” for a type. Read more
Source§impl<T: RTreeObject> Deref for CachedEnvelope<T>
impl<T: RTreeObject> Deref for CachedEnvelope<T>
Source§impl<T: Hash + RTreeObject> Hash for CachedEnvelope<T>
impl<T: Hash + RTreeObject> Hash for CachedEnvelope<T>
Source§impl<T: Ord + RTreeObject> Ord for CachedEnvelope<T>
impl<T: Ord + RTreeObject> Ord for CachedEnvelope<T>
Source§fn cmp(&self, other: &CachedEnvelope<T>) -> Ordering
fn cmp(&self, other: &CachedEnvelope<T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialEq + RTreeObject> PartialEq for CachedEnvelope<T>
impl<T: PartialEq + RTreeObject> PartialEq for CachedEnvelope<T>
Source§impl<T: PartialOrd + RTreeObject> PartialOrd for CachedEnvelope<T>where
T::Envelope: PartialOrd,
impl<T: PartialOrd + RTreeObject> PartialOrd for CachedEnvelope<T>where
T::Envelope: PartialOrd,
Source§impl<T: PointDistance> PointDistance for CachedEnvelope<T>
impl<T: PointDistance> PointDistance for CachedEnvelope<T>
Source§fn distance_2(
&self,
point: &<Self::Envelope as Envelope>::Point,
) -> <<Self::Envelope as Envelope>::Point as Point>::Scalar
fn distance_2( &self, point: &<Self::Envelope as Envelope>::Point, ) -> <<Self::Envelope as Envelope>::Point as Point>::Scalar
Returns the squared distance between an object and a point. Read more
Source§fn contains_point(&self, p: &<Self::Envelope as Envelope>::Point) -> bool
fn contains_point(&self, p: &<Self::Envelope as Envelope>::Point) -> bool
Returns
true
if a point is contained within this object. Read moreSource§fn distance_2_if_less_or_equal(
&self,
point: &<Self::Envelope as Envelope>::Point,
max_distance_2: <<Self::Envelope as Envelope>::Point as Point>::Scalar,
) -> Option<<<Self::Envelope as Envelope>::Point as Point>::Scalar>
fn distance_2_if_less_or_equal( &self, point: &<Self::Envelope as Envelope>::Point, max_distance_2: <<Self::Envelope as Envelope>::Point as Point>::Scalar, ) -> Option<<<Self::Envelope as Envelope>::Point as Point>::Scalar>
Returns the squared distance to this object, or
None
if the distance
is larger than a given maximum value. Read moreSource§impl<T: RTreeObject> RTreeObject for CachedEnvelope<T>
impl<T: RTreeObject> RTreeObject for CachedEnvelope<T>
impl<T: Copy + RTreeObject> Copy for CachedEnvelope<T>
impl<T: Eq + RTreeObject> Eq for CachedEnvelope<T>
impl<T: RTreeObject> StructuralPartialEq for CachedEnvelope<T>
Auto Trait Implementations§
impl<T> Freeze for CachedEnvelope<T>
impl<T> RefUnwindSafe for CachedEnvelope<T>
impl<T> Send for CachedEnvelope<T>
impl<T> Sync for CachedEnvelope<T>
impl<T> Unpin for CachedEnvelope<T>
impl<T> UnwindSafe for CachedEnvelope<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more