OSVR-Core
Public Types | Public Member Functions | Protected Attributes | List of all members
Eigen::AlignedBox< _Scalar, _AmbientDim > Class Template Reference

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
}
 Define constants to name the corners of a 1D, 2D or 3D axis aligned bounding box. More...
 
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 ()
 Default constructor initializing a null box. More...
 
 AlignedBox (int _dim)
 Constructs a null box with _dim the dimension of the ambient space. More...
 
 AlignedBox (const VectorType &_min, const VectorType &_max)
 Constructs a box with extremities _min and _max. More...
 
 AlignedBox (const VectorType &p)
 Constructs a box containing a single point p. More...
 
int dim () const
 
bool isNull () const
 
void setNull ()
 Makes *this a null/empty box. More...
 
const VectorType &() min () const
 
VectorType &() min ()
 
const VectorType &() max () const
 
VectorType &() max ()
 
bool contains (const VectorType &p) const
 
bool contains (const AlignedBox &b) const
 
AlignedBoxextend (const VectorType &p)
 Extends *this such that it contains the point p and returns a reference to *this. More...
 
AlignedBoxextend (const AlignedBox &b)
 Extends *this such that it contains the box b and returns a reference to *this. More...
 
AlignedBoxclamp (const AlignedBox &b)
 Clamps *this by the box b and returns a reference to *this. More...
 
AlignedBoxtranslate (const VectorType &t)
 Translate *this by the vector t and returns a reference to *this. More...
 
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)
 Copy constructor with scalar type conversion.
 
bool isApprox (const AlignedBox &other, typename NumTraits< Scalar >::Real prec=precision< Scalar >()) const
 
 AlignedBox ()
 Default constructor initializing a null box. More...
 
 AlignedBox (Index _dim)
 Constructs a null box with _dim the dimension of the ambient space. More...
 
template<typename OtherVectorType1 , typename OtherVectorType2 >
 AlignedBox (const OtherVectorType1 &_min, const OtherVectorType2 &_max)
 Constructs a box with extremities _min and _max. More...
 
template<typename Derived >
 AlignedBox (const MatrixBase< Derived > &p)
 Constructs a box containing a single point p. More...
 
Index dim () const
 
bool isNull () const
 
void setNull ()
 
bool isEmpty () const
 
void setEmpty ()
 Makes *this an empty box. More...
 
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 VectorTypesizes () const
 
Scalar volume () const
 
CwiseBinaryOp< internal::scalar_difference_op< Scalar >, const VectorType, const VectorTypediagonal () 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 >
AlignedBoxextend (const MatrixBase< Derived > &p)
 Extends *this such that it contains the point p and returns a reference to *this. More...
 
AlignedBoxextend (const AlignedBox &b)
 Extends *this such that it contains the box b and returns a reference to *this. More...
 
AlignedBoxclamp (const AlignedBox &b)
 Clamps *this by the box b and returns a reference to *this. More...
 
AlignedBox intersection (const AlignedBox &b) const
 Returns an AlignedBox that is the intersection of b and *this. More...
 
AlignedBox merged (const AlignedBox &b) const
 Returns an AlignedBox that is the union of b and *this. More...
 
template<typename Derived >
AlignedBoxtranslate (const MatrixBase< Derived > &a_t)
 Translate *this by the vector t and returns a reference to *this. More...
 
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)
 Copy constructor with scalar type conversion.
 
bool isApprox (const AlignedBox &other, const RealScalar &prec=ScalarTraits::dummy_precision()) const
 

Protected Attributes

VectorType m_min
 
VectorType m_max
 

Detailed Description

template<typename _Scalar, int _AmbientDim>
class Eigen::AlignedBox< _Scalar, _AmbientDim >

An axis aligned box

Parameters
_Scalarthe type of the scalar coefficients
_AmbientDimthe 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.

An axis aligned box

Template Parameters
_Scalarthe type of the scalar coefficients
_AmbientDimthe 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.

Warning
The result of most methods is undefined when applied to an empty box. You can check for empty boxes using isEmpty().
See also
Global aligned box typedefs

Member Enumeration Documentation

§ CornerType

template<typename _Scalar, int _AmbientDim>
enum Eigen::AlignedBox::CornerType

Define constants to name the corners of a 1D, 2D or 3D axis aligned bounding box.

Enumerator
Min 

1D names

BottomLeft 

Identifier for 2D corner.

BottomLeftFloor 

Identifier for 3D corner.

Constructor & Destructor Documentation

§ AlignedBox() [1/8]

template<typename _Scalar, int _AmbientDim>
Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox ( )
inline

Default constructor initializing a null box.

§ AlignedBox() [2/8]

template<typename _Scalar, int _AmbientDim>
Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox ( int  _dim)
inlineexplicit

Constructs a null box with _dim the dimension of the ambient space.

§ AlignedBox() [3/8]

template<typename _Scalar, int _AmbientDim>
Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox ( const VectorType _min,
const VectorType _max 
)
inline

Constructs a box with extremities _min and _max.

§ AlignedBox() [4/8]

template<typename _Scalar, int _AmbientDim>
Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox ( const VectorType p)
inlineexplicit

Constructs a box containing a single point p.

§ AlignedBox() [5/8]

template<typename _Scalar, int _AmbientDim>
Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox ( )
inline

Default constructor initializing a null box.

§ AlignedBox() [6/8]

template<typename _Scalar, int _AmbientDim>
Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox ( Index  _dim)
inlineexplicit

Constructs a null box with _dim the dimension of the ambient space.

§ AlignedBox() [7/8]

template<typename _Scalar, int _AmbientDim>
template<typename OtherVectorType1 , typename OtherVectorType2 >
Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox ( const OtherVectorType1 &  _min,
const OtherVectorType2 &  _max 
)
inline

Constructs a box with extremities _min and _max.

Warning
If either component of _min is larger than the same component of _max, the constructed box is empty.

§ AlignedBox() [8/8]

template<typename _Scalar, int _AmbientDim>
template<typename Derived >
Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox ( const MatrixBase< Derived > &  p)
inlineexplicit

Constructs a box containing a single point p.

Member Function Documentation

§ cast() [1/2]

template<typename _Scalar, int _AmbientDim>
template<typename NewScalarType >
internal::cast_return_type<AlignedBox, AlignedBox<NewScalarType,AmbientDimAtCompileTime> >::type Eigen::AlignedBox< _Scalar, _AmbientDim >::cast ( ) const
inline
Returns
*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.

§ cast() [2/2]

template<typename _Scalar, int _AmbientDim>
template<typename NewScalarType >
internal::cast_return_type<AlignedBox, AlignedBox<NewScalarType,AmbientDimAtCompileTime> >::type Eigen::AlignedBox< _Scalar, _AmbientDim >::cast ( ) const
inline
Returns
*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.

§ center()

template<typename _Scalar, int _AmbientDim>
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
Returns
the center of the box

§ clamp() [1/2]

template<typename _Scalar, int _AmbientDim>
AlignedBox& Eigen::AlignedBox< _Scalar, _AmbientDim >::clamp ( const AlignedBox< _Scalar, _AmbientDim > &  b)
inline

Clamps *this by the box b and returns a reference to *this.

§ clamp() [2/2]

template<typename _Scalar, int _AmbientDim>
AlignedBox& Eigen::AlignedBox< _Scalar, _AmbientDim >::clamp ( const AlignedBox< _Scalar, _AmbientDim > &  b)
inline

Clamps *this by the box b and returns a reference to *this.

Note
If the boxes don't intersect, the resulting box is empty.
See also
intersection(), intersects()

§ contains() [1/4]

template<typename _Scalar, int _AmbientDim>
bool Eigen::AlignedBox< _Scalar, _AmbientDim >::contains ( const VectorType p) const
inline
Returns
true if the point p is inside the box *this.

§ contains() [2/4]

template<typename _Scalar, int _AmbientDim>
bool Eigen::AlignedBox< _Scalar, _AmbientDim >::contains ( const AlignedBox< _Scalar, _AmbientDim > &  b) const
inline
Returns
true if the box b is entirely inside the box *this.

§ contains() [3/4]

template<typename _Scalar, int _AmbientDim>
template<typename Derived >
bool Eigen::AlignedBox< _Scalar, _AmbientDim >::contains ( const MatrixBase< Derived > &  p) const
inline
Returns
true if the point p is inside the box *this.

§ contains() [4/4]

template<typename _Scalar, int _AmbientDim>
bool Eigen::AlignedBox< _Scalar, _AmbientDim >::contains ( const AlignedBox< _Scalar, _AmbientDim > &  b) const
inline
Returns
true if the box b is entirely inside the box *this.

§ corner()

template<typename _Scalar, int _AmbientDim>
VectorType Eigen::AlignedBox< _Scalar, _AmbientDim >::corner ( CornerType  corner) const
inline
Returns
the vertex of the bounding box at the corner defined by the corner-id corner. It works only for a 1D, 2D or 3D bounding box. For 1D bounding boxes corners are named by 2 enum constants: BottomLeft and BottomRight. For 2D bounding boxes, corners are named by 4 enum constants: BottomLeft, BottomRight, TopLeft, TopRight. For 3D bounding boxes, the following names are added: BottomLeftCeil, BottomRightCeil, TopLeftCeil, TopRightCeil.

§ diagonal()

template<typename _Scalar, int _AmbientDim>
CwiseBinaryOp< internal::scalar_difference_op<Scalar>, const VectorType, const VectorType> Eigen::AlignedBox< _Scalar, _AmbientDim >::diagonal ( ) const
inline
Returns
an expression for the bounding box diagonal vector if the length of the diagonal is needed: diagonal().norm() will provide it.

§ dim() [1/2]

template<typename _Scalar, int _AmbientDim>
int Eigen::AlignedBox< _Scalar, _AmbientDim >::dim ( ) const
inline
Returns
the dimension in which the box holds

§ dim() [2/2]

template<typename _Scalar, int _AmbientDim>
Index Eigen::AlignedBox< _Scalar, _AmbientDim >::dim ( ) const
inline
Returns
the dimension in which the box holds

§ extend() [1/4]

template<typename _Scalar, int _AmbientDim>
AlignedBox& Eigen::AlignedBox< _Scalar, _AmbientDim >::extend ( const VectorType p)
inline

Extends *this such that it contains the point p and returns a reference to *this.

§ extend() [2/4]

template<typename _Scalar, int _AmbientDim>
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.

§ extend() [3/4]

template<typename _Scalar, int _AmbientDim>
template<typename Derived >
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.

See also
extend(const AlignedBox&)

§ extend() [4/4]

template<typename _Scalar, int _AmbientDim>
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.

See also
merged, extend(const MatrixBase&)

§ exteriorDistance() [1/3]

template<typename _Scalar, int _AmbientDim>
Scalar Eigen::AlignedBox< _Scalar, _AmbientDim >::exteriorDistance ( const VectorType p) const
inline
Returns
the distance between the point p and the box *this, and zero if p is inside the box.
See also
squaredExteriorDistance()

§ exteriorDistance() [2/3]

template<typename _Scalar, int _AmbientDim>
template<typename Derived >
NonInteger Eigen::AlignedBox< _Scalar, _AmbientDim >::exteriorDistance ( const MatrixBase< Derived > &  p) const
inline
Returns
the distance between the point p and the box *this, and zero if p is inside the box.
See also
squaredExteriorDistance(const MatrixBase&), exteriorDistance(const AlignedBox&)

§ exteriorDistance() [3/3]

template<typename _Scalar, int _AmbientDim>
NonInteger Eigen::AlignedBox< _Scalar, _AmbientDim >::exteriorDistance ( const AlignedBox< _Scalar, _AmbientDim > &  b) const
inline
Returns
the distance between the boxes b and *this, and zero if the boxes intersect.
See also
squaredExteriorDistance(const AlignedBox&), exteriorDistance(const MatrixBase&)

§ intersection()

template<typename _Scalar, int _AmbientDim>
AlignedBox Eigen::AlignedBox< _Scalar, _AmbientDim >::intersection ( const AlignedBox< _Scalar, _AmbientDim > &  b) const
inline

Returns an AlignedBox that is the intersection of b and *this.

Note
If the boxes don't intersect, the resulting box is empty.
See also
intersects(), clamp, contains()

§ intersects()

template<typename _Scalar, int _AmbientDim>
bool Eigen::AlignedBox< _Scalar, _AmbientDim >::intersects ( const AlignedBox< _Scalar, _AmbientDim > &  b) const
inline
Returns
true if the box b is intersecting the box *this.
See also
intersection, clamp

§ isApprox() [1/2]

template<typename _Scalar, int _AmbientDim>
bool Eigen::AlignedBox< _Scalar, _AmbientDim >::isApprox ( const AlignedBox< _Scalar, _AmbientDim > &  other,
typename NumTraits< Scalar >::Real  prec = precision<Scalar>() 
) const
inline
Returns
true if *this is approximately equal to other, within the precision determined by prec.
See also
MatrixBase::isApprox()

§ isApprox() [2/2]

template<typename _Scalar, int _AmbientDim>
bool Eigen::AlignedBox< _Scalar, _AmbientDim >::isApprox ( const AlignedBox< _Scalar, _AmbientDim > &  other,
const RealScalar &  prec = ScalarTraits::dummy_precision() 
) const
inline
Returns
true if *this is approximately equal to other, within the precision determined by prec.
See also
MatrixBase::isApprox()

§ isEmpty()

template<typename _Scalar, int _AmbientDim>
bool Eigen::AlignedBox< _Scalar, _AmbientDim >::isEmpty ( ) const
inline
Returns
true if the box is empty.
See also
setEmpty

§ isNull() [1/2]

template<typename _Scalar, int _AmbientDim>
bool Eigen::AlignedBox< _Scalar, _AmbientDim >::isNull ( ) const
inline
Returns
true if the box is null, i.e, empty.

§ isNull() [2/2]

template<typename _Scalar, int _AmbientDim>
bool Eigen::AlignedBox< _Scalar, _AmbientDim >::isNull ( ) const
inline

§ max() [1/4]

template<typename _Scalar, int _AmbientDim>
const VectorType&() Eigen::AlignedBox< _Scalar, _AmbientDim >::max ( ) const
inline
Returns
the maximal corner

§ max() [2/4]

template<typename _Scalar, int _AmbientDim>
VectorType&() Eigen::AlignedBox< _Scalar, _AmbientDim >::max ( )
inline
Returns
a non const reference to the maximal corner

§ max() [3/4]

template<typename _Scalar, int _AmbientDim>
const VectorType&() Eigen::AlignedBox< _Scalar, _AmbientDim >::max ( ) const
inline
Returns
the maximal corner

§ max() [4/4]

template<typename _Scalar, int _AmbientDim>
VectorType&() Eigen::AlignedBox< _Scalar, _AmbientDim >::max ( )
inline
Returns
a non const reference to the maximal corner

§ merged()

template<typename _Scalar, int _AmbientDim>
AlignedBox Eigen::AlignedBox< _Scalar, _AmbientDim >::merged ( const AlignedBox< _Scalar, _AmbientDim > &  b) const
inline

Returns an AlignedBox that is the union of b and *this.

Note
Merging with an empty box may result in a box bigger than *this.
See also
extend(const AlignedBox&)

§ min() [1/4]

template<typename _Scalar, int _AmbientDim>
const VectorType&() Eigen::AlignedBox< _Scalar, _AmbientDim >::min ( ) const
inline
Returns
the minimal corner

§ min() [2/4]

template<typename _Scalar, int _AmbientDim>
VectorType&() Eigen::AlignedBox< _Scalar, _AmbientDim >::min ( )
inline
Returns
a non const reference to the minimal corner

§ min() [3/4]

template<typename _Scalar, int _AmbientDim>
const VectorType&() Eigen::AlignedBox< _Scalar, _AmbientDim >::min ( ) const
inline
Returns
the minimal corner

§ min() [4/4]

template<typename _Scalar, int _AmbientDim>
VectorType&() Eigen::AlignedBox< _Scalar, _AmbientDim >::min ( )
inline
Returns
a non const reference to the minimal corner

§ sample()

template<typename _Scalar, int _AmbientDim>
VectorType Eigen::AlignedBox< _Scalar, _AmbientDim >::sample ( ) const
inline
Returns
a random point inside the bounding box sampled with a uniform distribution

§ setEmpty()

template<typename _Scalar, int _AmbientDim>
void Eigen::AlignedBox< _Scalar, _AmbientDim >::setEmpty ( )
inline

Makes *this an empty box.

See also
isEmpty

§ setNull() [1/2]

template<typename _Scalar, int _AmbientDim>
void Eigen::AlignedBox< _Scalar, _AmbientDim >::setNull ( )
inline

Makes *this a null/empty box.

§ setNull() [2/2]

template<typename _Scalar, int _AmbientDim>
void Eigen::AlignedBox< _Scalar, _AmbientDim >::setNull ( )
inline

§ sizes()

template<typename _Scalar, int _AmbientDim>
const CwiseBinaryOp< internal::scalar_difference_op<Scalar>, const VectorType, const VectorType> Eigen::AlignedBox< _Scalar, _AmbientDim >::sizes ( ) const
inline
Returns
the lengths of the sides of the bounding box. Note that this function does not get the same result for integral or floating scalar types: see

§ squaredExteriorDistance() [1/3]

template<typename Scalar , int AmbiantDim>
Scalar Eigen::AlignedBox< Scalar, AmbiantDim >::squaredExteriorDistance ( const VectorType p) const
inline
Returns
the squared distance between the point p and the box *this, and zero if p is inside the box.
See also
exteriorDistance()

§ squaredExteriorDistance() [2/3]

template<typename Scalar , int AmbientDim>
template<typename Derived >
Scalar Eigen::AlignedBox< Scalar, AmbientDim >::squaredExteriorDistance ( const MatrixBase< Derived > &  p) const
inline
Returns
the squared distance between the point p and the box *this, and zero if p is inside the box.
See also
exteriorDistance(const MatrixBase&), squaredExteriorDistance(const AlignedBox&)

§ squaredExteriorDistance() [3/3]

template<typename Scalar , int AmbientDim>
Scalar Eigen::AlignedBox< Scalar, AmbientDim >::squaredExteriorDistance ( const AlignedBox< _Scalar, _AmbientDim > &  b) const
inline
Returns
the squared distance between the boxes b and *this, and zero if the boxes intersect.
See also
exteriorDistance(const AlignedBox&), squaredExteriorDistance(const MatrixBase&)

§ translate() [1/2]

template<typename _Scalar, int _AmbientDim>
AlignedBox& Eigen::AlignedBox< _Scalar, _AmbientDim >::translate ( const VectorType t)
inline

Translate *this by the vector t and returns a reference to *this.

§ translate() [2/2]

template<typename _Scalar, int _AmbientDim>
template<typename Derived >
AlignedBox& Eigen::AlignedBox< _Scalar, _AmbientDim >::translate ( const MatrixBase< Derived > &  a_t)
inline

Translate *this by the vector t and returns a reference to *this.

§ volume()

template<typename _Scalar, int _AmbientDim>
Scalar Eigen::AlignedBox< _Scalar, _AmbientDim >::volume ( ) const
inline
Returns
the volume of the bounding box

The documentation for this class was generated from the following file: