An axis aligned box. More...
Public Types | |
enum | { AmbientDimAtCompileTime } |
typedef NumTraits< Scalar >::Real | RealScalar |
typedef _Scalar | Scalar |
typedef Matrix< Scalar, AmbientDimAtCompileTime, 1 > | VectorType |
Public Member Functions | |
AlignedBox () | |
AlignedBox (int _dim) | |
AlignedBox (const VectorType &_min, const VectorType &_max) | |
AlignedBox (const VectorType &p) | |
template<typename OtherScalarType > | |
AlignedBox (const AlignedBox< OtherScalarType, AmbientDimAtCompileTime > &other) | |
template<typename NewScalarType > | |
ei_cast_return_type < AlignedBox, AlignedBox < NewScalarType, AmbientDimAtCompileTime > >::type | cast () const |
AlignedBox & | clamp (const AlignedBox &b) |
bool | contains (const VectorType &p) const |
bool | contains (const AlignedBox &b) const |
int | dim () const |
AlignedBox & | extend (const VectorType &p) |
AlignedBox & | extend (const AlignedBox &b) |
Scalar | exteriorDistance (const VectorType &p) const |
bool | isApprox (const AlignedBox &other, typename NumTraits< Scalar >::Real prec=precision< Scalar >()) const |
bool | isNull () const |
const VectorType & | max () const |
VectorType & | max () |
const VectorType & | min () const |
VectorType & | min () |
void | setNull () |
Scalar | squaredExteriorDistance (const VectorType &p) const |
AlignedBox & | translate (const VectorType &t) |
Protected Attributes | |
VectorType | m_max |
VectorType | m_min |
An axis aligned box.
This is defined in the Geometry module.
#include <Eigen/Geometry>
_Scalar | the type of the scalar coefficients |
_AmbientDim | the dimension of the ambient space, can be a compile time value or Dynamic. |
This class represents an axis aligned box as a pair of the minimal and maximal corners.
AlignedBox | ( | ) | [inline, explicit] |
Default constructor initializing a null box.
AlignedBox | ( | int | _dim | ) | [inline, explicit] |
Constructs a null box with _dim the dimension of the ambient space.
AlignedBox | ( | const VectorType & | _min, |
const VectorType & | _max | ||
) | [inline] |
Constructs a box with extremities _min and _max.
AlignedBox | ( | const VectorType & | p | ) | [inline, explicit] |
Constructs a box containing a single point p.
AlignedBox | ( | const AlignedBox< OtherScalarType, AmbientDimAtCompileTime > & | other | ) | [inline, explicit] |
Copy constructor with scalar type conversion
ei_cast_return_type<AlignedBox, AlignedBox<NewScalarType,AmbientDimAtCompileTime> >::type cast | ( | ) | const [inline] |
*this
with scalar type casted to NewScalarType Note that if NewScalarType is equal to the current scalar type of *this
then this function smartly returns a const reference to *this
.
AlignedBox& clamp | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | [inline] |
Clamps *this
by the box b and returns a reference to *this
.
bool contains | ( | const VectorType & | p | ) | const [inline] |
*this
. bool contains | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | const [inline] |
*this
. int dim | ( | ) | const [inline] |
AlignedBox& extend | ( | const VectorType & | p | ) | [inline] |
Extends *this
such that it contains the point p and returns a reference to *this
.
AlignedBox& extend | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | [inline] |
Extends *this
such that it contains the box b and returns a reference to *this
.
Scalar exteriorDistance | ( | const VectorType & | p | ) | const [inline] |
*this
, and zero if p is inside the box. bool isApprox | ( | const AlignedBox< _Scalar, _AmbientDim > & | other, |
typename NumTraits< Scalar >::Real | prec = precision<Scalar>() |
||
) | const [inline] |
true
if *this
is approximately equal to other, within the precision determined by prec.bool isNull | ( | ) | const [inline] |
const VectorType& max | ( | ) | const [inline] |
VectorType& max | ( | ) | [inline] |
const VectorType& min | ( | ) | const [inline] |
VectorType& min | ( | ) | [inline] |
void setNull | ( | ) | [inline] |
Makes *this
a null/empty box.
Scalar squaredExteriorDistance | ( | const VectorType & | p | ) | const [inline] |
*this
, and zero if p is inside the box. AlignedBox& translate | ( | const VectorType & | t | ) | [inline] |
Translate *this
by the vector t and returns a reference to *this
.