maliput
LaneSRange Class Reference

Detailed Description

Directed longitudinal range of a specific Lane, identified by a LaneId.

#include <include/maliput/api/regions.h>

Public Member Functions

 MALIPUT_DEFAULT_COPY_AND_MOVE_AND_ASSIGN (LaneSRange)
 
 LaneSRange (const LaneId &lane_id, const SRange &s_range)
 Constructs a LaneSRange as s_range on Lane lane_id. More...
 
const LaneIdlane_id () const
 Gets the LaneId. More...
 
SRange s_range () const
 Gets the SRange. More...
 
double length () const
 Returns the length of this LaneSRange, which is dictated by the SRange. More...
 
bool Intersects (const LaneSRange &lane_s_range, double tolerance) const
 Determines whether this LaneSRange intersects with lane_s_range. More...
 
bool Contains (const LaneSRange &lane_s_range, double tolerance) const
 Determines whether this LaneSRange contains lane_s_range. More...
 
std::optional< LaneSRangeGetIntersection (const LaneSRange &lane_s_range, double tolerance) const
 Computes a std::optional<LaneSRange> bearing the intersected LaneSRange that results overlapping this LaneSRange with lane_s_range. More...
 

Constructor & Destructor Documentation

◆ LaneSRange()

LaneSRange ( const LaneId lane_id,
const SRange s_range 
)

Constructs a LaneSRange as s_range on Lane lane_id.

Parameters
lane_idRefers to the Lane this LaneSRange belongs to.
s_rangeThe SRange in the lane_id Lane.

Member Function Documentation

◆ Contains()

bool Contains ( const LaneSRange lane_s_range,
double  tolerance 
) const

Determines whether this LaneSRange contains lane_s_range.

tolerance will modify this LaneSRanges's ranges and lane_s_range 's ranges by increasing the maximum and reducing the minimum of each range. When tolerance is negative, it shrinks both ranges.

Parameters
lane_s_rangeThe LaneSRange to evaluate whether it is included into this LaneSRange.
toleranceThe tolerance to use to evaluate the inclusion with.
Returns
true When lane_s_range is contained within this LaneSRange.

◆ GetIntersection()

std::optional< LaneSRange > GetIntersection ( const LaneSRange lane_s_range,
double  tolerance 
) const

Computes a std::optional<LaneSRange> bearing the intersected LaneSRange that results overlapping this LaneSRange with lane_s_range.

When there is no common area, std::nullopt is returned.

tolerance will modify this range and lane_s_range by increasing the maximum and reducing the minimum of each range. When tolerance is negative, it shrinks both ranges.

Parameters
lane_s_rangeThe LaneSRange to compute the intersection with.
toleranceThe tolerance to use to evaluate the intersection.
Returns
A std::optional<LaneSRange> with the intersected LaneSRange.

◆ Intersects()

bool Intersects ( const LaneSRange lane_s_range,
double  tolerance 
) const

Determines whether this LaneSRange intersects with lane_s_range.

LaneIds are evaluated prior calling SRange::Intersects() method.

tolerance will modify this LaneSRanges's ranges and lane_s_range 's ranges by increasing the maximum and reducing the minimum of each range. When tolerance is negative, it shrinks both ranges.

Parameters
lane_s_rangeThe LaneSRange to compute the intersection with.
toleranceThe tolerance to use to evaluate the intersection.
Returns
true When lane_s_range intersects this LaneSRange.

◆ lane_id()

const LaneId& lane_id ( ) const

Gets the LaneId.

Returns
The LaneId.

◆ length()

double length ( ) const

Returns the length of this LaneSRange, which is dictated by the SRange.

Returns
The SRange's size.

◆ MALIPUT_DEFAULT_COPY_AND_MOVE_AND_ASSIGN()

MALIPUT_DEFAULT_COPY_AND_MOVE_AND_ASSIGN ( LaneSRange  )

◆ s_range()

SRange s_range ( ) const

Gets the SRange.

Returns
The SRange.

The documentation for this class was generated from the following files: