2 #include <boost/variant.hpp> 45 template <
typename VisitorT>
52 return applyVisitor([](
auto& elem) {
return elem.id(); });
61 return applyVisitor([](
auto& elem) {
return elem.regulatoryElements(); });
66 return applyVisitor([](
auto& elem) {
return elem.template regulatoryElementsAs<T>(); });
92 return area()->outerBoundPolygon();
106 stream << *obj.
area();
117 lanelets.reserve(lars.size());
118 for (
const auto& lar : lars) {
119 if (lar.isLanelet()) {
120 lanelets.push_back(static_cast<const ConstLanelet&>(lar));
127 lanelets.reserve(lars.size());
128 for (
const auto& lar : lars) {
130 lanelets.push_back(static_cast<const ConstArea&>(lar));
Optional< ConstLanelet > lanelet() const
return the managed lanelet
An object that can either refer to a lanelet or an area.
bool equals(const ConstLaneletOrArea &other) const
compares this lanelet or area
std::vector< ConstLaneletOrArea > ConstLaneletOrAreas
ConstLaneletOrArea(ConstLanelet lanelet)
ConstLaneletOrArea & operator=(ConstArea area)
Id id() const
get the id of the lanelet or area
std::ostream & operator<<(std::ostream &stream, const Attribute &obj)
Optional< ConstArea > area() const
get the managed area
bool operator==(const Attribute &lhs, const Attribute &rhs)
ConstLaneletOrArea(ConstArea area)
ConstLaneletOrArea & operator=(ConstLaneletOrArea &&rhs)=default
~ConstLaneletOrArea() noexcept=default
CompoundPolygon3d boundingPolygon() const
returns the outer bound if it is an area or the polygon made of the lanelet bounds if it's a lanelet ...
Combines multiple linestrings to one polygon in 3d.
boost::optional< T > Optional
bool operator!=(const Attribute &lhs, const Attribute &rhs)
ConstLaneletOrArea()=default
ConstLanelets getAllLanelets(const ConstLaneletOrAreas &lars)
boost::variant< ConstLanelet, ConstArea > laneletOrArea_
std::vector< std::shared_ptr< const T > > regulatoryElementsAs() const
bool isArea() const
true if this object holds an area
std::vector< RegulatoryElementConstPtr > RegulatoryElementConstPtrs
bool isLanelet() const
true if this objct holds a lanelet
decltype(auto) applyVisitor(VisitorT visitor) const
apply a generic visitor
ConstLaneletOrArea & operator=(ConstLanelet lanelet)
A const (i.e. immutable) Area.
RegulatoryElementConstPtrs regulatoryElements() const
ConstAreas getAllAreas(const ConstLaneletOrAreas &lars)
std::vector< ConstArea > ConstAreas
const AttributeMap & attributes() const
get the attributes of the lanelet or area
std::vector< ConstLanelet > ConstLanelets