Go to the documentation of this file.
17 template <
typename Po
intT>
18 using Segment = std::pair<PointT, PointT>;
54 template <
typename Po
intT>
62 template <
typename Po
intT>
70 std::transform(primitive.begin(), primitive.end(), ls2d.begin(), utils::to2D<BasicPoint3d>);
74 template <
typename Po
intT>
86 template <
typename Po
intT>
90 template <
typename Po
intT>
104 template <
typename T>
107 template <
typename Po
intT>
120 template <
typename T>
124 return Points3d::iterator(it);
126 template <
typename T>
156 template <
typename IteratorT = const_iterator>
157 IteratorT
begin(
bool inverted)
const noexcept {
161 template <
typename IteratorT = iterator>
162 IteratorT
begin(
bool inverted) noexcept {
166 template <
typename IteratorT = const_iterator>
167 IteratorT
end(
bool inverted)
const noexcept {
170 template <
typename IteratorT = iterator>
171 IteratorT
end(
bool inverted) noexcept {
219 template <
typename Po
intT>
252 template <
typename OtherT>
305 assert(idx <
size());
326 assert(idx <
size());
327 auto first =
begin() + idx;
328 auto second = idx + 1 ==
size() ?
begin() : first + 1;
347 template <
typename LineStringT>
363 template <
typename ConstLineStringT>
373 using Base::inverted;
379 template <
typename OtherT>
382 explicit LineStringImpl(
const std::shared_ptr<const LineStringData>&,
bool inverted) =
delete;
402 points() = std::move(rhs);
416 return inverted() ? Iter::reversed(fwIter + 1) : Iter(fwIter);
420 template <
typename InIter>
425 using RViter = std::reverse_iterator<Viter>;
427 return RIter(Points3d::reverse_iterator(fwIter + 1));
430 return RIter(fwIter);
445 return inverted() ? Iter::reversed(it) : Iter(it);
477 using Base::operator[];
494 assert(idx < size());
495 return points()[inverted() ?
points().size() - 1 - idx : idx];
503 assert(idx < size());
504 const auto snd = idx + 1;
505 return SegmentType(
operator[](idx),
operator[](snd == size() ? 0 : snd));
625 assert(idx <
size());
626 const auto snd = idx + 1;
676 assert(idx <
size());
677 const auto snd = idx + 1;
683 stream <<
"[id: " << obj.
id();
685 stream <<
", inverted";
687 stream <<
" point ids: ";
688 for (
auto it = obj.
begin(); it != obj.
end(); ++it) {
690 if (std::next(it) != obj.
end()) {
694 return stream <<
"]";
698 stream <<
"[id: " << obj.
id();
700 stream <<
", inverted";
702 stream <<
" point ids: ";
703 for (
auto it = obj.
begin(); it != obj.
end(); ++it) {
705 if (std::next(it) != obj.
end()) {
709 return stream <<
"]";
713 template <
typename LhsPo
intT,
typename RhsPo
intT>
717 template <
typename LhsPo
intT,
typename RhsPo
intT>
719 return !(lhs == rhs);
722 template <
typename Po
intT>
724 return lhs.
size() == rhs.size() && std::equal(lhs.
begin(), lhs.
end(), rhs.begin());
727 template <
typename Po
intT>
732 template <
typename Po
intT>
734 return !(lhs == rhs);
737 template <
typename Po
intT>
739 return !(lhs == rhs);
743 template <
typename T>
745 return isCategory<T, traits::LineStringTag>();
749 template <
typename T,
typename Enable =
void>
752 template <
typename T>
756 template <
typename T>
761 template <
typename LineStringT>
764 template <
typename LineStringT>
770 template <
typename T,
typename RetT>
771 using IfLS = std::enable_if_t<traits::isLinestringT<T>(), RetT>;
773 template <
typename T1,
typename T2,
typename RetT>
774 using IfLS2 = std::enable_if_t<traits::isLinestringT<T1>() && traits::isLinestringT<T2>(), RetT>;
789 template <
typename Po
intT>
791 return std::any_of(ls.
begin(), ls.
end(), [&
id](
const auto& elem) { return elem.id() == id; });
constexpr Id InvalId
indicates a primitive that is not part of a map
void pop_back()
removes element from the end
Base class for all mutable Primitives of lanelet2.
const ConstPointType & operator[](size_t idx) const noexcept
returns the point at this position
BasicIterator begin() const noexcept
BasicPoint3d Iterator to begin.
ConstLineString2d invert() const noexcept
create a new, inverted linestring from this one
BasicLineString basicLineString() const noexcept
Create a basic linestring (ie a vector of Eigen Points)
ConstHybridLineString3d invert() const noexcept
Returns an inverted linestring, O(0)
std::enable_if_t< traits::isLinestringT< T1 >() &&traits::isLinestringT< T2 >(), RetT > IfLS2
BasicIterator basicBegin() const noexcept
returns a normal iterator to the internal point type at begin
BasicLineString2d TwoDType
auto toBasicSegment(const Segment< PointT > &s)
static constexpr traits::Dimensions Dimension
std::vector< BasicPoint3d > BasicPoints3d
multiple simple 3d-points
LineStringData(Id id, Points3d points, AttributeMap attributes)
BasicLineString2d TwoDType
SegmentType segment(size_t idx) const noexcept
returns the n-th segment. If n equals size() -1, the segment from back() to front() is returned.
LineStringImpl(const LineStringImpl< OtherT > &other)
Construct from other (mutable!) LineStrings.
Common data class for all lanelet primitives.
Segment< ConstPoint3d > ConstSegment3d
BasicLineString3d ThreeDType
ConstHybridLineString3d(const LineString3d &ls)
Eigen::Vector3d BasicPoint3d
a simple 3d-point
const AttributeMap & attributes() const
get the attributes of this primitive
SegmentType segment(size_t idx) const noexcept
returns the n-th segment. If n equals size() -1, the segment from back() to front() is returned.
BasicIterator basicEnd() const noexcept
returns a normal iterator for the internal point type at end
std::enable_if_t< traits::isLinestringT< T >(), RetT > IfLS
constexpr auto toHybrid(const LineStringT ls)
typename LineStringTraits< T >::HybridType Type
HybridMap< Attribute, decltype(AttributeNamesString::Map)&, AttributeNamesString::Map > AttributeMap
Container invert(const Container &cont)
typename Base::SegmentType SegmentType
typename SelectLsIterator< T >::Iterator SelectLsIteratorT
Segment< BasicPoint3d > BasicSegment3d
Implementation template class that is common to all non-const types.
auto toBasicPoint(const PointT &point) -> std::enable_if_t< PointTraits< PointT >::IsPrimitive, BasicPointT< PointT >>
bool operator==(const Attribute &lhs, const Attribute &rhs)
typename PointTraits< PointT >::MutablePoint MutablePointT
IteratorT begin(bool inverted) noexcept
BasicIterator begin() const noexcept
BasicPoint2d Iterator to begin.
const BasicPointType & front() const noexcept
Get first BasicPoint2d.
LineStringImpl & operator=(std::vector< Point3d > &&rhs)
Move assign from a normal vector. Id and attributes stay unchanged.
std::ostream & operator<<(std::ostream &stream, const Attribute &obj)
auto transform(Iterator begin, Iterator end, const Func f)
std::pair< PointT, PointT > Segment
void push_back(const PointType &point)
inserts a new element at the end
traits::ConstPrimitiveType< SegmentType > ConstSegmentType
const ConstPointType & back() const noexcept
returns the last point (if it exist)
Identifies bounding boxes.
bool inverted() const noexcept
Returns whether this is an inverted linestring.
Specialization of traits for linestrings.
A Linestring that returns BasicPoint2d instead of Point2d.
Segment< Point3d > Segment3d
~LineStringImpl() noexcept=default
ConstHybridLineString2d(const LineString2d &ls)
Segment< ThreeD< PointT > > ThreeDType
BasicLineString3d ConstType
BasicLineString2d MutableType
void reserve(size_t num)
request a change in capacity
internal::TransformIterator< const_iterator, const BasicPointType > BasicIterator
BasicLineString2d ConstType
const BasicPointType & operator[](size_t idx) const noexcept
access BasicPoint3d at specific position
Segment< ConstPoint2d > ConstSegment2d
A normal 2d linestring with immutable data.
Segment< BasicPointType > SegmentType
const ConstPoint3d & front(bool inverted) const noexcept
internal::ReverseAndForwardIterator< Points3d::iterator > iterator
IteratorT begin(bool inverted) const noexcept
ConstHybridLineString3d(const ConstLineString3d &ls)
A normal 2d linestring with mutable data.
LineStringImpl & operator=(std::vector< PointType > rhs)
Copy assign from a normal vector. The Id of this object is unchanged.
const std::shared_ptr< const LineStringData > & constData() const
get the internal data of this primitive
Segment< traits::BasicPointT< PointT > > HybridType
BasicLineString2d to2D< BasicLineString3d >(const BasicLineString3d &primitive)
traits::BasicPointT< Point3d > BasicPointType
BasicLineString3d ThreeDType
auto transform(Container &&c, Func f)
Implementation template class that is common to all LineStrings.
ConstLineStringImpl(const std::shared_ptr< const LineStringData > &data, bool inverted=false)
Constructs a linestring from the data object of another linestring.
Segment< ConstPrimitiveType< PointT > > ConstType
SegmentType segment(size_t idx) noexcept
returns the n-th segment. If n equals size() -1, the segment from back() to front() is returned.
AttributeMap attributes
attributes of this primitive
size_t numSegments() const noexcept
Returns the number of (geometrically valid) segments.
std::vector< Point3d > Points3d
constexpr bool isLinestringT()
LineString3d invert() const noexcept
create a new, inverted linestring from this one
BasicPoints2d BasicLineString2d
ConstLineString3d invert() const noexcept
create a new, inverted linestring from this one
PointType & front()
get a refernce to the first element (make sure it exists)
Segment< BasicPointType > SegmentType
internal::SelectBasicLineStringT< BasicPointType > BasicLineString
BasicLineString3d MutableType
bool operator!=(const Attribute &lhs, const Attribute &rhs)
LineStringImpl(const std::shared_ptr< LineStringData > &data, bool inverted)
Construct from linestring data.
typename SelectBasicLineString< T >::Type SelectBasicLineStringT
BasicIterator end() const noexcept
BasicPoint3d Iterator to past-the-end.
bool empty() const noexcept
return if there are any points in this object
iterator begin()
mutable iterator for the elements of this vector.
typename PrimitiveTraits< PrimitiveT >::ConstType ConstPrimitiveType
Utility for determinig the matching const type for a primitive.
const BasicPointType & operator[](size_t idx) const noexcept
access element at specific position
ConstHybridLineString2d invert() const noexcept
Returns an inverted linestring, O(0)
Eigen::Matrix< double, 2, 1, Eigen::DontAlign > BasicPoint2d
a simple 2d-point
ConstSegmentType segment(size_t idx) const noexcept
returns the n-th segment. If n equals size() -1, the segment from back() to front() is returned.
internal::ReverseAndForwardIterator< Points3d::const_iterator > const_iterator
IteratorT end(bool inverted) noexcept
auto empty() const noexcept
LineString2d invert() const noexcept
create a new, inverted linestring from this one
const ConstPoint3d & at(bool inverted, size_t idx) const noexcept
const BasicPointType & front() const noexcept
Get first BasicPoint3d.
bool has(const ConstArea &ll, Id id)
returns true if element of a regulatory element has a matching Id
iterator insert(iterator position, InIter start, InIter end)
Inserts an range of elements at a specific position.
traits::MutablePointT< Point3d > MutablePointType
linestring will return this point type
~ConstLineStringImpl() noexcept=default
Basic Primitive class for all primitives of lanelet2.
iterator end()
mutable iterator to the end of the elements of this vector.
const BasicPointType & back() const noexcept
Get last BasicPoint3d.
internal::SelectLsIteratorT< const ConstPointType > const_iterator
typename iterator::difference_type difference_type
typename detail::HybridType< LineStringT >::Type HybridT
ConstHybridLineString3d()=default
Points3d::const_iterator pointIter(internal::ReverseAndForwardIterator< Points3d::iterator > it)
size_t size() const noexcept
Return the number of points in this linestring.
const ConstPointType & front() const noexcept
returns the first point (if it exist)
PointType & operator[](size_t idx)
access element at specific position
A normal 3d linestring with immutable data.
ConstLineString3d()=default
typename LineStringTraits< T >::HybridType Type
PointType & back()
get a reference to the last element if it exists
auto size() const noexcept
Points3d & points()
returns a reference to the points
IteratorT end(bool inverted) const noexcept
ConstLineStringImpl & operator=(ConstLineStringImpl &&rhs) noexcept=default
A Linestring that returns BasicPoint3d instead of Point3d.
typename LineStringT::HybridType HybridType
internal::SelectLsIteratorT< PointType > iterator
const_iterator end() const noexcept
Returns an iterator to end of the points.
const_iterator begin() const noexcept
Returns an iterator to the start of the points.
Segment< TwoD< PointT > > TwoDType
Specialization of traits for points.
BasicIterator end() const noexcept
BasicPoint2d Iterator to past-the-end.
iterator erase(iterator position)
Removes point, returns iterator to the next point.
Id id
Id of this primitive (unique across one map)
typename PointTraits< PointT >::BasicPoint BasicPointT
Identifies RegulatoryElementPrimitives.
ConstLineString2d()=default
const ConstPoint3d & back(bool inverted) const noexcept
BasicLineString3d HybridType
std::shared_ptr< DataType > data() const
typename PointTraits< PointT >::ConstPoint ConstPointT
const BasicPointType & back() const noexcept
Get last BasicPoint2d.
iterator insert(iterator position, const PointType &point)
Inserts an element at a specific position.
A normal 3d linestring with mutable data.
Id id() const noexcept
get the unique id of this primitive
Segment< Point2d > Segment2d
ConstPointType value_type
Segment< BasicPoint2d > BasicSegment2d
ConstLineStringImpl(Id id=InvalId, Points3d points=Points3d(), const AttributeMap &attributes=AttributeMap())
Constructs a LineString or similar from an Id and a list of points.
std::vector< Eigen::Vector2d, Eigen::aligned_allocator< Eigen::Vector2d > > BasicPoints2d
multiple simple 2d-points
BasicLineString2d HybridType
Segment< Point3d > SegmentType
traits::ConstPointT< Point3d > ConstPointType
Segment< MutablePrimitiveType< PointT > > MutableType
ConstHybridLineString2d()=default
ConstLineStringImpl(const ConstLineStringImpl< OtherT > &other)
construct from other ConstLineStrings
BasicPoints3d BasicLineString3d
ConstHybridLineString2d(const ConstLineString2d &ls)
lanelet2_core
Author(s): Fabian Poggenhans
autogenerated on Thu Mar 6 2025 03:25:52