2 #pragma GCC diagnostic push 3 #if defined __GNUC__ && (__GNUC__ >= 6) 4 #pragma GCC diagnostic ignored "-Wignored-attributes" 5 #pragma GCC diagnostic ignored "-Wint-in-bool-context" 8 #pragma GCC diagnostic pop 20 using BasicPoint2d = Eigen::Matrix<double, 2, 1, Eigen::DontAlign>;
22 Eigen::aligned_allocator<Eigen::Vector2d>>;
29 template <
typename InType>
31 return t.basicPoint2d();
67 static constexpr
bool IsPrimitive =
false;
68 static constexpr
Dimensions Dimension = Dimensions::Three;
75 static constexpr
bool IsPrimitive =
false;
83 static constexpr
bool IsPrimitive =
false;
89 return {primitive.x(), primitive.y(), 0};
93 return {primitive.x(), primitive.y()};
108 :
PrimitiveData(id, attributes), point(point), point2d_{point.x(), point.y()} {}
115 if (BOOST_UNLIKELY(point.head<2>() != point2d_)) {
116 point2d_ = point.head<2>();
182 const BasicPoint& basicPoint()
const noexcept {
return point2d(); }
186 const BasicPoint2d& basicPoint2d()
const noexcept {
return point2d(); }
189 double x()
const noexcept {
return point().x(); }
192 double y()
const noexcept {
return point().y(); }
195 const BasicPoint3d& point()
const {
return constData()->point; }
196 const BasicPoint2d& point2d()
const {
return constData()->point2d(); }
224 double z() const noexcept {
return point().z(); }
247 return point().head<2>();
257 double&
x() noexcept {
return point().x(); }
260 double&
y() noexcept {
return point().y(); }
261 double z()
const noexcept =
delete;
264 using Primitive::point;
303 double&
x() noexcept {
return point().x(); }
306 double&
y() noexcept {
return point().y(); }
309 double&
z() noexcept {
return point().z(); }
313 return stream <<
"[id: " << obj.
id() <<
" x: " << obj.x() <<
" y: " << obj.y() <<
"]";
317 return stream <<
"[id: " << obj.
id() <<
" x: " << obj.x() <<
" y: " << obj.y() <<
" z: " << obj.
z() <<
"]";
321 return stream <<
"[id: " << obj.
id() <<
" x: " << obj.
x() <<
" y: " << obj.
y() <<
"]";
325 return stream <<
"[id: " << obj.
id() <<
" x: " << obj.
x() <<
" y: " << obj.
y() <<
" z: " << obj.
z() <<
"]";
329 template <
typename T>
331 return isCategory<T, traits::PointTag>();
334 template <
typename T,
typename RetT>
335 using IfPT = std::enable_if_t<traits::isPointT<T>(), RetT>;
std::vector< BasicPoint3d > BasicPoints3d
multiple simple 3d-points
typename PrimitiveTraits< BasicPoint2d >::ConstType ConstPoint
std::vector< Eigen::Vector2d, Eigen::aligned_allocator< Eigen::Vector2d > > BasicPoints2d
multiple simple 2d-points
PointData(Id id, BasicPoint3d point, const AttributeMap &attributes=AttributeMap())
Id id() const noexcept
get the unique id of this primitive
typename PrimitiveTraits< BasicPoint2d >::MutableType MutablePoint
double & y() noexcept
gets a mutable reference to the y coordinate
auto basicPoint() noexcept
get a mutable reference to the 2d point data
double & z() noexcept
gets a mutable reference to the z coordinate
ConstPoint3d(const ConstPoint2d &other)
const BasicPoint2d & convert(const InType &t) const
typename PrimitiveTraits< BasicPoint3d >::ConstType ConstPoint
Eigen::Vector3d BasicPoint3d
a simple 3d-point
Point3d(const Point2d &other)
constructs a 3D from a 2D point. No data is lost in that process.
std::ostream & operator<<(std::ostream &stream, const Attribute &obj)
HybridMap< Attribute, decltype(AttributeNamesString::Map)&, AttributeNamesString::Map > AttributeMap
double z() const noexcept
get the z coordinate
const BasicPoint2d & basicPoint() const noexcept
get a basic 2d point
BasicPoint3d to3D(const BasicPoint2d &primitive)
typename T::MutableType MutableType
typename PrimitiveTraits< BasicPoint2d >::ConstType ConstPoint
double & y() noexcept
gets a mutable reference to the y coordinate
Describes a position in linestring coordinates.
std::enable_if_t< traits::isPointT< T >(), RetT > IfPT
constexpr bool isPointT()
Identifies RegulatoryElementPrimitives.
const BasicPoint & basicPoint() const noexcept
get a basic 3d point
BasicPoint2d BasicPoint
returned basic point type
double & x() noexcept
gets a mutable reference to the x coordinate
typename PrimitiveTraits< BasicPoint2d >::MutableType MutablePoint
double & x() noexcept
gets a mutable reference to the x coordinate
Optional< double > distance
typename PrimitiveTraits< BasicPoint3d >::MutableType MutablePoint
Basic Primitive class for all primitives of lanelet2.
Base class for all mutable Primitives of lanelet2.
Common data class for all lanelet primitivesThis class provides the data that all lanelet primitives ...
BasicPoint2d to2D(const BasicPoint3d &primitive)
const BasicPoint2d & point2d() const
BasicPoint & basicPoint() noexcept
Get a mutable reference to the internal 3d point.
Eigen::Matrix< double, 2, 1, Eigen::DontAlign > BasicPoint2d
a simple 2d-point
const BasicPoint & basicPoint() const noexcept
Get an immutable reference to the internal 3d point.
ConstPoint2d(Id id, const BasicPoint3d &point, const AttributeMap &attributes=AttributeMap())
Construct from an id and a point.
ConstPrimitive(const std::shared_ptr< const Data > &data)
Construct from a pointer to the data.
Specialization of traits for points.
typename T::ConstType ConstType
constexpr Id InvalId
indicates a primitive that is not part of a map