Rename building path->driveway, since path is such an overloaded term.

This commit is contained in:
Dustin Carlino 2021-04-13 15:08:26 -07:00
parent 9923c1270a
commit ae6414abd5
8 changed files with 29 additions and 29 deletions

View File

@ -140,7 +140,7 @@ impl App {
}
if layers.show_buildings {
g.redraw(&draw_map.draw_all_buildings);
// Not the building paths
// Not the building driveways
}
// Still show some shape selection when zoomed out.
@ -192,8 +192,8 @@ impl App {
match obj.get_id() {
ID::Building(_) => {
if !drawn_all_buildings {
if opts.show_building_paths {
g.redraw(&draw_map.draw_all_building_paths);
if opts.show_building_driveways {
g.redraw(&draw_map.draw_all_building_driveways);
}
g.redraw(&draw_map.draw_all_buildings);
g.redraw(&draw_map.draw_all_building_outlines);

View File

@ -707,7 +707,7 @@ pub fn apply_map_edits(ctx: &mut EventCtx, app: &mut App, edits: MapEdits) {
if effects.resnapped_buildings {
app.primary
.draw_map
.recreate_building_paths(ctx, &app.primary.map, &app.cs, &app.opts);
.recreate_building_driveways(ctx, &app.primary.map, &app.cs, &app.opts);
}
for pl in effects.changed_parking_lots {
app.primary.draw_map.get_pl(pl).clear_rendering();

View File

@ -312,7 +312,7 @@ impl<A: AppLike> State<A> for OptionsPanel {
ctx.loading_screen("rerendering buildings", |ctx, timer| {
let mut all_buildings = GeomBatch::new();
let mut all_building_outlines = GeomBatch::new();
let mut all_building_paths = GeomBatch::new();
let mut all_building_driveways = GeomBatch::new();
timer
.start_iter("rendering buildings", app.map().all_buildings().len());
for b in app.map().all_buildings() {
@ -326,18 +326,18 @@ impl<A: AppLike> State<A> for OptionsPanel {
&mut all_buildings,
&mut all_building_outlines,
);
DrawBuilding::draw_path(
DrawBuilding::draw_driveway(
b,
app.map(),
app.cs(),
app.opts(),
&mut all_building_paths,
&mut all_building_driveways,
);
}
timer.start("upload geometry");
app.mut_draw_map().draw_all_buildings = all_buildings.upload(ctx);
app.mut_draw_map().draw_all_building_paths =
all_building_paths.upload(ctx);
app.mut_draw_map().draw_all_building_driveways =
all_building_driveways.upload(ctx);
app.mut_draw_map().draw_all_building_outlines =
all_building_outlines.upload(ctx);
timer.stop("upload geometry");

View File

@ -195,12 +195,12 @@ impl DrawBuilding {
}
}
pub fn draw_path(
pub fn draw_driveway(
bldg: &Building,
map: &Map,
cs: &ColorScheme,
opts: &Options,
paths_batch: &mut GeomBatch,
batch: &mut GeomBatch,
) {
if opts.camera_angle != CameraAngle::Abstract {
// Trim the driveway away from the sidewalk's center line, so that it doesn't overlap.
@ -215,7 +215,7 @@ impl DrawBuilding {
.map(|(pl, _)| pl)
.unwrap_or_else(|_| orig_pl.clone());
paths_batch.push(
batch.push(
if opts.color_scheme == ColorSchemeChoice::NightMode {
Color::hex("#4B4B4B")
} else {

View File

@ -32,7 +32,7 @@ pub struct DrawMap {
pub boundary_polygon: Drawable,
pub draw_all_unzoomed_roads_and_intersections: Drawable,
pub draw_all_buildings: Drawable,
pub draw_all_building_paths: Drawable,
pub draw_all_building_driveways: Drawable,
pub draw_all_building_outlines: Drawable,
pub draw_all_unzoomed_parking_lots: Drawable,
pub draw_all_areas: Drawable,
@ -84,7 +84,7 @@ impl DrawMap {
let mut buildings: Vec<DrawBuilding> = Vec::new();
let mut all_buildings = GeomBatch::new();
let mut all_building_outlines = GeomBatch::new();
let mut all_building_paths = GeomBatch::new();
let mut all_building_driveways = GeomBatch::new();
timer.start_iter("make DrawBuildings", map.all_buildings().len());
for b in map.all_buildings() {
timer.next();
@ -97,11 +97,11 @@ impl DrawMap {
&mut all_buildings,
&mut all_building_outlines,
));
DrawBuilding::draw_path(b, map, cs, opts, &mut all_building_paths);
DrawBuilding::draw_driveway(b, map, cs, opts, &mut all_building_driveways);
}
timer.start("upload all buildings");
let draw_all_buildings = all_buildings.upload(ctx);
let draw_all_building_paths = all_building_paths.upload(ctx);
let draw_all_building_driveways = all_building_driveways.upload(ctx);
let draw_all_building_outlines = all_building_outlines.upload(ctx);
timer.stop("upload all buildings");
@ -192,7 +192,7 @@ impl DrawMap {
boundary_polygon,
draw_all_unzoomed_roads_and_intersections,
draw_all_buildings,
draw_all_building_paths,
draw_all_building_driveways,
draw_all_building_outlines,
draw_all_unzoomed_parking_lots,
draw_all_areas,
@ -432,7 +432,7 @@ impl DrawMap {
let mut bldgs_batch = GeomBatch::new();
let mut outlines_batch = GeomBatch::new();
let mut paths_batch = GeomBatch::new();
let mut driveways_batch = GeomBatch::new();
for b in map.all_buildings() {
DrawBuilding::new(
ctx,
@ -443,9 +443,9 @@ impl DrawMap {
&mut bldgs_batch,
&mut outlines_batch,
);
DrawBuilding::draw_path(b, map, cs, app.opts(), &mut paths_batch);
DrawBuilding::draw_driveway(b, map, cs, app.opts(), &mut driveways_batch);
}
batch.append(paths_batch);
batch.append(driveways_batch);
batch.append(bldgs_batch);
batch.append(outlines_batch);
@ -497,7 +497,7 @@ impl DrawMap {
self.roads[road.id.0] = draw;
}
pub fn recreate_building_paths(
pub fn recreate_building_driveways(
&mut self,
ctx: &mut EventCtx,
map: &Map,
@ -506,8 +506,8 @@ impl DrawMap {
) {
let mut batch = GeomBatch::new();
for b in map.all_buildings() {
DrawBuilding::draw_path(b, map, cs, opts, &mut batch);
DrawBuilding::draw_driveway(b, map, cs, opts, &mut batch);
}
self.draw_all_building_paths = ctx.upload(batch);
self.draw_all_building_driveways = ctx.upload(batch);
}
}

View File

@ -78,8 +78,8 @@ pub struct DrawOptions {
pub suppress_traffic_signal_details: Vec<IntersectionID>,
/// Label every building.
pub label_buildings: bool,
/// Draw building paths.
pub show_building_paths: bool,
/// Draw building driveways.
pub show_building_driveways: bool,
}
impl DrawOptions {
@ -88,7 +88,7 @@ impl DrawOptions {
DrawOptions {
suppress_traffic_signal_details: Vec::new(),
label_buildings: false,
show_building_paths: true,
show_building_driveways: true,
}
}
}

View File

@ -121,8 +121,8 @@ impl<T: 'static> SimpleApp<T> {
match obj.get_id() {
ID::Building(_) => {
if !drawn_all_buildings {
if opts.show_building_paths {
g.redraw(&self.draw_map.draw_all_building_paths);
if opts.show_building_driveways {
g.redraw(&self.draw_map.draw_all_building_driveways);
}
g.redraw(&self.draw_map.draw_all_buildings);
g.redraw(&self.draw_map.draw_all_building_outlines);

View File

@ -367,7 +367,7 @@ impl State<App> for Viewer {
app.draw_unzoomed(g);
} else {
let mut opts = DrawOptions::new();
opts.show_building_paths = false;
opts.show_building_driveways = false;
app.draw_zoomed(g, opts);
}