Go to the documentation of this file.
38 #ifndef COAL_HIERARCHY_TREE_ARRAY_H
39 #define COAL_HIERARCHY_TREE_ARRAY_H
54 namespace implementation_array {
57 template <
typename BV>
88 HierarchyTree(
int bu_threshold_ = 16,
int topdown_level_ = 0);
94 void init(
Node* leaves,
int n_leaves_,
int level = 0);
98 size_t insert(
const BV& bv,
void* data);
110 void update(
size_t leaf,
int lookahead_level = -1);
114 bool update(
size_t leaf,
const BV& bv);
120 bool update(
size_t leaf,
const BV& bv,
const Vec3s& vel);
154 void print(
size_t root,
int depth);
158 void bottomup(
size_t* lbeg,
size_t* lend);
161 size_t topdown(
size_t* lbeg,
size_t* lend);
167 void getMaxDepth(
size_t node,
size_t depth,
size_t& max_depth)
const;
174 size_t topdown_0(
size_t* lbeg,
size_t* lend);
182 size_t topdown_1(
size_t* lbeg,
size_t* lend);
205 size_t mortonRecurse_0(
size_t* lbeg,
size_t* lend,
const uint32_t& split,
208 size_t mortonRecurse_1(
size_t* lbeg,
size_t* lend,
const uint32_t& split,
214 void update_(
size_t leaf,
const BV& bv);
233 size_t createNode(
size_t parent,
const BV& bv1,
const BV& bv2,
void* data);
235 size_t createNode(
size_t parent,
const BV& bv,
void* data);
263 static const size_t NULL_NODE = std::numeric_limits<size_t>::max();
266 template <
typename BV>
270 template <
typename BV>
286 template <
typename BV>
291 template <
typename BV>
size_t topdown_1(size_t *lbeg, size_t *lend)
construct a tree from a list of nodes stored in [lbeg, lend) in a topdown manner. During construction...
void extractLeaves(size_t root, Node *&leaves) const
extract all the leaves of the tree
void balanceTopdown()
balance the tree from top
Eigen::Matrix< CoalScalar, 3, 1 > Vec3s
void refit()
refit the tree, i.e., when the leaf nodes' bounding volumes change, update the entire tree in a botto...
void update(size_t leaf, int lookahead_level=-1)
update one leaf node
bool empty() const
Whether the tree is empty.
size_t select(size_t query, size_t node1, size_t node2, NodeBase< BV > *nodes)
select the node from node1 and node2 which is close to the query-th node in the nodes....
size_t getRoot() const
get the root of the tree
bool operator()(size_t a, size_t b) const
void recurseRefit(size_t node)
bool operator()(size_t i, size_t j) const
void init_3(Node *leaves, int n_leaves_)
init tree from leaves using morton code. It uses morton_2, i.e., for all nodes, we simply divide the ...
size_t insert(const BV &bv, void *data)
Initialize the tree by a set of leaves using algorithm with a given level.
nodeBaseLess(const NodeBase< BV > *nodes_, size_t d_)
size_t getMaxHeight() const
get the max height of the tree
static const size_t NULL_NODE
size_t topdown_0(size_t *lbeg, size_t *lend)
construct a tree from a list of nodes stored in [lbeg, lend) in a topdown manner. During construction...
size_t createNode(size_t parent, const BV &bv1, const BV &bv2, void *data)
create one node (leaf or internal)
void clear()
Clear the tree.
size_t topdown(size_t *lbeg, size_t *lend)
construct a tree for a set of leaves from top
void init_1(Node *leaves, int n_leaves_)
init tree from leaves using morton code. It uses morton_0, i.e., for nodes which is of depth more tha...
SortByMorton(Node *nodes_in)
size_t removeLeaf(size_t leaf)
Remove a leaf. The leaf node itself is not deleted yet, but all the unnecessary internal nodes are de...
size_t size() const
number of leaves in the tree
const NodeBase< BV > * nodes
the nodes array
Node * getNodes() const
get the pointer to the nodes array
size_t mortonRecurse_2(size_t *lbeg, size_t *lend)
Functor comparing two nodes.
int bu_threshold
decide the depth to use expensive bottom-up algorithm
void bottomup(size_t *lbeg, size_t *lend)
construct a tree for a set of leaves from bottom – very heavy way
void remove(size_t leaf)
Remove a leaf node.
void fetchLeaves(size_t root, Node *&leaves, int depth=-1)
Delete all internal nodes and return all leaves nodes with given depth from root.
size_t getMaxDepth() const
get the max depth of the tree
size_t mortonRecurse_0(size_t *lbeg, size_t *lend, const uint32_t &split, int bits)
int topdown_level
decide which topdown algorithm to use
void deleteNode(size_t node)
void insertLeaf(size_t root, size_t leaf)
Insert a leaf node and also update its ancestors.
void init(Node *leaves, int n_leaves_, int level=0)
Initialize the tree by a set of leaves using algorithm with a given level.
void print(size_t root, int depth)
print the tree in a recursive way
HierarchyTree(int bu_threshold_=16, int topdown_level_=0)
Create hierarchy tree with suitable setting. bu_threshold decides the height of tree node to start bo...
void init_0(Node *leaves, int n_leaves_)
init tree from leaves in the topdown manner (topdown_0 or topdown_1)
void init_2(Node *leaves, int n_leaves_)
init tree from leaves using morton code. It uses morton_0, i.e., for nodes which is of depth more tha...
Class for hierarchy tree structure.
size_t d
the dimension to compare
void balanceIncremental(int iterations)
balance the tree in an incremental way
SortByMorton(Node *nodes_in, uint32_t split_in)
void balanceBottomup()
balance the tree from bottom
size_t mortonRecurse_1(size_t *lbeg, size_t *lend, const uint32_t &split, int bits)
size_t indexOf(size_t node)
void update_(size_t leaf, const BV &bv)
update one leaf node's bounding volume
hpp-fcl
Author(s):
autogenerated on Sat Nov 23 2024 03:44:58