Public Types | Public Member Functions | Protected Attributes | List of all members
Eigen::AlignedBox Class Reference

An axis aligned box. More...

#include <ForwardDeclarations.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 Eigen::Index Index
 
typedef ScalarTraits::NonInteger NonInteger
 
typedef ScalarTraits::Real RealScalar
 
typedef _Scalar Scalar
 
typedef NumTraits< ScalarScalarTraits
 
typedef Matrix< Scalar, AmbientDimAtCompileTime, 1 > VectorType
 
typedef CwiseBinaryOp< internal::scalar_sum_op< Scalar >, const VectorType, const VectorTypeVectorTypeSum
 

Public Member Functions

EIGEN_DEVICE_FUNC AlignedBox ()
 
template<typename OtherScalarType >
EIGEN_DEVICE_FUNC AlignedBox (const AlignedBox< OtherScalarType, AmbientDimAtCompileTime > &other)
 
template<typename Derived >
EIGEN_DEVICE_FUNC AlignedBox (const MatrixBase< Derived > &p)
 
template<typename OtherVectorType1 , typename OtherVectorType2 >
EIGEN_DEVICE_FUNC AlignedBox (const OtherVectorType1 &_min, const OtherVectorType2 &_max)
 
EIGEN_DEVICE_FUNC AlignedBox (Index _dim)
 
template<typename NewScalarType >
EIGEN_DEVICE_FUNC internal::cast_return_type< AlignedBox, AlignedBox< NewScalarType, AmbientDimAtCompileTime > >::type cast () const
 
EIGEN_DEVICE_FUNC AlignedBoxclamp (const AlignedBox &b)
 
EIGEN_DEVICE_FUNC bool contains (const AlignedBox &b) const
 
template<typename Derived >
EIGEN_DEVICE_FUNC bool contains (const MatrixBase< Derived > &p) const
 
EIGEN_DEVICE_FUNC VectorType corner (CornerType corner) const
 
EIGEN_DEVICE_FUNC CwiseBinaryOp< internal::scalar_difference_op< Scalar, Scalar >, const VectorType, const VectorTypediagonal () const
 
EIGEN_DEVICE_FUNC Index dim () const
 
const EIGEN_DEVICE_FUNC EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE (VectorTypeSum, RealScalar, quotient) center() const
 
EIGEN_DEVICE_FUNC AlignedBoxextend (const AlignedBox &b)
 
template<typename Derived >
EIGEN_DEVICE_FUNC AlignedBoxextend (const MatrixBase< Derived > &p)
 
EIGEN_DEVICE_FUNC NonInteger exteriorDistance (const AlignedBox &b) const
 
template<typename Derived >
EIGEN_DEVICE_FUNC NonInteger exteriorDistance (const MatrixBase< Derived > &p) const
 
EIGEN_DEVICE_FUNC AlignedBox intersection (const AlignedBox &b) const
 
EIGEN_DEVICE_FUNC bool intersects (const AlignedBox &b) const
 
EIGEN_DEVICE_FUNC bool isApprox (const AlignedBox &other, const RealScalar &prec=ScalarTraits::dummy_precision()) const
 
EIGEN_DEVICE_FUNC bool isEmpty () const
 
EIGEN_DEVICE_FUNC bool isNull () const
 
EIGEN_DEVICE_FUNC VectorType &() max ()
 
const EIGEN_DEVICE_FUNC VectorType &() max () const
 
EIGEN_DEVICE_FUNC AlignedBox merged (const AlignedBox &b) const
 
EIGEN_DEVICE_FUNC VectorType &() min ()
 
const EIGEN_DEVICE_FUNC VectorType &() min () const
 
EIGEN_DEVICE_FUNC VectorType sample () const
 
EIGEN_DEVICE_FUNC void setEmpty ()
 
EIGEN_DEVICE_FUNC void setNull ()
 
const EIGEN_DEVICE_FUNC CwiseBinaryOp< internal::scalar_difference_op< Scalar, Scalar >, const VectorType, const VectorTypesizes () const
 
EIGEN_DEVICE_FUNC Scalar squaredExteriorDistance (const AlignedBox &b) const
 
template<typename Derived >
EIGEN_DEVICE_FUNC Scalar squaredExteriorDistance (const MatrixBase< Derived > &p) const
 
template<int Mode, int Options>
EIGEN_DEVICE_FUNC void transform (const Transform< Scalar, AmbientDimAtCompileTime, Mode, Options > &transform)
 
template<int Mode, int Options>
EIGEN_DEVICE_FUNC void transform (const typename Transform< Scalar, AmbientDimAtCompileTime, Mode, Options >::TranslationType &translation)
 
template<int Mode, int Options>
EIGEN_DEVICE_FUNC AlignedBox transformed (const Transform< Scalar, AmbientDimAtCompileTime, Mode, Options > &transform) const
 
template<typename Derived >
EIGEN_DEVICE_FUNC AlignedBoxtranslate (const MatrixBase< Derived > &a_t)
 
template<typename Derived >
EIGEN_DEVICE_FUNC AlignedBox translated (const MatrixBase< Derived > &a_t) const
 
EIGEN_DEVICE_FUNC Scalar volume () const
 
EIGEN_DEVICE_FUNC ~AlignedBox ()
 

Protected Attributes

VectorType m_max
 
VectorType m_min
 

Detailed Description

An axis aligned box.

\geometry_module

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

Definition at line 292 of file ForwardDeclarations.h.

Member Typedef Documentation

◆ Index

Deprecated:
since Eigen 3.3

Definition at line 73 of file AlignedBox.h.

◆ NonInteger

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

Definition at line 75 of file AlignedBox.h.

◆ RealScalar

Definition at line 74 of file AlignedBox.h.

◆ Scalar

typedef _Scalar Eigen::AlignedBox::Scalar

Definition at line 71 of file AlignedBox.h.

◆ ScalarTraits

Definition at line 72 of file AlignedBox.h.

◆ VectorType

Definition at line 76 of file AlignedBox.h.

◆ VectorTypeSum

Definition at line 77 of file AlignedBox.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
AmbientDimAtCompileTime 

Definition at line 70 of file AlignedBox.h.

◆ CornerType

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

Enumerator
Min 

1D names

Max 
BottomLeft 

Identifier for 2D corner

BottomRight 
TopLeft 
TopRight 
BottomLeftFloor 

Identifier for 3D corner

BottomRightFloor 
TopLeftFloor 
TopRightFloor 
BottomLeftCeil 
BottomRightCeil 
TopLeftCeil 
TopRightCeil 

Definition at line 80 of file AlignedBox.h.

Constructor & Destructor Documentation

◆ AlignedBox() [1/5]

EIGEN_DEVICE_FUNC Eigen::AlignedBox::AlignedBox ( )
inline

Default constructor initializing a null box.

Definition at line 101 of file AlignedBox.h.

◆ AlignedBox() [2/5]

EIGEN_DEVICE_FUNC Eigen::AlignedBox::AlignedBox ( Index  _dim)
inlineexplicit

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

Definition at line 105 of file AlignedBox.h.

◆ AlignedBox() [3/5]

template<typename OtherVectorType1 , typename OtherVectorType2 >
EIGEN_DEVICE_FUNC Eigen::AlignedBox::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.

Definition at line 111 of file AlignedBox.h.

◆ AlignedBox() [4/5]

template<typename Derived >
EIGEN_DEVICE_FUNC Eigen::AlignedBox::AlignedBox ( const MatrixBase< Derived > &  p)
inlineexplicit

Constructs a box containing a single point p.

Definition at line 115 of file AlignedBox.h.

◆ ~AlignedBox()

EIGEN_DEVICE_FUNC Eigen::AlignedBox::~AlignedBox ( )
inline

Definition at line 118 of file AlignedBox.h.

◆ AlignedBox() [5/5]

template<typename OtherScalarType >
EIGEN_DEVICE_FUNC Eigen::AlignedBox::AlignedBox ( const AlignedBox< OtherScalarType, AmbientDimAtCompileTime > &  other)
inlineexplicit

Copy constructor with scalar type conversion

Definition at line 386 of file AlignedBox.h.

Member Function Documentation

◆ cast()

template<typename NewScalarType >
EIGEN_DEVICE_FUNC 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 378 of file AlignedBox.h.

◆ clamp()

EIGEN_DEVICE_FUNC AlignedBox& Eigen::AlignedBox::clamp ( const AlignedBox 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()

Definition at line 256 of file AlignedBox.h.

◆ contains() [1/2]

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

Definition at line 225 of file AlignedBox.h.

◆ contains() [2/2]

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

Definition at line 218 of file AlignedBox.h.

◆ corner()

EIGEN_DEVICE_FUNC 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 182 of file AlignedBox.h.

◆ diagonal()

EIGEN_DEVICE_FUNC CwiseBinaryOp< internal::scalar_difference_op<Scalar,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 170 of file AlignedBox.h.

◆ dim()

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

Definition at line 121 of file AlignedBox.h.

◆ EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE()

const EIGEN_DEVICE_FUNC Eigen::AlignedBox::EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE ( VectorTypeSum  ,
RealScalar  ,
quotient   
) const
inline
Returns
the center of the box

Definition at line 151 of file AlignedBox.h.

◆ extend() [1/2]

EIGEN_DEVICE_FUNC AlignedBox& Eigen::AlignedBox::extend ( const AlignedBox b)
inline

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

See also
merged, extend(const MatrixBase&)

Definition at line 246 of file AlignedBox.h.

◆ extend() [2/2]

template<typename Derived >
EIGEN_DEVICE_FUNC AlignedBox& Eigen::AlignedBox::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&)

Definition at line 236 of file AlignedBox.h.

◆ exteriorDistance() [1/2]

EIGEN_DEVICE_FUNC 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(const AlignedBox&), exteriorDistance(const MatrixBase&)

Definition at line 319 of file AlignedBox.h.

◆ exteriorDistance() [2/2]

template<typename Derived >
EIGEN_DEVICE_FUNC 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(const MatrixBase&), exteriorDistance(const AlignedBox&)

Definition at line 312 of file AlignedBox.h.

◆ intersection()

EIGEN_DEVICE_FUNC AlignedBox Eigen::AlignedBox::intersection ( const AlignedBox 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()

Definition at line 266 of file AlignedBox.h.

◆ intersects()

EIGEN_DEVICE_FUNC bool Eigen::AlignedBox::intersects ( const AlignedBox b) const
inline
Returns
true if the box b is intersecting the box *this.
See also
intersection, clamp

Definition at line 230 of file AlignedBox.h.

◆ isApprox()

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

Definition at line 396 of file AlignedBox.h.

◆ isEmpty()

EIGEN_DEVICE_FUNC bool Eigen::AlignedBox::isEmpty ( ) const
inline
Returns
true if the box is empty.
See also
setEmpty

Definition at line 131 of file AlignedBox.h.

◆ isNull()

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

Definition at line 124 of file AlignedBox.h.

◆ max() [1/2]

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

Definition at line 148 of file AlignedBox.h.

◆ max() [2/2]

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

Definition at line 146 of file AlignedBox.h.

◆ merged()

EIGEN_DEVICE_FUNC AlignedBox Eigen::AlignedBox::merged ( const AlignedBox 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&)

Definition at line 272 of file AlignedBox.h.

◆ min() [1/2]

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

Definition at line 144 of file AlignedBox.h.

◆ min() [2/2]

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

Definition at line 142 of file AlignedBox.h.

◆ sample()

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

Definition at line 200 of file AlignedBox.h.

◆ setEmpty()

EIGEN_DEVICE_FUNC void Eigen::AlignedBox::setEmpty ( )
inline

Makes *this an empty box.

See also
isEmpty

Definition at line 135 of file AlignedBox.h.

◆ setNull()

EIGEN_DEVICE_FUNC void Eigen::AlignedBox::setNull ( )
inline
Deprecated:
use setEmpty()

Definition at line 127 of file AlignedBox.h.

◆ sizes()

const EIGEN_DEVICE_FUNC CwiseBinaryOp< internal::scalar_difference_op<Scalar,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 159 of file AlignedBox.h.

◆ squaredExteriorDistance() [1/2]

EIGEN_DEVICE_FUNC 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(const AlignedBox&), squaredExteriorDistance(const MatrixBase&)

Definition at line 430 of file AlignedBox.h.

◆ squaredExteriorDistance() [2/2]

template<typename Derived >
EIGEN_DEVICE_FUNC Scalar Eigen::AlignedBox::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&)

Definition at line 408 of file AlignedBox.h.

◆ transform() [1/2]

template<int Mode, int Options>
EIGEN_DEVICE_FUNC void Eigen::AlignedBox::transform ( const Transform< Scalar, AmbientDimAtCompileTime, Mode, Options > &  transform)
inline

Transforms this box by transform and recomputes it to still be an axis-aligned box.

Note
This method is provided under BSD license (see the top of this file).

Definition at line 339 of file AlignedBox.h.

◆ transform() [2/2]

template<int Mode, int Options>
EIGEN_DEVICE_FUNC void Eigen::AlignedBox::transform ( const typename Transform< Scalar, AmbientDimAtCompileTime, Mode, Options >::TranslationType &  translation)
inline

Specialization of transform for pure translation.

Definition at line 326 of file AlignedBox.h.

◆ transformed()

template<int Mode, int Options>
EIGEN_DEVICE_FUNC AlignedBox Eigen::AlignedBox::transformed ( const Transform< Scalar, AmbientDimAtCompileTime, Mode, Options > &  transform) const
inline
Returns
a copy of *this transformed by transform and recomputed to still be an axis-aligned box.

Definition at line 364 of file AlignedBox.h.

◆ translate()

template<typename Derived >
EIGEN_DEVICE_FUNC 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 277 of file AlignedBox.h.

◆ translated()

template<typename Derived >
EIGEN_DEVICE_FUNC AlignedBox Eigen::AlignedBox::translated ( const MatrixBase< Derived > &  a_t) const
inline
Returns
a copy of *this translated by the vector t.

Definition at line 287 of file AlignedBox.h.

◆ volume()

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

Definition at line 163 of file AlignedBox.h.

Member Data Documentation

◆ m_max

VectorType Eigen::AlignedBox::m_max
protected

Definition at line 401 of file AlignedBox.h.

◆ m_min

VectorType Eigen::AlignedBox::m_min
protected

Definition at line 401 of file AlignedBox.h.


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


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:10:18