112 using Scalar =
typename DataPoint::Scalar;
113 using InnerType = _InnerNodeType;
114 using LeafType = _LeafNodeType;
132 using AabbType = Eigen::AlignedBox<Scalar, DataPoint::Dim>;
140 data.m_leaf = n.data.m_leaf;
144 data.m_inner = n.data.m_inner;
152 m_is_leaf = n.m_is_leaf;
155 data.m_leaf = n.data.m_leaf;
159 data.m_inner = n.data.m_inner;
166 PONCA_MULTIARCH
constexpr KdTreeCustomizableNode(
const KdTreeCustomizableNode& n) : m_is_leaf(n.m_is_leaf)
170 data.m_leaf = n.data.m_leaf;
174 data.m_inner = n.data.m_inner;
178 PONCA_MULTIARCH
constexpr KdTreeCustomizableNode& operator=(
const KdTreeCustomizableNode& n)
182 m_is_leaf = n.m_is_leaf;
185 data.m_leaf = n.data.m_leaf;
189 data.m_inner = n.data.m_inner;
196 PONCA_MULTIARCH_HOST ~KdTreeCustomizableNode() {}
198 PONCA_MULTIARCH [[nodiscard]]
bool is_leaf()
const {
return m_is_leaf; }
199 PONCA_MULTIARCH
void set_is_leaf(
bool is_leaf) { m_is_leaf = is_leaf; }
217 data.m_leaf.start = start;
218 data.m_leaf.size = (LeafSize)size;
231 PONCA_MULTIARCH
void configure_inner(Scalar split_value, Index first_child_id, Index split_dim)
235 data.m_inner.split_value = split_value;
236 data.m_inner.first_child_id = first_child_id;
237 data.m_inner.split_dim = split_dim;
245 PONCA_MULTIARCH [[nodiscard]] Index
leaf_start()
const {
return data.m_leaf.start; }
250 PONCA_MULTIARCH [[nodiscard]] LeafSize
leaf_size()
const {
return data.m_leaf.size; }
255 PONCA_MULTIARCH [[nodiscard]] Scalar
inner_split_value()
const {
return data.m_inner.split_value; }
260 PONCA_MULTIARCH [[nodiscard]]
int inner_split_dim()
const {
return (
int)data.m_inner.split_dim; }
269 PONCA_MULTIARCH [[nodiscard]] Index
inner_first_child_id()
const {
return (Index)data.m_inner.first_child_id; }
272 PONCA_MULTIARCH [[nodiscard]]
inline LeafType& getAsLeaf() {
return data.m_leaf; }
273 PONCA_MULTIARCH [[nodiscard]]
inline InnerType& getAsInner() {
return data.m_inner; }
274 PONCA_MULTIARCH [[nodiscard]]
inline const LeafType& getAsLeaf()
const {
return data.m_leaf; }
275 PONCA_MULTIARCH [[nodiscard]]
inline const InnerType& getAsInner()
const {
return data.m_inner; }
278 bool m_is_leaf{
true};
281 constexpr Data() : m_leaf() {}
332 using IndexType = int;
333 using LeafSizeType =
unsigned short;
336 using PointContainer = std::vector<DataPoint>;
337 using IndexContainer = std::vector<IndexType>;
340 using NodeIndexType = std::size_t;
341 using NodeType = _NodeType<IndexType, NodeIndexType, DataPoint, LeafSizeType>;
342 using NodeContainer = std::vector<NodeType>;