Eigen::AlignedBox
template<typename _Scalar, int _AmbientDim>
class Eigen::AlignedBox< _Scalar, _AmbientDim >
An axis aligned box.
This is defined in the Geometry module.
#include <Eigen/Geometry>
-
Template Parameters
-
_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.
-
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
|
enum |
CornerType { Min , Max , BottomLeft , BottomRight , TopLeft , TopRight , BottomLeftFloor , BottomRightFloor , TopLeftFloor , TopRightFloor , BottomLeftCeil , BottomRightCeil , TopLeftCeil , TopRightCeil } |
|
typedef Eigen::Index |
Index |
|
|
|
|
|
|
AlignedBox () |
|
template<typename OtherScalarType > |
|
AlignedBox (const AlignedBox< OtherScalarType, AmbientDimAtCompileTime > &other) |
|
template<typename Derived > |
|
AlignedBox (const MatrixBase< Derived > &p) |
|
template<typename OtherVectorType1 , typename OtherVectorType2 > |
|
AlignedBox (const OtherVectorType1 &_min, const OtherVectorType2 &_max) |
|
|
AlignedBox (Index _dim) |
|
template<typename NewScalarType > |
internal::cast_return_type< AlignedBox, AlignedBox< NewScalarType, AmbientDimAtCompileTime > >::type |
cast () const |
|
AlignedBox & |
clamp (const AlignedBox &b) |
|
bool |
contains (const AlignedBox &b) const |
|
template<typename Derived > |
bool |
contains (const MatrixBase< Derived > &p) const |
|
VectorType |
corner (CornerType corner) const |
|
CwiseBinaryOp< internal::scalar_difference_op< Scalar, Scalar >, const VectorType, const VectorType > |
diagonal () const |
|
Index |
dim () const |
|
const |
EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE (VectorTypeSum, RealScalar, quotient) center() const |
|
AlignedBox & |
extend (const AlignedBox &b) |
|
template<typename Derived > |
AlignedBox & |
extend (const MatrixBase< Derived > &p) |
|
NonInteger |
exteriorDistance (const AlignedBox &b) const |
|
template<typename Derived > |
NonInteger |
exteriorDistance (const MatrixBase< Derived > &p) const |
|
AlignedBox |
intersection (const AlignedBox &b) const |
|
bool |
intersects (const AlignedBox &b) const |
|
bool |
isApprox (const AlignedBox &other, const RealScalar &prec=ScalarTraits::dummy_precision()) const |
|
bool |
isEmpty () const |
|
bool |
isNull () const |
|
VectorType &() |
max () |
|
const VectorType &() |
max () const |
|
AlignedBox |
merged (const AlignedBox &b) const |
|
VectorType &() |
min () |
|
const VectorType &() |
min () const |
|
VectorType |
sample () const |
|
void |
setEmpty () |
|
void |
setNull () |
|
const CwiseBinaryOp< internal::scalar_difference_op< Scalar, Scalar >, const VectorType, const VectorType > |
sizes () const |
|
Scalar |
squaredExteriorDistance (const AlignedBox &b) const |
|
template<typename Derived > |
Scalar |
squaredExteriorDistance (const MatrixBase< Derived > &p) const |
|
template<int Mode, int Options> |
void |
transform (const Transform< Scalar, AmbientDimAtCompileTime, Mode, Options > &transform) |
|
template<int Mode, int Options> |
void |
transform (const typename Transform< Scalar, AmbientDimAtCompileTime, Mode, Options >::TranslationType &translation) |
|
template<int Mode, int Options> |
AlignedBox |
transformed (const Transform< Scalar, AmbientDimAtCompileTime, Mode, Options > &transform) const |
|
template<typename Derived > |
AlignedBox & |
translate (const MatrixBase< Derived > &a_t) |
|
template<typename Derived > |
AlignedBox |
translated (const MatrixBase< Derived > &a_t) const |
|
Scalar |
volume () const |
|
Index
template<typename _Scalar , int _AmbientDim>
CornerType
template<typename _Scalar , int _AmbientDim>
Define constants to name the corners of a 1D, 2D or 3D axis aligned bounding box
Enumerator |
Min |
1D names |
Max |
1D names |
BottomLeft |
Identifier for 2D corner |
BottomRight |
Identifier for 2D corner |
TopLeft |
Identifier for 2D corner |
TopRight |
Identifier for 2D corner |
BottomLeftFloor |
Identifier for 3D corner |
BottomRightFloor |
Identifier for 3D corner |
TopLeftFloor |
Identifier for 3D corner |
TopRightFloor |
Identifier for 3D corner |
BottomLeftCeil |
Identifier for 3D corner |
BottomRightCeil |
Identifier for 3D corner |
TopLeftCeil |
Identifier for 3D corner |
TopRightCeil |
Identifier for 3D corner |
AlignedBox() [1/5]
template<typename _Scalar , int _AmbientDim>
Default constructor initializing a null box.
AlignedBox() [2/5]
template<typename _Scalar , int _AmbientDim>
Constructs a null box with _dim the dimension of the ambient space.
AlignedBox() [3/5]
template<typename _Scalar , int _AmbientDim>
template<typename OtherVectorType1 , typename OtherVectorType2 >
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() [4/5]
template<typename _Scalar , int _AmbientDim>
template<typename Derived >
Constructs a box containing a single point p.
AlignedBox() [5/5]
template<typename _Scalar , int _AmbientDim>
template<typename OtherScalarType >
Copy constructor with scalar type conversion
cast()
template<typename _Scalar , int _AmbientDim>
template<typename NewScalarType >
-
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
.
clamp()
template<typename _Scalar , int _AmbientDim>
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/2]
template<typename _Scalar , int _AmbientDim>
-
Returns
-
true if the box b is entirely inside the box
*this
.
contains() [2/2]
template<typename _Scalar , int _AmbientDim>
template<typename Derived >
-
Returns
-
true if the point p is inside the box
*this
.
corner()
template<typename _Scalar , int _AmbientDim>
-
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>
-
Returns
-
an expression for the bounding box diagonal vector if the length of the diagonal is needed: diagonal().norm() will provide it.
dim()
template<typename _Scalar , int _AmbientDim>
-
Returns
-
the dimension in which the box holds
EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE()
template<typename _Scalar , int _AmbientDim>
-
Returns
-
the center of the box
extend() [1/2]
template<typename _Scalar , int _AmbientDim>
extend() [2/2]
template<typename _Scalar , int _AmbientDim>
template<typename Derived >
exteriorDistance() [1/2]
template<typename _Scalar , int _AmbientDim>
-
Returns
-
the distance between the boxes b and
*this
, and zero if the boxes intersect.
-
See also
-
squaredExteriorDistance(const AlignedBox&), exteriorDistance(const MatrixBase&)
exteriorDistance() [2/2]
template<typename _Scalar , int _AmbientDim>
template<typename Derived >
-
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&)
intersection()
template<typename _Scalar , int _AmbientDim>
intersects()
template<typename _Scalar , int _AmbientDim>
-
Returns
-
true if the box b is intersecting the box
*this
.
-
See also
- intersection, clamp
isApprox()
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>
-
Returns
-
true if the box is empty.
-
See also
- setEmpty
isNull()
template<typename _Scalar , int _AmbientDim>
max() [1/2]
template<typename _Scalar , int _AmbientDim>
-
Returns
-
a non const reference to the maximal corner
max() [2/2]
template<typename _Scalar , int _AmbientDim>
-
Returns
-
the maximal corner
merged()
template<typename _Scalar , int _AmbientDim>
min() [1/2]
template<typename _Scalar , int _AmbientDim>
-
Returns
-
a non const reference to the minimal corner
min() [2/2]
template<typename _Scalar , int _AmbientDim>
-
Returns
-
the minimal corner
sample()
template<typename _Scalar , int _AmbientDim>
-
Returns
-
a random point inside the bounding box sampled with a uniform distribution
setEmpty()
template<typename _Scalar , int _AmbientDim>
Makes *this
an empty box.
-
See also
- isEmpty
setNull()
template<typename _Scalar , int _AmbientDim>
sizes()
template<typename _Scalar , int _AmbientDim>
-
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/2]
template<typename Scalar , int AmbientDim>
-
Returns
-
the squared distance between the boxes b and
*this
, and zero if the boxes intersect.
-
See also
-
exteriorDistance(const AlignedBox&), squaredExteriorDistance(const MatrixBase&)
squaredExteriorDistance() [2/2]
template<typename Scalar , int AmbientDim>
template<typename Derived >
-
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&)
template<typename _Scalar , int _AmbientDim>
template<int Mode, int Options>
void Eigen::AlignedBox< _Scalar, _AmbientDim >::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).
template<typename _Scalar , int _AmbientDim>
template<int Mode, int Options>
void Eigen::AlignedBox< _Scalar, _AmbientDim >::transform |
( |
const typename Transform< Scalar, AmbientDimAtCompileTime, Mode, Options >::TranslationType & |
translation |
) |
|
|
inline |
Specialization of transform for pure translation.
template<typename _Scalar , int _AmbientDim>
template<int Mode, int Options>
-
Returns
-
a copy of
*this
transformed by transform and recomputed to still be an axis-aligned box.
translate()
template<typename _Scalar , int _AmbientDim>
template<typename Derived >
Translate *this
by the vector t and returns a reference to *this
.
translated()
template<typename _Scalar , int _AmbientDim>
template<typename Derived >
-
Returns
-
a copy of
*this
translated by the vector t.
volume()
template<typename _Scalar , int _AmbientDim>
-
Returns
-
the volume of the bounding box
The documentation for this class was generated from the following file: