Go to the documentation of this file.
38 #ifndef FCL_HIERARCHY_TREE_ARRAY_H
39 #define FCL_HIERARCHY_TREE_ARRAY_H
56 namespace implementation_array
63 using S =
typename BV::S;
70 : nodes(nodes_in), split(split_in) {}
71 bool operator() (
size_t a,
size_t b)
const
73 if((a != NULL_NODE) && (b != NULL_NODE))
74 return nodes[a].code < nodes[b].code;
75 else if(a == NULL_NODE)
76 return split < nodes[b].code;
77 else if(b == NULL_NODE)
78 return nodes[a].code < split;
92 HierarchyTree(
int bu_threshold_ = 16,
int topdown_level_ = 0);
97 void init(NodeType* leaves,
int n_leaves_,
int level = 0);
100 size_t insert(
const BV& bv,
void* data);
103 void remove(
size_t leaf);
112 void update(
size_t leaf,
int lookahead_level = -1);
115 bool update(
size_t leaf,
const BV& bv);
118 bool update(
size_t leaf,
const BV& bv,
const Vector3<S>& vel, S margin);
121 bool update(
size_t leaf,
const BV& bv,
const Vector3<S>& vel);
124 size_t getMaxHeight()
const;
127 size_t getMaxDepth()
const;
130 void balanceBottomup();
133 void balanceTopdown();
136 void balanceIncremental(
int iterations);
142 void extractLeaves(
size_t root, NodeType*& leaves)
const;
148 size_t getRoot()
const;
151 NodeType* getNodes()
const;
154 void print(
size_t root,
int depth);
159 void bottomup(
size_t* lbeg,
size_t* lend);
162 size_t topdown(
size_t* lbeg,
size_t* lend);
165 size_t getMaxHeight(
size_t node)
const;
168 void getMaxDepth(
size_t node,
size_t depth,
size_t& max_depth)
const;
173 size_t topdown_0(
size_t* lbeg,
size_t* lend);
179 size_t topdown_1(
size_t* lbeg,
size_t* lend);
182 void init_0(NodeType* leaves,
int n_leaves_);
186 void init_1(NodeType* leaves,
int n_leaves_);
190 void init_2(NodeType* leaves,
int n_leaves_);
193 void init_3(NodeType* leaves,
int n_leaves_);
195 size_t mortonRecurse_0(
size_t* lbeg,
size_t* lend,
const uint32& split,
int bits);
197 size_t mortonRecurse_1(
size_t* lbeg,
size_t* lend,
const uint32& split,
int bits);
199 size_t mortonRecurse_2(
size_t* lbeg,
size_t* lend);
202 void update_(
size_t leaf,
const BV& bv);
205 void insertLeaf(
size_t root,
size_t leaf);
209 size_t removeLeaf(
size_t leaf);
212 void fetchLeaves(
size_t root, NodeType*& leaves,
int depth = -1);
214 size_t indexOf(
size_t node);
216 size_t allocateNode();
219 size_t createNode(
size_t parent,
224 size_t createNode(
size_t parent,
228 size_t createNode(
size_t parent,
231 void deleteNode(
size_t node);
233 void recurseRefit(
size_t node);
255 static const size_t NULL_NODE = -1;
258 template<
typename BV>
263 template<
typename BV>
281 template<
typename BV>
286 template<
typename BV>
int bu_threshold
decide the depth to use expensive bottom-up algorithm
Class for hierarchy tree structure.
size_t d
the dimension to compare
typename fcl::AABB< S > ::S S
nodeBaseLess(const NodeBase< BV > *nodes_, size_t d_)
const NodeBase< BV > * nodes
the nodes array
Functor comparing two nodes.
Eigen::Matrix< S, 3, 1 > Vector3
bool operator()(size_t i, size_t j) const
SortByMorton(NodeType *nodes_in)
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....
int topdown_level
decide which topdown algorithm to use
SortByMorton(NodeType *nodes_in, uint32 split_in)
fcl
Author(s):
autogenerated on Tue Dec 5 2023 03:40:48