Main MRPT website > C++ reference
MRPT logo
Public Types | Public Member Functions | Protected Attributes
Eigen::AlignedBox Class Reference

Detailed Description

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.

List of all members.

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< ScalarScalarTraits
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 VectorTypemin () const
VectorTypemin ()
const VectorTypemax () const
VectorTypemax ()
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 > &a_p) const
bool contains (const AlignedBox &b) const
template<typename Derived >
AlignedBoxextend (const MatrixBase< Derived > &a_p)
 Extends *this such that it contains the point p and returns a reference to *this.
AlignedBoxextend (const AlignedBox &b)
 Extends *this such that it contains the box b and returns a reference to *this.
AlignedBoxclamp (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 >
AlignedBoxtranslate (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

Member Typedef Documentation

Definition at line 49 of file Geometry.

typedef ScalarTraits::NonInteger Eigen::AlignedBox::NonInteger

Definition at line 51 of file Geometry.

typedef ScalarTraits::Real Eigen::AlignedBox::RealScalar

Definition at line 50 of file Geometry.

typedef _Scalar Eigen::AlignedBox::Scalar

Definition at line 47 of file Geometry.

Definition at line 48 of file Geometry.

typedef Matrix<Scalar,AmbientDimAtCompileTime,1> Eigen::AlignedBox::VectorType

Definition at line 52 of file Geometry.


Member Enumeration Documentation

anonymous enum
Enumerator:
AmbientDimAtCompileTime 

Definition at line 46 of file Geometry.

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

Enumerator:
Min 

1D names

Max 
BottomLeft 

Added names for 2D.

BottomRight 
TopLeft 
TopRight 
BottomLeftFloor 

Added names for 3D.

BottomRightFloor 
TopLeftFloor 
TopRightFloor 
BottomLeftCeil 
BottomRightCeil 
TopLeftCeil 
TopRightCeil 

Definition at line 55 of file Geometry.


Constructor & Destructor Documentation

Eigen::AlignedBox::AlignedBox ( ) [inline, explicit]

Default constructor initializing a null box.

Definition at line 73 of file Geometry.

Eigen::AlignedBox::AlignedBox ( Index  _dim) [inline, explicit]

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

Definition at line 77 of file Geometry.

template<typename OtherVectorType1 , typename OtherVectorType2 >
Eigen::AlignedBox::AlignedBox ( const OtherVectorType1 &  _min,
const OtherVectorType2 &  _max 
) [inline]

Constructs a box with extremities _min and _max.

Definition at line 82 of file Geometry.

template<typename Derived >
Eigen::AlignedBox::AlignedBox ( const MatrixBase< Derived > &  a_p) [inline, explicit]

Constructs a box containing a single point p.

Definition at line 86 of file Geometry.

Eigen::AlignedBox::~AlignedBox ( ) [inline]

Definition at line 93 of file Geometry.

template<typename OtherScalarType >
Eigen::AlignedBox::AlignedBox ( const AlignedBox< OtherScalarType, AmbientDimAtCompileTime > &  other) [inline, explicit]

Copy constructor with scalar type conversion.

Definition at line 289 of file Geometry.


Member Function Documentation

template<typename NewScalarType >
internal::cast_return_type<AlignedBox, AlignedBox<NewScalarType,AmbientDimAtCompileTime> >::type Eigen::AlignedBox::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.

Definition at line 281 of file Geometry.

const CwiseUnaryOp<internal::scalar_quotient1_op<Scalar>, const CwiseBinaryOp<internal::scalar_sum_op<Scalar>, const VectorType, const VectorType> > Eigen::AlignedBox::center ( ) const [inline]
Returns:
the center of the box

Definition at line 126 of file Geometry.

AlignedBox& Eigen::AlignedBox::clamp ( const AlignedBox b) [inline]

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

Definition at line 221 of file Geometry.

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

Definition at line 192 of file Geometry.

bool Eigen::AlignedBox::contains ( const AlignedBox b) const [inline]
Returns:
true if the box b is entirely inside the box *this.

Definition at line 199 of file Geometry.

VectorType Eigen::AlignedBox::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.

Definition at line 156 of file Geometry.

CwiseBinaryOp< internal::scalar_difference_op<Scalar>, const VectorType, const VectorType> Eigen::AlignedBox::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.

Definition at line 144 of file Geometry.

Index Eigen::AlignedBox::dim ( ) const [inline]
Returns:
the dimension in which the box holds

Definition at line 96 of file Geometry.

template<typename Derived >
AlignedBox& Eigen::AlignedBox::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 204 of file Geometry.

AlignedBox& Eigen::AlignedBox::extend ( const AlignedBox b) [inline]

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

Definition at line 213 of file Geometry.

template<typename Derived >
NonInteger Eigen::AlignedBox::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()

Definition at line 264 of file Geometry.

NonInteger Eigen::AlignedBox::exteriorDistance ( const AlignedBox b) const [inline]
Returns:
the distance between the boxes b and *this, and zero if the boxes intersect.
See also:
squaredExteriorDistance()

Definition at line 271 of file Geometry.

AlignedBox Eigen::AlignedBox::intersection ( const AlignedBox b) const [inline]

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

Definition at line 229 of file Geometry.

bool Eigen::AlignedBox::isApprox ( const AlignedBox other,
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()

Definition at line 299 of file Geometry.

bool Eigen::AlignedBox::isEmpty ( ) const [inline]
Returns:
true if the box is empty.

Definition at line 105 of file Geometry.

bool Eigen::AlignedBox::isNull ( ) const [inline]
Deprecated:
use isEmpty

Definition at line 99 of file Geometry.

const VectorType& Eigen::AlignedBox::max ( ) const [inline]
Returns:
the maximal corner

Definition at line 119 of file Geometry.

VectorType& Eigen::AlignedBox::max ( ) [inline]
Returns:
a non const reference to the maximal corner

Definition at line 121 of file Geometry.

AlignedBox Eigen::AlignedBox::merged ( const AlignedBox b) const [inline]

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

Definition at line 233 of file Geometry.

const VectorType& Eigen::AlignedBox::min ( ) const [inline]
Returns:
the minimal corner

Definition at line 115 of file Geometry.

VectorType& Eigen::AlignedBox::min ( ) [inline]
Returns:
a non const reference to the minimal corner

Definition at line 117 of file Geometry.

VectorType Eigen::AlignedBox::sample ( ) const [inline]
Returns:
a random point inside the bounding box sampled with a uniform distribution

Definition at line 174 of file Geometry.

void Eigen::AlignedBox::setEmpty ( ) [inline]

Makes *this an empty box.

Definition at line 108 of file Geometry.

void Eigen::AlignedBox::setNull ( ) [inline]
Deprecated:
use setEmpty

Definition at line 102 of file Geometry.

const CwiseBinaryOp< internal::scalar_difference_op<Scalar>, const VectorType, const VectorType> Eigen::AlignedBox::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

Definition at line 133 of file Geometry.

template<typename Derived >
Scalar Eigen::AlignedBox::squaredExteriorDistance ( const MatrixBase< Derived > &  a_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()

Definition at line 311 of file Geometry.

Scalar Eigen::AlignedBox::squaredExteriorDistance ( const AlignedBox b) const [inline]
Returns:
the squared distance between the boxes b and *this, and zero if the boxes intersect.
See also:
exteriorDistance()

Definition at line 333 of file Geometry.

template<typename Derived >
AlignedBox& Eigen::AlignedBox::translate ( const MatrixBase< Derived > &  a_t) [inline]

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

Definition at line 238 of file Geometry.

Scalar Eigen::AlignedBox::volume ( ) const [inline]
Returns:
the volume of the bounding box

Definition at line 137 of file Geometry.


Member Data Documentation

Definition at line 304 of file Geometry.

Definition at line 304 of file Geometry.




Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011