 |
Voxomap
A C++11 voxel container.
|
Go to the documentation of this file. 1 #ifndef _VOXOMAP_NODE_HPP_
2 #define _VOXOMAP_NODE_HPP_
10 template <
typename T_Node>
class Octree;
16 template <
typename T_Node>
27 Node(
int x,
int y,
int z,
int size);
88 void merge(T_Node
const& other);
98 T_Node*
findNode(
int x,
int y,
int z,
int size)
const;
107 inline T_Node*
getChild(
int x,
int y,
int z)
const;
131 template <
typename T>
132 inline bool isInside(T x, T y, T z, T sx, T sy, T sz)
const;
140 template <
typename T>
150 template <
typename T>
182 #endif // _VOXOMAP_NODE_HPP_
Node(int x, int y, int z, int size)
Constructs Node with its properties.
int getChildPos(int x, int y, int z) const
Get the child node position that can contain the point at coordinate xyz.
T_Node * findNode(int x, int y, int z, int size) const
Find node.
int getX() const
Returns x position of the node.
bool isInside(T x, T y, T z, T sx, T sy, T sz) const
Check if box is inside the node.
int getY() const
Returns y position of the node.
Node(Node const &other)
Copy constructor.
uint8_t getChildId() const
Octree< T_Node > * _octree
Parent octree.
std::array< T_Node *, 8 > _children
Array of children.
Octree< T_Node > * getOctree() const
Returns the octree.
int _size
Size of the node.
bool isInside(T x, T y, T z, T size) const
Check if box is inside the node.
uint8_t _nbChildren
Number of node inside the children array.
T_Node * getParent() const
Returns the parent node.
T_Node * getChild(int x, int y, int z) const
Get the child node that can contain the point at coordinate xyz.
void changeOctree(Octree< T_Node > &octree)
Change octree of the node and all its children.
bool empty() const
Check if node has children.
int getZ() const
Returns z position of the node.
bool operator!=(Node const &other) const
Compare coordinate and size of the node.
int getSize() const
Returns size of node.
void merge(T_Node const &other)
Merge method of the node, do nothing.
bool isInside(T x, T y, T z) const
Check if point is inside the node.
int getNbChildren() const
Returns the number of children, [0, 8].
virtual ~Node()
Destructor method.
bool operator==(Node const &other) const
Compare coordinate and size of the node.
T_Node * _parent
Parent node.
uint8_t _childId
Child id inside parent's children array.
std::array< T_Node *, 8 > const & getChildren() const
Returns the children array.
bool isInside(T_Node &node) const
Check if node is inside the node.