55 unsigned int childCount = (
unsigned int)(
value/ 8.0 +0.5);
56 for (
unsigned int k=0; k<8; k++) {
115 root_key[0] = root_key[1] = root_key[2] = this->
tree_max_val;
121 unsigned int& min_hits,
122 unsigned int max_depth,
126 if (depth < max_depth && node->hasChildren()) {
128 unsigned short int center_offset_key = this->
tree_max_val >> (depth + 1);
131 for (
unsigned int i=0; i<8; ++i) {
142 node_centers.push_back(this->
keyToCoord(parent_key, depth));
unsigned int value
stored data (payload)
unsigned char computeChildIdx(const OcTreeKey &key, int depth)
generate child index (between 0 and 7) from key at given tree depth
const unsigned int tree_depth
Maximum tree depth is fixed to 16 currently.
void setValue(T v)
sets value to be stored in the node
void computeChildKey(const unsigned int &pos, const unsigned short int ¢er_offset_key, const OcTreeKey &parent_key, OcTreeKey &child_key)
bool childExists(unsigned int i) const
bool coordToKeyChecked(const point3d &coord, OcTreeKey &key) const
CountingOcTreeNode * getChild(unsigned int i)
double keyToCoord(unsigned short int key, unsigned depth) const
CountingOcTree(double resolution)
Default constructor, sets resolution of leafs.
OcTreeDataNode< unsigned int > ** children
pointer to array of children, may be NULL
void getCentersMinHits(point3d_list &node_centers, unsigned int min_hits) const
void getCentersMinHitsRecurs(point3d_list &node_centers, unsigned int &min_hits, unsigned int max_depth, CountingOcTreeNode *node, unsigned int depth, const OcTreeKey &parent_key) const
static StaticMemberInitializer countingOcTreeMemberInit
static member to ensure static initialization (only once)
bool createChild(unsigned int i)
std::list< octomath::Vector3 > point3d_list
This class represents a three-dimensional vector.
CountingOcTreeNode()
implementation of CountingOcTreeNode -------------------------------—
virtual CountingOcTreeNode * updateNode(const point3d &value)
CountingOcTreeNode * root
Pointer to the root NODE, NULL for empty tree.
unsigned int getCount() const
const unsigned int tree_max_val