pub struct LaneSRange { /* private fields */ }
Expand description
Directed longitudinal range of a specific Lane, identified by a LaneId. Similar to SRange, but associated with a specific Lane.
Implementations§
Source§impl LaneSRange
impl LaneSRange
Sourcepub fn new(lane_id: &String, s_range: &SRange) -> LaneSRange
pub fn new(lane_id: &String, s_range: &SRange) -> LaneSRange
Sourcepub fn lane_id(&self) -> String
pub fn lane_id(&self) -> String
Returns the lane id of the LaneSRange
.
§Returns
A String
containing the id of the lane associated with this LaneSRange
.
Sourcepub fn length(&self) -> f64
pub fn length(&self) -> f64
Returns the length of the LaneSRange
.
This is equivalent to s_range.size()
.
§Returns
A f64
representing the length of the LaneSRange
.
Sourcepub fn intersects(&self, lane_s_range: &LaneSRange, tolerance: f64) -> bool
pub fn intersects(&self, lane_s_range: &LaneSRange, tolerance: f64) -> bool
Sourcepub fn contains(&self, lane_s_range: &LaneSRange, tolerance: f64) -> bool
pub fn contains(&self, lane_s_range: &LaneSRange, tolerance: f64) -> bool
Determines whether this LaneSRange contains lane_s_range
.
§Arguments
lane_s_range
- AnotherLaneSRange
to check if it is contained within this LaneSRange.tolerance
- A tolerance value to consider when checking for containment.
§Returns
A boolean indicating whether this LaneSRange contains lane_s_range
.
This checks if the s_range
of lane_s_range
is fully contained
within the s_range
of this LaneSRange
, considering the lane id.
If the lane id does not match, it returns false.
Sourcepub fn get_intersection(
&self,
lane_s_range: &LaneSRange,
tolerance: f64,
) -> Option<LaneSRange>
pub fn get_intersection( &self, lane_s_range: &LaneSRange, tolerance: f64, ) -> Option<LaneSRange>
Computes the intersection of this LaneSRange
with lane_s_range
.
§Arguments
lane_s_range
- AnotherLaneSRange
to get the intersection with.tolerance
- A tolerance value to consider when checking for intersection.
§Returns
An Option<LaneSRange>
containing the intersection of this LaneSRange
with lane_s_range
.
If the lane ids do not match, it returns None.
If the intersection is empty, it returns None.