59 explicit Octree(
int max_depth = 8,
int max_items = 16);
69 void build(
const std::vector<T>& items)
override;
140 void insert_recursive(
int node_idx,
const T& item,
int depth);
150 void subdivide_recursive(
int node_idx,
int depth);
159 void query_range_recursive(
int node_idx,
const AABB3D& range,
160 std::vector<T>& result)
const;
169 void query_ray_recursive(
int node_idx,
const Ray3Dd& ray,
170 std::vector<T>& result)
const;
178 static Point3D get_position(
const T& item);
180 std::shared_ptr<OctreeData<T>> data_;
std::vector< T > query_knn(const Point3D &point, size_t k) const override
K 近邻查询
void insert(const T &item) override
增量插入对象
bool remove(const T &item) override
删除对象
std::vector< T > query_range(const AABB3D &range) const override
范围查询
void clear() override
清空八叉树
void build(const std::vector< T > &items) override
批量构建八叉树
size_t size() const override
当前索引中的对象数量
Octree(int max_depth=8, int max_items=16)
构造八叉树
std::vector< T > query_ray(const Ray3Dd &ray) const override
射线查询
Ray3D< double > Ray3Dd
双精度三维射线
Triangle< double > Triangle3D
双精度三维三角形
AABB< double > AABB3D
双精度三维包围盒
foundation::Vector3D Vector3D
双精度三维向量(重新导出)
foundation::Point3D Point3D
双精度三维点(重新导出)