27 #include <Eigen/Eigen>
56 template <
typename PNT_TYPE>
57 AABB(std::vector<PNT_TYPE*>
const& pnts,
58 std::vector<std::size_t>
const& ids)
62 for (std::size_t i = 1; i < ids.size(); ++i)
81 template <
typename InputIterator>
82 AABB(InputIterator first, InputIterator last)
84 if (std::distance(first, last) <= 0)
87 "AABB::AABB(InputIterator first, InputIterator last): first > "
91 InputIterator it(first);
102 template <
typename PNT_TYPE>
108 std::pair<bool, std::bitset<3>> updated(
false, 0);
109 for (std::size_t k(0); k < 3; k++)
115 updated.first =
true;
122 updated.second[k] =
true;
126 if (updated.second.any())
131 return updated.first;
137 template <
typename T>
155 template <
typename T>
197 Eigen::Vector3d
_min_pnt{std::numeric_limits<double>::max(),
198 std::numeric_limits<double>::max(),
199 std::numeric_limits<double>::max()};
200 Eigen::Vector3d
_max_pnt{std::numeric_limits<double>::lowest(),
201 std::numeric_limits<double>::lowest(),
202 std::numeric_limits<double>::lowest()};
210 for (std::size_t k = 0; k < 3; ++k)
215 _max_pnt[k], std::numeric_limits<double>::max());
220 template <
typename PNT_TYPE>
228 template <
typename PNT_TYPE>
229 void init(PNT_TYPE*
const& pnt)
239 template <
typename PNT_TYPE>
242 for (std::size_t k(0); k < 3; k++)
255 template <
typename PNT_TYPE>
261 template <
typename PNT_TYPE>
Class AABB is an axis aligned bounding box around a given set of geometric points of (template) type ...
void updateWithoutEnlarge(PNT_TYPE *const &pnt)
AABB(InputIterator first, InputIterator last)
AABB(std::vector< PNT_TYPE * > const &pnts, std::vector< std::size_t > const &ids)
Eigen::Vector3d const & getMinPoint() const
bool containsPoint(T const &pnt, double eps) const
void update(PNT_TYPE const *pnt)
AABB(AABB const &)=default
void init(PNT_TYPE const &pnt)
Eigen::Vector3d const & getMaxPoint() const
void updateWithoutEnlarge(PNT_TYPE const &p)
void init(PNT_TYPE *const &pnt)
bool update(PNT_TYPE const &p)
bool containsAABB(AABB const &other_aabb) const
bool containsPointXY(T const &pnt) const
void enlarge(std::bitset< 3 > to_update=7)