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

An axis aligned box. More...

Public Types

enum  { AmbientDimAtCompileTime }
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef _Scalar Scalar
 
typedef Matrix< Scalar,
AmbientDimAtCompileTime, 1 > 
VectorType
 

Public Member Functions

 AlignedBox ()
 
 AlignedBox (int _dim)
 
 AlignedBox (const VectorType &_min, const VectorType &_max)
 
 AlignedBox (const VectorType &p)
 
template<typename OtherScalarType >
 AlignedBox (const AlignedBox< OtherScalarType, AmbientDimAtCompileTime > &other)
 
template<typename NewScalarType >
ei_cast_return_type
< AlignedBox, AlignedBox
< NewScalarType,
AmbientDimAtCompileTime >
>::type 
cast () const
 
AlignedBoxclamp (const AlignedBox &b)
 
bool contains (const VectorType &p) const
 
bool contains (const AlignedBox &b) const
 
int dim () const
 
AlignedBoxextend (const VectorType &p)
 
AlignedBoxextend (const AlignedBox &b)
 
Scalar exteriorDistance (const VectorType &p) const
 
bool isApprox (const AlignedBox &other, typename NumTraits< Scalar >::Real prec=precision< Scalar >()) const
 
bool isNull () const
 
const VectorTypemax () const
 
VectorTypemax ()
 
const VectorTypemin () const
 
VectorTypemin ()
 
void setNull ()
 
Scalar squaredExteriorDistance (const VectorType &p) const
 
AlignedBoxtranslate (const VectorType &t)
 

Protected Attributes

VectorType m_max
 
VectorType m_min
 

Detailed Description

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

An axis aligned box.

This is defined in the Geometry module.

#include <Eigen/Geometry>
Warning
This is not considered to be part of the stable public API yet. Changes may happen in future releases. See Experimental parts of Eigen
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.

Constructor & Destructor Documentation

AlignedBox ( )
inlineexplicit

Default constructor initializing a null box.

AlignedBox ( int  _dim)
inlineexplicit

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

AlignedBox ( const VectorType _min,
const VectorType _max 
)
inline

Constructs a box with extremities _min and _max.

AlignedBox ( const VectorType p)
inlineexplicit

Constructs a box containing a single point p.

AlignedBox ( const AlignedBox< OtherScalarType, AmbientDimAtCompileTime > &  other)
inlineexplicit

Copy constructor with scalar type conversion

Member Function Documentation

ei_cast_return_type<AlignedBox, AlignedBox<NewScalarType,AmbientDimAtCompileTime> >::type 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.

AlignedBox& clamp ( const AlignedBox< _Scalar, _AmbientDim > &  b)
inline

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

bool contains ( const VectorType p) const
inline
Returns
true if the point p is inside the box *this.
bool contains ( const AlignedBox< _Scalar, _AmbientDim > &  b) const
inline
Returns
true if the box b is entirely inside the box *this.
int dim ( ) const
inline
Returns
the dimension in which the box holds
AlignedBox& extend ( const VectorType p)
inline

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

AlignedBox& extend ( const AlignedBox< _Scalar, _AmbientDim > &  b)
inline

Extends *this such that it contains the box b and returns a reference to *this.

Scalar 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()
bool 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()
bool isNull ( ) const
inline
Returns
true if the box is null, i.e, empty.
const VectorType& max ( ) const
inline
Returns
the maximal corner
VectorType& max ( )
inline
Returns
a non const reference to the maximal corner
const VectorType& min ( ) const
inline
Returns
the minimal corner
VectorType& min ( )
inline
Returns
a non const reference to the minimal corner
void setNull ( )
inline

Makes *this a null/empty box.

Scalar 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()
AlignedBox& translate ( const VectorType t)
inline

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


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