stop coloring synthetic/original stuff in map editor. not useful now that it's normal to modify existing stuff

This commit is contained in:
Dustin Carlino 2019-11-06 10:16:06 -08:00
parent 7800ac046e
commit 179009de32
3 changed files with 9 additions and 22 deletions

View File

@ -48,7 +48,6 @@ pub fn split_up_roads(
IntersectionType::StopSign IntersectionType::StopSign
}, },
label: None, label: None,
synthetic: false,
}, },
); );
} }

View File

@ -227,12 +227,7 @@ impl Model {
self.world.add( self.world.add(
prerender, prerender,
Object::new( Object::new(ID::Intersection(id), color, poly).maybe_label(i.label.clone()),
ID::Intersection(id),
if i.synthetic { color.alpha(0.5) } else { color },
poly,
)
.maybe_label(i.label.clone()),
); );
} }
@ -246,7 +241,6 @@ impl Model {
point, point,
intersection_type: IntersectionType::StopSign, intersection_type: IntersectionType::StopSign,
label: None, label: None,
synthetic: true,
}, },
); );
self.intersection_added(id, prerender); self.intersection_added(id, prerender);
@ -567,9 +561,8 @@ impl Model {
fn road_objects(&self, id: OriginalRoad) -> Vec<Object<ID>> { fn road_objects(&self, id: OriginalRoad) -> Vec<Object<ID>> {
let r = &self.map.roads[&id]; let r = &self.map.roads[&id];
let synthetic = r.synthetic();
let unset = let unset =
synthetic && r.osm_tags.get(osm::NAME) == Some(&"Streety McStreetFace".to_string()); r.synthetic() && r.osm_tags.get(osm::NAME) == Some(&"Streety McStreetFace".to_string());
let lanes_unknown = r.osm_tags.contains_key(osm::INFERRED_PARKING) let lanes_unknown = r.osm_tags.contains_key(osm::INFERRED_PARKING)
|| r.osm_tags.contains_key(osm::INFERRED_SIDEWALKS); || r.osm_tags.contains_key(osm::INFERRED_SIDEWALKS);
let spec = r.get_spec(); let spec = r.get_spec();
@ -582,7 +575,7 @@ impl Model {
for (idx, lt) in spec.fwd.iter().enumerate() { for (idx, lt) in spec.fwd.iter().enumerate() {
obj.push( obj.push(
Model::lt_to_color(*lt, synthetic, unset, lanes_unknown), Model::lt_to_color(*lt, unset, lanes_unknown),
center_pts center_pts
.shift_right(LANE_THICKNESS * (0.5 + (idx as f64))) .shift_right(LANE_THICKNESS * (0.5 + (idx as f64)))
.unwrap() .unwrap()
@ -597,7 +590,7 @@ impl Model {
} }
for (idx, lt) in spec.back.iter().enumerate() { for (idx, lt) in spec.back.iter().enumerate() {
obj.push( obj.push(
Model::lt_to_color(*lt, synthetic, unset, lanes_unknown), Model::lt_to_color(*lt, unset, lanes_unknown),
center_pts center_pts
.reversed() .reversed()
.shift_right(LANE_THICKNESS * (0.5 + (idx as f64))) .shift_right(LANE_THICKNESS * (0.5 + (idx as f64)))
@ -637,7 +630,7 @@ impl Model {
} }
// Copied from render/lane.rs. :( // Copied from render/lane.rs. :(
fn lt_to_color(lt: LaneType, synthetic: bool, unset: bool, lanes_unknown: bool) -> Color { fn lt_to_color(lt: LaneType, unset: bool, lanes_unknown: bool) -> Color {
let color = match lt { let color = match lt {
LaneType::Driving => Color::BLACK, LaneType::Driving => Color::BLACK,
LaneType::Bus => Color::rgb(190, 74, 76), LaneType::Bus => Color::rgb(190, 74, 76),
@ -647,14 +640,10 @@ impl Model {
LaneType::SharedLeftTurn => Color::YELLOW, LaneType::SharedLeftTurn => Color::YELLOW,
LaneType::Construction => Color::rgb(255, 109, 0), LaneType::Construction => Color::rgb(255, 109, 0),
}; };
if synthetic { if unset {
if unset { match color {
match color { Color::RGBA(_, g, b, _) => Color::rgba_f(0.9, g, b, 0.5),
Color::RGBA(_, g, b, _) => Color::rgba_f(0.9, g, b, 0.5), _ => unreachable!(),
_ => unreachable!(),
}
} else {
color.alpha(0.5)
} }
} else if lanes_unknown { } else if lanes_unknown {
match color { match color {

View File

@ -534,7 +534,6 @@ pub struct RawIntersection {
pub point: Pt2D, pub point: Pt2D,
pub intersection_type: IntersectionType, pub intersection_type: IntersectionType,
pub label: Option<String>, pub label: Option<String>,
pub synthetic: bool,
} }
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]