pub trait WithinStrategy<P: PointTrait, G> {
// Required methods
fn within(&self, p: &P, g: &G) -> bool;
fn covered_by(&self, p: &P, g: &G) -> bool;
}Expand description
A strategy for point-in-geometry containment.
Mirrors the per-CS within strategy concept declared in
boost/geometry/strategies/within.hpp and refined per coordinate
system in strategies/cartesian/point_in_poly_winding.hpp /
strategies/spherical/point_in_poly_winding.hpp. The Boost concept
exposes a stateful apply(point, s1, s2, state) accumulator plus a
final result(state) reduction; the Rust analogue collapses the
two phases into a single within / covered_by pair keyed on the
geometry type, because the per-segment walk shape is identical for
every CS — only the per-segment kernel changes.
Required Methods§
Sourcefn within(&self, p: &P, g: &G) -> bool
fn within(&self, p: &P, g: &G) -> bool
true iff p lies in the strict interior of g.
Mirrors boost::geometry::within(p, g, strategy) from
boost/geometry/algorithms/within.hpp resolved through
cartesian_winding::result == 1 at
strategy/cartesian/point_in_poly_winding.hpp:69-74.
Sourcefn covered_by(&self, p: &P, g: &G) -> bool
fn covered_by(&self, p: &P, g: &G) -> bool
true iff p lies in the strict interior or on the
boundary of g.
Mirrors boost::geometry::covered_by(p, g, strategy) from
boost/geometry/algorithms/covered_by.hpp resolved through
cartesian_winding::result >= 0 at the same lines.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".