Enum graphics_shapes::shape_box::ShapeBox
source · pub enum ShapeBox {
Line(Line),
Rect(Rect),
Triangle(Triangle),
Circle(Circle),
Ellipse(Ellipse),
Polygon(Polygon),
}
Variants§
Trait Implementations§
source§impl ContainsShape for ShapeBox
impl ContainsShape for ShapeBox
source§fn contains_rect(&self, rect: &Rect) -> bool
fn contains_rect(&self, rect: &Rect) -> bool
Returns true if
self
contains rect
source§fn contains_circle(&self, circle: &Circle) -> bool
fn contains_circle(&self, circle: &Circle) -> bool
Returns true if
self
contains circle
source§fn contains_line(&self, line: &Line) -> bool
fn contains_line(&self, line: &Line) -> bool
Returns true if
self
contains line
source§fn contains_triangle(&self, triangle: &Triangle) -> bool
fn contains_triangle(&self, triangle: &Triangle) -> bool
Returns true if
self
contains triangle
source§fn contains_ellipse(&self, ellipse: &Ellipse) -> bool
fn contains_ellipse(&self, ellipse: &Ellipse) -> bool
Returns true if
self
contains ellipse
source§fn contains_polygon(&self, polygon: &Polygon) -> bool
fn contains_polygon(&self, polygon: &Polygon) -> bool
Returns true if
self
contains polygon
source§impl<'de> Deserialize<'de> for ShapeBox
impl<'de> Deserialize<'de> for ShapeBox
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl IntersectsContains for ShapeBox
impl IntersectsContains for ShapeBox
source§impl IntersectsShape for ShapeBox
impl IntersectsShape for ShapeBox
source§fn intersects_rect(&self, rect: &Rect) -> bool
fn intersects_rect(&self, rect: &Rect) -> bool
Returns true if
rect
intersects self
source§fn intersects_circle(&self, circle: &Circle) -> bool
fn intersects_circle(&self, circle: &Circle) -> bool
Returns true if
circle
intersects self
source§fn intersects_line(&self, line: &Line) -> bool
fn intersects_line(&self, line: &Line) -> bool
Returns true if
line
intersects self
source§fn intersects_triangle(&self, triangle: &Triangle) -> bool
fn intersects_triangle(&self, triangle: &Triangle) -> bool
Returns true if
triangle
intersects self
source§fn intersects_ellipse(&self, ellipse: &Ellipse) -> bool
fn intersects_ellipse(&self, ellipse: &Ellipse) -> bool
Returns true if
ellipse
intersects self
source§fn intersects_polygon(&self, polygon: &Polygon) -> bool
fn intersects_polygon(&self, polygon: &Polygon) -> bool
Returns true if
polygon
intersects self
source§impl PartialEq for ShapeBox
impl PartialEq for ShapeBox
source§impl Shape for ShapeBox
impl Shape for ShapeBox
source§fn to_shape_box(&self) -> ShapeBox
fn to_shape_box(&self) -> ShapeBox
Same as clone()
source§fn from_points(_: &[Coord]) -> Selfwhere
Self: Sized,
fn from_points(_: &[Coord]) -> Selfwhere
Self: Sized,
create this shape from a list of points (corners of a shape or tips of a line)
fn rebuild(&self, points: &[Coord]) -> Selfwhere
Self: Sized,
source§fn outline_pixels(&self) -> Vec<Coord>
fn outline_pixels(&self) -> Vec<Coord>
The coords for drawing the shape outline, the points may be in any order
This should be cached rather than called per frame
source§fn filled_pixels(&self) -> Vec<Coord>
fn filled_pixels(&self) -> Vec<Coord>
The coords for drawing the filled shape, the points may be in any order
This should be cached rather than called per frame
source§fn translate_by(&self, delta: Coord) -> Selfwhere
Self: Sized,
fn translate_by(&self, delta: Coord) -> Selfwhere
Self: Sized,
change every point by +
delta
source§fn move_to(&self, point: Coord) -> Selfwhere
Self: Sized,
fn move_to(&self, point: Coord) -> Selfwhere
Self: Sized,
moves the shapes first point to
point
(and changes every other point to match their original distance and angle) Read moresource§fn move_center_to(&self, point: Coord) -> Selfwhere
Self: Sized,
fn move_center_to(&self, point: Coord) -> Selfwhere
Self: Sized,
Moves the shapes center to
point
(and changes every other point to match their original distance and angle) Read moresource§fn rotate_around(&self, degrees: isize, point: Coord) -> Selfwhere
Self: Sized,
fn rotate_around(&self, degrees: isize, point: Coord) -> Selfwhere
Self: Sized,
Rotate shape around a point
fn top_left(&self) -> Coord
fn top_right(&self) -> Coord
fn bottom_left(&self) -> Coord
fn bottom_right(&self) -> Coord
impl StructuralPartialEq for ShapeBox
Auto Trait Implementations§
impl Freeze for ShapeBox
impl RefUnwindSafe for ShapeBox
impl Send for ShapeBox
impl Sync for ShapeBox
impl Unpin for ShapeBox
impl UnwindSafe for ShapeBox
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