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.
Definition at line 41 of file AlignedBox.h.
#include <src/Geometry/AlignedBox.h>
Public Types | |
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 } |
Define constants to name the corners of a 1D, 2D or 3D axis aligned bounding box. More... | |
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 () | |
Default constructor initializing a null box. | |
AlignedBox (Index _dim) | |
Constructs a null box with _dim the dimension of the ambient space. | |
template<typename OtherVectorType1 , typename OtherVectorType2 > | |
AlignedBox (const OtherVectorType1 &_min, const OtherVectorType2 &_max) | |
Constructs a box with extremities _min and _max. | |
template<typename Derived > | |
AlignedBox (const MatrixBase< Derived > &a_p) | |
Constructs a box containing a single point p. | |
~AlignedBox () | |
Index | dim () const |
bool | isNull () const |
void | setNull () |
bool | isEmpty () const |
void | setEmpty () |
Makes *this an empty box. | |
const VectorType & | min () const |
VectorType & | min () |
const VectorType & | max () const |
VectorType & | max () |
const CwiseUnaryOp < internal::scalar_quotient1_op < Scalar >, CwiseBinaryOp < internal::scalar_sum_op < Scalar >, VectorType, VectorType > > | center () const |
const CwiseBinaryOp < internal::scalar_difference_op < Scalar >, VectorType, VectorType > | sizes () const |
Scalar | volume () const |
CwiseBinaryOp < internal::scalar_difference_op < Scalar >, VectorType, 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) |
Extends *this such that it contains the point p and returns a reference to *this . | |
AlignedBox & | extend (const AlignedBox &b) |
Extends *this such that it contains the box b and returns a reference to *this . | |
AlignedBox & | clamp (const AlignedBox &b) |
Clamps *this by the box b and returns a reference to *this . | |
AlignedBox | intersection (const AlignedBox &b) const |
Returns an AlignedBox that is the intersection of b and *this . | |
AlignedBox | merged (const AlignedBox &b) const |
Returns an AlignedBox that is the union of b and *this . | |
template<typename Derived > | |
AlignedBox & | translate (const MatrixBase< Derived > &a_t) |
Translate *this by the vector t and returns a reference to *this . | |
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) | |
Copy constructor with scalar type conversion. | |
bool | isApprox (const AlignedBox &other, RealScalar prec=ScalarTraits::dummy_precision()) const |
Protected Attributes | |
VectorType | m_min |
VectorType | m_max |
typedef DenseIndex AlignedBox< _Scalar, _AmbientDim >::Index |
Definition at line 48 of file AlignedBox.h.
typedef ScalarTraits::NonInteger AlignedBox< _Scalar, _AmbientDim >::NonInteger |
Definition at line 50 of file AlignedBox.h.
typedef ScalarTraits::Real AlignedBox< _Scalar, _AmbientDim >::RealScalar |
Definition at line 49 of file AlignedBox.h.
typedef _Scalar AlignedBox< _Scalar, _AmbientDim >::Scalar |
Definition at line 46 of file AlignedBox.h.
typedef NumTraits<Scalar> AlignedBox< _Scalar, _AmbientDim >::ScalarTraits |
Definition at line 47 of file AlignedBox.h.
typedef Matrix<Scalar,AmbientDimAtCompileTime,1> AlignedBox< _Scalar, _AmbientDim >::VectorType |
Definition at line 51 of file AlignedBox.h.
anonymous enum |
Definition at line 45 of file AlignedBox.h.
enum AlignedBox::CornerType |
Define constants to name the corners of a 1D, 2D or 3D axis aligned bounding box.
Definition at line 54 of file AlignedBox.h.
AlignedBox< _Scalar, _AmbientDim >::AlignedBox | ( | ) | [inline, explicit] |
Default constructor initializing a null box.
Definition at line 72 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::AmbientDimAtCompileTime, Dynamic, and AlignedBox< _Scalar, _AmbientDim >::setEmpty().
Referenced by AlignedBox< _Scalar, _AmbientDim >::cast(), AlignedBox< _Scalar, _AmbientDim >::intersection(), and AlignedBox< _Scalar, _AmbientDim >::merged().
AlignedBox< _Scalar, _AmbientDim >::AlignedBox | ( | Index | _dim | ) | [inline, explicit] |
Constructs a null box with _dim the dimension of the ambient space.
Definition at line 76 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::setEmpty().
AlignedBox< _Scalar, _AmbientDim >::AlignedBox | ( | const OtherVectorType1 & | _min, |
const OtherVectorType2 & | _max | ||
) | [inline] |
Constructs a box with extremities _min and _max.
Definition at line 81 of file AlignedBox.h.
AlignedBox< _Scalar, _AmbientDim >::AlignedBox | ( | const MatrixBase< Derived > & | a_p | ) | [inline, explicit] |
Constructs a box containing a single point p.
Definition at line 85 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::m_max, and AlignedBox< _Scalar, _AmbientDim >::m_min.
AlignedBox< _Scalar, _AmbientDim >::~AlignedBox | ( | ) | [inline] |
Definition at line 92 of file AlignedBox.h.
AlignedBox< _Scalar, _AmbientDim >::AlignedBox | ( | const AlignedBox< OtherScalarType, AmbientDimAtCompileTime > & | other | ) | [inline, explicit] |
Copy constructor with scalar type conversion.
Definition at line 288 of file AlignedBox.h.
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 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
.
Definition at line 280 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::AlignedBox().
const CwiseUnaryOp<internal::scalar_quotient1_op<Scalar>, CwiseBinaryOp<internal::scalar_sum_op<Scalar>, VectorType, VectorType> > AlignedBox< _Scalar, _AmbientDim >::center | ( | ) | const [inline] |
Definition at line 125 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::m_max, and AlignedBox< _Scalar, _AmbientDim >::m_min.
AlignedBox& AlignedBox< _Scalar, _AmbientDim >::clamp | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | [inline] |
Clamps *this
by the box b and returns a reference to *this
.
Definition at line 220 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::m_max, and AlignedBox< _Scalar, _AmbientDim >::m_min.
bool AlignedBox< _Scalar, _AmbientDim >::contains | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | const [inline] |
*this
. Definition at line 198 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::m_max, AlignedBox< _Scalar, _AmbientDim >::m_min, AlignedBox< _Scalar, _AmbientDim >::max(), and AlignedBox< _Scalar, _AmbientDim >::min().
bool AlignedBox< _Scalar, _AmbientDim >::contains | ( | const MatrixBase< Derived > & | a_p | ) | const [inline] |
*this
. Definition at line 191 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::m_max, and AlignedBox< _Scalar, _AmbientDim >::m_min.
VectorType AlignedBox< _Scalar, _AmbientDim >::corner | ( | CornerType | corner | ) | const [inline] |
Definition at line 155 of file AlignedBox.h.
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>, VectorType, VectorType> AlignedBox< _Scalar, _AmbientDim >::diagonal | ( | ) | const [inline] |
Definition at line 143 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::sizes().
Index AlignedBox< _Scalar, _AmbientDim >::dim | ( | ) | const [inline] |
Definition at line 95 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::AmbientDimAtCompileTime, Dynamic, and AlignedBox< _Scalar, _AmbientDim >::m_min.
Referenced by AlignedBox< _Scalar, _AmbientDim >::corner(), and AlignedBox< _Scalar, _AmbientDim >::sample().
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
.
Definition at line 203 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::m_max, and AlignedBox< _Scalar, _AmbientDim >::m_min.
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
.
Definition at line 212 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::m_max, and AlignedBox< _Scalar, _AmbientDim >::m_min.
NonInteger AlignedBox< _Scalar, _AmbientDim >::exteriorDistance | ( | const MatrixBase< Derived > & | p | ) | const [inline] |
*this
, and zero if p is inside the box. Definition at line 263 of file AlignedBox.h.
References sqrt(), and AlignedBox< _Scalar, _AmbientDim >::squaredExteriorDistance().
NonInteger AlignedBox< _Scalar, _AmbientDim >::exteriorDistance | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | const [inline] |
*this
, and zero if the boxes intersect. Definition at line 270 of file AlignedBox.h.
References sqrt(), and AlignedBox< _Scalar, _AmbientDim >::squaredExteriorDistance().
AlignedBox AlignedBox< _Scalar, _AmbientDim >::intersection | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | const [inline] |
Returns an AlignedBox that is the intersection of b and *this
.
Definition at line 228 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::AlignedBox(), AlignedBox< _Scalar, _AmbientDim >::m_max, and AlignedBox< _Scalar, _AmbientDim >::m_min.
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.Definition at line 298 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::m_max, and AlignedBox< _Scalar, _AmbientDim >::m_min.
bool AlignedBox< _Scalar, _AmbientDim >::isEmpty | ( | ) | const [inline] |
Definition at line 104 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::m_max, and AlignedBox< _Scalar, _AmbientDim >::m_min.
Referenced by AlignedBox< _Scalar, _AmbientDim >::isNull().
bool AlignedBox< _Scalar, _AmbientDim >::isNull | ( | ) | const [inline] |
Definition at line 98 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::isEmpty().
const VectorType& AlignedBox< _Scalar, _AmbientDim >::max | ( | ) | const [inline] |
Definition at line 118 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::m_max.
Referenced by AlignedBox< _Scalar, _AmbientDim >::AlignedBox(), and AlignedBox< _Scalar, _AmbientDim >::contains().
VectorType& AlignedBox< _Scalar, _AmbientDim >::max | ( | ) | [inline] |
Definition at line 120 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::m_max.
AlignedBox AlignedBox< _Scalar, _AmbientDim >::merged | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | const [inline] |
Returns an AlignedBox that is the union of b and *this
.
Definition at line 232 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::AlignedBox(), AlignedBox< _Scalar, _AmbientDim >::m_max, and AlignedBox< _Scalar, _AmbientDim >::m_min.
const VectorType& AlignedBox< _Scalar, _AmbientDim >::min | ( | ) | const [inline] |
Definition at line 114 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::m_min.
Referenced by AlignedBox< _Scalar, _AmbientDim >::AlignedBox(), and AlignedBox< _Scalar, _AmbientDim >::contains().
VectorType& AlignedBox< _Scalar, _AmbientDim >::min | ( | ) | [inline] |
Definition at line 116 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::m_min.
VectorType AlignedBox< _Scalar, _AmbientDim >::sample | ( | ) | const [inline] |
Definition at line 173 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::dim(), GenericNumTraits< Scalar >::IsInteger, AlignedBox< _Scalar, _AmbientDim >::m_max, and AlignedBox< _Scalar, _AmbientDim >::m_min.
void AlignedBox< _Scalar, _AmbientDim >::setEmpty | ( | ) | [inline] |
Makes *this
an empty box.
Definition at line 107 of file AlignedBox.h.
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 AlignedBox< _Scalar, _AmbientDim >::setNull | ( | ) | [inline] |
Definition at line 101 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::setEmpty().
const CwiseBinaryOp< internal::scalar_difference_op<Scalar>, VectorType, VectorType> AlignedBox< _Scalar, _AmbientDim >::sizes | ( | ) | const [inline] |
Definition at line 132 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::m_max, and AlignedBox< _Scalar, _AmbientDim >::m_min.
Referenced by AlignedBox< _Scalar, _AmbientDim >::diagonal(), and AlignedBox< _Scalar, _AmbientDim >::volume().
Scalar AlignedBox< Scalar, AmbientDim >::squaredExteriorDistance | ( | const MatrixBase< Derived > & | a_p | ) | const [inline] |
*this
, and zero if p is inside the box. Definition at line 310 of file AlignedBox.h.
Referenced by AlignedBox< _Scalar, _AmbientDim >::exteriorDistance().
Scalar AlignedBox< Scalar, AmbientDim >::squaredExteriorDistance | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | const [inline] |
*this
, and zero if the boxes intersect. Definition at line 332 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::m_max, and AlignedBox< _Scalar, _AmbientDim >::m_min.
AlignedBox& AlignedBox< _Scalar, _AmbientDim >::translate | ( | const MatrixBase< Derived > & | a_t | ) | [inline] |
Translate *this
by the vector t and returns a reference to *this
.
Definition at line 237 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::m_max, AlignedBox< _Scalar, _AmbientDim >::m_min, and t().
Scalar AlignedBox< _Scalar, _AmbientDim >::volume | ( | ) | const [inline] |
Definition at line 136 of file AlignedBox.h.
References AlignedBox< _Scalar, _AmbientDim >::sizes().
VectorType AlignedBox< _Scalar, _AmbientDim >::m_max [protected] |
Definition at line 303 of file AlignedBox.h.
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 AlignedBox< _Scalar, _AmbientDim >::m_min [protected] |
Definition at line 303 of file AlignedBox.h.
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().
Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:40:17 UTC 2011 |