MOAB
4.9.3pre
|
An axis aligned box. More...
#include <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 } |
typedef _Scalar | Scalar |
typedef NumTraits< Scalar > | ScalarTraits |
typedef Eigen::Index | Index |
typedef ScalarTraits::Real | RealScalar |
typedef ScalarTraits::NonInteger | NonInteger |
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 > &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 > &p) const |
bool | contains (const AlignedBox &b) const |
bool | intersects (const AlignedBox &b) const |
template<typename Derived > | |
AlignedBox & | extend (const MatrixBase< Derived > &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 > &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, const 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.
Definition at line 30 of file AlignedBox.h.
typedef Eigen::Index Eigen::AlignedBox< _Scalar, _AmbientDim >::Index |
Definition at line 37 of file AlignedBox.h.
typedef ScalarTraits::NonInteger Eigen::AlignedBox< _Scalar, _AmbientDim >::NonInteger |
Definition at line 39 of file AlignedBox.h.
typedef ScalarTraits::Real Eigen::AlignedBox< _Scalar, _AmbientDim >::RealScalar |
Definition at line 38 of file AlignedBox.h.
typedef _Scalar Eigen::AlignedBox< _Scalar, _AmbientDim >::Scalar |
Definition at line 35 of file AlignedBox.h.
typedef NumTraits<Scalar> Eigen::AlignedBox< _Scalar, _AmbientDim >::ScalarTraits |
Definition at line 36 of file AlignedBox.h.
typedef Matrix<Scalar,AmbientDimAtCompileTime,1> Eigen::AlignedBox< _Scalar, _AmbientDim >::VectorType |
Definition at line 40 of file AlignedBox.h.
anonymous enum |
Definition at line 34 of file AlignedBox.h.
{ AmbientDimAtCompileTime = _AmbientDim };
enum Eigen::AlignedBox::CornerType |
Define constants to name the corners of a 1D, 2D or 3D axis aligned bounding box
Definition at line 43 of file AlignedBox.h.
{ 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 };
Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox | ( | ) | [inline] |
Default constructor initializing a null box.
Definition at line 64 of file AlignedBox.h.
{ if (AmbientDimAtCompileTime!=Dynamic) setEmpty(); }
Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox | ( | Index | _dim | ) | [inline, explicit] |
Constructs a null box with _dim the dimension of the ambient space.
Definition at line 68 of file AlignedBox.h.
Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox | ( | const OtherVectorType1 & | _min, |
const OtherVectorType2 & | _max | ||
) | [inline] |
Constructs a box with extremities _min and _max.
Definition at line 74 of file AlignedBox.h.
Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox | ( | const MatrixBase< Derived > & | p | ) | [inline, explicit] |
Constructs a box containing a single point p.
Definition at line 78 of file AlignedBox.h.
Eigen::AlignedBox< _Scalar, _AmbientDim >::~AlignedBox | ( | ) | [inline] |
Definition at line 81 of file AlignedBox.h.
{}
Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox | ( | const AlignedBox< OtherScalarType, AmbientDimAtCompileTime > & | other | ) | [inline, explicit] |
Copy constructor with scalar type conversion
Definition at line 292 of file AlignedBox.h.
internal::cast_return_type<AlignedBox, AlignedBox<NewScalarType,AmbientDimAtCompileTime> >::type Eigen::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 284 of file AlignedBox.h.
{ return typename internal::cast_return_type<AlignedBox, AlignedBox<NewScalarType,AmbientDimAtCompileTime> >::type(*this); }
const CwiseUnaryOp<internal::scalar_quotient1_op<Scalar>, const CwiseBinaryOp<internal::scalar_sum_op<Scalar>, const VectorType, const VectorType> > Eigen::AlignedBox< _Scalar, _AmbientDim >::center | ( | ) | const [inline] |
Definition at line 116 of file AlignedBox.h.
AlignedBox& Eigen::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.
bool Eigen::AlignedBox< _Scalar, _AmbientDim >::contains | ( | const MatrixBase< Derived > & | p | ) | const [inline] |
*this
. Definition at line 182 of file AlignedBox.h.
bool Eigen::AlignedBox< _Scalar, _AmbientDim >::contains | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | const [inline] |
*this
. Definition at line 189 of file AlignedBox.h.
VectorType Eigen::AlignedBox< _Scalar, _AmbientDim >::corner | ( | CornerType | corner | ) | const [inline] |
Definition at line 146 of file AlignedBox.h.
{ EIGEN_STATIC_ASSERT(_AmbientDim <= 3, THIS_METHOD_IS_ONLY_FOR_VECTORS_OF_A_SPECIFIC_SIZE); VectorType res; Index mult = 1; for(Index d=0; d<dim(); ++d) { if( mult & corner ) res[d] = m_max[d]; else res[d] = m_min[d]; mult *= 2; } return res; }
CwiseBinaryOp< internal::scalar_difference_op<Scalar>, const VectorType, const VectorType> Eigen::AlignedBox< _Scalar, _AmbientDim >::diagonal | ( | ) | const [inline] |
Definition at line 134 of file AlignedBox.h.
{ return sizes(); }
Index Eigen::AlignedBox< _Scalar, _AmbientDim >::dim | ( | ) | const [inline] |
Definition at line 84 of file AlignedBox.h.
{ return AmbientDimAtCompileTime==Dynamic ? m_min.size() : Index(AmbientDimAtCompileTime); }
AlignedBox& Eigen::AlignedBox< _Scalar, _AmbientDim >::extend | ( | const MatrixBase< Derived > & | p | ) | [inline] |
Extends *this
such that it contains the point p and returns a reference to *this
.
Definition at line 200 of file AlignedBox.h.
AlignedBox& Eigen::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 210 of file AlignedBox.h.
NonInteger Eigen::AlignedBox< _Scalar, _AmbientDim >::exteriorDistance | ( | const MatrixBase< Derived > & | p | ) | const [inline] |
*this
, and zero if p is inside the box. Definition at line 267 of file AlignedBox.h.
{ using std::sqrt; return sqrt(NonInteger(squaredExteriorDistance(p))); }
NonInteger Eigen::AlignedBox< _Scalar, _AmbientDim >::exteriorDistance | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | const [inline] |
*this
, and zero if the boxes intersect. Definition at line 274 of file AlignedBox.h.
{ using std::sqrt; return sqrt(NonInteger(squaredExteriorDistance(b))); }
AlignedBox Eigen::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 230 of file AlignedBox.h.
{return AlignedBox(m_min.cwiseMax(b.m_min), m_max.cwiseMin(b.m_max)); }
bool Eigen::AlignedBox< _Scalar, _AmbientDim >::intersects | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | const [inline] |
*this
. Definition at line 194 of file AlignedBox.h.
bool Eigen::AlignedBox< _Scalar, _AmbientDim >::isApprox | ( | const AlignedBox< _Scalar, _AmbientDim > & | other, |
const RealScalar & | prec = ScalarTraits::dummy_precision() |
||
) | const [inline] |
true
if *this
is approximately equal to other, within the precision determined by prec.Definition at line 302 of file AlignedBox.h.
bool Eigen::AlignedBox< _Scalar, _AmbientDim >::isEmpty | ( | ) | const [inline] |
bool Eigen::AlignedBox< _Scalar, _AmbientDim >::isNull | ( | ) | const [inline] |
const VectorType&() Eigen::AlignedBox< _Scalar, _AmbientDim >::max | ( | ) | const [inline] |
VectorType&() Eigen::AlignedBox< _Scalar, _AmbientDim >::max | ( | ) | [inline] |
Definition at line 111 of file AlignedBox.h.
{ return m_max; }
AlignedBox Eigen::AlignedBox< _Scalar, _AmbientDim >::merged | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | const [inline] |
Returns an AlignedBox that is the union of b and *this
.
*this
. Definition at line 236 of file AlignedBox.h.
{ return AlignedBox(m_min.cwiseMin(b.m_min), m_max.cwiseMax(b.m_max)); }
const VectorType&() Eigen::AlignedBox< _Scalar, _AmbientDim >::min | ( | ) | const [inline] |
VectorType&() Eigen::AlignedBox< _Scalar, _AmbientDim >::min | ( | ) | [inline] |
Definition at line 107 of file AlignedBox.h.
{ return m_min; }
VectorType Eigen::AlignedBox< _Scalar, _AmbientDim >::sample | ( | ) | const [inline] |
Definition at line 164 of file AlignedBox.h.
void Eigen::AlignedBox< _Scalar, _AmbientDim >::setEmpty | ( | ) | [inline] |
Makes *this
an empty box.
Definition at line 98 of file AlignedBox.h.
{ m_min.setConstant( ScalarTraits::highest() ); m_max.setConstant( ScalarTraits::lowest() ); }
void Eigen::AlignedBox< _Scalar, _AmbientDim >::setNull | ( | ) | [inline] |
const CwiseBinaryOp< internal::scalar_difference_op<Scalar>, const VectorType, const VectorType> Eigen::AlignedBox< _Scalar, _AmbientDim >::sizes | ( | ) | const [inline] |
Definition at line 123 of file AlignedBox.h.
Scalar Eigen::AlignedBox< Scalar, AmbientDim >::squaredExteriorDistance | ( | const MatrixBase< Derived > & | p | ) | const [inline] |
*this
, and zero if p is inside the box. Definition at line 314 of file AlignedBox.h.
Scalar Eigen::AlignedBox< Scalar, AmbientDim >::squaredExteriorDistance | ( | const AlignedBox< _Scalar, _AmbientDim > & | b | ) | const [inline] |
*this
, and zero if the boxes intersect. Definition at line 336 of file AlignedBox.h.
AlignedBox& Eigen::AlignedBox< _Scalar, _AmbientDim >::translate | ( | const MatrixBase< Derived > & | a_t | ) | [inline] |
Scalar Eigen::AlignedBox< _Scalar, _AmbientDim >::volume | ( | ) | const [inline] |
Definition at line 127 of file AlignedBox.h.
{ return sizes().prod(); }
VectorType Eigen::AlignedBox< _Scalar, _AmbientDim >::m_max [protected] |
Definition at line 307 of file AlignedBox.h.
VectorType Eigen::AlignedBox< _Scalar, _AmbientDim >::m_min [protected] |
Definition at line 307 of file AlignedBox.h.