Axis-Aligned bounding box in 2d. More...
#include <BoundingBox.h>
Public Types | |
enum | { AmbientDimAtCompileTime = 2 } |
enum | CornerType { Min = 0, Max = 1, BottomLeft = 0, BottomRight = 1, TopLeft = 2, TopRight = 3, BottomLeftFloor = 0, BottomRightFloor = 1, TopLeftFloor = 2, TopRightFloor = 3, BottomLeftCeil = 4, BottomRightCeil = 5, TopLeftCeil = 6, TopRightCeil = 7 } |
using | Index = Eigen::Index |
using | NonInteger = ScalarTraits::NonInteger |
using | RealScalar = ScalarTraits::Real |
using | Scalar = double |
using | ScalarTraits = Eigen::NumTraits< Scalar > |
using | VectorType = BasicPoint2d |
Public Member Functions | |
BoundingBox2d () | |
BoundingBox2d (const Eigen::AlignedBox< double, 2 > &other) | |
template<typename OtherScalarType > | |
BoundingBox2d (const Eigen::AlignedBox< OtherScalarType, AmbientDimAtCompileTime > &other) | |
template<typename Derived > | |
BoundingBox2d (const Eigen::MatrixBase< Derived > &p) | |
BoundingBox2d (Index dim) | |
template<typename OtherVectorType1 , typename OtherVectorType2 > | |
BoundingBox2d (OtherVectorType1 min, OtherVectorType2 max) | |
BasicPoint2d | center () const |
BoundingBox2d & | clamp (const BoundingBox2d &b) |
bool | contains (const BoundingBox2d &b) const |
template<typename Derived > | |
bool | contains (const Eigen::MatrixBase< Derived > &p) const |
VectorType | corner (CornerType corner) const |
BasicPoint2d | diagonal () const |
Index | dim () const |
BoundingBox2d & | extend (const BoundingBox2d &b) |
template<typename Derived > | |
BoundingBox2d & | extend (const Eigen::MatrixBase< Derived > &p) |
NonInteger | exteriorDistance (const BoundingBox2d &b) const |
template<typename Derived > | |
NonInteger | exteriorDistance (const Eigen::MatrixBase< Derived > &p) const |
BoundingBox2d | intersection (const BoundingBox2d &b) const |
bool | intersects (const BoundingBox2d &b) const |
bool | isApprox (const BoundingBox2d &other, const RealScalar &prec=ScalarTraits::dummy_precision()) const |
bool | isEmpty () const |
bool | isNull () const |
VectorType &() | max () |
const VectorType &() | max () const |
BoundingBox2d | merged (const BoundingBox2d &b) const |
VectorType &() | min () |
const VectorType &() | min () const |
VectorType | sample () const |
void | setEmpty () |
void | setNull () |
BasicPoint2d | sizes () const |
Scalar | squaredExteriorDistance (const BoundingBox2d &b) const |
template<typename Derived > | |
Scalar | squaredExteriorDistance (const Eigen::MatrixBase< Derived > &p) const |
template<typename Derived > | |
BoundingBox2d & | translate (const Eigen::MatrixBase< Derived > &aT) |
Scalar | volume () const |
Private Attributes | |
VectorType | max_ |
VectorType | min_ |
Axis-Aligned bounding box in 2d.
Eigens aligned bounding box does not work for us in 2d, because of its memory alignment reqiurements. This is basically the same implementation, but without the memory alginment. We don't have to do that for the 3d case, because the 3d case does not use memory alignment in Eigen.
Definition at line 23 of file primitives/BoundingBox.h.
using lanelet::BoundingBox2d::Index = Eigen::Index |
Definition at line 28 of file primitives/BoundingBox.h.
using lanelet::BoundingBox2d::NonInteger = ScalarTraits::NonInteger |
Definition at line 30 of file primitives/BoundingBox.h.
using lanelet::BoundingBox2d::RealScalar = ScalarTraits::Real |
Definition at line 29 of file primitives/BoundingBox.h.
using lanelet::BoundingBox2d::Scalar = double |
Definition at line 26 of file primitives/BoundingBox.h.
using lanelet::BoundingBox2d::ScalarTraits = Eigen::NumTraits<Scalar> |
Definition at line 27 of file primitives/BoundingBox.h.
Definition at line 31 of file primitives/BoundingBox.h.
anonymous enum |
Enumerator | |
---|---|
AmbientDimAtCompileTime |
Definition at line 25 of file primitives/BoundingBox.h.
Define constants to name the corners of a 1D, 2D or 3D axis aligned bounding box
Definition at line 34 of file primitives/BoundingBox.h.
|
inline |
Default constructor initializing a null box.
Definition at line 60 of file primitives/BoundingBox.h.
|
inlineexplicit |
Constructs a null box with _dim the dimension of the ambient space.
Definition at line 67 of file primitives/BoundingBox.h.
|
inline |
Constructs a box with extremities _min and _max.
Definition at line 73 of file primitives/BoundingBox.h.
|
inlineexplicit |
Constructs a box containing a single point p.
Definition at line 77 of file primitives/BoundingBox.h.
|
inline |
Definition at line 79 of file primitives/BoundingBox.h.
|
inlineexplicit |
Copy constructor with scalar type conversion
Definition at line 261 of file primitives/BoundingBox.h.
|
inline |
Definition at line 113 of file primitives/BoundingBox.h.
|
inline |
Clamps *this
by the box b and returns a reference to *this
.
Definition at line 196 of file primitives/BoundingBox.h.
|
inline |
*this
. Definition at line 165 of file primitives/BoundingBox.h.
|
inline |
*this
. Definition at line 160 of file primitives/BoundingBox.h.
|
inline |
Definition at line 139 of file primitives/BoundingBox.h.
|
inline |
Definition at line 128 of file primitives/BoundingBox.h.
|
inline |
Definition at line 82 of file primitives/BoundingBox.h.
|
inline |
Extends *this
such that it contains the box b and returns a reference to *this
.
Definition at line 187 of file primitives/BoundingBox.h.
|
inline |
Extends *this
such that it contains the point p and returns a reference to *this
.
Definition at line 178 of file primitives/BoundingBox.h.
|
inline |
*this
, and zero if the boxes intersect. Definition at line 254 of file primitives/BoundingBox.h.
|
inline |
*this
, and zero if p is inside the box. Definition at line 246 of file primitives/BoundingBox.h.
|
inline |
Returns an BoundingBox2d that is the intersection of b and *this
Definition at line 205 of file primitives/BoundingBox.h.
|
inline |
*this
. Definition at line 171 of file primitives/BoundingBox.h.
|
inline |
true
if *this
is approximately equal to other, within the precision determined by prec.Definition at line 270 of file primitives/BoundingBox.h.
|
inline |
Definition at line 94 of file primitives/BoundingBox.h.
|
inline |
Definition at line 87 of file primitives/BoundingBox.h.
|
inline |
Definition at line 110 of file primitives/BoundingBox.h.
|
inline |
Definition at line 108 of file primitives/BoundingBox.h.
|
inline |
Returns an BoundingBox2d that is the union of b and *this
.
*this
. Definition at line 212 of file primitives/BoundingBox.h.
|
inline |
Definition at line 106 of file primitives/BoundingBox.h.
|
inline |
Definition at line 104 of file primitives/BoundingBox.h.
|
inline |
Definition at line 156 of file primitives/BoundingBox.h.
|
inline |
|
inline |
Definition at line 90 of file primitives/BoundingBox.h.
|
inline |
Definition at line 119 of file primitives/BoundingBox.h.
|
inline |
*this
, and zero if the boxes intersect. Definition at line 236 of file primitives/BoundingBox.h.
|
inline |
*this
, and zero if p is inside the box. Definition at line 228 of file primitives/BoundingBox.h.
|
inline |
Translate *this
by the vector t and returns a reference to *this
.
Definition at line 216 of file primitives/BoundingBox.h.
|
inline |
Definition at line 122 of file primitives/BoundingBox.h.
|
private |
Definition at line 275 of file primitives/BoundingBox.h.
|
private |
Definition at line 275 of file primitives/BoundingBox.h.