Go to the documentation of this file.
   46      std::ofstream file(filename.c_str(), std::ios_base::out | std::ios_base::binary);
 
   62     s << 
fileHeader <<
"\n# (feel free to add / change comments, but leave the first line as it is!)\n#\n";
 
   64     s << 
"size "<< 
size() << std::endl;
 
   66     s << 
"data" << std::endl;
 
   75     std::ifstream file(filename.c_str(), std::ios_base::in |std::ios_base::binary);
 
   91     std::getline(s, line);
 
  125     bool headerRead = 
false;
 
  126     while(s.good() && !headerRead) {
 
  128       if (token == 
"data"){
 
  134         } 
while(s.good() && (c != 
'\n'));
 
  136       else if (token.compare(0,1,
"#") == 0){
 
  141         } 
while(s.good() && (c != 
'\n'));
 
  143       else if (token == 
"id")
 
  145       else if (token == 
"res")
 
  147       else if (token == 
"size")
 
  154         } 
while(s.good() && (c != 
'\n'));
 
  176       OCTOMAP_WARNING(
"You are using a deprecated id \"%s\", changing to \"OcTree\" (you should update your file header)\n", 
id.c_str());
 
  185     std::map<std::string, AbstractOcTree*>::iterator it = 
classIDMapping().find(class_name);
 
  187       OCTOMAP_ERROR(
"Could not create octree of type %s, not in store in classIDMapping\n", class_name.c_str());
 
  201     static std::map<std::string, AbstractOcTree*>* map = 
new std::map<std::string, AbstractOcTree*>();
 
  
#define OCTOMAP_WARNING_STR(args)
static std::map< std::string, AbstractOcTree * > & classIDMapping()
create private store, Construct on first use
virtual std::ostream & writeData(std::ostream &s) const =0
static const std::string fileHeader
bool write(const std::string &filename) const
Write file header and complete tree to file (serialization)
#define OCTOMAP_DEBUG_STR(args)
virtual double getResolution() const =0
static AbstractOcTree * createTree(const std::string id, double res)
#define OCTOMAP_ERROR(...)
static bool readHeader(std::istream &s, std::string &id, unsigned &size, double &res)
virtual std::string getTreeType() const =0
returns actual class name as string for identification
#define OCTOMAP_ERROR_STR(args)
virtual size_t size() const =0
static void registerTreeType(AbstractOcTree *tree)
#define OCTOMAP_WARNING(...)
static AbstractOcTree * read(const std::string &filename)
virtual std::istream & readData(std::istream &s)=0
virtual AbstractOcTree * create() const =0
virtual constructor: creates a new object of same type
virtual void setResolution(double res)=0
octomap
Author(s): Kai M. Wurm 
, Armin Hornung 
autogenerated on Mon Apr 21 2025 02:39:48