A collection of lineStrings that act as one line string. More...
#include <CompoundLineString.h>
Public Types | |
using | BasicIterator = internal::TransformIterator< RFIter, const BasicPointType > |
using | BasicLineString = internal::SelectBasicLineStringT< BasicPointType > |
using | BasicPointType = traits::BasicPointT< PointT > |
using | Category = traits::LineStringTag |
using | const_iterator = internal::SelectCompoundLsIteratorT< ConstPointType > |
using | ConstPointType = traits::ConstPointT< PointT > |
using | DataType = CompoundLineStringData |
using | iterator = const_iterator |
using | PointType = PointT |
using | SegmentType = Segment< ConstPointType > |
Public Member Functions | |
const PointType & | back () const noexcept |
returns the last point of the last linestring More... | |
BasicIterator | basicBegin () const |
returns a normal iterator to the internal point type at begin More... | |
BasicIterator | basicEnd () const |
returns a normal iterator for the internal point type at end More... | |
BasicLineString | basicLineString () const |
create a basic linestring from this linestring More... | |
const_iterator | begin () const noexcept |
returns an iterator to the start of the points More... | |
CompoundLineStringImpl (const ConstLineStrings3d &ls=ConstLineStrings3d()) | |
Construct from a vector of ConstLineString3d. More... | |
template<typename OtherT , typename = IfLS<OtherT, void>> | |
CompoundLineStringImpl (const std::vector< OtherT > &lss) | |
Construct from a vector of LineStrings or CompoundLineStrings. More... | |
CompoundLineStringImpl (CompoundLineStringDataConstPtr data, bool inverted) | |
Internal construction from data pointer. More... | |
template<typename OtherT > | |
CompoundLineStringImpl (const CompoundLineStringImpl< OtherT > &other) | |
construct from other CompoundLineString More... | |
CompoundLineStringImpl (CompoundLineStringImpl &&rhs) noexcept=default | |
CompoundLineStringImpl (const CompoundLineStringImpl &rhs)=default | |
std::shared_ptr< const CompoundLineStringData > | constData () const noexcept |
returns the internal data on the linestrings managed by this object More... | |
bool | empty () const noexcept |
return whether this contains any points More... | |
const_iterator | end () const noexcept |
returns an iterator to end of the points More... | |
const PointType & | front () const noexcept |
returns the first point of the first linestring More... | |
Ids | ids () const |
returns the ids of all linestrings in order More... | |
bool | inverted () const noexcept |
returns whether this is an inverted CompoundLineString More... | |
ConstLineStrings3d | lineStrings () const |
size_t | numSegments () const noexcept |
Returns the number of (geometrically valid) segments. More... | |
CompoundLineStringImpl & | operator= (CompoundLineStringImpl &&rhs) noexcept=default |
CompoundLineStringImpl & | operator= (const CompoundLineStringImpl &rhs)=default |
const PointType & | operator[] (size_t idx) const |
returns the point at this position More... | |
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. More... | |
size_t | size () const noexcept |
return the total number of unique points More... | |
~CompoundLineStringImpl () noexcept=default | |
Static Public Attributes | |
static constexpr traits::Dimensions | Dimension = traits::PointTraits<PointT>::Dimension |
Private Types | |
using | RFIter = CompoundLineStringData::RFIter |
Private Attributes | |
CompoundLineStringDataConstPtr | data_ |
bool | inverted_ {false} |
A collection of lineStrings that act as one line string.
PointT | the point type that the linestring returns |
A CompoundLineString has the same interface as a LineString2d/LineString3d, but internally accesses the points of multiple linestrings. Because it just provides an interface to the points, the internal data can not be modified. If adjacent linestrings share the same points, one of them is discarded.
Definition at line 69 of file CompoundLineString.h.
using lanelet::CompoundLineStringImpl< PointT >::BasicIterator = internal::TransformIterator<RFIter, const BasicPointType> |
Definition at line 80 of file CompoundLineString.h.
using lanelet::CompoundLineStringImpl< PointT >::BasicLineString = internal::SelectBasicLineStringT<BasicPointType> |
Definition at line 84 of file CompoundLineString.h.
using lanelet::CompoundLineStringImpl< PointT >::BasicPointType = traits::BasicPointT<PointT> |
Definition at line 76 of file CompoundLineString.h.
using lanelet::CompoundLineStringImpl< PointT >::Category = traits::LineStringTag |
Definition at line 78 of file CompoundLineString.h.
using lanelet::CompoundLineStringImpl< PointT >::const_iterator = internal::SelectCompoundLsIteratorT<ConstPointType> |
Definition at line 82 of file CompoundLineString.h.
using lanelet::CompoundLineStringImpl< PointT >::ConstPointType = traits::ConstPointT<PointT> |
Definition at line 77 of file CompoundLineString.h.
using lanelet::CompoundLineStringImpl< PointT >::DataType = CompoundLineStringData |
Definition at line 74 of file CompoundLineString.h.
using lanelet::CompoundLineStringImpl< PointT >::iterator = const_iterator |
Definition at line 83 of file CompoundLineString.h.
using lanelet::CompoundLineStringImpl< PointT >::PointType = PointT |
Definition at line 75 of file CompoundLineString.h.
|
private |
Definition at line 70 of file CompoundLineString.h.
using lanelet::CompoundLineStringImpl< PointT >::SegmentType = Segment<ConstPointType> |
Definition at line 85 of file CompoundLineString.h.
|
inlineexplicit |
Construct from a vector of ConstLineString3d.
ls | objects to construct from. The order will also be the order of the linestrings. |
Definition at line 91 of file CompoundLineString.h.
|
inlineexplicit |
Construct from a vector of LineStrings or CompoundLineStrings.
Definition at line 96 of file CompoundLineString.h.
|
inline |
Internal construction from data pointer.
Definition at line 101 of file CompoundLineString.h.
|
inlineexplicit |
construct from other CompoundLineString
Definition at line 106 of file CompoundLineString.h.
|
defaultnoexcept |
|
default |
|
defaultnoexcept |
|
inlinenoexcept |
returns the last point of the last linestring
The internal point type is a different one, but because all points inherit from the internal point type, no slicing is possible.
Definition at line 172 of file CompoundLineString.h.
|
inline |
returns a normal iterator to the internal point type at begin
Definition at line 209 of file CompoundLineString.h.
|
inline |
returns a normal iterator for the internal point type at end
Definition at line 215 of file CompoundLineString.h.
|
inline |
create a basic linestring from this linestring
A basic linestring is a simple vector with eigen points. You can do what you want with these points, because changes to them will not affect lanelet objects.
BasicLineString is registered with boost::geometry, therefore you can use it for geometry calculations.
Definition at line 227 of file CompoundLineString.h.
|
inlinenoexcept |
returns an iterator to the start of the points
Dereferencing the iterator will convert the point from the internal Point3d to PointT. It will return the first point of the first linestring.
Definition at line 147 of file CompoundLineString.h.
|
inlinenoexcept |
returns the internal data on the linestrings managed by this object
Definition at line 233 of file CompoundLineString.h.
|
inlinenoexcept |
return whether this contains any points
Note this is O(n) in the number of points.
Definition at line 137 of file CompoundLineString.h.
|
inlinenoexcept |
|
inlinenoexcept |
returns the first point of the first linestring
Definition at line 163 of file CompoundLineString.h.
|
inline |
returns the ids of all linestrings in order
Definition at line 245 of file CompoundLineString.h.
|
inlinenoexcept |
returns whether this is an inverted CompoundLineString
Inverted linestrings behave just as normal linestrings but provide access to the points in inverted order.
Definition at line 122 of file CompoundLineString.h.
|
inline |
Definition at line 235 of file CompoundLineString.h.
|
inlinenoexcept |
Returns the number of (geometrically valid) segments.
Definition at line 203 of file CompoundLineString.h.
|
defaultnoexcept |
|
default |
|
inline |
returns the point at this position
The internal point type is a different one, but because all points inherit from the internal point type, no slicing is possible.
Note this is O(n) in the number of points, not O(0)
Definition at line 183 of file CompoundLineString.h.
|
inlinenoexcept |
returns the n-th segment. If n equals size() -1, the segment from back() to front() is returned.
It is not a good idea to use this in a loop, because this has O(n) for every iteration. Use helper::forEachSegment instead.
Definition at line 195 of file CompoundLineString.h.
|
inlinenoexcept |
return the total number of unique points
Unique means that adjacent points with the same id are not counted. Note that this O(n) in the number of points, not O(0).
Definition at line 130 of file CompoundLineString.h.
|
private |
Definition at line 254 of file CompoundLineString.h.
|
static |
Definition at line 79 of file CompoundLineString.h.
|
private |
Definition at line 255 of file CompoundLineString.h.