Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Static Protected Attributes | Static Private Member Functions | Friends | List of all members
octomap::AbstractOcTree Class Referenceabstract

#include <AbstractOcTree.h>

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

Public Member Functions

 AbstractOcTree ()
 
virtual void clear ()=0
 
virtual AbstractOcTreecreate () const =0
 virtual constructor: creates a new object of same type More...
 
virtual void expand ()=0
 
virtual void getMetricMax (double &x, double &y, double &z)=0
 
virtual void getMetricMax (double &x, double &y, double &z) const =0
 
virtual void getMetricMin (double &x, double &y, double &z)=0
 
virtual void getMetricMin (double &x, double &y, double &z) const =0
 
virtual void getMetricSize (double &x, double &y, double &z)=0
 
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 void prune ()=0
 
virtual std::istream & readData (std::istream &s)=0
 
virtual void setResolution (double res)=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 std::ostream & writeData (std::ostream &s) const =0
 
virtual ~AbstractOcTree ()
 

Static Public Member Functions

static AbstractOcTreecreateTree (const std::string id, double res)
 
static AbstractOcTreeread (const std::string &filename)
 
static AbstractOcTreeread (std::istream &s)
 

Static Protected Member Functions

static bool readHeader (std::istream &s, std::string &id, unsigned &size, double &res)
 
static void registerTreeType (AbstractOcTree *tree)
 

Static Protected Attributes

static const std::string fileHeader = "# Octomap OcTree file"
 

Static Private Member Functions

static std::map< std::string, AbstractOcTree * > & classIDMapping ()
 create private store, Construct on first use More...
 

Friends

class StaticMapInit
 

Detailed Description

This abstract class is an interface to all octrees and provides a factory design pattern for readin and writing all kinds of OcTrees to files (see read()).

Definition at line 50 of file AbstractOcTree.h.

Constructor & Destructor Documentation

octomap::AbstractOcTree::AbstractOcTree ( )

Definition at line 41 of file AbstractOcTree.cpp.

virtual octomap::AbstractOcTree::~AbstractOcTree ( )
inlinevirtual

Definition at line 54 of file AbstractOcTree.h.

Member Function Documentation

std::map< std::string, AbstractOcTree * > & octomap::AbstractOcTree::classIDMapping ( )
staticprivate

create private store, Construct on first use

Definition at line 197 of file AbstractOcTree.cpp.

virtual void octomap::AbstractOcTree::clear ( )
pure virtual
virtual AbstractOcTree* octomap::AbstractOcTree::create ( ) const
pure virtual

virtual constructor: creates a new object of same type

Implemented in octomap::ColorOcTree, octomap::OcTreeStamped, octomap::OcTree, octomap::OcTreeBase< NODE >, and octomap::OcTreeBase< CountingOcTreeNode >.

AbstractOcTree * octomap::AbstractOcTree::createTree ( const std::string  id,
double  res 
)
static

Creates a certain OcTree (factory pattern)

Parameters
idunique ID of OcTree
resresolution of OcTree
Returns
pointer to newly created OcTree (empty). NULL if the ID is unknown!

Definition at line 184 of file AbstractOcTree.cpp.

virtual void octomap::AbstractOcTree::expand ( )
pure virtual
virtual void octomap::AbstractOcTree::getMetricMax ( double &  x,
double &  y,
double &  z 
)
pure virtual
virtual void octomap::AbstractOcTree::getMetricMax ( double &  x,
double &  y,
double &  z 
) const
pure virtual
virtual void octomap::AbstractOcTree::getMetricMin ( double &  x,
double &  y,
double &  z 
)
pure virtual
virtual void octomap::AbstractOcTree::getMetricMin ( double &  x,
double &  y,
double &  z 
) const
pure virtual
virtual void octomap::AbstractOcTree::getMetricSize ( double &  x,
double &  y,
double &  z 
)
pure virtual
virtual double octomap::AbstractOcTree::getResolution ( ) const
pure virtual
virtual std::string octomap::AbstractOcTree::getTreeType ( ) const
pure virtual
virtual size_t octomap::AbstractOcTree::memoryUsage ( ) const
pure virtual
virtual size_t octomap::AbstractOcTree::memoryUsageNode ( ) const
pure virtual
virtual void octomap::AbstractOcTree::prune ( )
pure virtual
AbstractOcTree * octomap::AbstractOcTree::read ( const std::string &  filename)
static

Read the file header, create the appropriate class and deserialize. This creates a new octree which you need to delete yourself. If you expect or requre a specific kind of octree, use dynamic_cast afterwards:

AbstractOcTree* tree = AbstractOcTree::read("filename.ot");
OcTree* octree = dynamic_cast<OcTree*>(tree);

Definition at line 74 of file AbstractOcTree.cpp.

AbstractOcTree * octomap::AbstractOcTree::read ( std::istream &  s)
static

Read the file header, create the appropriate class and deserialize. This creates a new octree which you need to delete yourself.

Definition at line 87 of file AbstractOcTree.cpp.

virtual std::istream& octomap::AbstractOcTree::readData ( std::istream &  s)
pure virtual
bool octomap::AbstractOcTree::readHeader ( std::istream &  s,
std::string &  id,
unsigned &  size,
double &  res 
)
staticprotected

Definition at line 119 of file AbstractOcTree.cpp.

void octomap::AbstractOcTree::registerTreeType ( AbstractOcTree tree)
staticprotected

Definition at line 205 of file AbstractOcTree.cpp.

virtual void octomap::AbstractOcTree::setResolution ( double  res)
pure virtual
virtual size_t octomap::AbstractOcTree::size ( ) const
pure virtual
bool octomap::AbstractOcTree::write ( const std::string &  filename) const

Write file header and complete tree to file (serialization)

Definition at line 45 of file AbstractOcTree.cpp.

bool octomap::AbstractOcTree::write ( std::ostream &  s) const

Write file header and complete tree to stream (serialization)

Definition at line 61 of file AbstractOcTree.cpp.

virtual std::ostream& octomap::AbstractOcTree::writeData ( std::ostream &  s) const
pure virtual

Friends And Related Function Documentation

friend class StaticMapInit
friend

Definition at line 51 of file AbstractOcTree.h.

Member Data Documentation

const std::string octomap::AbstractOcTree::fileHeader = "# Octomap OcTree file"
staticprotected

Definition at line 155 of file AbstractOcTree.h.


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


octomap
Author(s): Kai M. Wurm , Armin Hornung
autogenerated on Wed Jun 5 2019 19:26:27