Struct map_model::DiagonalFilter
source · pub struct DiagonalFilter {
pub i: IntersectionID,
pub r1: RoadID,
pub r2: RoadID,
pub filter_type: FilterType,
pub group1: BTreeSet<RoadID>,
pub group2: BTreeSet<RoadID>,
}
Expand description
A diagonal filter exists in an intersection. It’s defined by two roads (the order is arbitrary). When all of the intersection’s roads are sorted in clockwise order, this pair of roads splits the ordering into two groups. Turns in each group are still possible, but not across groups.
Be careful with PartialEq
– see approx_eq
.
Fields§
§i: IntersectionID
§r1: RoadID
§r2: RoadID
§filter_type: FilterType
§group1: BTreeSet<RoadID>
§group2: BTreeSet<RoadID>
Implementations§
source§impl DiagonalFilter
impl DiagonalFilter
sourcepub fn cycle_through_alternatives(
map: &Map,
i: IntersectionID,
filter_type: FilterType
) -> Vec<EditCmd>
pub fn cycle_through_alternatives( map: &Map, i: IntersectionID, filter_type: FilterType ) -> Vec<EditCmd>
The caller must call this in a before_edit
/ redraw_all_icons
“transaction.”
fn new( map: &Map, i: IntersectionID, r1: RoadID, r2: RoadID, filter_type: FilterType ) -> DiagonalFilter
pub fn allows_turn(&self, from: RoadID, to: RoadID) -> bool
pub fn avoid_movements_between_roads(&self) -> Vec<(RoadID, RoadID)>
fn approx_eq(&self, other: &DiagonalFilter) -> bool
Trait Implementations§
source§impl Clone for DiagonalFilter
impl Clone for DiagonalFilter
source§fn clone(&self) -> DiagonalFilter
fn clone(&self) -> DiagonalFilter
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for DiagonalFilter
impl Debug for DiagonalFilter
source§impl<'de> Deserialize<'de> for DiagonalFilter
impl<'de> Deserialize<'de> for DiagonalFilter
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for DiagonalFilter
impl PartialEq for DiagonalFilter
source§fn eq(&self, other: &DiagonalFilter) -> bool
fn eq(&self, other: &DiagonalFilter) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for DiagonalFilter
impl Serialize for DiagonalFilter
impl StructuralPartialEq for DiagonalFilter
Auto Trait Implementations§
impl Freeze for DiagonalFilter
impl RefUnwindSafe for DiagonalFilter
impl Send for DiagonalFilter
impl Sync for DiagonalFilter
impl Unpin for DiagonalFilter
impl UnwindSafe for DiagonalFilter
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more