Trait shape_core::Shape2D
source · pub trait Shape2D {
type Value;
type VertexIterator<'a>: Iterator<Item = Point<Self::Value>>
where Self: 'a;
type LineIterator<'a>: Iterator<Item = Line<Self::Value>>
where Self: 'a;
// Required methods
fn is_valid(&self) -> bool;
fn boundary(&self) -> Rectangle<Self::Value>;
fn vertices<'a>(&'a self, sample: usize) -> Self::VertexIterator<'a>;
fn edges<'a>(&'a self, sample: usize) -> Self::LineIterator<'a>;
// Provided method
fn normalize(&mut self) -> bool { ... }
}Required Associated Types§
sourcetype VertexIterator<'a>: Iterator<Item = Point<Self::Value>>
where
Self: 'a
type VertexIterator<'a>: Iterator<Item = Point<Self::Value>> where Self: 'a
The value type of the shape.
sourcetype LineIterator<'a>: Iterator<Item = Line<Self::Value>>
where
Self: 'a
type LineIterator<'a>: Iterator<Item = Line<Self::Value>> where Self: 'a
The value type of the shape.
Required Methods§
sourcefn vertices<'a>(&'a self, sample: usize) -> Self::VertexIterator<'a>
fn vertices<'a>(&'a self, sample: usize) -> Self::VertexIterator<'a>
Returns the owned vertices of the shape.
Notice that sample only works for non-linear shapes.
sourcefn edges<'a>(&'a self, sample: usize) -> Self::LineIterator<'a>
fn edges<'a>(&'a self, sample: usize) -> Self::LineIterator<'a>
Returns the owned edges of the shape.
Provided Methods§
Object Safety§
This trait is not object safe.