std::ostream& OcTreePCL::writeBinary(std::ostream &s){ // format: treetype | resolution | num nodes | [binary nodes] this->toMaxLikelihood(); this->prune(); return writeBinaryConst(s); }
bool AbstractOccupancyOcTree::writeBinaryConst(const std::string& filename) const{ std::ofstream binary_outfile( filename.c_str(), std::ios_base::binary); if (!binary_outfile.is_open()){ OCTOMAP_ERROR_STR("Filestream to "<< filename << " not open, nothing written."); return false; } writeBinaryConst(binary_outfile); binary_outfile.close(); return true; }
void OcTreePCL::writeBinaryConst(const std::string& filename) const{ std::ofstream binary_outfile( filename.c_str(), std::ios_base::binary); if (!binary_outfile.is_open()){ std::cerr << "ERROR: Filestream to "<< filename << " not open, nothing written.\n"; return; } else { writeBinaryConst(binary_outfile); binary_outfile.close(); } }
bool AbstractOccupancyOcTree::writeBinary(std::ostream &s){ // convert to max likelihood first, this makes efficient pruning on binary data possible this->toMaxLikelihood(); this->prune(); return writeBinaryConst(s); }