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