113 using Scalar =
typename DataPoint::Scalar;
114 using InnerType = _InnerNodeType;
115 using LeafType = _LeafNodeType;
133 using AabbType = Eigen::AlignedBox<Scalar, DataPoint::Dim>;
138 : m_is_leaf(n.m_is_leaf)
142 data.m_leaf = n.data.m_leaf;
146 data.m_inner = n.data.m_inner;
154 m_is_leaf = n.m_is_leaf;
157 data.m_leaf = n.data.m_leaf;
161 data.m_inner = n.data.m_inner;
168 PONCA_MULTIARCH
constexpr KdTreeCustomizableNode(
const KdTreeCustomizableNode& n)
169 : m_is_leaf(n.m_is_leaf)
173 data.m_leaf = n.data.m_leaf;
177 data.m_inner = n.data.m_inner;
181 PONCA_MULTIARCH
constexpr KdTreeCustomizableNode& operator=(
const KdTreeCustomizableNode& n)
185 m_is_leaf = n.m_is_leaf;
188 data.m_leaf = n.data.m_leaf;
192 data.m_inner = n.data.m_inner;
199 PONCA_MULTIARCH_HOST ~KdTreeCustomizableNode() {}
201 PONCA_MULTIARCH [[nodiscard]]
bool is_leaf()
const {
return m_is_leaf; }
202 PONCA_MULTIARCH
void set_is_leaf(
bool is_leaf) { m_is_leaf = is_leaf; }
220 data.m_leaf.start = start;
221 data.m_leaf.size = (LeafSize)size;
234 PONCA_MULTIARCH
void configure_inner(Scalar split_value, Index first_child_id, Index split_dim)
238 data.m_inner.split_value = split_value;
239 data.m_inner.first_child_id = first_child_id;
240 data.m_inner.split_dim = split_dim;
248 PONCA_MULTIARCH [[nodiscard]] Index
leaf_start()
const {
return data.m_leaf.start; }
253 PONCA_MULTIARCH [[nodiscard]] LeafSize
leaf_size()
const {
return data.m_leaf.size; }
258 PONCA_MULTIARCH [[nodiscard]] Scalar
inner_split_value()
const {
return data.m_inner.split_value; }
263 PONCA_MULTIARCH [[nodiscard]]
int inner_split_dim()
const {
return (
int)data.m_inner.split_dim; }
272 PONCA_MULTIARCH [[nodiscard]] Index
inner_first_child_id()
const {
return (Index)data.m_inner.first_child_id; }
275 PONCA_MULTIARCH [[nodiscard]]
inline LeafType& getAsLeaf() {
return data.m_leaf; }
276 PONCA_MULTIARCH [[nodiscard]]
inline InnerType& getAsInner() {
return data.m_inner; }
277 PONCA_MULTIARCH [[nodiscard]]
inline const LeafType& getAsLeaf()
const {
return data.m_leaf; }
278 PONCA_MULTIARCH [[nodiscard]]
inline const InnerType& getAsInner()
const {
return data.m_inner; }
281 bool m_is_leaf{
true};
285 constexpr Data() : m_leaf() {}
336 using IndexType = int;
337 using LeafSizeType =
unsigned short;
340 using PointContainer = std::vector<DataPoint>;
341 using IndexContainer = std::vector<IndexType>;
344 using NodeIndexType = std::size_t;
345 using NodeType = _NodeType<IndexType, NodeIndexType, DataPoint, LeafSizeType>;
346 using NodeContainer = std::vector<NodeType>;