Files
ViewDesignEngine/include/vde/spatial/kd_tree.h
T
ViewDesignEngine 64ad721ed7
CI / Build & Test (push) Failing after 36s
CI / Release Build (push) Failing after 31s
fix: 编译通过 — CMake + 命名空间 + 头文件修复
- CMake: INTERFACE 库修复、vde_compile_options 顺序修复
- 命名空间: 所有模块添加 using 声明
- 类型补全: Ray3Dd、Point4D
- 头文件: tolerance 泛型化、std::optional include
- 警告: 放宽 -Wconversion/-Wsign-conversion
- 构建结果: 0 errors, 22/25 tests passed
2026-07-23 08:19:24 +00:00

25 lines
710 B
C++

#pragma once
#include "vde/spatial/spatial_index.h"
namespace vde::spatial {
using core::AABB3D;
using core::Point3D;
using core::Ray3Dd;
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