pub struct Intersection<L, R> {
pub point: [f64; 2],
pub left: L,
pub right: R,
}Expand description
Intersection point and indices of the “left” and “right” composite types.
This struct is used as the Iterator::Item of the iterators created by the
intersection methods of the Composite trait. It contains the intersection
point itself as well as the segment keys of the involved composite types.
These keys (SegmentIdx or ShapeIdx) can be used to retrieve the segments
from the composite types where the intersection occurred (see
Composite::segment).
Fields§
§point: [f64; 2]The intersection point itself.
left: LKey to retrieve the intersected segment of the “left” side composite
(self for the intersection functions in Composite).
right: RKey to retrieve the intersected segment of the “right” side composite
(the second argument of the intersection functions in Composite).
Implementations§
Source§impl<L, R> Intersection<L, R>
impl<L, R> Intersection<L, R>
Sourcepub fn switch(self) -> Intersection<R, L>
pub fn switch(self) -> Intersection<R, L>
Switches the left and ``rightfields ofSelf`.
Source§impl Intersection<ShapeIdx, ShapeIdx>
impl Intersection<ShapeIdx, ShapeIdx>
Sourcepub fn draw(
&self,
style: &IntersectionStyle,
left: Option<(&Shape, &Style)>,
right: Option<(&Shape, &Style)>,
context: &Context,
) -> Result<(), Error>
pub fn draw( &self, style: &IntersectionStyle, left: Option<(&Shape, &Style)>, right: Option<(&Shape, &Style)>, context: &Context, ) -> Result<(), Error>
Draws the intersection between two Shapes onto the given
cairo::Context using the given IntersectionStyle.
Optionally, the intersected segments of the involved composite types
SegmentChain, Contour or Shape can also
be drawn onto the canvas if the corresponding (&Composite, &Style) tuple
is provided. See the module documentation
for an example.
Source§impl Intersection<ShapeIdx, SegmentIdx>
impl Intersection<ShapeIdx, SegmentIdx>
Sourcepub fn draw(
&self,
style: &IntersectionStyle,
left: Option<(&Shape, &Style)>,
right: Option<(&SegmentChain, &Style)>,
context: &Context,
) -> Result<(), Error>
pub fn draw( &self, style: &IntersectionStyle, left: Option<(&Shape, &Style)>, right: Option<(&SegmentChain, &Style)>, context: &Context, ) -> Result<(), Error>
Draws the intersection between a Shape and a SegmentChain onto the
given cairo::Context using the given IntersectionStyle.
Optionally, the intersected segments of the involved composite types
SegmentChain, Contour or Shape can also
be drawn onto the canvas if the corresponding (&Composite, &Style) tuple
is provided. See the module documentation
for an example.
Source§impl Intersection<SegmentIdx, ShapeIdx>
impl Intersection<SegmentIdx, ShapeIdx>
Sourcepub fn draw(
&self,
style: &IntersectionStyle,
left: Option<(&SegmentChain, &Style)>,
right: Option<(&Shape, &Style)>,
context: &Context,
) -> Result<(), Error>
pub fn draw( &self, style: &IntersectionStyle, left: Option<(&SegmentChain, &Style)>, right: Option<(&Shape, &Style)>, context: &Context, ) -> Result<(), Error>
Draws the intersection between a SegmentChain and a Shape onto the
given cairo::Context using the given IntersectionStyle.
Optionally, the intersected segments of the involved composite types
SegmentChain, Contour or Shape can also
be drawn onto the canvas if the corresponding (&Composite, &Style) tuple
is provided. See the module documentation
for an example.
Source§impl Intersection<ShapeIdx, ()>
impl Intersection<ShapeIdx, ()>
Sourcepub fn draw(
&self,
style: &IntersectionStyle,
left: Option<(&Shape, &Style)>,
context: &Context,
) -> Result<(), Error>
pub fn draw( &self, style: &IntersectionStyle, left: Option<(&Shape, &Style)>, context: &Context, ) -> Result<(), Error>
Draws the intersection between a Shape and a
Primitive onto the given cairo::Context
using the given IntersectionStyle.
Optionally, the intersected segments of the involved composite types
SegmentChain, Contour or Shape can also
be drawn onto the canvas if the corresponding (&Composite, &Style) tuple
is provided. See the module documentation
for an example.
Source§impl Intersection<(), ShapeIdx>
impl Intersection<(), ShapeIdx>
Sourcepub fn draw(
&self,
style: &IntersectionStyle,
right: Option<(&Shape, &Style)>,
context: &Context,
) -> Result<(), Error>
pub fn draw( &self, style: &IntersectionStyle, right: Option<(&Shape, &Style)>, context: &Context, ) -> Result<(), Error>
Draws the intersection between a Primitive
and a Shape onto the given cairo::Context using the given
IntersectionStyle.
Optionally, the intersected segments of the involved composite types
SegmentChain, Contour or Shape can also
be drawn onto the canvas if the corresponding (&Composite, &Style) tuple
is provided. See the module documentation
for an example.
Source§impl Intersection<SegmentIdx, SegmentIdx>
impl Intersection<SegmentIdx, SegmentIdx>
Sourcepub fn draw(
&self,
style: &IntersectionStyle,
left: Option<(&SegmentChain, &Style)>,
right: Option<(&SegmentChain, &Style)>,
context: &Context,
) -> Result<(), Error>
pub fn draw( &self, style: &IntersectionStyle, left: Option<(&SegmentChain, &Style)>, right: Option<(&SegmentChain, &Style)>, context: &Context, ) -> Result<(), Error>
Draws the intersection between two SegmentChains onto the given
cairo::Context using the given IntersectionStyle.
Optionally, the intersected segments of the involved composite types
SegmentChain, Contour or Shape can also
be drawn onto the canvas if the corresponding (&Composite, &Style) tuple
is provided. See the module documentation
for an example.
Source§impl Intersection<SegmentIdx, ()>
impl Intersection<SegmentIdx, ()>
Sourcepub fn draw(
&self,
style: &IntersectionStyle,
left: Option<(&SegmentChain, &Style)>,
context: &Context,
) -> Result<(), Error>
pub fn draw( &self, style: &IntersectionStyle, left: Option<(&SegmentChain, &Style)>, context: &Context, ) -> Result<(), Error>
Draws the intersection between a SegmentChain and a
Primitive onto the given cairo::Context
using the given IntersectionStyle.
Optionally, the intersected segments of the involved composite types
SegmentChain, Contour or Shape can also
be drawn onto the canvas if the corresponding (&Composite, &Style) tuple
is provided. See the module documentation
for an example.
Source§impl Intersection<(), SegmentIdx>
impl Intersection<(), SegmentIdx>
Sourcepub fn draw(
&self,
style: &IntersectionStyle,
right: Option<(&SegmentChain, &Style)>,
context: &Context,
) -> Result<(), Error>
pub fn draw( &self, style: &IntersectionStyle, right: Option<(&SegmentChain, &Style)>, context: &Context, ) -> Result<(), Error>
Draws the intersection between a Primitive
and a SegmentChain onto the given cairo::Context using the given
IntersectionStyle.
Optionally, the intersected segments of the involved composite types
SegmentChain, Contour or Shape can also
be drawn onto the canvas if the corresponding (&Composite, &Style) tuple
is provided. See the module documentation
for an example.
Source§impl Intersection<(), ()>
impl Intersection<(), ()>
Sourcepub fn draw(
&self,
style: &IntersectionStyle,
context: &Context,
) -> Result<(), Error>
pub fn draw( &self, style: &IntersectionStyle, context: &Context, ) -> Result<(), Error>
Draws the intersection between two
Primitives onto the given
cairo::Context using the given IntersectionStyle.
Optionally, the intersected segments of the involved composite types
SegmentChain, Contour or Shape can also
be drawn onto the canvas if the corresponding (&Composite, &Style) tuple
is provided. See the module documentation
for an example.
Trait Implementations§
Source§impl<L: PartialEq, R: PartialEq> AbsDiffEq for Intersection<L, R>
impl<L: PartialEq, R: PartialEq> AbsDiffEq for Intersection<L, R>
Source§fn default_epsilon() -> f64
fn default_epsilon() -> f64
Source§fn abs_diff_eq(&self, other: &Self, epsilon: f64) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: f64) -> bool
Source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
AbsDiffEq::abs_diff_eq.Source§impl<L: Clone, R: Clone> Clone for Intersection<L, R>
impl<L: Clone, R: Clone> Clone for Intersection<L, R>
Source§fn clone(&self) -> Intersection<L, R>
fn clone(&self) -> Intersection<L, R>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<L: PartialEq, R: PartialEq> RelativeEq for Intersection<L, R>
impl<L: PartialEq, R: PartialEq> RelativeEq for Intersection<L, R>
Source§fn default_max_relative() -> f64
fn default_max_relative() -> f64
Source§fn relative_eq(&self, other: &Self, epsilon: f64, max_relative: f64) -> bool
fn relative_eq(&self, other: &Self, epsilon: f64, max_relative: f64) -> bool
Source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
RelativeEq::relative_eq.Source§impl<L: PartialEq, R: PartialEq> UlpsEq for Intersection<L, R>
impl<L: PartialEq, R: PartialEq> UlpsEq for Intersection<L, R>
impl<L: Copy, R: Copy> Copy for Intersection<L, R>
impl<L, R> StructuralPartialEq for Intersection<L, R>
Auto Trait Implementations§
impl<L, R> Freeze for Intersection<L, R>
impl<L, R> RefUnwindSafe for Intersection<L, R>where
L: RefUnwindSafe,
R: RefUnwindSafe,
impl<L, R> Send for Intersection<L, R>
impl<L, R> Sync for Intersection<L, R>
impl<L, R> Unpin for Intersection<L, R>
impl<L, R> UnsafeUnpin for Intersection<L, R>where
L: UnsafeUnpin,
R: UnsafeUnpin,
impl<L, R> UnwindSafe for Intersection<L, R>where
L: UnwindSafe,
R: UnwindSafe,
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
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>
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>
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