Skip to main content

TestGeometry

Trait TestGeometry 

Source
pub trait TestGeometry: Sized + Debug {
    type SubdivideResult: AsRef<[Self]>;
    type TestOrder: AsRef<[usize]>;

    // Required methods
    fn subdivide(&self) -> Self::SubdivideResult;
    fn test_order(&self) -> Self::TestOrder;
    fn should_test(&self, nearest: f32) -> bool;
}
Expand description

A trait for implementing individual geometry tests

See Layer::test. This is a low-level interface and should generally not be directly implemented by users

Required Associated Types§

Required Methods§

Source

fn subdivide(&self) -> Self::SubdivideResult

Subdivide this geometry

This is required to return results in the same order as SpatialIndex::subdivide, both results will be reordered as given by test_order

Source

fn test_order(&self) -> Self::TestOrder

The order in which to test cells

This is used to optimize tests where only the single, nearest, result should be returned

Source

fn should_test(&self, nearest: f32) -> bool

Return whether this geometry is valid and non-empty

nearest may be std::f32::INFINITY

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§