9f2536498b
P0 实现(11/11 完成,0 stub 残留): - mesh: QEM 简化、Laplacian 平滑、质量评估、修复、3D 布尔 - spatial: Octree、KD-Tree、R-Tree 完整实现 - collision: GJK 距离+EPA 穿透深度、SAT、Tri-Tri 相交 - boolean: Vatti 2D 布尔扫描线算法 - core: 3D 凸包 QuickHull - spatial/BVH: 最近命中查询(AABB slab + Möller-Trumbore) 文档新增: - 05-核心竞争力与差异化功能(14 项独有功能) - SRS 扩展到 16 类 FR、100+ 条目 - 杀手功能:约束求解器/SDF隐式建模/可微分几何/惰性管线/Python绑定
23 lines
667 B
C++
23 lines
667 B
C++
#pragma once
|
|
#include "vde/spatial/spatial_index.h"
|
|
#include <vector>
|
|
|
|
namespace vde::spatial {
|
|
|
|
template <typename T>
|
|
class KDTree : public SpatialIndex<T> {
|
|
public:
|
|
void build(const std::vector<T>& items) override;
|
|
void insert(const T& item) override;
|
|
bool remove(const T& item) override;
|
|
std::vector<T> query_range(const AABB3D& range) const override;
|
|
std::vector<T> query_knn(const Point3D& point, size_t k) const override;
|
|
std::vector<T> query_ray(const Ray3Dd& ray) const override;
|
|
void clear() override;
|
|
size_t size() const override { return items_.size(); }
|
|
private:
|
|
std::vector<T> items_;
|
|
};
|
|
|
|
} // namespace vde::spatial
|