Namespaces | |
detail | |
Classes | |
struct | IdLess |
Compares ids of primitives. Can be used for some sorted stl containers. More... | |
Typedefs | |
template<typename PrimitiveT > | |
using | ConstLayerPrimitive = typename PrimitiveLayer< PrimitiveT >::ConstPrimitiveT |
Functions | |
template<class T > | |
std::shared_ptr< const T > | addConst (std::shared_ptr< T > t) |
template<class T > | |
const T & | addConst (T &t) |
template<typename Container , typename Predicate > | |
bool | anyOf (const Container &c, Predicate &&p) |
template<typename ContainerT > | |
auto | concatenate (ContainerT &&c) |
overload assuming that c is a container of containers. The return type will be the type of the inner container. More... | |
template<typename ContainerT , typename Func > | |
auto | concatenate (ContainerT &&c, Func f) |
create one big vector from a vector and a function that returns a vector for each element in this vector More... | |
template<typename T > | |
auto | concatenate (std::initializer_list< T > &&c) |
template<typename T , typename Func > | |
auto | concatenate (std::initializer_list< T > &&c, Func f) |
template<typename ContainerT , typename Func > | |
auto | concatenateRange (ContainerT &&c, Func f) |
Similar to concatenate but expects Func to return a pair of begin and end of the range to concatenated. More... | |
template<typename ContainerT , typename Func , typename AllocatorT > | |
auto | concatenateRange (ContainerT &&c, Func f, const AllocatorT &alloc) |
Overload for an allocator (e.g. for Eigen::aligned_allocator) More... | |
template<typename T , typename Func > | |
auto | concatenateRange (std::initializer_list< T > &&c, Func f) |
template<typename T , typename Func , typename AllocatorT > | |
auto | concatenateRange (std::initializer_list< T > &&c, Func f, const AllocatorT &alloc) |
template<typename Container , typename Value > | |
bool | contains (const Container &c, const Value &v) |
LaneletMapConstUPtr | createConstMap (const ConstLanelets &fromLanelets, const ConstAreas &fromAreas) |
LaneletSubmapConstUPtr | createConstSubmap (const ConstLanelets &fromLanelets, const ConstAreas &fromAreas) |
LaneletMapUPtr | createMap (const Areas &fromAreas) |
LaneletMapUPtr | createMap (const Lanelets &fromLanelets) |
LaneletMapUPtr | createMap (const Lanelets &fromLanelets, const Areas &fromAreas) |
LaneletMapUPtr | createMap (const LineStrings3d &fromLineStrings) |
LaneletMapUPtr | createMap (const Points3d &fromPoints) |
Efficiently create a LaneletMap from a vector of things. All elements must have a valid id! More... | |
LaneletMapUPtr | createMap (const Polygons3d &fromPolygons) |
LaneletSubmapUPtr | createSubmap (const Areas &fromAreas) |
LaneletSubmapUPtr | createSubmap (const Lanelets &fromLanelets) |
LaneletSubmapUPtr | createSubmap (const Lanelets &fromLanelets, const Areas &fromAreas) |
LaneletSubmapUPtr | createSubmap (const LineStrings3d &fromLineStrings) |
LaneletSubmapUPtr | createSubmap (const Points3d &fromPoints) |
Efficiently create a LaneletSubmap from a vector of things. All elements must have a valid id! More... | |
LaneletSubmapUPtr | createSubmap (const Polygons3d &fromPolygons) |
template<typename ContainerT , typename ValueT > | |
auto | find (ContainerT &&c, const ValueT &val) |
template<typename ContainerT , typename Func > | |
auto | findIf (ContainerT &&c, Func f) |
template<typename PrimitiveT > | |
std::vector< ConstLayerPrimitive< PrimitiveT > > | findUsages (const PrimitiveLayer< PrimitiveT > &layer, Id id) |
template std::vector< ConstLayerPrimitive< Lanelet > > | findUsages< Lanelet > (const PrimitiveLayer< Lanelet > &, Id) |
template std::vector< ConstLayerPrimitive< LineString3d > > | findUsages< LineString3d > (const PrimitiveLayer< LineString3d > &, Id) |
template std::vector< ConstLayerPrimitive< Polygon3d > > | findUsages< Polygon3d > (const PrimitiveLayer< Polygon3d > &, Id) |
template std::vector< ConstLayerPrimitive< RegulatoryElementPtr > > | findUsages< RegulatoryElementPtr > (const PrimitiveLayer< RegulatoryElementPtr > &, Id) |
ConstAreas | findUsagesInAreas (const LaneletMapLayers &map, const ConstPoint3d &p) |
ConstLanelets | findUsagesInLanelets (const LaneletMapLayers &map, const ConstPoint3d &p) |
template<typename Container , typename Func > | |
void | forEach (Container &&c, Func &&f) |
ConstAreas | getAllAreas (const ConstLaneletOrAreas &lars) |
ConstLanelets | getAllLanelets (const ConstLaneletOrAreas &lars) |
Id | getId () |
returns a unique id by incrementing a counter each time this is called. More... | |
template<typename T , typename Variant > | |
std::vector< T > | getVariant (const std::vector< Variant > &v) |
template<typename PointT > | |
bool | has (const CompoundLineStringImpl< PointT > &ls, Id id) |
returns true if element of a primitive has a matching Id More... | |
bool | has (const ConstArea &ll, Id id) |
returns true if element of a regulatory element has a matching Id More... | |
bool | has (const ConstLanelet &ll, Id id) |
returns true if element of a regulatory element has a matching Id More... | |
template<typename PointT > | |
bool | has (const ConstLineStringImpl< PointT > &ls, Id id) |
returns true if element of a lanelet primitive has a matching Id More... | |
bool | has (const LaneletSequence &ll, Id id) |
returns true if element of a primitive has a matching Id More... | |
bool | has (const RegulatoryElement ®Elem, Id id) |
returns true if element of a regulatory element has a matching Id More... | |
bool | has (const RegulatoryElementConstPtr &ls, Id id) |
template<typename PrimitiveT > | |
constexpr bool | idLess (const PrimitiveT &p1, const PrimitiveT &p2) |
Compares ids of primitives. Can be used for some stl algorithms. More... | |
template<typename Container > | |
Container | invert (const Container &cont) |
bool | nearZero (double d) |
Tests if a double is close to zero within a small margin. More... | |
template<typename T1 , typename T2 > | |
auto | orderedPair (T1 &first, T2 &second) |
void | registerId (Id id) |
template<class T > | |
T & | removeConst (const T &t) |
template<class T > | |
std::shared_ptr< T > | removeConst (std::shared_ptr< const T > t) |
constexpr bool | strequal (char const *lhs, char const *rhs) |
compares two c-strings at compile time. Do not use this for run time. More... | |
template<typename WeakT > | |
auto | strong (std::vector< WeakT > v) |
transforms a vector of weak_ptrs to a vector of shared_ptrs More... | |
template<typename Range , typename Func > | |
auto | sum (Range &&r, Func f) |
Wrapper around std::accumulate for summing up the result of Func over a range. More... | |
template<typename Container , typename Func > | |
auto | transform (Container &&c, Func f) |
template<typename Iterator , typename Func > | |
auto | transform (Iterator begin, Iterator end, const Func f) |
template<typename T , typename Func > | |
auto | transform (std::initializer_list< T > &&c, Func f) |
template<typename OutT , typename InT > | |
auto | transformSharedPtr (const std::vector< std::shared_ptr< InT >> &v) |
using lanelet::utils::ConstLayerPrimitive = typedef typename PrimitiveLayer<PrimitiveT>::ConstPrimitiveT |
Definition at line 504 of file LaneletMap.h.
std::shared_ptr<const T> lanelet::utils::addConst | ( | std::shared_ptr< T > | t | ) |
Definition at line 154 of file Utilities.h.
const T& lanelet::utils::addConst | ( | T & | t | ) |
Definition at line 149 of file Utilities.h.
bool lanelet::utils::anyOf | ( | const Container & | c, |
Predicate && | p | ||
) |
Definition at line 216 of file Utilities.h.
auto lanelet::utils::concatenate | ( | ContainerT && | c | ) |
overload assuming that c is a container of containers. The return type will be the type of the inner container.
For containers holding heavy objects consider moving the container into this.
Definition at line 260 of file Utilities.h.
auto lanelet::utils::concatenate | ( | ContainerT && | c, |
Func | f | ||
) |
create one big vector from a vector and a function that returns a vector for each element in this vector
Definition at line 276 of file Utilities.h.
auto lanelet::utils::concatenate | ( | std::initializer_list< T > && | c | ) |
Definition at line 266 of file Utilities.h.
auto lanelet::utils::concatenate | ( | std::initializer_list< T > && | c, |
Func | f | ||
) |
Definition at line 282 of file Utilities.h.
auto lanelet::utils::concatenateRange | ( | ContainerT && | c, |
Func | f | ||
) |
Similar to concatenate but expects Func to return a pair of begin and end of the range to concatenated.
Significantly more efficient than the above but requires that the range is already present in memory. A use case is a vector of vectors.
Definition at line 295 of file Utilities.h.
auto lanelet::utils::concatenateRange | ( | ContainerT && | c, |
Func | f, | ||
const AllocatorT & | alloc | ||
) |
Overload for an allocator (e.g. for Eigen::aligned_allocator)
Definition at line 306 of file Utilities.h.
auto lanelet::utils::concatenateRange | ( | std::initializer_list< T > && | c, |
Func | f | ||
) |
Definition at line 300 of file Utilities.h.
auto lanelet::utils::concatenateRange | ( | std::initializer_list< T > && | c, |
Func | f, | ||
const AllocatorT & | alloc | ||
) |
Definition at line 311 of file Utilities.h.
bool lanelet::utils::contains | ( | const Container & | c, |
const Value & | v | ||
) |
Definition at line 221 of file Utilities.h.
LaneletMapConstUPtr lanelet::utils::createConstMap | ( | const ConstLanelets & | fromLanelets, |
const ConstAreas & | fromAreas | ||
) |
Definition at line 875 of file LaneletMap.cpp.
LaneletSubmapConstUPtr lanelet::utils::createConstSubmap | ( | const ConstLanelets & | fromLanelets, |
const ConstAreas & | fromAreas | ||
) |
Definition at line 924 of file LaneletMap.cpp.
LaneletMapUPtr lanelet::utils::createMap | ( | const Areas & | fromAreas | ) |
Definition at line 867 of file LaneletMap.cpp.
LaneletMapUPtr lanelet::utils::createMap | ( | const Lanelets & | fromLanelets | ) |
Definition at line 865 of file LaneletMap.cpp.
LaneletMapUPtr lanelet::utils::createMap | ( | const Lanelets & | fromLanelets, |
const Areas & | fromAreas | ||
) |
Definition at line 824 of file LaneletMap.cpp.
LaneletMapUPtr lanelet::utils::createMap | ( | const LineStrings3d & | fromLineStrings | ) |
Definition at line 818 of file LaneletMap.cpp.
LaneletMapUPtr lanelet::utils::createMap | ( | const Points3d & | fromPoints | ) |
Efficiently create a LaneletMap from a vector of things. All elements must have a valid id!
Definition at line 813 of file LaneletMap.cpp.
LaneletMapUPtr lanelet::utils::createMap | ( | const Polygons3d & | fromPolygons | ) |
Definition at line 869 of file LaneletMap.cpp.
LaneletSubmapUPtr lanelet::utils::createSubmap | ( | const Areas & | fromAreas | ) |
Definition at line 910 of file LaneletMap.cpp.
LaneletSubmapUPtr lanelet::utils::createSubmap | ( | const Lanelets & | fromLanelets | ) |
Definition at line 908 of file LaneletMap.cpp.
LaneletSubmapUPtr lanelet::utils::createSubmap | ( | const Lanelets & | fromLanelets, |
const Areas & | fromAreas | ||
) |
Definition at line 912 of file LaneletMap.cpp.
LaneletSubmapUPtr lanelet::utils::createSubmap | ( | const LineStrings3d & | fromLineStrings | ) |
Definition at line 898 of file LaneletMap.cpp.
LaneletSubmapUPtr lanelet::utils::createSubmap | ( | const Points3d & | fromPoints | ) |
Efficiently create a LaneletSubmap from a vector of things. All elements must have a valid id!
Definition at line 893 of file LaneletMap.cpp.
LaneletSubmapUPtr lanelet::utils::createSubmap | ( | const Polygons3d & | fromPolygons | ) |
Definition at line 903 of file LaneletMap.cpp.
auto lanelet::utils::find | ( | ContainerT && | c, |
const ValueT & | val | ||
) |
Definition at line 186 of file Utilities.h.
auto lanelet::utils::findIf | ( | ContainerT && | c, |
Func | f | ||
) |
Definition at line 196 of file Utilities.h.
std::vector< ConstLayerPrimitive< PrimitiveT > > lanelet::utils::findUsages | ( | const PrimitiveLayer< PrimitiveT > & | layer, |
Id | id | ||
) |
Definition at line 779 of file LaneletMap.cpp.
template std::vector<ConstLayerPrimitive<Lanelet> > lanelet::utils::findUsages< Lanelet > | ( | const PrimitiveLayer< Lanelet > & | , |
Id | |||
) |
template std::vector<ConstLayerPrimitive<LineString3d> > lanelet::utils::findUsages< LineString3d > | ( | const PrimitiveLayer< LineString3d > & | , |
Id | |||
) |
template std::vector<ConstLayerPrimitive<Polygon3d> > lanelet::utils::findUsages< Polygon3d > | ( | const PrimitiveLayer< Polygon3d > & | , |
Id | |||
) |
template std::vector<ConstLayerPrimitive<RegulatoryElementPtr> > lanelet::utils::findUsages< RegulatoryElementPtr > | ( | const PrimitiveLayer< RegulatoryElementPtr > & | , |
Id | |||
) |
ConstAreas lanelet::utils::findUsagesInAreas | ( | const LaneletMapLayers & | map, |
const ConstPoint3d & | p | ||
) |
Definition at line 803 of file LaneletMap.cpp.
ConstLanelets lanelet::utils::findUsagesInLanelets | ( | const LaneletMapLayers & | map, |
const ConstPoint3d & | p | ||
) |
Definition at line 793 of file LaneletMap.cpp.
void lanelet::utils::forEach | ( | Container && | c, |
Func && | f | ||
) |
Definition at line 226 of file Utilities.h.
|
inline |
Definition at line 125 of file LaneletOrArea.h.
|
inline |
Definition at line 115 of file LaneletOrArea.h.
Id lanelet::utils::getId | ( | ) |
returns a unique id by incrementing a counter each time this is called.
Useful for creating a new map with primitives. As long as all the ids are generated using this function, it is guaranteed that there will be no duplicates. This is different from PrimitiveLayer::uniqueId, which only guarantees that an Id is unique within this layer.
This is threa safe.
Definition at line 883 of file LaneletMap.cpp.
std::vector<T> lanelet::utils::getVariant | ( | const std::vector< Variant > & | v | ) |
Definition at line 316 of file Utilities.h.
bool lanelet::utils::has | ( | const CompoundLineStringImpl< PointT > & | ls, |
Id | id | ||
) |
returns true if element of a primitive has a matching Id
ls | the element holding other primitives |
id | id to look for |
This function does not look for the id of the element, only its members Works for linestrings and polylines. A similar implementation exists for regulatory elements and lanelets.
Definition at line 355 of file CompoundLineString.h.
returns true if element of a regulatory element has a matching Id
ll | the element holding other primitives |
id | id to look for |
This function does not look for the id of the element, only its members Works for linestrings and polylines. Does NOT check members in regulatory elements, only ids of regulatory elements itself. A similar implementation exists for linestrings and regulatory elements.
Definition at line 324 of file primitives/Area.h.
bool lanelet::utils::has | ( | const ConstLanelet & | ll, |
Id | id | ||
) |
returns true if element of a regulatory element has a matching Id
ll | the element holding other primitives |
id | id to look for |
This function does not look for the id of the element, only its members Works for linestrings and polylines. Does NOT check members in regulatory elements, only ids of regulatory elements itself. A similar implementation exists for linestrings and regulatory elements.
Definition at line 307 of file Lanelet.cpp.
bool lanelet::utils::has | ( | const ConstLineStringImpl< PointT > & | ls, |
Id | id | ||
) |
returns true if element of a lanelet primitive has a matching Id
ls | the element holding other primitives |
id | id to look for |
This function does not look for the id of the element, only its members Works for linestrings and polylines. A similar implementation exists for regulatory elements and lanelets.
Definition at line 790 of file primitives/LineString.h.
|
inline |
returns true if element of a primitive has a matching Id
ll | the element holding other primitives |
id | id to look for |
This function does not look for the id of the element, only its members Works for linestrings and polylines. A similar implementation exists for regulatory elements and lanelets.
Definition at line 256 of file LaneletSequence.h.
bool lanelet::utils::has | ( | const RegulatoryElement & | regElem, |
Id | id | ||
) |
returns true if element of a regulatory element has a matching Id
regElem | the element holding other primitives |
id | id to look for |
This function does not look for the id of the element, only its members Works for linestrings and polylines. A similar implementation exists for linestrings and lanelets.
Definition at line 164 of file RegulatoryElement.cpp.
|
inline |
Definition at line 326 of file primitives/RegulatoryElement.h.
|
constexpr |
Compares ids of primitives. Can be used for some stl algorithms.
Definition at line 133 of file Utilities.h.
Container lanelet::utils::invert | ( | const Container & | cont | ) |
Definition at line 169 of file Utilities.h.
|
inline |
Tests if a double is close to zero within a small margin.
Definition at line 359 of file Utilities.h.
|
inline |
Definition at line 144 of file Utilities.h.
void lanelet::utils::registerId | ( | Id | id | ) |
Register an id as being in use. This id will no longer be returned by getId. Function is thread safe.
Definition at line 885 of file LaneletMap.cpp.
T& lanelet::utils::removeConst | ( | const T & | t | ) |
Definition at line 164 of file Utilities.h.
std::shared_ptr<T> lanelet::utils::removeConst | ( | std::shared_ptr< const T > | t | ) |
Definition at line 159 of file Utilities.h.
|
constexpr |
compares two c-strings at compile time. Do not use this for run time.
Definition at line 332 of file Utilities.h.
auto lanelet::utils::strong | ( | std::vector< WeakT > | v | ) |
transforms a vector of weak_ptrs to a vector of shared_ptrs
Expired elements are discarded.
Definition at line 347 of file Utilities.h.
auto lanelet::utils::sum | ( | Range && | r, |
Func | f | ||
) |
Wrapper around std::accumulate for summing up the result of Func over a range.
Definition at line 248 of file Utilities.h.
auto lanelet::utils::transform | ( | Container && | c, |
Func | f | ||
) |
Definition at line 206 of file Utilities.h.
auto lanelet::utils::transform | ( | Iterator | begin, |
Iterator | end, | ||
const Func | f | ||
) |
Definition at line 176 of file Utilities.h.
auto lanelet::utils::transform | ( | std::initializer_list< T > && | c, |
Func | f | ||
) |
Definition at line 211 of file Utilities.h.
auto lanelet::utils::transformSharedPtr | ( | const std::vector< std::shared_ptr< InT >> & | v | ) |
Definition at line 231 of file Utilities.h.