Main MRPT website > C++ reference for MRPT 1.3.2
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
octomap::CountingOcTreeNode Class Reference

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

Definition at line 68 of file CountingOcTree.h.

#include <mrpt/otherlibs/octomap/CountingOcTree.h>

Inheritance diagram for octomap::CountingOcTreeNode:
Inheritance graph

Public Types

typedef unsigned int DataType
 Make the templated data type available from the outside. More...
 

Public Member Functions

 CountingOcTreeNode ()
 
 ~CountingOcTreeNode ()
 
bool createChild (unsigned int i)
 
CountingOcTreeNodegetChild (unsigned int i)
 
const CountingOcTreeNodegetChild (unsigned int i) const
 
unsigned int getCount () const
 
void increaseCount ()
 
void setCount (unsigned c)
 
void expandNode ()
 
bool operator== (const OcTreeDataNode &rhs) const
 Equals operator, compares if the stored value is identical. More...
 
bool childExists (unsigned int i) const
 
bool hasChildren () 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. More...
 
void deleteChild (unsigned int i)
 Deletes the i-th child of the node. More...
 
bool pruneNode ()
 Prunes a node when it is collapsible. More...
 
unsigned int getValue () const
 
void setValue (unsigned intv)
 sets value to be stored in the node More...
 
std::istream & readValue (std::istream &s)
 Read node from binary stream (incl. More...
 
std::ostream & writeValue (std::ostream &s) const
 Write node to binary stream (incl float value), recursively continue with all children. More...
 

Protected Member Functions

void allocChildren ()
 

Protected Attributes

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

Member Typedef Documentation

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

Make the templated data type available from the outside.

Definition at line 156 of file OcTreeDataNode.h.

Constructor & Destructor Documentation

octomap::CountingOcTreeNode::CountingOcTreeNode ( )
octomap::CountingOcTreeNode::~CountingOcTreeNode ( )

Member Function Documentation

void octomap::OcTreeDataNode< unsigned int >::allocChildren ( )
protectedinherited
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 ( )

Referenced by setCount().

CountingOcTreeNode* octomap::CountingOcTreeNode::getChild ( unsigned int  i)
inline

Definition at line 76 of file CountingOcTree.h.

References octomap::OcTreeDataNode< T >::getChild().

const CountingOcTreeNode* octomap::CountingOcTreeNode::getChild ( unsigned int  i) const
inline

Definition at line 80 of file CountingOcTree.h.

References octomap::OcTreeDataNode< T >::getChild().

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

Definition at line 129 of file OcTreeDataNode.h.

Referenced by getCount().

bool octomap::OcTreeDataNode< unsigned int >::hasChildren ( ) const
inherited
Returns
true if the node has at least one child
void octomap::CountingOcTreeNode::increaseCount ( )
inline

Definition at line 85 of file CountingOcTree.h.

References octomap::OcTreeDataNode< unsigned int >::value.

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)
inlineinherited

sets value to be stored in the node

Definition at line 131 of file OcTreeDataNode.h.

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

Member Data Documentation

OcTreeDataNode<unsigned int >** octomap::OcTreeDataNode< unsigned int >::children
protectedinherited

pointer to array of children, may be NULL

Definition at line 163 of file OcTreeDataNode.h.

unsigned int octomap::OcTreeDataNode< unsigned int >::value
protectedinherited

stored data (payload)

Definition at line 165 of file OcTreeDataNode.h.

Referenced by octomap::CountingOcTree::CountingOcTree(), and increaseCount().




Page generated by Doxygen 1.8.11 for MRPT 1.3.2 SVN:Unversioned directory at Sun May 1 08:45:24 UTC 2016