| 64 | */ |
| 65 | template <typename _Scalar, int _AmbientDim> |
| 66 | class AlignedBox |
| 67 | { |
| 68 | public: |
| 69 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim) |
| 70 | enum { AmbientDimAtCompileTime = _AmbientDim }; |
| 71 | typedef _Scalar Scalar; |
| 72 | typedef NumTraits<Scalar> ScalarTraits; |
| 73 | typedef Eigen::Index Index; ///< \deprecated since Eigen 3.3 |
| 74 | typedef typename ScalarTraits::Real RealScalar; |
| 75 | typedef typename ScalarTraits::NonInteger NonInteger; |
| 76 | typedef Matrix<Scalar,AmbientDimAtCompileTime,1> VectorType; |
| 77 | typedef CwiseBinaryOp<internal::scalar_sum_op<Scalar>, const VectorType, const VectorType> VectorTypeSum; |
| 78 | |
| 79 | /** Define constants to name the corners of a 1D, 2D or 3D axis aligned bounding box */ |
| 80 | enum CornerType |
| 81 | { |
| 82 | /** 1D names @{ */ |
| 83 | Min=0, Max=1, |
| 84 | /** @} */ |
| 85 | |
| 86 | /** Identifier for 2D corner @{ */ |
| 87 | BottomLeft=0, BottomRight=1, |
| 88 | TopLeft=2, TopRight=3, |
| 89 | /** @} */ |
| 90 | |
| 91 | /** Identifier for 3D corner @{ */ |
| 92 | BottomLeftFloor=0, BottomRightFloor=1, |
| 93 | TopLeftFloor=2, TopRightFloor=3, |
| 94 | BottomLeftCeil=4, BottomRightCeil=5, |
| 95 | TopLeftCeil=6, TopRightCeil=7 |
| 96 | /** @} */ |
| 97 | }; |
| 98 | |
| 99 | |
| 100 | /** Default constructor initializing a null box. */ |
| 101 | EIGEN_DEVICE_FUNC inline AlignedBox() |
| 102 | { if (EIGEN_CONST_CONDITIONAL(AmbientDimAtCompileTime!=Dynamic)) setEmpty(); } |
| 103 | |
| 104 | /** Constructs a null box with \a _dim the dimension of the ambient space. */ |
| 105 | EIGEN_DEVICE_FUNC inline explicit AlignedBox(Index _dim) : m_min(_dim), m_max(_dim) |
| 106 | { setEmpty(); } |
| 107 | |
| 108 | /** Constructs a box with extremities \a _min and \a _max. |
| 109 | * \warning If either component of \a _min is larger than the same component of \a _max, the constructed box is empty. */ |
| 110 | template<typename OtherVectorType1, typename OtherVectorType2> |
| 111 | EIGEN_DEVICE_FUNC inline AlignedBox(const OtherVectorType1& _min, const OtherVectorType2& _max) : m_min(_min), m_max(_max) {} |
| 112 | |
| 113 | /** Constructs a box containing a single point \a p. */ |
| 114 | template<typename Derived> |
| 115 | EIGEN_DEVICE_FUNC inline explicit AlignedBox(const MatrixBase<Derived>& p) : m_min(p), m_max(m_min) |
| 116 | { } |
| 117 | |
| 118 | EIGEN_DEVICE_FUNC ~AlignedBox() {} |
| 119 | |
| 120 | /** \returns the dimension in which the box holds */ |
| 121 | EIGEN_DEVICE_FUNC inline Index dim() const { return AmbientDimAtCompileTime==Dynamic ? m_min.size() : Index(AmbientDimAtCompileTime); } |
| 122 | |
| 123 | /** \deprecated use isEmpty() */ |
no outgoing calls
no test coverage detected