34#ifndef OCTOMAP_ABSTRACT_OCTREE_H
35#define OCTOMAP_ABSTRACT_OCTREE_H
66 virtual size_t size()
const = 0;
70 virtual void getMetricMin(
double& x,
double& y,
double& z)
const = 0;
72 virtual void getMetricMax(
double& x,
double& y,
double& z)
const = 0;
107 bool write(
const std::string& filename)
const;
109 bool write(std::ostream& s)
const;
142 virtual std::istream&
readData(std::istream &s) = 0;
146 virtual std::ostream&
writeData(std::ostream &s)
const = 0;
149 static std::map<std::string, AbstractOcTree*>& classIDMapping();
152 static bool readHeader(std::istream &s, std::string&
id,
unsigned&
size,
double& res);
Base class for OcTree iterators.
Definition: OcTreeIterator.hxx:42
OcTreeBaseImpl< NodeType, INTERFACE > const * tree
Octree this iterator is working on.
Definition: OcTreeIterator.hxx:158
This abstract class is an interface to all octrees and provides a factory design pattern for readin a...
Definition: AbstractOcTree.h:50
virtual std::istream & readData(std::istream &s)=0
Read all nodes from the input stream (without file header), for this the tree needs to be already cre...
virtual double getResolution() const =0
virtual std::string getTreeType() const =0
returns actual class name as string for identification
virtual void getMetricMin(double &x, double &y, double &z) const =0
AbstractOcTree()
Definition: AbstractOcTree.cpp:41
virtual ~AbstractOcTree()
Definition: AbstractOcTree.h:54
virtual void getMetricMin(double &x, double &y, double &z)=0
virtual size_t size() const =0
static AbstractOcTree * read(const std::string &filename)
Read the file header, create the appropriate class and deserialize.
Definition: AbstractOcTree.cpp:74
virtual void getMetricMax(double &x, double &y, double &z)=0
friend class StaticMapInit
Definition: AbstractOcTree.h:51
virtual size_t memoryUsageNode() const =0
static bool readHeader(std::istream &s, std::string &id, unsigned &size, double &res)
Definition: AbstractOcTree.cpp:119
virtual size_t memoryUsage() const =0
bool write(const std::string &filename) const
Write file header and complete tree to file (serialization)
Definition: AbstractOcTree.cpp:45
virtual AbstractOcTree * create() const =0
virtual constructor: creates a new object of same type
static void registerTreeType(AbstractOcTree *tree)
Definition: AbstractOcTree.cpp:205
virtual void getMetricMax(double &x, double &y, double &z) const =0
virtual void getMetricSize(double &x, double &y, double &z)=0
static AbstractOcTree * createTree(const std::string id, double res)
Creates a certain OcTree (factory pattern)
Definition: AbstractOcTree.cpp:184
virtual std::ostream & writeData(std::ostream &s) const =0
Write complete state of tree to stream (without file header) unmodified. Pruning the tree first produ...
static const std::string fileHeader
Definition: AbstractOcTree.h:155
virtual void setResolution(double res)=0
Namespace the OctoMap library and visualization tools.