pub struct MapSegment {
pub id: (usize, usize),
pub point1: [f32; 2],
pub point2: [f32; 2],
}Expand description
A connection line between two points on the map, ready to be stored in an
rstar::RTree.
Mirrors sde::objects::SdeSegment’s shape (id, point1, point2) so
callers that already hold sde connection data can build one with a
straight field-for-field copy; the only structural difference is f32
instead of f64 for the coordinates, matching egui’s own coordinate
type (egui — and therefore this widget — doesn’t work in f64).
Lines are installed with Map::add_hashmap_lines,
keyed by an id that nodes reference through MapPoint::connections.
The bounding box the R-tree uses for broad-phase viewport culling and
hit-testing is computed on demand from point1/point2 in
envelope rather than cached on the
struct, same as SdeSegment.
Fields§
§id: (usize, usize)Identifier shared with the line key (and with the
MapPoint::connections of the endpoint nodes).
point1: [f32; 2]One endpoint of the segment, in map coordinates.
point2: [f32; 2]The other endpoint 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
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MapSegment
Source§impl Debug for MapSegment
impl Debug for MapSegment
Source§impl PartialEq for MapSegment
impl PartialEq for MapSegment
Source§impl RTreeObject for MapSegment
impl RTreeObject for MapSegment
impl StructuralPartialEq for MapSegment
Auto Trait Implementations§
impl Freeze for MapSegment
impl RefUnwindSafe for MapSegment
impl Send for MapSegment
impl Sync 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
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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