Expresses a generic traffic sign rule. More...
#include <BasicRegulatoryElements.h>
Public Types | |
using | Ptr = std::shared_ptr< TrafficSign > |
![]() | |
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 |
![]() | |
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... | |
![]() | |
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< ConstRuleParameter > | find (Id id) const |
template<> | |
boost::optional< ConstLanelet > | find (Id id) const |
template<> | |
boost::optional< ConstArea > | find (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< ConstLanelet > | getParameters (const std::string &role) const |
template<typename T > | |
std::vector< T > | getParameters (RoleName role) const |
template<> | |
std::vector< ConstLanelet > | getParameters (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 () |
![]() | |
const Attribute & | attribute (AttributeName name) const |
retrieve an attribute (enum version) More... | |
const Attribute & | attribute (const std::string &name) const |
retrieve an attribute More... | |
T | attributeOr (AttributeName name, T defaultVal) const |
retrieve an attribute (enum version) More... | |
T | attributeOr (const std::string &name, T defaultVal) const noexcept |
retrieve an attribute (string version) More... | |
const AttributeMap & | attributes () 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 constexpr char | RuleName [] = "basic_regulatory_element" |
![]() | |
static constexpr bool | IsConst |
Friends | |
class | RegisterRegulatoryElement< TrafficSign > |
Expresses a generic traffic sign rule.
Definition at line 230 of file BasicRegulatoryElements.h.
using lanelet::TrafficSign::Ptr = std::shared_ptr<TrafficSign> |
Definition at line 232 of file BasicRegulatoryElements.h.
|
protected |
Definition at line 274 of file BasicRegulatoryElements.cpp.
|
explicitprotected |
Definition at line 270 of file BasicRegulatoryElements.cpp.
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.
void lanelet::TrafficSign::addCancellingTrafficSign | ( | const TrafficSignsWithType & | signs | ) |
Add new cancelling traffic sign.
Definition at line 336 of file BasicRegulatoryElements.cpp.
void lanelet::TrafficSign::addRefLine | ( | const LineString3d & | line | ) |
Add a new reference line.
Definition at line 314 of file BasicRegulatoryElements.cpp.
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.
LineStrings3d lanelet::TrafficSign::cancelLines | ( | ) |
LineStrings3d lanelet::TrafficSign::cancelLines | ( | ) | const |
gets the line(s) from which a sign becomes invalid.
Definition at line 365 of file BasicRegulatoryElements.cpp.
LineStringsOrPolygons3d lanelet::TrafficSign::cancellingTrafficSigns | ( | ) |
LineStringsOrPolygons3d lanelet::TrafficSign::cancellingTrafficSigns | ( | ) | const |
get list of cancellingTrafficSigns, if existing
Definition at line 347 of file BasicRegulatoryElements.cpp.
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.
|
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.
id | id of traffic sign rule |
attributes | attributes for it (might be extended if necessary) |
trafficSigns | list of the traffic signs defining the rule |
cancellingTrafficSigns | list of traffic signs where the rule is cancelled. Can be empty. |
refLines | lines from where the rule becomes valid. Can be empty. |
cancelLines | lines after which a rule becomes invalid. Can be empty. |
Definition at line 250 of file BasicRegulatoryElements.h.
LineStrings3d lanelet::TrafficSign::refLines | ( | ) |
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.
bool lanelet::TrafficSign::removeCancellingRefLine | ( | const LineString3d & | line | ) |
Remove a cancelling line. Returns true on success.
Definition at line 324 of file BasicRegulatoryElements.cpp.
bool lanelet::TrafficSign::removeCancellingTrafficSign | ( | const LineStringOrPolygon3d & | sign | ) |
remove a cancelling traffic sign, returns true on success
Definition at line 343 of file BasicRegulatoryElements.cpp.
bool lanelet::TrafficSign::removeRefLine | ( | const LineString3d & | line | ) |
Remove a reference line. Returns true on success.
Definition at line 316 of file BasicRegulatoryElements.cpp.
bool lanelet::TrafficSign::removeTrafficSign | ( | const LineStringOrPolygon3d & | sign | ) |
remove a traffic sign and returns true on success
Definition at line 310 of file BasicRegulatoryElements.cpp.
LineStringsOrPolygons3d lanelet::TrafficSign::trafficSigns | ( | ) |
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.
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.
|
friend |
Definition at line 319 of file BasicRegulatoryElements.h.
|
staticconstexpr |
Definition at line 233 of file BasicRegulatoryElements.h.