Go to the documentation of this file.
13 struct GetGeometry<T,
IfAr<T, void>> {
14 static inline auto twoD(
const T& geometry) {
return geometry.basicPolygonWithHoles2d(); }
15 static inline auto threeD(
const T& geometry) {
return geometry.basicPolygonWithHoles3d(); }
19 template <
typename AreaT>
21 return boost::geometry::covered_by(point, area.basicPolygonWithHoles2d());
24 template <
typename AreaT>
29 template <
typename AreaT>
34 template <
typename Area1T,
typename Area2T>
36 if (area == otherArea) {
39 return intersects(area.basicPolygonWithHoles2d(), otherArea.basicPolygonWithHoles2d());
42 template <
typename AreaT>
47 template <
typename AreaT>
49 return overlaps3d(area.outerBoundPolygon(), otherArea.outerBoundPolygon(), heightTolerance);
52 template <
typename AreaT,
typename LaneletT>
57 template <
typename AreaT,
typename LaneletT>
59 return overlaps3d(area.outerBoundPolygon(),
lanelet.polygon3d(), heightTolerance);
63 return utils::anyOf(left.
outerBound(), [&right](
auto& bound) { return bound.invert() == right.leftBound(); });
72 return (ls.front() == p1 && ls.back() == p2) || (ls.front() == p2 && ls.back() == p1);
81 auto rotatedNext = [&ls = outer2](
auto iter) {
return iter + 1 == ls.
end() ? ls.begin() : iter + 1; };
82 for (
auto i = 0u; i < outer1.numSegments(); ++i) {
83 auto segment = outer1.segment(i);
84 auto second =
std::find(outer2.begin(), outer2.end(), segment.second);
85 if (second != outer2.end() && *rotatedNext(second) == segment.first) {
94 return (boundLs.back() == p1 && boundLs.front() == p2);
106 return ((boundLs.back() == p2 && boundLs.front() == p1) || (boundLs.back() == p3 && boundLs.front() == p4));
117 return boundLs == lb.invert() || boundLs == rb;
123 return !!utils::findIf(ar2.outerBound(),
124 [ar1Bound = ar1Bound.invert()](auto& ar2Bound) { return ar2Bound == ar1Bound; });
136 return res->invert();
IfAr< Area1T, bool > intersects2d(const Area1T &area, const Area2T &otherArea)
test whether two areas intersect in 2d.
IfAr< AreaT, BoundingBox3d > boundingBox3d(const AreaT &area)
calculates 3d bounding box
Optional< ConstLineString3d > determineCommonLineFollowing(const ConstArea &ar, const ConstLanelet &ll)
bool follows(const ConstLanelet &prev, const ConstArea &next)
Test whether area follows lanelet.
BoundingBox2d to2D(const BoundingBox3d &primitive)
IfAr< AreaT, bool > inside(const AreaT &area, const BasicPoint2d &point)
Checks whether a point is within or at the border of a area.
ConstLanelet invert() const
returns the inverted lanelet
A const (i.e. immutable) Area.
Optional< ConstLineString3d > determineCommonLineFollowingOrPreceding(const ConstArea &ar, const ConstLanelet &ll)
static auto threeD(const T &geometry)
const ConstPointType & back() const noexcept
returns the last point (if it exist)
Optional< ConstLineString3d > determineCommonLineRight(const ConstLanelet &left, const ConstArea &right)
boost::optional< T > Optional
Optional< ConstLineString3d > determineCommonLineSideways(const ConstLanelet &ll, const ConstArea &ar)
Optional< ConstLineString3d > determineCommonLine(const ConstArea &ar, const ConstLanelet &ll)
auto findIf(ContainerT &&c, Func f)
IfAr< AreaT, bool > overlaps2d(const AreaT &area, const AreaT &otherArea)
Eigen::Matrix< double, 2, 1, Eigen::DontAlign > BasicPoint2d
a simple 2d-point
static auto twoD(const T &geometry)
IfAr< AreaT, bool > overlaps3d(const AreaT &area, const AreaT &otherArea, double heightTolerance)
Optional< ConstLineString3d > determineCommonLinePreceding(const ConstLanelet &ll, const ConstArea &ar)
CompoundPolygon3d outerBoundPolygon() const
get the outer bound as polygon
bool anyOf(const Container &c, Predicate &&p)
IfAr< AreaT, BoundingBox2d > boundingBox2d(const AreaT &area)
calculates an up-right 2d bounding box
bool leftOf(const ConstLanelet &right, const ConstArea &left)
Test whether area is left of lanelet.
const ConstPointType & front() const noexcept
returns the first point (if it exist)
const_iterator end() const noexcept
returns an iterator to end of the points
A normal 3d linestring with immutable data.
std::enable_if_t< traits::isAreaT< T >(), RetT > IfAr
ConstLineStrings3d outerBound() const
Get linestrings that form the outer bound.
ConstLineString3d leftBound() const
get the left bound.
auto find(ContainerT &&c, const ValueT &val)
bool rightOf(const ConstLanelet &left, const ConstArea &area)
Test whether area is right of lanelet.
ConstLineString3d rightBound() const
get the right bound.
Optional< ConstLineString3d > determineCommonLineLeft(const ConstLanelet &right, const ConstArea &left)
bool adjacent(const ConstArea &area1, const ConstArea &area2)
Test if two areas are adjacent.
lanelet2_core
Author(s): Fabian Poggenhans
autogenerated on Thu Mar 6 2025 03:25:52