Go to the documentation of this file.
75 template <
typename RegElemT>
79 template <
typename RegElemT>
98 [](
const auto& elem) { return CompoundPolygon3d(elem); });
197 template <
typename RegElemT>
199 return constData()->regulatoryElementsAs<RegElemT>();
216 using Primitive::innerBounds;
217 using Primitive::outerBound;
218 using Primitive::regulatoryElements;
219 using Primitive::regulatoryElementsAs;
241 if (regElem ==
nullptr) {
244 data()->regulatoryElements().push_back(std::move(regElem));
249 auto& regElems =
data()->regulatoryElements();
250 auto remove =
std::find(regElems.begin(), regElems.end(), regElem);
251 if (remove != regElems.end()) {
252 regElems.erase(remove);
259 template <
typename RegElemT>
261 return data()->regulatoryElementsAs<RegElemT>();
338 stream <<
" outer: [";
339 std::copy(obId.begin(), obId.end(), std::ostream_iterator<Id>(stream,
","));
344 stream <<
" inner: ";
345 for (
const auto& ib : ibs) {
347 auto ibId = ib.ids();
348 std::copy(ibId.begin(), ibId.end(), std::ostream_iterator<Id>(stream,
","));
357 template <
typename T>
359 return isCategory<T, traits::AreaTag>();
363 template <
typename T,
typename RetT>
364 using IfAr = std::enable_if_t<traits::isAreaT<T>(), RetT>;
constexpr Id InvalId
indicates a primitive that is not part of a map
LineStrings3d outerBound_
linestrings that together form the outer bound
std::vector< ConstLineString3d > ConstLineStrings3d
Base class for all mutable Primitives of lanelet2.
std::vector< LineString3d > LineStrings3d
BasicPolygon3d basicPolygon() const
ConstInnerBounds innerBounds() const
std::vector< RegulatoryElementPtr > RegulatoryElementPtrs
Common data class for all lanelet primitives.
Combines multiple linestrings to one polygon in 3d.
BoundingBox2d to2D(const BoundingBox3d &primitive)
std::shared_ptr< RegulatoryElement > RegulatoryElementPtr
const AttributeMap & attributes() const
get the attributes of this primitive
CompoundPolygons3d innerBoundPolygons() const
get the inner bounds as polygon
A const (i.e. immutable) Area.
HybridMap< Attribute, decltype(AttributeNamesString::Map)&, AttributeNamesString::Map > AttributeMap
ConstArea(Id id=InvalId)
Constructs an empty or invalid area.
void setInnerBounds(const std::vector< LineStrings3d > &bounds)
void addRegulatoryElement(RegulatoryElementPtr regElem)
adds a new regulatory element
bool operator==(const Attribute &lhs, const Attribute &rhs)
const CompoundPolygons3d & innerBoundPolygons() const
std::ostream & operator<<(std::ostream &stream, const Attribute &obj)
std::vector< LineStrings3d > InnerBounds
auto transform(Iterator begin, Iterator end, const Func f)
RegulatoryElementConstPtrs regulatoryElements() const
ConstInnerBounds innerBounds() const
get the linestrings that form the inner bounds
const InnerBounds & innerBounds()
Get the linestrings that form the inner bound.
const LineStrings3d & outerBound()
Get linestrings that form the outer bound.
std::weak_ptr< const AreaData > areaData_
std::vector< LineStrings3d > innerBounds_
vector of ls for inner bounds
A (basic) 2d polygon with holes inside.
Famous Area class that represents a basic area as element of the map.
RegulatoryElementPtrs regulatoryElements_
regulatory elements that apply
std::shared_ptr< const AreaData > AreaDataConstPtr
const std::shared_ptr< const AreaData > & constData() const
get the internal data of this primitive
ConstLineStrings3d outerBound() const
ConstWeakArea(ConstArea area)
RegulatoryElementConstPtrs regulatoryElements() const
get a list of regulatory elements that affect this area
const LineStrings3d & outerBound()
BasicPolygonWithHoles2d basicPolygonWithHoles2d() const
generates a basic polygon in 2d with holes for this area
AttributeMap attributes
attributes of this primitive
used internally by RegulatoryElements to avoid cyclic dependencies.
RegulatoryElementPtrs & regulatoryElements()
const CompoundPolygon3d & outerBoundPolygon() const
Ids ids() const
returns the ids of all linestrings in order
bool removeRegulatoryElement(const RegulatoryElementPtr ®Elem)
removes a regulatory element, returns true on success
void setOuterBound(const LineStrings3d &bound)
Sets a new outer bound and resets the cache.
void setInnerBounds(const std::vector< LineStrings3d > &bounds)
sets a new inner bound and resets the cache
std::vector< std::shared_ptr< const RegElemT > > regulatoryElementsAs() const
get the regulatoryElements that could be converted to a type
bool operator!=(const Attribute &lhs, const Attribute &rhs)
const InnerBounds & innerBounds()
CompoundPolygons3d innerBoundPolygons_
represents the inner bounds of the area
CompoundPolygon3d outerBoundPolygon_
represents the outer bounds of the area
Common data management class for all Area-Typed objects.
std::shared_ptr< const RegulatoryElement > RegulatoryElementConstPtr
bool expired() const noexcept
tests whether the WeakArea is still valid
AreaData(Id id, LineStrings3d outerBound, std::vector< LineStrings3d > innerBounds=std::vector< LineStrings3d >(), AttributeMap attributes=AttributeMap(), RegulatoryElementPtrs regulatoryElements=RegulatoryElementPtrs())
Constructs a new, AreaData object.
std::vector< std::shared_ptr< RegElemT > > regulatoryElementsAs()
get the regulatoryElements that could be converted to RegElemT
CompoundPolygon3d outerBoundPolygon() const
get the outer bound as polygon
ConstArea(const std::shared_ptr< const AreaData > &data)
Constructor to construct from the data of a different Area.
bool has(const ConstArea &ll, Id id)
returns true if element of a regulatory element has a matching Id
std::shared_ptr< AreaData > AreaDataPtr
Basic Primitive class for all primitives of lanelet2.
const RegulatoryElementPtrs & regulatoryElements()
return regulatoryElements that affect this area.
BasicPolygonWithHoles3d basicPolygonWithHoles3d() const
generates a basic polygon in 2d with holes for this area
std::vector< RegulatoryElementConstPtr > RegulatoryElementConstPtrs
A normal 3d linestring with immutable data.
std::enable_if_t< traits::isAreaT< T >(), RetT > IfAr
Identifies LaneletPrimitives.
ConstArea lock() const
Obtains the original ConstArea.
ConstLineStrings3d outerBound() const
Get linestrings that form the outer bound.
std::vector< CompoundPolygon3d > CompoundPolygons3d
std::vector< std::shared_ptr< RegElemT > > regulatoryElementsAs()
used internally by RegulatoryElements to avoid cyclic dependencies.
SharedPtrs in lanelet2 must never point to null. If this is violated, this exception is thrown (usual...
std::vector< ConstLineStrings3d > ConstInnerBounds
Id id
Id of this primitive (unique across one map)
Area(const AreaDataPtr &data)
std::shared_ptr< DataType > data() const
A (basic) 2d polygon with holes inside.
void setOuterBound(const LineStrings3d &bound)
sets a new outer bound.
auto find(ContainerT &&c, const ValueT &val)
Id id() const noexcept
get the unique id of this primitive
Area lock() const
Obtains the original ConstArea.
ConstArea(Id id, const LineStrings3d &outerBound, const InnerBounds &innerBounds=InnerBounds(), const AttributeMap &attributes=AttributeMap(), const RegulatoryElementPtrs ®ulatoryElements=RegulatoryElementPtrs())
Constructs a new area.
std::vector< std::shared_ptr< const RegElemT > > regulatoryElementsAs() const
lanelet2_core
Author(s): Fabian Poggenhans
autogenerated on Thu Mar 6 2025 03:25:52