13 #include <unordered_map>
15 #include "IJsonConvertibleIO.h"
19 static const std::unordered_map<
21 std::function<bool(
const std::string &, geometry::Octree &)>>
26 static const std::unordered_map<
35 auto octree = std::make_shared<geometry::Octree>();
42 const std::string &
format) {
43 std::string filename_ext;
50 if (filename_ext.empty()) {
52 "Read geometry::Octree failed: unknown file extension.");
58 "Read geometry::Octree failed: unknown file extension.");
67 std::string filename_ext =
69 if (filename_ext.empty()) {
71 "Write geometry::Octree failed: unknown file extension.");
77 "Write geometry::Octree failed: unknown file extension.");
filament::Texture::InternalFormat format
bool WriteOctree(const std::string &filename, const geometry::Octree &octree)
static const std::unordered_map< std::string, std::function< bool(const std::string &, geometry::Octree &)> > file_extension_to_octree_read_function
bool ReadOctreeFromJson(const std::string &filename, geometry::Octree &octree)
bool WriteIJsonConvertibleToJSON(const std::string &filename, const cloudViewer::utility::IJsonConvertible &object)
static const std::unordered_map< std::string, std::function< bool(const std::string &, const geometry::Octree &)> > file_extension_to_octree_write_function
bool WriteOctreeToJson(const std::string &filename, const geometry::Octree &octree)
bool ReadIJsonConvertible(const std::string &filename, cloudViewer::utility::IJsonConvertible &object)
std::shared_ptr< geometry::Octree > CreateOctreeFromFile(const std::string &filename, const std::string &format="auto")
bool ReadOctree(const std::string &filename, geometry::Octree &octree, const std::string &format="auto")
std::string GetFileExtensionInLowerCase(const std::string &filename)
Generic file read and write utility for python interface.