1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use crate::graphics::{Point, Rectangle};
/// A geometric figure.
#[derive(Debug, Clone, PartialEq)]
pub enum Shape {
/// A rectangle
Rectangle(Rectangle<f32>),
/// A circle
Circle {
/// The center of the circle
center: Point,
/// The radius of the circle
radius: f32,
},
/// An ellipse
Ellipse {
/// The center of the ellipse
center: Point,
/// The horizontal radius of the ellipse
horizontal_radius: f32,
/// The vertical radius of the ellipse
vertical_radius: f32,
/// The rotation of the ellipse in radians
rotation: f32,
},
/// A polyline
Polyline {
/// The points of the polyline
points: Vec<Point>,
},
}