1use geom::{Bounds, Distance, Pt2D, Tessellation};
4use map_model::{IntersectionID, Map};
5use widgetry::GfxCtx;
6
7pub use crate::render::area::DrawArea;
8pub use crate::render::building::DrawBuilding;
9pub use crate::render::intersection::{calculate_corners, DrawIntersection};
10pub use crate::render::map::DrawMap;
11pub use crate::render::turn::DrawMovement;
12use crate::{AppLike, ID};
13
14mod area;
15mod building;
16mod intersection;
17mod lane;
18mod map;
19mod parking_lot;
20mod road;
21pub mod traffic_signal;
22mod transit_stop;
23mod turn;
24
25pub const BIG_ARROW_THICKNESS: Distance = Distance::const_meters(0.5);
26
27pub const OUTLINE_THICKNESS: Distance = Distance::const_meters(0.5);
28
29pub trait Renderable {
32 fn get_id(&self) -> ID;
33 fn draw(&self, g: &mut GfxCtx, app: &dyn AppLike, opts: &DrawOptions);
35 fn get_zorder(&self) -> isize {
37 -5
38 }
39 fn get_outline(&self, map: &Map) -> Tessellation;
42 fn get_bounds(&self, map: &Map) -> Bounds;
43 fn contains_pt(&self, pt: Pt2D, map: &Map) -> bool;
44}
45
46pub struct DrawOptions {
48 pub suppress_traffic_signal_details: Vec<IntersectionID>,
50 pub label_buildings: bool,
52}
53
54impl DrawOptions {
55 pub fn new() -> DrawOptions {
57 DrawOptions {
58 suppress_traffic_signal_details: Vec::new(),
59 label_buildings: false,
60 }
61 }
62}