Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
lanelet::TrafficSign Class Reference

Expresses a generic traffic sign rule. More...

#include <BasicRegulatoryElements.h>

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

Public Types

using Ptr = std::shared_ptr< TrafficSign >
 
- Public Types inherited from lanelet::RegulatoryElement
using Category = traits::RegulatoryElementTag
 
using const_iterator = RuleParameterMap::const_iterator
 
using ConstType = RegulatoryElement
 
using iterator = RuleParameterMap::iterator
 
using MutableType = GenericRegulatoryElement
 
using ThreeDType = RegulatoryElement
 
using TwoDType = RegulatoryElement
 
- Public Types inherited from lanelet::ConstPrimitive< RegulatoryElementData >
using DataType = RegulatoryElementData
 

Public Member Functions

void addCancellingRefLine (const LineString3d &line)
 Add a new line from where the sign becomes inactive. More...
 
void addCancellingTrafficSign (const TrafficSignsWithType &signs)
 Add new cancelling traffic sign. More...
 
void addRefLine (const LineString3d &line)
 Add a new reference line. More...
 
void addTrafficSign (const LineStringOrPolygon3d &sign)
 Adds another traffic sign. More...
 
LineStrings3d cancelLines ()
 
ConstLineStrings3d cancelLines () const
 gets the line(s) from which a sign becomes invalid. More...
 
LineStringsOrPolygons3d cancellingTrafficSigns ()
 
ConstLineStringsOrPolygons3d cancellingTrafficSigns () const
 get list of cancellingTrafficSigns, if existing More...
 
std::vector< std::string > cancelTypes () const
 Types of the cancelling traffic signs if they exist. More...
 
LineStrings3d refLines ()
 
ConstLineStrings3d refLines () const
 gets the line(s) from which a sign becomes valid. More...
 
bool removeCancellingRefLine (const LineString3d &line)
 Remove a cancelling line. Returns true on success. More...
 
bool removeCancellingTrafficSign (const LineStringOrPolygon3d &sign)
 remove a cancelling traffic sign, returns true on success More...
 
bool removeRefLine (const LineString3d &line)
 Remove a reference line. Returns true on success. More...
 
bool removeTrafficSign (const LineStringOrPolygon3d &sign)
 remove a traffic sign and returns true on success More...
 
LineStringsOrPolygons3d trafficSigns ()
 
ConstLineStringsOrPolygons3d trafficSigns () const
 returns the traffic signs More...
 
std::string type () const
 get the id/number of the sign(s) More...
 
- Public Member Functions inherited from lanelet::RegulatoryElement
void applyVisitor (RuleParameterVisitor &visitor) const
 applies a visitor to every parameter in the regulatory element More...
 
bool empty () const
 returns true if this object contains no parameters More...
 
template<typename T >
Optional< T > find (Id id) const
 Finds a parameter by its id, independent of the role. More...
 
template<>
Optional< ConstRuleParameterfind (Id id) const
 
template<>
boost::optional< ConstLaneletfind (Id id) const
 
template<>
boost::optional< ConstAreafind (Id id) const
 
ConstRuleParameterMap getParameters () const
 Returns all parameters as const object (coversion overhead for const) More...
 
template<typename T >
std::vector< T > getParameters (const std::string &role) const
 Returns a vector of all RuleParameters that could be converted to T. More...
 
template<>
std::vector< ConstLaneletgetParameters (const std::string &role) const
 
template<typename T >
std::vector< T > getParameters (RoleName role) const
 
template<>
std::vector< ConstLaneletgetParameters (RoleName role) const
 
std::vector< std::string > roles () const
 returns all the roles this regulatory element has More...
 
void setId (Id id) noexcept
 
size_t size () const
 get the number of roles in this regulatoryElement More...
 
virtual ~RegulatoryElement ()
 
- Public Member Functions inherited from lanelet::ConstPrimitive< RegulatoryElementData >
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 RegulatoryElementData > & constData () const
 get the internal data of this primitive More...
 
 ConstPrimitive (const std::shared_ptr< const RegulatoryElementData > &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
 

Static Public Member Functions

static Ptr make (Id id, const AttributeMap &attributes, const TrafficSignsWithType &trafficSigns, const TrafficSignsWithType &cancellingTrafficSigns={}, const LineStrings3d &refLines={}, const LineStrings3d &cancelLines={})
 Create a valid TrafficSign object. More...
 

Static Public Attributes

static constexpr char RuleName [] = "traffic_sign"
 
- Static Public Attributes inherited from lanelet::RegulatoryElement
static constexpr char RuleName [] = "basic_regulatory_element"
 
- Static Public Attributes inherited from lanelet::ConstPrimitive< RegulatoryElementData >
static constexpr bool IsConst
 

Protected Member Functions

 TrafficSign (const RegulatoryElementDataPtr &data)
 
 TrafficSign (Id id, const AttributeMap &attributes, const TrafficSignsWithType &trafficSigns, const TrafficSignsWithType &cancellingTrafficSigns={}, const LineStrings3d &refLines={}, const LineStrings3d &cancelLines={})
 
- Protected Member Functions inherited from lanelet::RegulatoryElement
void applyVisitor (internal::MutableParameterVisitor &visitor) const
 
const_iterator begin () const
 
RegulatoryElementDataPtr data ()
 
const_iterator end () const
 
template<typename T >
std::vector< T > getParameters (RoleName role)
 
RuleParameterMapparameters ()
 
const RuleParameterMapparameters () const
 
 RegulatoryElement (const RegulatoryElementDataPtr &data)
 
 RegulatoryElement (Id id=InvalId, const RuleParameterMap &members=RuleParameterMap(), const AttributeMap &attributes=AttributeMap())
 
- Protected Member Functions inherited from lanelet::ConstPrimitive< RegulatoryElementData >
 ConstPrimitive (const ConstPrimitive &rhs)=default
 
 ConstPrimitive (ConstPrimitive &&rhs) noexcept=default
 
ConstPrimitiveoperator= (const ConstPrimitive &rhs)=default
 
ConstPrimitiveoperator= (ConstPrimitive &&rhs) noexcept=default
 
 ~ConstPrimitive () noexcept=default
 

Friends

class RegisterRegulatoryElement< TrafficSign >
 

Detailed Description

Expresses a generic traffic sign rule.

Definition at line 230 of file BasicRegulatoryElements.h.

Member Typedef Documentation

◆ Ptr

using lanelet::TrafficSign::Ptr = std::shared_ptr<TrafficSign>

Definition at line 232 of file BasicRegulatoryElements.h.

Constructor & Destructor Documentation

◆ TrafficSign() [1/2]

lanelet::TrafficSign::TrafficSign ( Id  id,
const AttributeMap attributes,
const TrafficSignsWithType trafficSigns,
const TrafficSignsWithType cancellingTrafficSigns = {},
const LineStrings3d refLines = {},
const LineStrings3d cancelLines = {} 
)
protected

Definition at line 274 of file BasicRegulatoryElements.cpp.

◆ TrafficSign() [2/2]

lanelet::TrafficSign::TrafficSign ( const RegulatoryElementDataPtr data)
explicitprotected

Definition at line 270 of file BasicRegulatoryElements.cpp.

Member Function Documentation

◆ addCancellingRefLine()

void lanelet::TrafficSign::addCancellingRefLine ( const LineString3d line)

Add a new line from where the sign becomes inactive.

Definition at line 320 of file BasicRegulatoryElements.cpp.

◆ addCancellingTrafficSign()

void lanelet::TrafficSign::addCancellingTrafficSign ( const TrafficSignsWithType signs)

Add new cancelling traffic sign.

Definition at line 336 of file BasicRegulatoryElements.cpp.

◆ addRefLine()

void lanelet::TrafficSign::addRefLine ( const LineString3d line)

Add a new reference line.

Definition at line 314 of file BasicRegulatoryElements.cpp.

◆ addTrafficSign()

void lanelet::TrafficSign::addTrafficSign ( const LineStringOrPolygon3d sign)

Adds another traffic sign.

Traffic signs are represented as linestrings that start at the left edge and end at the right edge of a traffic sign.

Definition at line 306 of file BasicRegulatoryElements.cpp.

◆ cancelLines() [1/2]

LineStrings3d lanelet::TrafficSign::cancelLines ( )

◆ cancelLines() [2/2]

LineStrings3d lanelet::TrafficSign::cancelLines ( ) const

gets the line(s) from which a sign becomes invalid.

Definition at line 365 of file BasicRegulatoryElements.cpp.

◆ cancellingTrafficSigns() [1/2]

LineStringsOrPolygons3d lanelet::TrafficSign::cancellingTrafficSigns ( )

◆ cancellingTrafficSigns() [2/2]

LineStringsOrPolygons3d lanelet::TrafficSign::cancellingTrafficSigns ( ) const

get list of cancellingTrafficSigns, if existing

Definition at line 347 of file BasicRegulatoryElements.cpp.

◆ cancelTypes()

std::vector< std::string > lanelet::TrafficSign::cancelTypes ( ) const

Types of the cancelling traffic signs if they exist.

Definition at line 353 of file BasicRegulatoryElements.cpp.

◆ make()

static Ptr lanelet::TrafficSign::make ( Id  id,
const AttributeMap attributes,
const TrafficSignsWithType trafficSigns,
const TrafficSignsWithType cancellingTrafficSigns = {},
const LineStrings3d refLines = {},
const LineStrings3d cancelLines = {} 
)
inlinestatic

Create a valid TrafficSign object.

A traffic sign is usually composed of a set of traffic signs of the same type that mark the beginning of the rule. It also contains multiple traffic signs (potentially of different types) that mark the end of the rule. E.g. a 50kph section would contain all 50kph signs of this section as trafficSigns. All signs that stand at the end of this section (e.g. a 70kph sign and an end of 50kph sign) would be cancellingTrafficSigns.

Parameters
idid of traffic sign rule
attributesattributes for it (might be extended if necessary)
trafficSignslist of the traffic signs defining the rule
cancellingTrafficSignslist of traffic signs where the rule is cancelled. Can be empty.
refLineslines from where the rule becomes valid. Can be empty.
cancelLineslines after which a rule becomes invalid. Can be empty.

Definition at line 250 of file BasicRegulatoryElements.h.

◆ refLines() [1/2]

LineStrings3d lanelet::TrafficSign::refLines ( )

◆ refLines() [2/2]

LineStrings3d lanelet::TrafficSign::refLines ( ) const

gets the line(s) from which a sign becomes valid.

There might or might not be such a line. If there is none, the sign is valid for the whole lanelet

Definition at line 302 of file BasicRegulatoryElements.cpp.

◆ removeCancellingRefLine()

bool lanelet::TrafficSign::removeCancellingRefLine ( const LineString3d line)

Remove a cancelling line. Returns true on success.

Definition at line 324 of file BasicRegulatoryElements.cpp.

◆ removeCancellingTrafficSign()

bool lanelet::TrafficSign::removeCancellingTrafficSign ( const LineStringOrPolygon3d sign)

remove a cancelling traffic sign, returns true on success

Definition at line 343 of file BasicRegulatoryElements.cpp.

◆ removeRefLine()

bool lanelet::TrafficSign::removeRefLine ( const LineString3d line)

Remove a reference line. Returns true on success.

Definition at line 316 of file BasicRegulatoryElements.cpp.

◆ removeTrafficSign()

bool lanelet::TrafficSign::removeTrafficSign ( const LineStringOrPolygon3d sign)

remove a traffic sign and returns true on success

Definition at line 310 of file BasicRegulatoryElements.cpp.

◆ trafficSigns() [1/2]

LineStringsOrPolygons3d lanelet::TrafficSign::trafficSigns ( )

◆ trafficSigns() [2/2]

LineStringsOrPolygons3d lanelet::TrafficSign::trafficSigns ( ) const

returns the traffic signs

There might be multiple but they are all required to show the same symbol.

Definition at line 280 of file BasicRegulatoryElements.cpp.

◆ type()

std::string lanelet::TrafficSign::type ( ) const

get the id/number of the sign(s)

The id is in the format [country-code][ID], e.g. de205. The result can be dependant on country

Definition at line 286 of file BasicRegulatoryElements.cpp.

Friends And Related Function Documentation

◆ RegisterRegulatoryElement< TrafficSign >

friend class RegisterRegulatoryElement< TrafficSign >
friend

Definition at line 319 of file BasicRegulatoryElements.h.

Member Data Documentation

◆ RuleName

constexpr char lanelet::TrafficSign::RuleName = "traffic_sign"
staticconstexpr

Definition at line 233 of file BasicRegulatoryElements.h.


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


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