Public Types | Public Member Functions | Friends | List of all members
lanelet::Polygon2d Class Reference

An mutable clockwise oriented, open (ie start point != end point) polygon in 2d. More...

#include <Polygon.h>

Inheritance diagram for lanelet::Polygon2d:
Inheritance graph
[legend]

Public Types

using ConstType = ConstPolygon2d
 
using MutableType = Polygon2d
 
using ThreeDType = Polygon3d
 
using TwoDType = Polygon2d
 
- Public Types inherited from lanelet::LineStringImpl< ConstPolygon2d >
using iterator = internal::SelectLsIteratorT< PointType >
 
using PointType = typename Base::MutablePointType
 
using SegmentType = typename Base::SegmentType
 
- Public Types inherited from lanelet::Primitive< ConstPolygon2d >
using DataType = typename ConstPolygon2d ::DataType
 
- Public Types inherited from lanelet::ConstPolygon2d
using Category = traits::PolygonTag
 
using ConstType = ConstPolygon2d
 
using HybridType = ConstHybridPolygon2d
 
using MutableType = Polygon2d
 
using ThreeDType = ConstPolygon3d
 
using TwoDType = ConstPolygon2d
 
- Public Types inherited from lanelet::ConstLineStringImpl< Point2d >
using BasicIterator = internal::TransformIterator< const_iterator, const BasicPointType >
 
using BasicLineString = internal::SelectBasicLineStringT< BasicPointType >
 
using BasicPointType = traits::BasicPointT< Point2d >
 
using Category = traits::LineStringTag
 
using const_iterator = internal::SelectLsIteratorT< const ConstPointType >
 
using ConstPointType = traits::ConstPointT< Point2d >
 
using ConstSegmentType = traits::ConstPrimitiveType< SegmentType >
 
using difference_type = typename iterator::difference_type
 
using iterator = const_iterator
 
using MutablePointType = traits::MutablePointT< Point2d >
 linestring will return this point type More...
 
using PointType = ConstPointType
 
using SegmentType = Segment< Point2d >
 
using size_type = size_t
 
using value_type = ConstPointType
 
- Public Types inherited from lanelet::ConstPrimitive< LineStringData >
using DataType = LineStringData
 

Public Member Functions

BasicPolygon2d basicPolygon () const
 create a simple 2d polygon from this (just a vector) More...
 
 LineStringImpl ()=default
 
 LineStringImpl (const LineStringImpl &rhs)=default
 
template<typename OtherT >
 LineStringImpl (const LineStringImpl< OtherT > &other)
 Construct from other (mutable!) LineStrings. More...
 
 LineStringImpl (const std::shared_ptr< const LineStringData > &, bool inverted)=delete
 
 LineStringImpl (const std::shared_ptr< LineStringData > &data, bool inverted)
 Construct from linestring data. More...
 
 LineStringImpl (LineStringImpl &&rhs) noexcept=default
 
 operator BasicPolygon2d () const
 
 operator LineString2d () const
 
 Polygon2d ()=default
 
 Polygon2d (const LineString2d &other)
 Conversion from LineString2d. Does not ensure validity of the polygon! More...
 
- Public Member Functions inherited from lanelet::LineStringImpl< ConstPolygon2d >
PointTypeback ()
 get a reference to the last element if it exists More...
 
iterator begin ()
 mutable iterator for the elements of this vector. More...
 
void clear ()
 
iterator end ()
 mutable iterator to the end of the elements of this vector. More...
 
iterator erase (iterator position)
 Removes point, returns iterator to the next point. More...
 
PointTypefront ()
 get a refernce to the first element (make sure it exists) More...
 
iterator insert (iterator position, const PointType &point)
 Inserts an element at a specific position. More...
 
iterator insert (iterator position, InIter start, InIter end)
 Inserts an range of elements at a specific position. More...
 
 LineStringImpl ()=default
 
 LineStringImpl (const LineStringImpl< OtherT > &other)
 Construct from other (mutable!) LineStrings. More...
 
 LineStringImpl (const std::shared_ptr< const LineStringData > &, bool inverted)=delete
 
 LineStringImpl (const std::shared_ptr< LineStringData > &data, bool inverted)
 Construct from linestring data. More...
 
LineStringImploperator= (std::vector< Point3d > &&rhs)
 Move assign from a normal vector. Id and attributes stay unchanged. More...
 
LineStringImploperator= (std::vector< PointType > rhs)
 Copy assign from a normal vector. The Id of this object is unchanged. More...
 
PointTypeoperator[] (size_t idx)
 access element at specific position More...
 
void pop_back ()
 removes element from the end More...
 
void push_back (const PointType &point)
 inserts a new element at the end More...
 
void reserve (size_t num)
 request a change in capacity More...
 
void resize (size_t num)
 
SegmentType segment (size_t idx) noexcept
 returns the n-th segment. If n equals size() -1, the segment from back() to front() is returned. More...
 
- Public Member Functions inherited from lanelet::Primitive< ConstPolygon2d >
AttributeMapattributes () noexcept
 get the attributes in a mutable way More...
 
 Primitive ()=default
 
 Primitive (const Primitive< OtherT > &rhs)
 Construct from another primitive. Only works if both share the same. More...
 
 Primitive (const std::shared_ptr< const DataType > &)=delete
 
 Primitive (const std::shared_ptr< DataType > &data)
 Construct a new primitive from shared_ptr to its data. More...
 
void setAttribute (AttributeName name, const Attribute &attribute)
 set or overwrite an attribute (enum version) More...
 
void setAttribute (const std::string &name, const Attribute &attribute)
 set or overwrite an attribute More...
 
void setId (Id id) noexcept
 set a new id for this primitive More...
 
- Public Member Functions inherited from lanelet::ConstPolygon2d
BasicPolygon2d basicPolygon () const
 create a simple 2d polygon from this (just a vector) More...
 
 ConstLineStringImpl (const ConstLineStringImpl &rhs)=default
 
template<typename OtherT >
 ConstLineStringImpl (const ConstLineStringImpl< OtherT > &other)
 construct from other ConstLineStrings More...
 
 ConstLineStringImpl (const std::shared_ptr< const LineStringData > &data, bool inverted=false)
 Constructs a linestring from the data object of another linestring. More...
 
 ConstLineStringImpl (ConstLineStringImpl &&rhs) noexcept=default
 
 ConstLineStringImpl (Id id=InvalId, Points3d points=Points3d(), const AttributeMap &attributes=AttributeMap())
 Constructs a LineString or similar from an Id and a list of points. More...
 
 ConstPolygon2d ()=default
 
 ConstPolygon2d (const ConstLineString2d &other)
 Conversion from/to ConstLineString2d. More...
 
size_t numSegments () const noexcept
 Returns the number of (geometrically valid) segments. More...
 
 operator BasicPolygon2d () const
 implicit conversion to a basic polygon in 2d More...
 
 operator ConstLineString2d () const
 
- Public Member Functions inherited from lanelet::ConstLineStringImpl< Point2d >
const ConstPointTypeback () const noexcept
 returns the last point (if it exist) More...
 
BasicIterator basicBegin () const noexcept
 returns a normal iterator to the internal point type at begin More...
 
BasicIterator basicEnd () const noexcept
 returns a normal iterator for the internal point type at end More...
 
BasicLineString basicLineString () const noexcept
 Create a basic linestring (ie a vector of Eigen Points) More...
 
const_iterator begin () const noexcept
 Returns an iterator to the start of the points. More...
 
 ConstLineStringImpl (const ConstLineStringImpl< OtherT > &other)
 construct from other ConstLineStrings More...
 
 ConstLineStringImpl (const std::shared_ptr< const LineStringData > &data, bool inverted=false)
 Constructs a linestring from the data object of another linestring. More...
 
 ConstLineStringImpl (Id id=InvalId, Points3d points=Points3d(), const AttributeMap &attributes=AttributeMap())
 Constructs a LineString or similar from an Id and a list of points. More...
 
bool empty () const noexcept
 return if there are any points in this object More...
 
const_iterator end () const noexcept
 Returns an iterator to end of the points. More...
 
const ConstPointTypefront () const noexcept
 returns the first point (if it exist) More...
 
bool inverted () const noexcept
 Returns whether this is an inverted linestring. More...
 
size_t numSegments () const noexcept
 Returns the number of (geometrically valid) segments. More...
 
const ConstPointTypeoperator[] (size_t idx) const noexcept
 returns the point at this position More...
 
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. More...
 
size_t size () const noexcept
 Return the number of points in this linestring. More...
 
- Public Member Functions inherited from lanelet::ConstPrimitive< LineStringData >
const Attributeattribute (AttributeName name) const
 retrieve an attribute (enum version) More...
 
const Attributeattribute (const std::string &name) const
 retrieve an attribute More...
 
attributeOr (AttributeName name, T defaultVal) const
 retrieve an attribute (enum version) More...
 
attributeOr (const std::string &name, T defaultVal) const noexcept
 retrieve an attribute (string version) More...
 
const AttributeMapattributes () const
 get the attributes of this primitive More...
 
const std::shared_ptr< const LineStringData > & constData () const
 get the internal data of this primitive More...
 
 ConstPrimitive (const std::shared_ptr< const LineStringData > &data)
 Construct from a pointer to the data. More...
 
bool hasAttribute (AttributeName name) const noexcept
 check for an attribute (enum version) More...
 
bool hasAttribute (const std::string &name) const noexcept
 check whether this primitive has a specific attribute More...
 
Id id () const noexcept
 get the unique id of this primitive More...
 
bool operator!= (const ConstPrimitive &rhs) const
 
bool operator== (const ConstPrimitive &rhs) const
 

Friends

class Polygon3d
 

Additional Inherited Members

- Static Public Attributes inherited from lanelet::Primitive< ConstPolygon2d >
static constexpr bool IsConst
 
- Static Public Attributes inherited from lanelet::ConstLineStringImpl< Point2d >
static constexpr traits::Dimensions Dimension
 
- Static Public Attributes inherited from lanelet::ConstPrimitive< LineStringData >
static constexpr bool IsConst
 
- Protected Types inherited from lanelet::LineStringImpl< ConstPolygon2d >
using Base = Primitive< ConstPolygon2d >
 
- Protected Member Functions inherited from lanelet::LineStringImpl< ConstPolygon2d >
 LineStringImpl (const LineStringImpl &rhs)=default
 
 LineStringImpl (LineStringImpl &&rhs) noexcept=default
 
LineStringImploperator= (const LineStringImpl &rhs)=default
 
LineStringImploperator= (LineStringImpl &&rhs) noexcept=default
 
Points3dpoints ()
 
 ~LineStringImpl () noexcept=default
 
- Protected Member Functions inherited from lanelet::Primitive< ConstPolygon2d >
std::shared_ptr< DataTypedata () const
 
Primitiveoperator= (const Primitive &rhs) noexcept
 
Primitiveoperator= (Primitive &&rhs) noexcept
 
 Primitive (const Primitive &rhs) noexcept
 
 Primitive (Primitive &&rhs) noexcept
 
 ~Primitive () noexcept=default
 
- Protected Member Functions inherited from lanelet::ConstLineStringImpl< Point2d >
 ConstLineStringImpl (const ConstLineStringImpl &rhs)=default
 
 ConstLineStringImpl (ConstLineStringImpl &&rhs) noexcept=default
 
ConstLineStringImploperator= (const ConstLineStringImpl &rhs)=default
 
ConstLineStringImploperator= (ConstLineStringImpl &&rhs) noexcept=default
 
 ~ConstLineStringImpl () noexcept=default
 
- Protected Member Functions inherited from lanelet::ConstPrimitive< LineStringData >
 ConstPrimitive (const ConstPrimitive &rhs)=default
 
 ConstPrimitive (ConstPrimitive &&rhs) noexcept=default
 
ConstPrimitiveoperator= (const ConstPrimitive &rhs)=default
 
ConstPrimitiveoperator= (ConstPrimitive &&rhs) noexcept=default
 
 ~ConstPrimitive () noexcept=default
 

Detailed Description

An mutable clockwise oriented, open (ie start point != end point) polygon in 2d.

Definition at line 188 of file primitives/Polygon.h.

Member Typedef Documentation

◆ ConstType

Definition at line 191 of file primitives/Polygon.h.

◆ MutableType

Definition at line 192 of file primitives/Polygon.h.

◆ ThreeDType

Definition at line 194 of file primitives/Polygon.h.

◆ TwoDType

Definition at line 193 of file primitives/Polygon.h.

Constructor & Destructor Documentation

◆ Polygon2d() [1/2]

lanelet::Polygon2d::Polygon2d ( )
default

◆ Polygon2d() [2/2]

lanelet::Polygon2d::Polygon2d ( const LineString2d other)
inlineexplicit

Conversion from LineString2d. Does not ensure validity of the polygon!

Definition at line 199 of file primitives/Polygon.h.

Member Function Documentation

◆ basicPolygon()

BasicPolygon2d lanelet::Polygon2d::basicPolygon ( ) const
inline

create a simple 2d polygon from this (just a vector)

Definition at line 205 of file primitives/Polygon.h.

◆ LineStringImpl() [1/6]

lanelet::LineStringImpl< ConstLineStringT >::LineStringImpl
default

◆ LineStringImpl() [2/6]

lanelet::LineStringImpl< ConstLineStringT >::LineStringImpl
default

◆ LineStringImpl() [3/6]

template<typename OtherT >
lanelet::LineStringImpl< ConstLineStringT >::LineStringImpl ( typename OtherT  )
inlineexplicit

Construct from other (mutable!) LineStrings.

Definition at line 380 of file primitives/LineString.h.

◆ LineStringImpl() [4/6]

lanelet::LineStringImpl< ConstLineStringT >::LineStringImpl
explicitdelete

◆ LineStringImpl() [5/6]

lanelet::LineStringImpl< ConstLineStringT >::LineStringImpl
inlineexplicit

Construct from linestring data.

Definition at line 385 of file primitives/LineString.h.

◆ LineStringImpl() [6/6]

lanelet::LineStringImpl< ConstLineStringT >::LineStringImpl
defaultnoexcept

◆ operator BasicPolygon2d()

lanelet::Polygon2d::operator BasicPolygon2d ( ) const
inline

Definition at line 209 of file primitives/Polygon.h.

◆ operator LineString2d()

lanelet::Polygon2d::operator LineString2d ( ) const
inlineexplicit

Definition at line 200 of file primitives/Polygon.h.

Friends And Related Function Documentation

◆ Polygon3d

friend class Polygon3d
friend

Definition at line 212 of file primitives/Polygon.h.


The documentation for this class was generated from the following file:


lanelet2_core
Author(s): Fabian Poggenhans
autogenerated on Thu Mar 6 2025 03:25:52