Classes | Public Member Functions | Protected Member Functions | Static Protected Attributes | List of all members
octomap::CountingOcTree Class Reference

#include <CountingOcTree.h>

Inheritance diagram for octomap::CountingOcTree:
Inheritance graph
[legend]

Classes

class  StaticMemberInitializer
 

Public Member Functions

 CountingOcTree (double resolution)
 Default constructor, sets resolution of leafs. More...
 
void getCentersMinHits (point3d_list &node_centers, unsigned int min_hits) const
 
CountingOcTreeNodeupdateNode (const OcTreeKey &k)
 
virtual CountingOcTreeNodeupdateNode (const point3d &value)
 
- Public Member Functions inherited from octomap::OcTreeBase< CountingOcTreeNode >
OcTreeBase< CountingOcTreeNode > * create () const
 
std::string getTreeType () const
 returns actual class name as string for identification More...
 
 OcTreeBase (double res)
 
- Public Member Functions inherited from octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >
OcTreeKey adjustKeyAtDepth (const OcTreeKey &key, unsigned int depth) const
 
key_type adjustKeyAtDepth (key_type key, unsigned int depth) const
 
iterator begin (unsigned char maxDepth=0) const
 
leaf_iterator begin_leafs (unsigned char maxDepth=0) const
 
leaf_bbx_iterator begin_leafs_bbx (const OcTreeKey &min, const OcTreeKey &max, unsigned char maxDepth=0) const
 
leaf_bbx_iterator begin_leafs_bbx (const point3d &min, const point3d &max, unsigned char maxDepth=0) const
 
tree_iterator begin_tree (unsigned char maxDepth=0) const
 
size_t calcNumNodes () const
 Traverses the tree to calculate the total number of nodes. More...
 
void clear ()
 Deletes the complete tree structure. More...
 
void clearKeyRays ()
 
bool computeRay (const point3d &origin, const point3d &end, std::vector< point3d > &ray)
 
bool computeRayKeys (const point3d &origin, const point3d &end, KeyRay &ray) const
 
OcTreeKey coordToKey (const point3d &coord) const
 Converts from a 3D coordinate into a 3D addressing key. More...
 
OcTreeKey coordToKey (const point3d &coord, unsigned depth) const
 Converts from a 3D coordinate into a 3D addressing key at a given depth. More...
 
key_type coordToKey (double coordinate) const
 Converts from a single coordinate into a discrete key. More...
 
key_type coordToKey (double coordinate, unsigned depth) const
 Converts from a single coordinate into a discrete key at a given depth. More...
 
OcTreeKey coordToKey (double x, double y, double z) const
 Converts from a 3D coordinate into a 3D addressing key. More...
 
OcTreeKey coordToKey (double x, double y, double z, unsigned depth) const
 Converts from a 3D coordinate into a 3D addressing key at a given depth. More...
 
bool coordToKeyChecked (const point3d &coord, OcTreeKey &key) const
 
bool coordToKeyChecked (const point3d &coord, unsigned depth, OcTreeKey &key) const
 
bool coordToKeyChecked (double coordinate, key_type &key) const
 
bool coordToKeyChecked (double coordinate, unsigned depth, key_type &key) const
 
bool coordToKeyChecked (double x, double y, double z, OcTreeKey &key) const
 
bool coordToKeyChecked (double x, double y, double z, unsigned depth, OcTreeKey &key) const
 
CountingOcTreeNodecreateNodeChild (CountingOcTreeNode *node, unsigned int childIdx)
 Creates (allocates) the i-th child of the node. More...
 
bool deleteNode (const OcTreeKey &key, unsigned int depth=0)
 
bool deleteNode (const point3d &value, unsigned int depth=0)
 
bool deleteNode (double x, double y, double z, unsigned int depth=0)
 
void deleteNodeChild (CountingOcTreeNode *node, unsigned int childIdx)
 Deletes the i-th child of the node. More...
 
const iterator end () const
 
const leaf_iterator end_leafs () const
 
const leaf_bbx_iterator end_leafs_bbx () const
 
const tree_iterator end_tree () const
 
virtual void expand ()
 
virtual void expandNode (CountingOcTreeNode *node)
 
virtual void getMetricMax (double &x, double &y, double &z)
 maximum value of the bounding box of all known space in x, y, z More...
 
void getMetricMax (double &x, double &y, double &z) const
 maximum value of the bounding box of all known space in x, y, z More...
 
virtual void getMetricMin (double &x, double &y, double &z)
 minimum value of the bounding box of all known space in x, y, z More...
 
void getMetricMin (double &x, double &y, double &z) const
 minimum value of the bounding box of all known space in x, y, z More...
 
virtual void getMetricSize (double &x, double &y, double &z)
 Size of OcTree (all known space) in meters for x, y and z dimension. More...
 
virtual void getMetricSize (double &x, double &y, double &z) const
 Size of OcTree (all known space) in meters for x, y and z dimension. More...
 
const CountingOcTreeNodegetNodeChild (const CountingOcTreeNode *node, unsigned int childIdx) const
 
CountingOcTreeNodegetNodeChild (CountingOcTreeNode *node, unsigned int childIdx) const
 
double getNodeSize (unsigned depth) const
 
size_t getNumLeafNodes () const
 Traverses the tree to calculate the total number of leaf nodes. More...
 
double getResolution () const
 
CountingOcTreeNodegetRoot () const
 
unsigned int getTreeDepth () const
 
std::string getTreeType () const
 
void getUnknownLeafCenters (point3d_list &node_centers, point3d pmin, point3d pmax, unsigned int depth=0) const
 return centers of leafs that do NOT exist (but could) in a given bounding box More...
 
virtual bool isNodeCollapsible (const CountingOcTreeNode *node) const
 
point3d keyToCoord (const OcTreeKey &key) const
 
point3d keyToCoord (const OcTreeKey &key, unsigned depth) const
 
double keyToCoord (key_type key) const
 
double keyToCoord (key_type key, unsigned depth) const
 
unsigned long long memoryFullGrid () const
 
virtual size_t memoryUsage () const
 
virtual size_t memoryUsageNode () const
 
bool nodeChildExists (const CountingOcTreeNode *node, unsigned int childIdx) const
 
bool nodeHasChildren (const CountingOcTreeNode *node) const
 
 OcTreeBaseImpl (const OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree > &rhs)
 Deep copy constructor. More...
 
 OcTreeBaseImpl (double resolution)
 
bool operator== (const OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree > &rhs) const
 
virtual void prune ()
 
virtual bool pruneNode (CountingOcTreeNode *node)
 
std::istream & readData (std::istream &s)
 
CountingOcTreeNodesearch (const OcTreeKey &key, unsigned int depth=0) const
 
CountingOcTreeNodesearch (const point3d &value, unsigned int depth=0) const
 
CountingOcTreeNodesearch (double x, double y, double z, unsigned int depth=0) const
 
void setResolution (double r)
 
virtual size_t size () const
 
void swapContent (OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree > &rhs)
 
double volume ()
 
std::ostream & writeData (std::ostream &s) const
 
virtual ~OcTreeBaseImpl ()
 
- Public Member Functions inherited from octomap::AbstractOcTree
 AbstractOcTree ()
 
virtual AbstractOcTreecreate () const =0
 virtual constructor: creates a new object of same type More...
 
virtual double getResolution () const =0
 
virtual std::string getTreeType () const =0
 returns actual class name as string for identification More...
 
virtual size_t memoryUsage () const =0
 
virtual size_t memoryUsageNode () const =0
 
virtual size_t size () const =0
 
bool write (const std::string &filename) const
 Write file header and complete tree to file (serialization) More...
 
bool write (std::ostream &s) const
 Write file header and complete tree to stream (serialization) More...
 
virtual ~AbstractOcTree ()
 

Protected Member Functions

void getCentersMinHitsRecurs (point3d_list &node_centers, unsigned int &min_hits, unsigned int max_depth, CountingOcTreeNode *node, unsigned int depth, const OcTreeKey &parent_key) const
 
- Protected Member Functions inherited from octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >
void allocNodeChildren (CountingOcTreeNode *node)
 
void calcMinMax ()
 recalculates min and max in x, y, z. Does nothing when tree size didn't change. More...
 
void calcNumNodesRecurs (CountingOcTreeNode *node, size_t &num_nodes) const
 
void deleteNodeRecurs (CountingOcTreeNode *node)
 
bool deleteNodeRecurs (CountingOcTreeNode *node, unsigned int depth, unsigned int max_depth, const OcTreeKey &key)
 recursive call of deleteNode() More...
 
void expandRecurs (CountingOcTreeNode *node, unsigned int depth, unsigned int max_depth)
 recursive call of expand() More...
 
size_t getNumLeafNodesRecurs (const CountingOcTreeNode *parent) const
 
void init ()
 initialize non-trivial members, helper for constructors More...
 
 OcTreeBaseImpl (double resolution, unsigned int tree_depth, unsigned int tree_max_val)
 
void pruneRecurs (CountingOcTreeNode *node, unsigned int depth, unsigned int max_depth, unsigned int &num_pruned)
 recursive call of prune() More...
 
std::istream & readNodesRecurs (CountingOcTreeNode *, std::istream &s)
 recursive call of readData() More...
 
std::ostream & writeNodesRecurs (const CountingOcTreeNode *, std::ostream &s) const
 recursive call of writeData() More...
 

Static Protected Attributes

static StaticMemberInitializer countingOcTreeMemberInit
 static member to ensure static initialization (only once) More...
 
- Static Protected Attributes inherited from octomap::AbstractOcTree
static const std::string fileHeader = "# Octomap OcTree file"
 

Additional Inherited Members

- Public Types inherited from octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >
typedef leaf_iterator iterator
 
typedef CountingOcTreeNode NodeType
 Make the templated NODE type available from the outside. More...
 
- Static Public Member Functions inherited from octomap::AbstractOcTree
static AbstractOcTreecreateTree (const std::string id, double res)
 
static AbstractOcTreeread (const std::string &filename)
 
static AbstractOcTreeread (std::istream &s)
 
- Static Protected Member Functions inherited from octomap::AbstractOcTree
static bool readHeader (std::istream &s, std::string &id, unsigned &size, double &res)
 
static void registerTreeType (AbstractOcTree *tree)
 
- Protected Attributes inherited from octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >
std::vector< KeyRaykeyrays
 data structure for ray casting, array for multithreading More...
 
const leaf_bbx_iterator leaf_iterator_bbx_end
 
const leaf_iterator leaf_iterator_end
 
double max_value [3]
 max in x, y, z More...
 
double min_value [3]
 
double resolution
 in meters More...
 
double resolution_factor
 = 1. / resolution More...
 
CountingOcTreeNoderoot
 Pointer to the root NODE, NULL for empty tree. More...
 
bool size_changed
 flag to denote whether the octree extent changed (for lazy min/max eval) More...
 
std::vector< double > sizeLookupTable
 contains the size of a voxel at level i (0: root node). tree_depth+1 levels (incl. 0) More...
 
point3d tree_center
 
const unsigned int tree_depth
 Maximum tree depth is fixed to 16 currently. More...
 
const tree_iterator tree_iterator_end
 
const unsigned int tree_max_val
 
size_t tree_size
 

Detailed Description

An AbstractOcTree which stores an internal counter per node / volume.

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

Note
Was only used internally, not used anymore

Definition at line 76 of file CountingOcTree.h.

Constructor & Destructor Documentation

◆ CountingOcTree()

octomap::CountingOcTree::CountingOcTree ( double  resolution)

Default constructor, sets resolution of leafs.

implementation of CountingOcTree -----------------------------------—

Definition at line 52 of file CountingOcTree.cpp.

Member Function Documentation

◆ getCentersMinHits()

void octomap::CountingOcTree::getCentersMinHits ( point3d_list node_centers,
unsigned int  min_hits 
) const

Definition at line 94 of file CountingOcTree.cpp.

◆ getCentersMinHitsRecurs()

void octomap::CountingOcTree::getCentersMinHitsRecurs ( point3d_list node_centers,
unsigned int &  min_hits,
unsigned int  max_depth,
CountingOcTreeNode node,
unsigned int  depth,
const OcTreeKey parent_key 
) const
protected

Definition at line 102 of file CountingOcTree.cpp.

◆ updateNode() [1/2]

CountingOcTreeNode * octomap::CountingOcTree::updateNode ( const OcTreeKey k)

Definition at line 66 of file CountingOcTree.cpp.

◆ updateNode() [2/2]

CountingOcTreeNode * octomap::CountingOcTree::updateNode ( const point3d value)
virtual

Definition at line 57 of file CountingOcTree.cpp.

Member Data Documentation

◆ countingOcTreeMemberInit

CountingOcTree::StaticMemberInitializer octomap::CountingOcTree::countingOcTreeMemberInit
staticprotected

static member to ensure static initialization (only once)

Definition at line 116 of file CountingOcTree.h.


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


octomap
Author(s): Kai M. Wurm , Armin Hornung
autogenerated on Thu Mar 21 2024 02:40:30