octomap 1.5.0
|
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()). More...
Public Member Functions | |
AbstractOcTree () | |
virtual void | clear ()=0 |
virtual AbstractOcTree * | create () const =0 |
virtual constructor: creates a new object of same type | |
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 | |
virtual size_t | memoryUsage () const =0 |
virtual size_t | memoryUsageNode () const =0 |
virtual void | prune ()=0 |
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 created. | |
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) | |
bool | write (std::ostream &s) const |
Write file header and complete tree to stream (serialization) | |
virtual std::ostream & | writeData (std::ostream &s) const =0 |
Write complete state of tree to stream (without file header) unmodified. | |
virtual | ~AbstractOcTree () |
Static Public Member Functions | |
static AbstractOcTree * | createTree (const std::string id, double res) |
Creates a certain OcTree (factory pattern) | |
static AbstractOcTree * | read (std::istream &s) |
Read the file header, create the appropriate class and deserialize. | |
static AbstractOcTree * | read (const std::string &filename) |
Read the file header, create the appropriate class and deserialize. | |
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" |
Friends | |
class | StaticMapInit |
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()).
octomap::AbstractOcTree::AbstractOcTree | ( | ) |
virtual octomap::AbstractOcTree::~AbstractOcTree | ( | ) | [inline, virtual] |
virtual void octomap::AbstractOcTree::clear | ( | ) | [pure virtual] |
Implemented in octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, and octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >.
Referenced by octomap::AbstractOccupancyOcTree::readBinary(), and octomap::AbstractOccupancyOcTree::readBinaryLegacyHeader().
virtual AbstractOcTree* octomap::AbstractOcTree::create | ( | ) | const [pure virtual] |
virtual constructor: creates a new object of same type
Implemented in octomap::OcTreeBase< NODE >.
Referenced by createTree().
AbstractOcTree * octomap::AbstractOcTree::createTree | ( | const std::string | id, |
double | res | ||
) | [static] |
Creates a certain OcTree (factory pattern)
References create(), OCTOMAP_ERROR, and setResolution().
Referenced by read().
virtual void octomap::AbstractOcTree::expand | ( | ) | [pure virtual] |
Implemented in octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, and octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >.
virtual void octomap::AbstractOcTree::getMetricMax | ( | double & | x, |
double & | y, | ||
double & | z | ||
) | [pure virtual] |
Implemented in octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, and octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >.
virtual void octomap::AbstractOcTree::getMetricMax | ( | double & | x, |
double & | y, | ||
double & | z | ||
) | const [pure virtual] |
Implemented in octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, and octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >.
virtual void octomap::AbstractOcTree::getMetricMin | ( | double & | x, |
double & | y, | ||
double & | z | ||
) | const [pure virtual] |
Implemented in octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, and octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >.
virtual void octomap::AbstractOcTree::getMetricMin | ( | double & | x, |
double & | y, | ||
double & | z | ||
) | [pure virtual] |
Implemented in octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, and octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >.
virtual void octomap::AbstractOcTree::getMetricSize | ( | double & | x, |
double & | y, | ||
double & | z | ||
) | [pure virtual] |
Implemented in octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, and octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >.
virtual double octomap::AbstractOcTree::getResolution | ( | ) | const [pure virtual] |
Implemented in octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, and octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >.
Referenced by main(), write(), and octomap::AbstractOccupancyOcTree::writeBinaryConst().
virtual std::string octomap::AbstractOcTree::getTreeType | ( | ) | const [pure virtual] |
returns actual class name as string for identification
Implemented in octomap::OcTreeBase< NODE >, octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, and octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >.
Referenced by main(), registerTreeType(), write(), and octomap::AbstractOccupancyOcTree::writeBinaryConst().
virtual size_t octomap::AbstractOcTree::memoryUsage | ( | ) | const [pure virtual] |
Implemented in octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, and octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >.
virtual size_t octomap::AbstractOcTree::memoryUsageNode | ( | ) | const [pure virtual] |
Implemented in octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, and octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >.
virtual void octomap::AbstractOcTree::prune | ( | ) | [pure virtual] |
Implemented in octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, and octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >.
Referenced by octomap::AbstractOccupancyOcTree::writeBinary().
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);
References OCTOMAP_ERROR_STR.
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.
References createTree(), fileHeader, OCTOMAP_DEBUG_STR, OCTOMAP_ERROR_STR, readData(), readHeader(), and size().
virtual std::istream& octomap::AbstractOcTree::readData | ( | std::istream & | s | ) | [pure virtual] |
Read all nodes from the input stream (without file header), for this the tree needs to be already created.
For general file IO, you should probably use AbstractOcTree::read() instead.
Implemented in octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, and octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >.
Referenced by read().
bool octomap::AbstractOcTree::readHeader | ( | std::istream & | s, |
std::string & | id, | ||
unsigned & | size, | ||
double & | res | ||
) | [static, protected] |
References OCTOMAP_ERROR_STR, OCTOMAP_WARNING, OCTOMAP_WARNING_STR, and size().
Referenced by read(), and octomap::AbstractOccupancyOcTree::readBinary().
void octomap::AbstractOcTree::registerTreeType | ( | AbstractOcTree * | tree | ) | [static, protected] |
References getTreeType().
Referenced by octomap::OcTreeStamped::StaticMemberInitializer::StaticMemberInitializer(), octomap::OcTree::StaticMemberInitializer::StaticMemberInitializer(), octomap::CountingOcTree::StaticMemberInitializer::StaticMemberInitializer(), and octomap::ColorOcTree::StaticMemberInitializer::StaticMemberInitializer().
virtual void octomap::AbstractOcTree::setResolution | ( | double | res | ) | [pure virtual] |
Implemented in octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, and octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >.
Referenced by createTree(), and octomap::AbstractOccupancyOcTree::readBinary().
virtual size_t octomap::AbstractOcTree::size | ( | ) | const [pure virtual] |
Implemented in octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, and octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >.
Referenced by main(), read(), octomap::AbstractOccupancyOcTree::readBinary(), readHeader(), write(), and octomap::AbstractOccupancyOcTree::writeBinaryConst().
bool octomap::AbstractOcTree::write | ( | const std::string & | filename | ) | const |
Write file header and complete tree to file (serialization)
References OCTOMAP_ERROR_STR.
Referenced by main().
bool octomap::AbstractOcTree::write | ( | std::ostream & | s | ) | const |
Write file header and complete tree to stream (serialization)
References fileHeader, getResolution(), getTreeType(), size(), and writeData().
virtual std::ostream& octomap::AbstractOcTree::writeData | ( | std::ostream & | s | ) | const [pure virtual] |
Write complete state of tree to stream (without file header) unmodified.
Pruning the tree first produces smaller files (lossless compression)
Implemented in octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, and octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >.
Referenced by write().
friend class StaticMapInit [friend] |
const std::string octomap::AbstractOcTree::fileHeader = "# Octomap OcTree file" [static, protected] |