Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
octomap::OcTreeDataNode< T > Class Template Reference

#include <OcTreeDataNode.h>

Inheritance diagram for octomap::OcTreeDataNode< T >:
Inheritance graph
[legend]

Public Types

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

Public Member Functions

void copyData (const OcTreeDataNode &from)
 
getValue () const
 
 OCTOMAP_DEPRECATED (bool childExists(unsigned int i) const)
 
 OCTOMAP_DEPRECATED (bool hasChildren() const)
 
 OcTreeDataNode ()
 
 OcTreeDataNode (T initVal)
 
 OcTreeDataNode (const OcTreeDataNode &rhs)
 
bool operator== (const OcTreeDataNode &rhs) const
 Equals operator, compares if the stored value is identical. More...
 
std::istream & readData (std::istream &s)
 Read node payload (data only) from binary stream. More...
 
void setValue (T v)
 sets value to be stored in the node More...
 
std::ostream & writeData (std::ostream &s) const
 Write node payload (data only) to binary stream. More...
 
 ~OcTreeDataNode ()
 

Protected Member Functions

void allocChildren ()
 

Protected Attributes

AbstractOcTreeNode ** children
 
value
 stored data (payload) More...
 

Friends

template<typename NODE , typename I >
class OcTreeBaseImpl
 

Detailed Description

template<typename T>
class octomap::OcTreeDataNode< T >

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.#

Template Parameters
Tdata to be stored in the node (e.g. a float for probabilities)

Note: If you derive a class (directly or indirectly) from OcTreeDataNode, you have to implement (at least) the following functions to avoid slicing errors and memory-related bugs: createChild(), getChild(), getChild() const, expandNode() See ColorOcTreeNode in ColorOcTree.h for an example.

Definition at line 63 of file OcTreeDataNode.h.

Member Typedef Documentation

◆ DataType

template<typename T>
typedef T octomap::OcTreeDataNode< T >::DataType

Make the templated data type available from the outside.

Definition at line 117 of file OcTreeDataNode.h.

Constructor & Destructor Documentation

◆ OcTreeDataNode() [1/3]

template<typename T>
octomap::OcTreeDataNode< T >::OcTreeDataNode ( )

◆ OcTreeDataNode() [2/3]

template<typename T>
octomap::OcTreeDataNode< T >::OcTreeDataNode ( initVal)

◆ OcTreeDataNode() [3/3]

template<typename T>
octomap::OcTreeDataNode< T >::OcTreeDataNode ( const OcTreeDataNode< T > &  rhs)

Copy constructor, performs a recursive deep-copy of all children including node data in "value"

◆ ~OcTreeDataNode()

template<typename T>
octomap::OcTreeDataNode< T >::~OcTreeDataNode ( )

Delete only own members. OcTree maintains tree structure and must have deleted children already

Member Function Documentation

◆ allocChildren()

template<typename T>
void octomap::OcTreeDataNode< T >::allocChildren ( )
protected

◆ copyData()

template<typename T>
void octomap::OcTreeDataNode< T >::copyData ( const OcTreeDataNode< T > &  from)

Copy the payload (data in "value") from rhs into this node Opposed to copy ctor, this does not clone the children as well

◆ getValue()

template<typename T>
T octomap::OcTreeDataNode< T >::getValue ( ) const
inline
Returns
value stored in the node

Definition at line 103 of file OcTreeDataNode.h.

◆ OCTOMAP_DEPRECATED() [1/2]

template<typename T>
octomap::OcTreeDataNode< T >::OCTOMAP_DEPRECATED ( bool childExists(unsigned int i)  const)

Test whether the i-th child exists.

Deprecated:
Replaced by tree->nodeChildExists(...)
Returns
true if the i-th child exists

◆ OCTOMAP_DEPRECATED() [2/2]

template<typename T>
octomap::OcTreeDataNode< T >::OCTOMAP_DEPRECATED ( bool hasChildren()  const)
Deprecated:
Replaced by tree->nodeHasChildren(...)
Returns
true if the node has at least one child

◆ operator==()

template<typename T>
bool octomap::OcTreeDataNode< T >::operator== ( const OcTreeDataNode< T > &  rhs) const

Equals operator, compares if the stored value is identical.

◆ readData()

template<typename T>
std::istream& octomap::OcTreeDataNode< T >::readData ( std::istream &  s)

Read node payload (data only) from binary stream.

◆ setValue()

template<typename T>
void octomap::OcTreeDataNode< T >::setValue ( v)
inline

sets value to be stored in the node

Definition at line 105 of file OcTreeDataNode.h.

◆ writeData()

template<typename T>
std::ostream& octomap::OcTreeDataNode< T >::writeData ( std::ostream &  s) const

Write node payload (data only) to binary stream.

Friends And Related Function Documentation

◆ OcTreeBaseImpl

template<typename T>
template<typename NODE , typename I >
friend class OcTreeBaseImpl
friend

Definition at line 65 of file OcTreeDataNode.h.

Member Data Documentation

◆ children

template<typename T>
AbstractOcTreeNode** octomap::OcTreeDataNode< T >::children
protected

pointer to array of children, may be NULL

Note
The tree class manages this pointer, the array, and the memory for it! The children of a node are always enforced to be the same type as the node

Definition at line 126 of file OcTreeDataNode.h.

◆ value

template<typename T>
T octomap::OcTreeDataNode< T >::value
protected

stored data (payload)

Definition at line 128 of file OcTreeDataNode.h.


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


octomap
Author(s): Kai M. Wurm , Armin Hornung
autogenerated on Mon Feb 28 2022 22:58:06