pub struct MapSegment {
pub id: Rc<str>,
pub raw_line: RawLine,
pub aabb: AABB<RawPoint>,
}Expand description
A connection line between two points on the map, ready to be stored in an
rstar::RTree.
MapSegment is the line object of the widget: it carries the segment
geometry (RawLine) plus its precomputed axis-aligned bounding box
(AABB), which the R-tree uses as the spatial envelope for broad-phase
viewport culling and hit-testing. Lines are installed with
Map::add_lines, keyed by an id that nodes
reference through MapPoint::connections.
Fields§
§id: Rc<str>Identifier shared with the line key (and with the
MapPoint::connections of the endpoint nodes).
raw_line: RawLineThe segment geometry, in map coordinates.
aabb: AABB<RawPoint>Axis-aligned bounding box of the segment, in map coordinates.
Implementations§
Trait Implementations§
Source§impl Clone for MapSegment
impl Clone for MapSegment
Source§fn clone(&self) -> MapSegment
fn clone(&self) -> MapSegment
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MapSegment
impl Debug for MapSegment
Auto Trait Implementations§
impl !Send for MapSegment
impl !Sync for MapSegment
impl Freeze for MapSegment
impl RefUnwindSafe for MapSegment
impl Unpin for MapSegment
impl UnsafeUnpin for MapSegment
impl UnwindSafe for MapSegment
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more