An axis aligned box. More...
#include <AlignedBox.h>
Public Types | |
enum | { AmbientDimAtCompileTime = _AmbientDim } |
enum | { AmbientDimAtCompileTime = _AmbientDim } |
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 } |
typedef _Scalar | Scalar |
typedef NumTraits< Scalar >::Real | RealScalar |
typedef Matrix< Scalar, AmbientDimAtCompileTime, 1 > | VectorType |
typedef _Scalar | Scalar |
typedef NumTraits< Scalar > | ScalarTraits |
typedef DenseIndex | Index |
typedef ScalarTraits::Real | RealScalar |
typedef ScalarTraits::NonInteger | NonInteger |
typedef Matrix< Scalar, AmbientDimAtCompileTime, 1 > | VectorType |
Public Member Functions | |
AlignedBox () | |
AlignedBox (int _dim) | |
AlignedBox (const VectorType &_min, const VectorType &_max) | |
AlignedBox (const VectorType &p) | |
~AlignedBox () | |
int | dim () const |
bool | isNull () const |
void | setNull () |
const VectorType & | min () const |
VectorType & | min () |
const VectorType & | max () const |
VectorType & | max () |
bool | contains (const VectorType &p) const |
bool | contains (const AlignedBox &b) const |
AlignedBox & | extend (const VectorType &p) |
AlignedBox & | extend (const AlignedBox &b) |
AlignedBox & | clamp (const AlignedBox &b) |
AlignedBox & | translate (const VectorType &t) |
Scalar | squaredExteriorDistance (const VectorType &p) const |
Scalar | exteriorDistance (const VectorType &p) const |
template<typename NewScalarType > | |
internal::cast_return_type < AlignedBox, AlignedBox < NewScalarType, AmbientDimAtCompileTime > >::type | cast () const |
template<typename OtherScalarType > | |
AlignedBox (const AlignedBox< OtherScalarType, AmbientDimAtCompileTime > &other) | |
bool | isApprox (const AlignedBox &other, typename NumTraits< Scalar >::Real prec=precision< Scalar >()) const |
AlignedBox () | |
AlignedBox (Index _dim) | |
template<typename OtherVectorType1 , typename OtherVectorType2 > | |
AlignedBox (const OtherVectorType1 &_min, const OtherVectorType2 &_max) | |
template<typename Derived > | |
AlignedBox (const MatrixBase< Derived > &a_p) | |
~AlignedBox () | |
Index | dim () const |
bool | isNull () const |
void | setNull () |
bool | isEmpty () const |
void | setEmpty () |
const VectorType & | min () const |
VectorType & | min () |
const VectorType & | max () const |
VectorType & | max () |
const CwiseUnaryOp < internal::scalar_quotient1_op < Scalar >, const CwiseBinaryOp < internal::scalar_sum_op < Scalar >, const VectorType, const VectorType > > | center () const |
const CwiseBinaryOp < internal::scalar_difference_op < Scalar >, const VectorType, const VectorType > | sizes () const |
Scalar | volume () const |
CwiseBinaryOp < internal::scalar_difference_op < Scalar >, const VectorType, const VectorType > | diagonal () const |
VectorType | corner (CornerType corner) const |
VectorType | sample () const |
template<typename Derived > | |
bool | contains (const MatrixBase< Derived > &a_p) const |
bool | contains (const AlignedBox &b) const |
template<typename Derived > | |
AlignedBox & | extend (const MatrixBase< Derived > &a_p) |
AlignedBox & | extend (const AlignedBox &b) |
AlignedBox & | clamp (const AlignedBox &b) |
AlignedBox | intersection (const AlignedBox &b) const |
AlignedBox | merged (const AlignedBox &b) const |
template<typename Derived > | |
AlignedBox & | translate (const MatrixBase< Derived > &a_t) |
template<typename Derived > | |
Scalar | squaredExteriorDistance (const MatrixBase< Derived > &a_p) const |
Scalar | squaredExteriorDistance (const AlignedBox &b) const |
template<typename Derived > | |
NonInteger | exteriorDistance (const MatrixBase< Derived > &p) const |
NonInteger | exteriorDistance (const AlignedBox &b) const |
template<typename NewScalarType > | |
internal::cast_return_type < AlignedBox, AlignedBox < NewScalarType, AmbientDimAtCompileTime > >::type | cast () const |
template<typename OtherScalarType > | |
AlignedBox (const AlignedBox< OtherScalarType, AmbientDimAtCompileTime > &other) | |
bool | isApprox (const AlignedBox &other, RealScalar prec=ScalarTraits::dummy_precision()) const |
Protected Attributes | |
VectorType | m_min |
VectorType | m_max |
An axis aligned box.
_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.
_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.
typedef DenseIndex AlignedBox< _Scalar, _AmbientDim >::Index |
typedef ScalarTraits::NonInteger AlignedBox< _Scalar, _AmbientDim >::NonInteger |
typedef NumTraits<Scalar>::Real AlignedBox< _Scalar, _AmbientDim >::RealScalar |
typedef ScalarTraits::Real AlignedBox< _Scalar, _AmbientDim >::RealScalar |
typedef _Scalar AlignedBox< _Scalar, _AmbientDim >::Scalar |
typedef _Scalar AlignedBox< _Scalar, _AmbientDim >::Scalar |
typedef NumTraits<Scalar> AlignedBox< _Scalar, _AmbientDim >::ScalarTraits |
typedef Matrix<Scalar,AmbientDimAtCompileTime,1> AlignedBox< _Scalar, _AmbientDim >::VectorType |
typedef Matrix<Scalar,AmbientDimAtCompileTime,1> AlignedBox< _Scalar, _AmbientDim >::VectorType |
enum AlignedBox::CornerType |
Define constants to name the corners of a 1D, 2D or 3D axis aligned bounding box
AlignedBox< _Scalar, _AmbientDim >::AlignedBox | ( | ) | [inline, explicit] |
Default constructor initializing a null box.
AlignedBox< _Scalar, _AmbientDim >::AlignedBox | ( | int | _dim | ) | [inline, explicit] |
Constructs a null box with _dim the dimension of the ambient space.
AlignedBox< _Scalar, _AmbientDim >::AlignedBox | ( | const VectorType & | _min, | |
const VectorType & | _max | |||
) | [inline] |
Constructs a box with extremities _min and _max.
AlignedBox< _Scalar, _AmbientDim >::AlignedBox | ( | const VectorType & | p | ) | [inline, explicit] |
Constructs a box containing a single point p.
AlignedBox< _Scalar, _AmbientDim >::~AlignedBox | ( | ) | [inline] |
AlignedBox< _Scalar, _AmbientDim >::AlignedBox | ( | const AlignedBox< OtherScalarType, AmbientDimAtCompileTime > & | other | ) | [inline, explicit] |
Copy constructor with scalar type conversion
AlignedBox< _Scalar, _AmbientDim >::AlignedBox | ( | ) | [inline, explicit] |
Default constructor initializing a null box.
AlignedBox< _Scalar, _AmbientDim >::AlignedBox | ( | Index | _dim | ) | [inline, explicit] |
Constructs a null box with _dim the dimension of the ambient space.
AlignedBox< _Scalar, _AmbientDim >::AlignedBox | ( | const OtherVectorType1 & | _min, | |
const OtherVectorType2 & | _max | |||
) | [inline] |
Constructs a box with extremities _min and _max.
AlignedBox< _Scalar, _AmbientDim >::AlignedBox | ( | const MatrixBase< Derived > & | a_p | ) | [inline, explicit] |
Constructs a box containing a single point p.
AlignedBox< _Scalar, _AmbientDim >::~AlignedBox | ( | ) | [inline] |
AlignedBox< _Scalar, _AmbientDim >::AlignedBox | ( | const AlignedBox< OtherScalarType, AmbientDimAtCompileTime > & | other | ) | [inline, explicit] |
Copy constructor with scalar type conversion
internal::cast_return_type<AlignedBox, AlignedBox<NewScalarType,AmbientDimAtCompileTime> >::type AlignedBox< _Scalar, _AmbientDim >::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
.
internal::cast_return_type<AlignedBox, AlignedBox<NewScalarType,AmbientDimAtCompileTime> >::type AlignedBox< _Scalar, _AmbientDim >::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
.
const CwiseUnaryOp<internal::scalar_quotient1_op<Scalar>, const CwiseBinaryOp<internal::scalar_sum_op<Scalar>, const VectorType, const VectorType> > AlignedBox< _Scalar, _AmbientDim >::center | ( | ) | const [inline] |
AlignedBox& AlignedBox< _Scalar, _AmbientDim >::clamp | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | [inline] |
Clamps *this
by the box b and returns a reference to *this
.
AlignedBox& AlignedBox< _Scalar, _AmbientDim >::clamp | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | [inline] |
Clamps *this
by the box b and returns a reference to *this
.
bool AlignedBox< _Scalar, _AmbientDim >::contains | ( | const MatrixBase< Derived > & | a_p | ) | const [inline] |
*this
. bool AlignedBox< _Scalar, _AmbientDim >::contains | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | const [inline] |
*this
. bool AlignedBox< _Scalar, _AmbientDim >::contains | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | const [inline] |
*this
. bool AlignedBox< _Scalar, _AmbientDim >::contains | ( | const VectorType & | p | ) | const [inline] |
*this
. VectorType AlignedBox< _Scalar, _AmbientDim >::corner | ( | CornerType | corner | ) | const [inline] |
CwiseBinaryOp< internal::scalar_difference_op<Scalar>, const VectorType, const VectorType> AlignedBox< _Scalar, _AmbientDim >::diagonal | ( | ) | const [inline] |
int AlignedBox< _Scalar, _AmbientDim >::dim | ( | ) | const [inline] |
Index AlignedBox< _Scalar, _AmbientDim >::dim | ( | ) | const [inline] |
AlignedBox& AlignedBox< _Scalar, _AmbientDim >::extend | ( | const MatrixBase< Derived > & | a_p | ) | [inline] |
Extends *this
such that it contains the point p and returns a reference to *this
.
AlignedBox& AlignedBox< _Scalar, _AmbientDim >::extend | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | [inline] |
Extends *this
such that it contains the box b and returns a reference to *this
.
AlignedBox& AlignedBox< _Scalar, _AmbientDim >::extend | ( | const VectorType & | p | ) | [inline] |
Extends *this
such that it contains the point p and returns a reference to *this
.
AlignedBox& AlignedBox< _Scalar, _AmbientDim >::extend | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | [inline] |
Extends *this
such that it contains the box b and returns a reference to *this
.
NonInteger AlignedBox< _Scalar, _AmbientDim >::exteriorDistance | ( | const MatrixBase< Derived > & | p | ) | const [inline] |
*this
, and zero if p is inside the box. NonInteger AlignedBox< _Scalar, _AmbientDim >::exteriorDistance | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | const [inline] |
*this
, and zero if the boxes intersect. Scalar AlignedBox< _Scalar, _AmbientDim >::exteriorDistance | ( | const VectorType & | p | ) | const [inline] |
*this
, and zero if p is inside the box. AlignedBox AlignedBox< _Scalar, _AmbientDim >::intersection | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | const [inline] |
Returns an AlignedBox that is the intersection of b and *this
bool AlignedBox< _Scalar, _AmbientDim >::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 AlignedBox< _Scalar, _AmbientDim >::isApprox | ( | const AlignedBox< _Scalar, _AmbientDim > & | other, | |
RealScalar | prec = ScalarTraits::dummy_precision() | |||
) | const [inline] |
true
if *this
is approximately equal to other, within the precision determined by prec.bool AlignedBox< _Scalar, _AmbientDim >::isEmpty | ( | ) | const [inline] |
bool AlignedBox< _Scalar, _AmbientDim >::isNull | ( | ) | const [inline] |
bool AlignedBox< _Scalar, _AmbientDim >::isNull | ( | ) | const [inline] |
VectorType& AlignedBox< _Scalar, _AmbientDim >::max | ( | ) | [inline] |
VectorType& AlignedBox< _Scalar, _AmbientDim >::max | ( | ) | [inline] |
const VectorType& AlignedBox< _Scalar, _AmbientDim >::max | ( | ) | const [inline] |
const VectorType& AlignedBox< _Scalar, _AmbientDim >::max | ( | ) | const [inline] |
AlignedBox AlignedBox< _Scalar, _AmbientDim >::merged | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | const [inline] |
Returns an AlignedBox that is the union of b and *this
VectorType& AlignedBox< _Scalar, _AmbientDim >::min | ( | ) | [inline] |
const VectorType& AlignedBox< _Scalar, _AmbientDim >::min | ( | ) | const [inline] |
const VectorType& AlignedBox< _Scalar, _AmbientDim >::min | ( | ) | const [inline] |
VectorType& AlignedBox< _Scalar, _AmbientDim >::min | ( | ) | [inline] |
VectorType AlignedBox< _Scalar, _AmbientDim >::sample | ( | ) | const [inline] |
void AlignedBox< _Scalar, _AmbientDim >::setEmpty | ( | ) | [inline] |
Makes *this
an empty box.
void AlignedBox< _Scalar, _AmbientDim >::setNull | ( | ) | [inline] |
Makes *this
a null/empty box.
void AlignedBox< _Scalar, _AmbientDim >::setNull | ( | ) | [inline] |
const CwiseBinaryOp< internal::scalar_difference_op<Scalar>, const VectorType, const VectorType> AlignedBox< _Scalar, _AmbientDim >::sizes | ( | ) | const [inline] |
Scalar AlignedBox< Scalar, AmbiantDim >::squaredExteriorDistance | ( | const VectorType & | p | ) | const [inline] |
*this
, and zero if p is inside the box. Scalar AlignedBox< Scalar, AmbientDim >::squaredExteriorDistance | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | const [inline] |
*this
, and zero if the boxes intersect. Scalar AlignedBox< Scalar, AmbientDim >::squaredExteriorDistance | ( | const MatrixBase< Derived > & | a_p | ) | const [inline] |
*this
, and zero if p is inside the box. AlignedBox& AlignedBox< _Scalar, _AmbientDim >::translate | ( | const MatrixBase< Derived > & | a_t | ) | [inline] |
Translate *this
by the vector t and returns a reference to *this
.
AlignedBox& AlignedBox< _Scalar, _AmbientDim >::translate | ( | const VectorType & | t | ) | [inline] |
Translate *this
by the vector t and returns a reference to *this
.
Scalar AlignedBox< _Scalar, _AmbientDim >::volume | ( | ) | const [inline] |
VectorType AlignedBox< _Scalar, _AmbientDim >::m_max [protected] |
VectorType AlignedBox< _Scalar, _AmbientDim >::m_min [protected] |