mirror of
https://github.com/a-b-street/abstreet.git
synced 2025-01-01 19:04:50 +03:00
deleting a synthetic created thing is modeled more simply
This commit is contained in:
parent
d86f4a6e89
commit
bc7c9cb692
@ -146,8 +146,9 @@ impl Model {
|
|||||||
// It's easiest to just go back and detect all of the added roads and intersections. But we
|
// It's easiest to just go back and detect all of the added roads and intersections. But we
|
||||||
// have to avoid picking up changes from other fixes.
|
// have to avoid picking up changes from other fixes.
|
||||||
// TODO Ideally fixes would have a Polygon of where they influence, and all of the polygons
|
// TODO Ideally fixes would have a Polygon of where they influence, and all of the polygons
|
||||||
// would be disjoint. Nothing prevents fixes from being saved in the wrong group -- we're
|
// would be disjoint. Nothing prevents fixes from being saved in the wrong group, or a
|
||||||
// just sure that a fix isn't repeated.
|
// created road from one set to be deleted in another -- we're just sure that a fix isn't
|
||||||
|
// repeated.
|
||||||
let mut ignore_roads: BTreeSet<OriginalRoad> = BTreeSet::new();
|
let mut ignore_roads: BTreeSet<OriginalRoad> = BTreeSet::new();
|
||||||
let mut ignore_intersections: BTreeSet<OriginalIntersection> = BTreeSet::new();
|
let mut ignore_intersections: BTreeSet<OriginalIntersection> = BTreeSet::new();
|
||||||
for f in self.all_fixes.values() {
|
for f in self.all_fixes.values() {
|
||||||
@ -333,11 +334,13 @@ impl Model {
|
|||||||
self.world.delete(ID::Intersection(id));
|
self.world.delete(ID::Intersection(id));
|
||||||
|
|
||||||
if let Some(ref name) = self.edit_fixes {
|
if let Some(ref name) = self.edit_fixes {
|
||||||
|
if !i.synthetic {
|
||||||
self.all_fixes
|
self.all_fixes
|
||||||
.get_mut(name)
|
.get_mut(name)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.delete_intersections
|
.delete_intersections
|
||||||
.push(i.orig_id);
|
.push(i.orig_id);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
println!("This won't be saved in any MapFixes!");
|
println!("This won't be saved in any MapFixes!");
|
||||||
}
|
}
|
||||||
@ -498,11 +501,13 @@ impl Model {
|
|||||||
self.roads_per_intersection.remove(r.i2, id);
|
self.roads_per_intersection.remove(r.i2, id);
|
||||||
|
|
||||||
if let Some(ref name) = self.edit_fixes {
|
if let Some(ref name) = self.edit_fixes {
|
||||||
|
if r.osm_tags.get(osm::SYNTHETIC) != Some(&"true".to_string()) {
|
||||||
self.all_fixes
|
self.all_fixes
|
||||||
.get_mut(name)
|
.get_mut(name)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.delete_roads
|
.delete_roads
|
||||||
.push(r.orig_id);
|
.push(r.orig_id);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
println!("This won't be saved in any MapFixes!");
|
println!("This won't be saved in any MapFixes!");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user