pub struct MapPoint {
pub coords: [f32; 2],
pub id: usize,
pub name: Option<String>,
pub connections: Vec<(usize, usize)>,
}Expand description
A node on the map: an id, a 2D position and an optional display name.
Mirrors sde::objects::SdePoint’s shape (public coords/id/name/
connections fields) so callers that already hold sde map-query data
can build one with a straight field-for-field copy. Structural
differences from SdePoint:
f32instead off64forcoords, matchingegui’s own coordinate type.- 2 components instead of 3: this widget only ever renders a 2D map, so there’s no third axis to carry.
idis a plainusize, notOption<usize>.SdePointusesNonefor a bare coordinate with no entity behind it (e.g. a bounding-box corner); everyMapPointloaded into the widget represents a real, placed node whose id is used directly as the point-setHashMapkey and the kd-tree payload (see [Map::add_hashmap_points]), so an optional id would just push an.unwrap()(or a silently dropped node) into those call sites with no caller ever passingNone.
Nodes are loaded into the widget through
Map::add_hashmap_points, keyed by their
id.
Fields§
§coords: [f32; 2]Position of the node, in map coordinates.
id: usizeNode identifier, used for lookups, notifications and markers.
name: Option<String>Display name shown next to the node; None if it was never set.
connections: Vec<(usize, usize)>Ids of the lines connecting this node with others.
Each entry must match a key of the map passed to
Map::add_hashmap_lines (and
MapSegment::id). The usual pattern is to push the same pair into
the connections of both endpoint nodes. Line visibility is
computed from the segment bounding boxes (R-tree), not from node
visibility, so a line is drawn whenever its bounding box intersects
the viewport.
Implementations§
Trait Implementations§
impl StructuralPartialEq for MapPoint
Auto Trait Implementations§
impl Freeze for MapPoint
impl RefUnwindSafe for MapPoint
impl Send for MapPoint
impl Sync for MapPoint
impl Unpin for MapPoint
impl UnsafeUnpin for MapPoint
impl UnwindSafe for MapPoint
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> 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