Struct pixels_graphics_lib::prelude::Ellipse
source · pub struct Ellipse { /* private fields */ }
Implementations§
source§impl Ellipse
impl Ellipse
pub fn as_rect(&self) -> Rect
pub fn as_horizontal_line(&self) -> Line
pub fn as_vertical_line(&self) -> Line
sourcepub fn as_radius_line(&self) -> Line
pub fn as_radius_line(&self) -> Line
Create line from center to top edge at 0 degrees
sourcepub fn as_circle(&self) -> Option<Circle>
pub fn as_circle(&self) -> Option<Circle>
Returns a circle if the ellipse height and width are the same
pub fn as_largest_circle(&self) -> Circle
pub fn as_smallest_circle(&self) -> Circle
pub fn as_polygon(&self) -> Polygon
Trait Implementations§
source§impl ContainsShape for Ellipse
impl ContainsShape for Ellipse
source§fn contains_circle(&self, circle: &Circle) -> bool
fn contains_circle(&self, circle: &Circle) -> bool
Returns true if
self
contains circle
source§fn contains_ellipse(&self, ellipse: &Ellipse) -> bool
fn contains_ellipse(&self, ellipse: &Ellipse) -> bool
Returns true if
self
contains ellipse
source§fn contains_rect(&self, rect: &Rect) -> boolwhere
Self: Shape + Sized,
fn contains_rect(&self, rect: &Rect) -> boolwhere Self: Shape + Sized,
Returns true if
self
contains rect
source§fn contains_line(&self, line: &Line) -> boolwhere
Self: Shape + Sized,
fn contains_line(&self, line: &Line) -> boolwhere Self: Shape + Sized,
Returns true if
self
contains line
source§impl IntersectsContains for Ellipse
impl IntersectsContains for Ellipse
source§impl IntersectsShape for Ellipse
impl IntersectsShape for Ellipse
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<Ellipse> for Ellipse
impl PartialEq<Ellipse> for Ellipse
source§impl Shape for Ellipse
impl Shape for Ellipse
source§fn from_points(points: &[Coord]) -> Ellipsewhere
Ellipse: Sized,
fn from_points(points: &[Coord]) -> Ellipsewhere Ellipse: Sized,
must be [center, top, right] see Ellipse::points
source§fn points(&self) -> Vec<Coord, Global>
fn points(&self) -> Vec<Coord, Global>
Returns [center, top, right]
- Center is center point
- Top is center - height/2, at 0 degrees
- Right is center + width/2, at 90 degrees
fn rebuild(&self, points: &[Coord]) -> Ellipsewhere Ellipse: Sized,
source§fn translate_by(&self, delta: Coord) -> Ellipse
fn translate_by(&self, delta: Coord) -> Ellipse
change every point by +
delta
source§fn move_to(&self, point: Coord) -> Ellipse
fn move_to(&self, point: Coord) -> Ellipse
moves the shapes first point to
point
(and changes every other point to match their original distance and angle) Read moresource§fn outline_pixels(&self) -> Vec<Coord, Global>
fn outline_pixels(&self) -> Vec<Coord, Global>
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, Global>
fn filled_pixels(&self) -> Vec<Coord, Global>
The coords for drawing the filled shape, the points may be in any order
This should be cached rather than called per frame
fn to_shape_box(&self) -> ShapeBox
source§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 Eq for Ellipse
impl StructuralEq for Ellipse
impl StructuralPartialEq for Ellipse
Auto Trait Implementations§
impl RefUnwindSafe for Ellipse
impl Send for Ellipse
impl Sync for Ellipse
impl Unpin for Ellipse
impl UnwindSafe for Ellipse
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.