octomap 1.5.0
|
Basic node in the OcTree that can hold arbitrary data of type T in value. More...
Public Types | |
typedef T | DataType |
Make the templated data type available from the outside. | |
Public Member Functions | |
bool | childExists (unsigned int i) const |
bool | collapsible () const |
A node is collapsible if all children exist, don't have children of their own and have the same occupancy value. | |
bool | createChild (unsigned int i) |
initialize i-th child, allocate children array if needed | |
void | deleteChild (unsigned int i) |
Deletes the i-th child of the node. | |
void | expandNode () |
Expands a node (reverse of pruning): All children are created and their occupancy probability is set to the node's value. | |
const OcTreeDataNode< T > * | getChild (unsigned int i) const |
OcTreeDataNode< T > * | getChild (unsigned int i) |
T | getValue () const |
bool | hasChildren () const |
OcTreeDataNode (T initVal) | |
OcTreeDataNode (const OcTreeDataNode &rhs) | |
Copy constructor, performs a recursive deep-copy of all children. | |
OcTreeDataNode () | |
bool | operator== (const OcTreeDataNode &rhs) const |
Equals operator, compares if the stored value is identical. | |
bool | pruneNode () |
Prunes a node when it is collapsible. | |
std::istream & | readValue (std::istream &s) |
Read node from binary stream (incl. | |
void | setValue (T v) |
sets value to be stored in the node | |
std::ostream & | writeValue (std::ostream &s) const |
Write node to binary stream (incl float value), recursively continue with all children. | |
~OcTreeDataNode () | |
Protected Member Functions | |
void | allocChildren () |
Protected Attributes | |
OcTreeDataNode< T > ** | children |
pointer to array of children, may be NULL | |
T | value |
stored data (payload) |
Basic node in the OcTree that can hold arbitrary data of type T in value.
This is the base class for nodes used in an OcTree. The used implementation for occupancy mapping is in OcTreeNode.#
T | data to be stored in the node (e.g. a float for probabilities) |
typedef T octomap::OcTreeDataNode< T >::DataType |
Make the templated data type available from the outside.
octomap::OcTreeDataNode< T >::OcTreeDataNode | ( | ) |
octomap::OcTreeDataNode< T >::OcTreeDataNode | ( | T | initVal | ) |
octomap::OcTreeDataNode< T >::OcTreeDataNode | ( | const OcTreeDataNode< T > & | rhs | ) |
Copy constructor, performs a recursive deep-copy of all children.
References octomap::OcTreeDataNode< T >::allocChildren(), octomap::OcTreeDataNode< T >::children, and octomap::OcTreeDataNode< T >::hasChildren().
octomap::OcTreeDataNode< T >::~OcTreeDataNode | ( | ) |
void octomap::OcTreeDataNode< T >::allocChildren | ( | ) | [protected] |
Referenced by octomap::OcTreeDataNode< T >::OcTreeDataNode().
bool octomap::OcTreeDataNode< T >::childExists | ( | unsigned int | i | ) | const |
Referenced by octomap::CountingOcTree::getCentersMinHitsRecurs(), getLeafNodesRecurs(), getVoxelsRecurs(), octomap::ColorOcTree::updateInnerOccupancyRecurs(), and octomap::CountingOcTree::updateNode().
bool octomap::OcTreeDataNode< T >::collapsible | ( | ) | const |
A node is collapsible if all children exist, don't have children of their own and have the same occupancy value.
bool octomap::OcTreeDataNode< T >::createChild | ( | unsigned int | i | ) |
initialize i-th child, allocate children array if needed
Reimplemented in octomap::ColorOcTreeNode, octomap::CountingOcTreeNode, octomap::OcTreeNode, and octomap::OcTreeNodeStamped.
void octomap::OcTreeDataNode< T >::deleteChild | ( | unsigned int | i | ) |
Deletes the i-th child of the node.
void octomap::OcTreeDataNode< T >::expandNode | ( | ) |
Expands a node (reverse of pruning): All children are created and their occupancy probability is set to the node's value.
You need to verify that this is indeed a pruned node (i.e. not a leaf at the lowest level)
Reimplemented in octomap::ColorOcTreeNode, and octomap::CountingOcTreeNode.
OcTreeDataNode< T > * octomap::OcTreeDataNode< T >::getChild | ( | unsigned int | i | ) |
Reimplemented in octomap::ColorOcTreeNode, octomap::CountingOcTreeNode, octomap::OcTreeNode, and octomap::OcTreeNodeStamped.
const OcTreeDataNode< T > * octomap::OcTreeDataNode< T >::getChild | ( | unsigned int | i | ) | const |
Reimplemented in octomap::ColorOcTreeNode, octomap::CountingOcTreeNode, octomap::OcTreeNode, and octomap::OcTreeNodeStamped.
T octomap::OcTreeDataNode< T >::getValue | ( | ) | const [inline] |
bool octomap::OcTreeDataNode< T >::hasChildren | ( | ) | const |
Referenced by getLeafNodesRecurs(), getVoxelsRecurs(), octomap::OcTreeDataNode< T >::OcTreeDataNode(), and octomap::ColorOcTree::updateInnerOccupancyRecurs().
bool octomap::OcTreeDataNode< T >::operator== | ( | const OcTreeDataNode< T > & | rhs | ) | const |
Equals operator, compares if the stored value is identical.
References octomap::OcTreeDataNode< T >::value.
bool octomap::OcTreeDataNode< T >::pruneNode | ( | ) |
Prunes a node when it is collapsible.
Reimplemented in octomap::ColorOcTreeNode.
std::istream & octomap::OcTreeDataNode< T >::readValue | ( | std::istream & | s | ) |
Read node from binary stream (incl.
float value), recursively continue with all children.
s |
Reimplemented in octomap::ColorOcTreeNode.
void octomap::OcTreeDataNode< T >::setValue | ( | T | v | ) | [inline] |
sets value to be stored in the node
Referenced by octomap::CountingOcTreeNode::expandNode(), and octomap::ColorOcTreeNode::expandNode().
std::ostream & octomap::OcTreeDataNode< T >::writeValue | ( | std::ostream & | s | ) | const |
Write node to binary stream (incl float value), recursively continue with all children.
This preserves the complete state of the node.
s |
Reimplemented in octomap::ColorOcTreeNode.
OcTreeDataNode<T>** octomap::OcTreeDataNode< T >::children [protected] |
pointer to array of children, may be NULL
Referenced by octomap::OcTreeDataNode< T >::OcTreeDataNode().
T octomap::OcTreeDataNode< T >::value [protected] |