pub struct InferiorQualityZone { /* private fields */ }Expand description
Represents a zone of inferior quality in the Container
Implementations§
Source§impl InferiorQualityZone
impl InferiorQualityZone
Sourcepub fn new(
quality: usize,
original_shapes: Vec<OriginalShape>,
surrogate_config: SPSurrogateConfig,
) -> Result<Self>
pub fn new( quality: usize, original_shapes: Vec<OriginalShape>, surrogate_config: SPSurrogateConfig, ) -> Result<Self>
Converts the shapes for collision detection and generates their surrogates,
so they can be quantified as collision targets.
Returns an error for invalid geometry or a quality outside 0..N_QUALITIES.
Sourcepub fn filtered(&self, f: impl FnMut(&SPolygon) -> bool) -> Self
pub fn filtered(&self, f: impl FnMut(&SPolygon) -> bool) -> Self
Returns a zone with only the shapes whose collision contour satisfies f, in their original order.
Kept shapes are shared, not converted again. Hazard indices refer to the new zone’s order.
Sourcepub fn to_hazards(&self) -> impl Iterator<Item = Hazard>
pub fn to_hazards(&self) -> impl Iterator<Item = Hazard>
Returns the set of hazards induced by this zone.
pub fn area(&self) -> f32
Sourcepub fn quality(&self) -> usize
pub fn quality(&self) -> usize
Quality of this zone. Higher qualities are superior. A zone with quality 0 is treated as a hole.
Sourcepub fn shapes_orig(&self) -> &[Arc<OriginalShape>]
pub fn shapes_orig(&self) -> &[Arc<OriginalShape>]
Contours of this quality-zone as defined in the input file
Trait Implementations§
Source§impl Clone for InferiorQualityZone
impl Clone for InferiorQualityZone
Source§fn clone(&self) -> InferiorQualityZone
fn clone(&self) -> InferiorQualityZone
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for InferiorQualityZone
impl RefUnwindSafe for InferiorQualityZone
impl Send for InferiorQualityZone
impl Sync for InferiorQualityZone
impl Unpin for InferiorQualityZone
impl UnsafeUnpin for InferiorQualityZone
impl UnwindSafe for InferiorQualityZone
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more