Insert a point into the kd_tree async. Start at the root, comparing the new point’s first dimension with the root’s first dimension. If the new point’s value is less than the root’s, go to the left child; otherwise, go to the right child. At the next level, compare the second dimension. Continue this process, cycling through dimensions. When a leaf is reached, create a new node and insert the new point.
- Parameters
-
| [in] | points | Inserted points in k d. |
| [in] | threadPool | ThreadPool. |
- Todo
- Only block this task.
Definition at line 608 of file KDTree.h.
609 {
612 return true;
613 });
614 rval.get();
615
620 }
auto SubmitPoolTask(Func &&func, Args &&... args) -> std::future< decltype(func(std::forward< Args >(args)...))>
Submit a task to task queue, and wait for a idle thread to execute it.
void Wait()
Wait for all tasks executed finish in taskqueue.
void insert_recursive_async(Node *&node, std::shared_ptr< std::vector< item > > points, Spices::ThreadPool *threadPool, int depth)
Recursive function to insert a point into the kd_tree async.
Node * m_Root
Pointer to the root node of the tree.