ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
class_io.cpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #include <AutoIO.h>
9 #include <FeatureIO.h>
10 #include <IJsonConvertibleIO.h>
11 #include <ImageIO.h>
12 #include <LineSetIO.h>
13 #include <OctreeIO.h>
14 #include <PinholeCameraTrajectoryIO.h>
15 #include <VoxelGridIO.h>
18 
19 #include <string>
20 #include <unordered_map>
21 
22 #include "io/FileFormatIO.h"
23 #include "io/ModelIO.h"
24 #include "io/PointCloudIO.h"
25 #include "io/PoseGraphIO.h"
26 #include "io/TriangleMeshIO.h"
27 #include "pybind/docstring.h"
28 #include "pybind/io/io.h"
30 
31 #ifdef BUILD_AZURE_KINECT
34 #endif
35 
36 namespace cloudViewer {
37 namespace io {
38 
39 // IO functions have similar arguments, thus the arg docstrings may be shared
40 static const std::unordered_map<std::string, std::string>
42  {"filename", "Path to file."},
43  // Write options
44  {"compressed",
45  "Set to ``True`` to write in compressed format."},
46  {"format",
47  "The format of the input file. When not specified or set as "
48  "``auto``, the format is inferred from file extension name."},
49  {"remove_nan_points",
50  "If true, all points that include a NaN are removed from "
51  "the PointCloud."},
52  {"remove_infinite_points",
53  "If true, all points that include an infinite value are "
54  "removed from the PointCloud."},
55  {"quality", "Quality of the output file."},
56  {"write_ascii",
57  "Set to ``True`` to output in ascii format, otherwise binary "
58  "format will be used."},
59  {"write_vertex_normals",
60  "Set to ``False`` to not write any vertex normals, even if "
61  "present on the mesh"},
62  {"write_vertex_colors",
63  "Set to ``False`` to not write any vertex colors, even if "
64  "present on the mesh"},
65  {"write_triangle_uvs",
66  "Set to ``False`` to not write any triangle uvs, even if "
67  "present on the mesh. For ``obj`` format, mtl file is saved "
68  "only when ``True`` is set"},
69  // Entities
70  {"config", "AzureKinectSensor's config file."},
71  {"pointcloud", "The ``PointCloud`` object for I/O"},
72  {"mesh", "The ``TriangleMesh`` object for I/O"},
73  {"line_set", "The ``LineSet`` object for I/O"},
74  {"image", "The ``Image`` object for I/O"},
75  {"voxel_grid", "The ``VoxelGrid`` object for I/O"},
76  {"octree", "The ``Octree`` object for I/O"},
77  {"trajectory",
78  "The ``PinholeCameraTrajectory`` object for I/O"},
79  {"intrinsic", "The ``PinholeCameraIntrinsic`` object for I/O"},
80  {"parameters",
81  "The ``PinholeCameraParameters`` object for I/O"},
82  {"pose_graph", "The ``PoseGraph`` object for I/O"},
83  {"feature", "The ``Feature`` object for I/O"},
84  {"print_progress",
85  "If set to true a progress bar is visualized in the console"},
86 };
87 
88 void pybind_class_io(py::module &m_io) {
89  py::native_enum<FileGeometry>(m_io, "FileGeometry", "enum.IntFlag",
90  "Geometry types.")
91  .value("CONTENTS_UKNWOWN", FileGeometry::CONTENTS_UNKNOWN)
92  .value("CONTAINS_POINTS", FileGeometry::CONTAINS_POINTS)
93  .value("CONTAINS_LINES", FileGeometry::CONTAINS_LINES)
94  .value("CONTAINS_TRIANGLES", FileGeometry::CONTAINS_TRIANGLES)
95  .export_values()
96  .finalize();
97  m_io.def(
98  "read_file_geometry_type", &ReadFileGeometryType,
99  "Returns the type of geometry of the file. This is a faster way of "
100  "determining the file type than attempting to read the file as a "
101  "point cloud, mesh, or line set in turn.");
102 
103  // ccHObject
104  m_io.def(
105  "read_entity",
106  [](const fs::path &filename, const std::string &format,
107  bool print_progress) {
108  auto entity = std::make_shared<ccHObject>("group");
109  ReadEntity(filename.string(), *entity, format, print_progress);
110  return entity;
111  },
112  "Function to read entity from file", "filename"_a,
113  "format"_a = "auto", "print_progress"_a = false);
114  docstring::FunctionDocInject(m_io, "read_entity",
116 
117  m_io.def(
118  "write_entity",
119  [](const fs::path &filename, const ccHObject &entity,
120  bool write_ascii, bool compressed, bool print_progress) {
121  return WriteEntity(filename.string(), entity, write_ascii,
122  compressed, print_progress);
123  },
124  "Function to write entity to file", "filename"_a, "entity"_a,
125  "write_ascii"_a = false, "compressed"_a = false,
126  "print_progress"_a = false);
127  docstring::FunctionDocInject(m_io, "write_entity",
129 
130  // cloudViewer::geometry::Image
131  m_io.def(
132  "read_image",
133  [](const fs::path &filename) {
134  py::gil_scoped_release release;
136  ReadImage(filename.string(), image);
137  return image;
138  },
139  "Function to read Image from file", "filename"_a);
140  docstring::FunctionDocInject(m_io, "read_image",
142 
143  m_io.def(
144  "write_image",
145  [](const fs::path &filename, const geometry::Image &image,
146  int quality) {
147  py::gil_scoped_release release;
148  return WriteImage(filename.string(), image, quality);
149  },
150  "Function to write Image to file", "filename"_a, "image"_a,
151  "quality"_a = kCloudViewerImageIODefaultQuality);
152  docstring::FunctionDocInject(m_io, "write_image",
154 
155  // cloudViewer::geometry::LineSet
156  m_io.def(
157  "read_line_set",
158  [](const fs::path &filename, const std::string &format,
159  bool print_progress) {
160  py::gil_scoped_release release;
161  geometry::LineSet line_set;
162  ReadLineSet(filename.string(), line_set, format,
163  print_progress);
164  return line_set;
165  },
166  "Function to read LineSet from file", "filename"_a,
167  "format"_a = "auto", "print_progress"_a = false);
168  docstring::FunctionDocInject(m_io, "read_line_set",
170 
171  m_io.def(
172  "write_line_set",
173  [](const fs::path &filename, const geometry::LineSet &line_set,
174  bool write_ascii, bool compressed, bool print_progress) {
175  py::gil_scoped_release release;
176  return WriteLineSet(filename.string(), line_set, write_ascii,
177  compressed, print_progress);
178  },
179  "Function to write LineSet to file", "filename"_a, "line_set"_a,
180  "write_ascii"_a = false, "compressed"_a = false,
181  "print_progress"_a = false);
182  docstring::FunctionDocInject(m_io, "write_line_set",
184 
185  // ccPointCloud
186  m_io.def(
187  "read_point_cloud",
188  [](const fs::path &filename, const std::string &format,
189  bool remove_nan_points, bool remove_infinite_points,
190  bool print_progress) {
191  py::gil_scoped_release release;
192  auto pcd = std::make_shared<ccPointCloud>();
193  ReadPointCloud(filename.string(), *pcd,
194  {format, remove_nan_points,
195  remove_infinite_points, print_progress});
196  return pcd;
197  },
198  "Function to read PointCloud from file", "filename"_a,
199  "format"_a = "auto", "remove_nan_points"_a = false,
200  "remove_infinite_points"_a = false, "print_progress"_a = false);
201  docstring::FunctionDocInject(m_io, "read_point_cloud",
203 
204  m_io.def(
205  "read_point_cloud_from_bytes",
206  [](const py::bytes &bytes, const std::string &format,
207  bool remove_nan_points, bool remove_infinite_points,
208  bool print_progress) {
209  const char *dataptr = PYBIND11_BYTES_AS_STRING(bytes.ptr());
210  auto length = PYBIND11_BYTES_SIZE(bytes.ptr());
211  auto buffer = new unsigned char[length];
212  // copy before releasing GIL
213  std::memcpy(buffer, dataptr, length);
214  py::gil_scoped_release release;
215  auto pcd = std::make_shared<ccPointCloud>();
216  ReadPointCloud(reinterpret_cast<const unsigned char *>(buffer),
217  length, *pcd,
218  {format, remove_nan_points,
219  remove_infinite_points, print_progress});
220  delete[] buffer;
221  return pcd;
222  },
223  "Function to read PointCloud from memory", "bytes"_a,
224  "format"_a = "auto", "remove_nan_points"_a = false,
225  "remove_infinite_points"_a = false, "print_progress"_a = false);
226  docstring::FunctionDocInject(m_io, "read_point_cloud_from_bytes",
228 
229  m_io.def(
230  "write_point_cloud",
231  [](const fs::path &filename, const ccPointCloud &pointcloud,
232  const std::string &format, bool write_ascii, bool compressed,
233  bool print_progress) {
234  py::gil_scoped_release release;
235  return WritePointCloud(
236  filename.string(), pointcloud,
237  {format, write_ascii, compressed, print_progress});
238  },
239  "Function to write PointCloud to file", "filename"_a,
240  "pointcloud"_a, "format"_a = "auto", "write_ascii"_a = false,
241  "compressed"_a = false, "print_progress"_a = false);
242  docstring::FunctionDocInject(m_io, "write_point_cloud",
244 
245  m_io.def(
246  "write_point_cloud_to_bytes",
247  [](const ccPointCloud &pointcloud, const std::string &format,
248  bool write_ascii, bool compressed, bool print_progress) {
249  py::gil_scoped_release release;
250  size_t len = 0;
251  unsigned char *buffer = nullptr;
252  bool wrote = WritePointCloud(
253  buffer, len, pointcloud,
254  {format, write_ascii, compressed, print_progress});
255  py::gil_scoped_acquire acquire;
256  if (!wrote) {
257  return py::bytes();
258  }
259  auto ret =
260  py::bytes(reinterpret_cast<const char *>(buffer), len);
261  delete[] buffer;
262  return ret;
263  },
264  "Function to write PointCloud to memory", "pointcloud"_a,
265  "format"_a = "auto", "write_ascii"_a = false,
266  "compressed"_a = false, "print_progress"_a = false);
267  docstring::FunctionDocInject(m_io, "write_point_cloud_to_bytes",
269 
270  // cloudViewer::ccMesh
271  m_io.def(
272  "read_triangle_mesh",
273  [](const fs::path &filename, bool enable_post_processing,
274  bool print_progress) {
275  py::gil_scoped_release release;
276  ccMesh mesh;
278  opt.enable_post_processing = enable_post_processing;
279  opt.print_progress = print_progress;
280  ReadTriangleMesh(filename.string(), mesh, opt);
281  // do some cleaning
282  {
283  mesh.shrinkToFit();
285  if (normals) {
286  normals->shrink_to_fit();
287  }
288  }
289  return mesh;
290  },
291  "Function to read TriangleMesh from file", "filename"_a,
292  "enable_post_processing"_a = false, "print_progress"_a = false);
293  docstring::FunctionDocInject(m_io, "read_triangle_mesh",
295 
296  m_io.def(
297  "write_triangle_mesh",
298  [](const fs::path &filename, const ccMesh &mesh, bool write_ascii,
299  bool compressed, bool write_vertex_normals,
300  bool write_vertex_colors, bool write_triangle_uvs,
301  bool print_progress) {
302  py::gil_scoped_release release;
303  return WriteTriangleMesh(filename.string(), mesh, write_ascii,
304  compressed, write_vertex_normals,
305  write_vertex_colors,
306  write_triangle_uvs, print_progress);
307  },
308  "Function to write TriangleMesh to file", "filename"_a, "mesh"_a,
309  "write_ascii"_a = false, "compressed"_a = false,
310  "write_vertex_normals"_a = true, "write_vertex_colors"_a = true,
311  "write_triangle_uvs"_a = true, "print_progress"_a = false);
312  docstring::FunctionDocInject(m_io, "write_triangle_mesh",
314 
315  // cloudViewer::visualization::rendering::TriangleMeshModel (Model.h)
316  m_io.def(
317  "read_triangle_model",
318  [](const fs::path &filename, bool print_progress) {
319  py::gil_scoped_release release;
322  opt.print_progress = print_progress;
323  ReadTriangleModel(filename.string(), model, opt);
324  return model;
325  },
326  "Function to read visualization.rendering.TriangleMeshModel from "
327  "file",
328  "filename"_a, "print_progress"_a = false);
329  docstring::FunctionDocInject(m_io, "read_triangle_model",
331 
332  // cloudViewer::geometry::VoxelGrid
333  m_io.def(
334  "read_voxel_grid",
335  [](const fs::path &filename, const std::string &format,
336  bool print_progress) {
337  py::gil_scoped_release release;
338  geometry::VoxelGrid voxel_grid;
339  ReadVoxelGrid(filename.string(), voxel_grid, format);
340  return voxel_grid;
341  },
342  "Function to read VoxelGrid from file", "filename"_a,
343  "format"_a = "auto", "print_progress"_a = false);
344  docstring::FunctionDocInject(m_io, "read_voxel_grid",
346 
347  m_io.def(
348  "write_voxel_grid",
349  [](const fs::path &filename, const geometry::VoxelGrid &voxel_grid,
350  bool write_ascii, bool compressed, bool print_progress) {
351  py::gil_scoped_release release;
352  return WriteVoxelGrid(filename.string(), voxel_grid,
353  write_ascii, compressed, print_progress);
354  },
355  "Function to write VoxelGrid to file", "filename"_a, "voxel_grid"_a,
356  "write_ascii"_a = false, "compressed"_a = false,
357  "print_progress"_a = false);
358  docstring::FunctionDocInject(m_io, "write_voxel_grid",
360 
361  // cloudViewer::Octree
362  m_io.def(
363  "read_octree",
364  [](const fs::path &filename, const std::string &format) {
365  py::gil_scoped_release release;
367  ReadOctree(filename.string(), octree, format);
368  return octree;
369  },
370  "Function to read Octree from file", "filename"_a,
371  "format"_a = "auto");
372  docstring::FunctionDocInject(m_io, "read_octree",
374 
375  m_io.def(
376  "write_octree",
377  [](const fs::path &filename, const geometry::Octree &octree) {
378  py::gil_scoped_release release;
379  return WriteOctree(filename.string(), octree);
380  },
381  "Function to write Octree to file", "filename"_a, "octree"_a);
382  docstring::FunctionDocInject(m_io, "write_octree",
384 
385  // cloudViewer::camera
386  m_io.def(
387  "read_pinhole_camera_intrinsic",
388  [](const fs::path &filename) {
389  py::gil_scoped_release release;
391  ReadIJsonConvertible(filename.string(), intrinsic);
392  return intrinsic;
393  },
394  "Function to read PinholeCameraIntrinsic from file", "filename"_a);
395  docstring::FunctionDocInject(m_io, "read_pinhole_camera_intrinsic",
397 
398  m_io.def(
399  "write_pinhole_camera_intrinsic",
400  [](const fs::path &filename,
401  const camera::PinholeCameraIntrinsic &intrinsic) {
402  py::gil_scoped_release release;
403  return WriteIJsonConvertible(filename.string(), intrinsic);
404  },
405  "Function to write PinholeCameraIntrinsic to file", "filename"_a,
406  "intrinsic"_a);
407  docstring::FunctionDocInject(m_io, "write_pinhole_camera_intrinsic",
409 
410  m_io.def(
411  "read_pinhole_camera_parameters",
412  [](const fs::path &filename) {
413  py::gil_scoped_release release;
415  ReadIJsonConvertible(filename.string(), parameters);
416  return parameters;
417  },
418  "Function to read PinholeCameraParameters from file", "filename"_a);
419  docstring::FunctionDocInject(m_io, "read_pinhole_camera_parameters",
421 
422  m_io.def(
423  "write_pinhole_camera_parameters",
424  [](const fs::path &filename,
425  const camera::PinholeCameraParameters &parameters) {
426  py::gil_scoped_release release;
427  return WriteIJsonConvertible(filename.string(), parameters);
428  },
429  "Function to write PinholeCameraParameters to file", "filename"_a,
430  "parameters"_a);
431  docstring::FunctionDocInject(m_io, "write_pinhole_camera_parameters",
433 
434  m_io.def(
435  "read_pinhole_camera_trajectory",
436  [](const fs::path &filename) {
437  py::gil_scoped_release release;
439  ReadPinholeCameraTrajectory(filename.string(), trajectory);
440  return trajectory;
441  },
442  "Function to read PinholeCameraTrajectory from file", "filename"_a);
443  docstring::FunctionDocInject(m_io, "read_pinhole_camera_trajectory",
445 
446  m_io.def(
447  "write_pinhole_camera_trajectory",
448  [](const fs::path &filename,
449  const camera::PinholeCameraTrajectory &trajectory) {
450  py::gil_scoped_release release;
451  return WritePinholeCameraTrajectory(filename.string(),
452  trajectory);
453  },
454  "Function to write PinholeCameraTrajectory to file", "filename"_a,
455  "trajectory"_a);
456  docstring::FunctionDocInject(m_io, "write_pinhole_camera_trajectory",
458 
459  // cloudViewer::registration
460  m_io.def(
461  "read_feature",
462  [](const fs::path &filename) {
463  py::gil_scoped_release release;
464  utility::Feature feature;
465  ReadFeature(filename.string(), feature);
466  return feature;
467  },
468  "Function to read registration.Feature from file", "filename"_a);
469  docstring::FunctionDocInject(m_io, "read_feature",
471 
472  m_io.def(
473  "write_feature",
474  [](const fs::path &filename, const utility::Feature &feature) {
475  py::gil_scoped_release release;
476  return WriteFeature(filename.string(), feature);
477  },
478  "Function to write Feature to file", "filename"_a, "feature"_a);
479  docstring::FunctionDocInject(m_io, "write_feature",
481 
482  m_io.def(
483  "read_pose_graph",
484  [](const fs::path &filename) {
485  py::gil_scoped_release release;
487  ReadPoseGraph(filename.string(), pose_graph);
488  return pose_graph;
489  },
490  "Function to read PoseGraph from file", "filename"_a);
491  docstring::FunctionDocInject(m_io, "read_pose_graph",
493 
494  m_io.def(
495  "write_pose_graph",
496  [](const fs::path &filename,
497  const pipelines::registration::PoseGraph pose_graph) {
498  py::gil_scoped_release release;
499  WritePoseGraph(filename.string(), pose_graph);
500  },
501  "Function to write PoseGraph to file", "filename"_a,
502  "pose_graph"_a);
503  docstring::FunctionDocInject(m_io, "write_pose_graph",
505 
506 #ifdef BUILD_AZURE_KINECT
507  m_io.def(
508  "read_azure_kinect_sensor_config",
509  [](const fs::path &filename) {
511  bool success =
512  ReadIJsonConvertibleFromJSON(filename.string(), config);
513  if (!success) {
515  "Invalid sensor config {}, using default instead",
516  filename.string());
517  return AzureKinectSensorConfig();
518  }
519  return config;
520  },
521  "Function to read Azure Kinect sensor config from file",
522  "filename"_a);
523  docstring::FunctionDocInject(m_io, "read_azure_kinect_sensor_config",
525 
526  m_io.def(
527  "write_azure_kinect_sensor_config",
528  [](const fs::path &filename, const AzureKinectSensorConfig config) {
529  return WriteIJsonConvertibleToJSON(filename.string(), config);
530  },
531  "Function to write Azure Kinect sensor config to file",
532  "filename"_a, "config"_a);
533  docstring::FunctionDocInject(m_io, "write_azure_kinect_sensor_config",
535 
536  m_io.def(
537  "read_azure_kinect_mkv_metadata",
538  [](const fs::path &filename) {
539  MKVMetadata metadata;
540  bool success = ReadIJsonConvertibleFromJSON(filename.string(),
541  metadata);
542  if (!success) {
544  "Invalid mkv metadata {}, using default instead",
545  filename.string());
546  return MKVMetadata();
547  }
548  return metadata;
549  },
550  "Function to read Azure Kinect metadata from file", "filename"_a);
551  docstring::FunctionDocInject(m_io, "read_azure_kinect_mkv_metadata",
553 
554  m_io.def(
555  "write_azure_kinect_mkv_metadata",
556  [](const fs::path &filename, const MKVMetadata metadata) {
557  return WriteIJsonConvertibleToJSON(filename.string(), metadata);
558  },
559  "Function to write Azure Kinect metadata to file", "filename"_a,
560  "config"_a);
561  docstring::FunctionDocInject(m_io, "write_azure_kinect_mkv_metadata",
563 #endif
564 }
565 
566 } // namespace io
567 } // namespace cloudViewer
IsAscii write_ascii
Compressed compressed
std::string filename
std::shared_ptr< core::Tensor > image
filament::Texture::InternalFormat format
void * bytes
Array of compressed 3D normals (single index)
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
Triangular mesh.
Definition: ecvMesh.h:35
NormsIndexesTableType * getTriNormsTable() const override
Returns per-triangle normals shared array.
Definition: ecvMesh.h:344
void shrinkToFit()
Removes unused capacity.
Definition: ecvMesh.h:302
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Contains the pinhole camera intrinsic parameters.
Contains both intrinsic and extrinsic pinhole camera parameters.
The Image class stores image with customizable width, height, num of channels and bytes per channel.
Definition: Image.h:33
LineSet define a sets of lines in 3D. A typical application is to display the point cloud corresponde...
Definition: LineSet.h:29
Octree datastructure.
Definition: Octree.h:250
VoxelGrid is a collection of voxels which are aligned in grid.
Definition: VoxelGrid.h:64
Data structure defining the pose graph.
Definition: PoseGraph.h:96
Class to store featrues for registration.
Definition: ecvFeature.h:29
double normals[3]
#define LogWarning(...)
Definition: Logging.h:72
__host__ __device__ float length(float2 v)
Definition: cutil_math.h:1162
void FunctionDocInject(py::module &pybind_module, const std::string &function_name, const std::unordered_map< std::string, std::string > &map_parameter_body_docs)
Definition: docstring.cpp:76
bool ReadPoseGraph(const std::string &filename, pipelines::registration::PoseGraph &pose_graph)
Definition: PoseGraphIO.cpp:60
bool ReadFeature(const std::string &filename, utility::Feature &feature)
bool WriteIJsonConvertible(const std::string &filename, const cloudViewer::utility::IJsonConvertible &object)
bool WriteFeature(const std::string &filename, const utility::Feature &feature)
bool WriteTriangleMesh(const std::string &filename, const ccMesh &mesh, bool write_ascii, bool compressed, bool write_vertex_normals, bool write_vertex_colors, bool write_triangle_uvs, bool print_progress)
bool WriteImage(const std::string &filename, const geometry::Image &image, int quality=kCloudViewerImageIODefaultQuality)
bool WriteOctree(const std::string &filename, const geometry::Octree &octree)
constexpr int kCloudViewerImageIODefaultQuality
Definition: ImageIO.h:47
static const std::unordered_map< std::string, std::string > map_shared_argument_docstrings
Definition: class_io.cpp:41
FileGeometry ReadFileGeometryType(const std::string &path)
bool ReadPointCloud(const std::string &filename, ccPointCloud &pointcloud, const ReadPointCloudOption &params)
bool ReadPinholeCameraTrajectory(const std::string &filename, camera::PinholeCameraTrajectory &trajectory)
bool ReadImage(const std::string &filename, geometry::Image &image)
bool ReadTriangleModel(const std::string &filename, visualization::rendering::TriangleMeshModel &model, ReadTriangleModelOptions params)
Definition: ModelIO.cpp:22
bool WritePointCloud(const std::string &filename, const ccPointCloud &pointcloud, const WritePointCloudOption &params)
bool WriteVoxelGrid(const std::string &filename, const geometry::VoxelGrid &voxelgrid, bool write_ascii=false, bool compressed=false, bool print_progress=false)
bool WritePinholeCameraTrajectory(const std::string &filename, const camera::PinholeCameraTrajectory &trajectory)
bool ReadEntity(const std::string &filename, ccHObject &obj, const std::string &format="auto", bool print_progress=false)
bool WriteLineSet(const std::string &filename, const geometry::LineSet &lineset, bool write_ascii=false, bool compressed=false, bool print_progress=false)
bool WriteIJsonConvertibleToJSON(const std::string &filename, const cloudViewer::utility::IJsonConvertible &object)
bool ReadLineSet(const std::string &filename, geometry::LineSet &lineset, const std::string &format="auto", bool print_progress=false)
bool ReadIJsonConvertibleFromJSON(const std::string &filename, cloudViewer::utility::IJsonConvertible &object)
bool ReadIJsonConvertible(const std::string &filename, cloudViewer::utility::IJsonConvertible &object)
bool WriteEntity(const std::string &filename, const ccHObject &obj, bool write_ascii=false, bool compressed=false, bool print_progress=false)
void pybind_class_io(py::module &m_io)
Definition: class_io.cpp:88
bool ReadVoxelGrid(const std::string &filename, geometry::VoxelGrid &voxelgrid, const std::string &format="auto", bool print_progress=false)
bool ReadTriangleMesh(const std::string &filename, ccMesh &mesh, ReadTriangleMeshOptions params)
bool WritePoseGraph(const std::string &filename, const pipelines::registration::PoseGraph &pose_graph)
Definition: PoseGraphIO.cpp:81
bool ReadOctree(const std::string &filename, geometry::Octree &octree, const std::string &format="auto")
static const std::string path
Definition: PointCloud.cpp:59
Generic file read and write utility for python interface.
cloudViewer::DgmOctree * octree
bool enable_post_processing
Enables post-processing on the mesh.
Definition: AutoIO.h:26