6#include <spdlog/fmt/ostr.h>
52 template <
typename PNT_TYPE>
53 AABB(std::vector<PNT_TYPE*>
const& pnts,
54 std::vector<std::size_t>
const& ids)
58 for (std::size_t i = 1; i < ids.size(); ++i)
75 template <
typename InputIterator>
76 AABB(InputIterator first, InputIterator last)
78 if (std::distance(first, last) <= 0)
81 "AABB::AABB(InputIterator first, InputIterator last): first > "
85 InputIterator it(first);
96 template <
typename PNT_TYPE>
102 std::pair<bool, std::bitset<3>> updated(
false, 0);
103 for (std::size_t k(0); k < 3; k++)
109 updated.first =
true;
116 updated.second[k] =
true;
120 if (updated.second.any())
125 return updated.first;
131 template <
typename T>
149 template <
typename T>
194 os <<
"\tx [" << min[0] <<
", " << max[0] <<
") (extent "
195 << max[0] - min[0] <<
")\n";
196 os <<
"\ty [" << min[1] <<
", " << max[1] <<
") (extent "
197 << max[1] - min[1] <<
")\n";
198 os <<
"\tz [" << min[2] <<
", " << max[2] <<
") (extent "
199 << max[2] - min[2] <<
")";
204 Eigen::Vector3d
_min_pnt{std::numeric_limits<double>::max(),
205 std::numeric_limits<double>::max(),
206 std::numeric_limits<double>::max()};
207 Eigen::Vector3d
_max_pnt{std::numeric_limits<double>::lowest(),
208 std::numeric_limits<double>::lowest(),
209 std::numeric_limits<double>::lowest()};
217 for (std::size_t k = 0; k < 3; ++k)
222 _max_pnt[k], std::numeric_limits<double>::max());
227 template <
typename PNT_TYPE>
235 template <
typename PNT_TYPE>
236 void init(PNT_TYPE*
const& pnt)
246 template <
typename PNT_TYPE>
249 for (std::size_t k(0); k < 3; k++)
262 template <
typename PNT_TYPE>
268 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)
Eigen::Vector3d const & getMaxPoint() const
AABB(InputIterator first, InputIterator last)
friend std::ostream & operator<<(std::ostream &os, AABB const &aabb)
AABB(std::vector< PNT_TYPE * > const &pnts, std::vector< std::size_t > const &ids)
bool containsPoint(T const &pnt, double eps) const
void update(PNT_TYPE const *pnt)
void init(PNT_TYPE const &pnt)
void updateWithoutEnlarge(PNT_TYPE const &p)
Eigen::Vector3d const & getMinPoint() const
void init(PNT_TYPE *const &pnt)
MinMaxPoints getMinMaxPoints() const
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)