38 #ifndef PCL_OCTREE_KEY_H
39 #define PCL_OCTREE_KEY_H
64 OctreeKey (
unsigned int keyX,
unsigned int keyY,
unsigned int keyZ) :
65 x (keyX),
y (keyY),
z (keyZ)
81 return ((b.
x == this->x) && (b.
y == this->y) && (b.
z == this->z));
90 return ((b.
x >= this->x) && (b.
y >= this->y) && (b.
z >= this->z));
99 return ((b.
x <= this->x) && (b.
y <= this->y) && (b.
z <= this->z));
108 this->
x = (this->
x << 1) | (!!(childIndex & (1 << 2)));
109 this->
y = (this->
y << 1) | (!!(childIndex & (1 << 1)));
110 this->
z = (this->
z << 1) | (!!(childIndex & (1 << 0)));
130 return static_cast<unsigned char> (((!!(this->
x & depthMask)) << 2)
131 | ((!!(this->
y & depthMask)) << 1)
132 | (!!(this->
z & depthMask)));
136 static const unsigned char maxDepth =
static_cast<const unsigned char>(
sizeof(uint32_t)*8);
void pushBranch(unsigned char childIndex)
push a child node to the octree key
bool operator<=(const OctreeKey &b) const
Operator<= for comparing octree keys with each other.
OctreeKey(const OctreeKey &source)
Copy constructor.
static const unsigned char maxDepth
bool operator==(const OctreeKey &b) const
Operator== for comparing octree keys with each other.
unsigned char getChildIdxWithDepthMask(unsigned int depthMask) const
get child node index using depthMask
OctreeKey(unsigned int keyX, unsigned int keyY, unsigned int keyZ)
Constructor for key initialization.
OctreeKey()
Empty constructor.
bool operator>=(const OctreeKey &b) const
Operator>= for comparing octree keys with each other.
void popBranch()
pop child node from octree key