octomap 1.5.0
octomap::CountingOcTreeNode Class Reference

An Octree-node which stores an internal counter per node / volume. More...

Inheritance diagram for octomap::CountingOcTreeNode:
Collaboration diagram for octomap::CountingOcTreeNode:

Public Types

typedef unsigned int 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.
 CountingOcTreeNode ()
 implementation of CountingOcTreeNode ----------------------------------
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.
CountingOcTreeNodegetChild (unsigned int i)
const CountingOcTreeNodegetChild (unsigned int i) const
unsigned int getCount () const
unsigned int getValue () const
bool hasChildren () const
void increaseCount ()
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 setCount (unsigned c)
void setValue (unsigned intv)
 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.
 ~CountingOcTreeNode ()

Protected Member Functions

void allocChildren ()

Protected Attributes

OcTreeDataNode< unsigned int > ** children
 pointer to array of children, may be NULL
unsigned int value
 stored data (payload)

Detailed Description

An Octree-node which stores an internal counter per node / volume.

Count is recursive, parent nodes have the summed count of their children.

Note:
In our mapping system this data structure is used in CountingOcTree in the sensor model only

Member Typedef Documentation

typedef unsigned int octomap::OcTreeDataNode< unsigned int >::DataType [inherited]

Make the templated data type available from the outside.


Constructor & Destructor Documentation

octomap::CountingOcTreeNode::CountingOcTreeNode ( )

implementation of CountingOcTreeNode ----------------------------------

Referenced by createChild().

octomap::CountingOcTreeNode::~CountingOcTreeNode ( )

Member Function Documentation

void octomap::OcTreeDataNode< unsigned int >::allocChildren ( ) [protected, inherited]

Referenced by createChild().

bool octomap::OcTreeDataNode< unsigned int >::childExists ( unsigned int  i) const [inherited]
Returns:
true if the i-th child exists
bool octomap::OcTreeDataNode< unsigned int >::collapsible ( ) const [inherited]

A node is collapsible if all children exist, don't have children of their own and have the same occupancy value.

bool octomap::CountingOcTreeNode::createChild ( unsigned int  i)
void octomap::OcTreeDataNode< unsigned int >::deleteChild ( unsigned int  i) [inherited]

Deletes the i-th child of the node.

void octomap::CountingOcTreeNode::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 from octomap::OcTreeDataNode< unsigned int >.

References octomap::OcTreeDataNode< unsigned int >::children, createChild(), octomap::OcTreeDataNode< unsigned int >::hasChildren(), octomap::OcTreeDataNode< T >::setValue(), and octomap::OcTreeDataNode< unsigned int >::value.

CountingOcTreeNode* octomap::CountingOcTreeNode::getChild ( unsigned int  i) [inline]
Returns:
a pointer to the i-th child of the node. The child needs to exist.

Reimplemented from octomap::OcTreeDataNode< unsigned int >.

Referenced by octomap::CountingOcTree::getCentersMinHitsRecurs(), getChild(), and octomap::CountingOcTree::updateNode().

const CountingOcTreeNode* octomap::CountingOcTreeNode::getChild ( unsigned int  i) const [inline]
Returns:
a const pointer to the i-th child of the node. The child needs to exist.

Reimplemented from octomap::OcTreeDataNode< unsigned int >.

References getChild().

unsigned int octomap::CountingOcTreeNode::getCount ( ) const [inline]
unsigned int octomap::OcTreeDataNode< unsigned int >::getValue ( ) const [inline, inherited]
Returns:
value stored in the node

References octomap::OcTreeDataNode< T >::value.

Referenced by getCount().

bool octomap::OcTreeDataNode< unsigned int >::hasChildren ( ) const [inherited]
Returns:
true if the node has at least one child

Referenced by expandNode().

void octomap::CountingOcTreeNode::increaseCount ( ) [inline]
bool octomap::OcTreeDataNode< unsigned int >::operator== ( const OcTreeDataNode< unsigned int > &  rhs) const [inherited]

Equals operator, compares if the stored value is identical.

bool octomap::OcTreeDataNode< unsigned int >::pruneNode ( ) [inherited]

Prunes a node when it is collapsible.

Returns:
true if pruning was successful
std::istream& octomap::OcTreeDataNode< unsigned int >::readValue ( std::istream &  s) [inherited]

Read node from binary stream (incl.

float value), recursively continue with all children.

Parameters:
s
Returns:
void octomap::CountingOcTreeNode::setCount ( unsigned  c) [inline]
void octomap::OcTreeDataNode< unsigned int >::setValue ( unsigned int  v) [inline, inherited]

sets value to be stored in the node

References octomap::OcTreeDataNode< T >::value.

Referenced by setCount().

std::ostream& octomap::OcTreeDataNode< unsigned int >::writeValue ( std::ostream &  s) const [inherited]

Write node to binary stream (incl float value), recursively continue with all children.

This preserves the complete state of the node.

Parameters:
s
Returns:

Field Documentation

OcTreeDataNode<unsigned int >** octomap::OcTreeDataNode< unsigned int >::children [protected, inherited]

pointer to array of children, may be NULL

Referenced by createChild(), and expandNode().

unsigned int octomap::OcTreeDataNode< unsigned int >::value [protected, inherited]

stored data (payload)

Referenced by expandNode(), and increaseCount().


The documentation for this class was generated from the following files: