31 #include "../common/WThreadedRunner.h"
57 bool operator()(
const unsigned int& lhs,
const unsigned int& rhs )
const
78 WKdTreeThread(
float* pointArray, std::vector< unsigned int >* tree,
int left,
int right,
int axis );
87 void buildTree(
int left,
int right,
int axis );
114 WKdTree(
int size,
float* pointArray );
131 void buildTree(
int left,
int right,
int axis );
class to provide threaded computation of parts of the kd tree
std::vector< unsigned int > * m_tree
stores a pointer to the tree
WKdTreeThread(float *pointArray, std::vector< unsigned int > *tree, int left, int right, int axis)
constructor
int m_axis
stores axis, since the threadMain method has no arguments
int m_left
stores left boundary, since the threadMain method has no arguments
float * m_pointArray
stores a pointer to the vertex array
void buildTree(int left, int right, int axis)
recursive function to compute a part of the kd tree
int m_right
stores left boundary, since the threadMain method has no arguments
virtual void threadMain()
entry for the run command
implements the computation of a kd tree on a point array
float * m_pointArray
stores a pointer to the vertex array
WKdTree(int size, float *pointArray)
constructor
int m_size
size of the tree
unsigned int m_root
index of the root point
std::vector< unsigned int > m_tree
stores the tree
void buildTree(int left, int right, int axis)
recursive function to compute a part of the kd tree
Base class for all classes needing to be executed in a separate thread.
implements the compare function for std::nth_element on a point array
lessy(float const *const data, const int pos)
constructor
float const *const data
stores the pointer to the data array
bool operator()(const unsigned int &lhs, const unsigned int &rhs) const
comparison operator less
const int pos
stores the axis at which the array is sorted