aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Geometry/AlignedBox.h
diff options
context:
space:
mode:
authorGravatar Sven Strothoff <anonymous@invalid.net>2013-07-28 23:59:37 +0200
committerGravatar Sven Strothoff <anonymous@invalid.net>2013-07-28 23:59:37 +0200
commit5f11db695b74db219e0d06682728c9eda90cac5c (patch)
tree34d951d666db1ced8b420f512e668f5729fdc1fd /Eigen/src/Geometry/AlignedBox.h
parent2437215221db4e67a158ab316dc2ab231ab2361d (diff)
bug #502: add bool intersects() methods to AlignedBox
Diffstat (limited to 'Eigen/src/Geometry/AlignedBox.h')
-rw-r--r--Eigen/src/Geometry/AlignedBox.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Eigen/src/Geometry/AlignedBox.h b/Eigen/src/Geometry/AlignedBox.h
index 8e186d57a..b6a2f0e24 100644
--- a/Eigen/src/Geometry/AlignedBox.h
+++ b/Eigen/src/Geometry/AlignedBox.h
@@ -185,6 +185,10 @@ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim)
inline bool contains(const AlignedBox& b) const
{ return (m_min.array()<=(b.min)().array()).all() && ((b.max)().array()<=m_max.array()).all(); }
+ /** \returns true if the box \a b is intersecting the box \c *this. */
+ inline bool intersects(const AlignedBox& b) const
+ { return (m_min.array()<=(b.max)().array()).all() && ((b.min)().array()<=m_max.array()).all(); }
+
/** Extends \c *this such that it contains the point \a p and returns a reference to \c *this. */
template<typename Derived>
inline AlignedBox& extend(const MatrixBase<Derived>& a_p)