ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ModelIO.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 "io/ModelIO.h"
9 
10 #include <FileSystem.h>
11 #include <Logging.h>
12 
13 #include <unordered_map>
14 
15 namespace cloudViewer {
16 namespace io {
17 
18 bool ReadModelUsingAssimp(const std::string& filename,
19  visualization::rendering::TriangleMeshModel& model,
20  const ReadTriangleModelOptions& params /*={}*/);
21 
22 bool ReadTriangleModel(const std::string& filename,
25  if (params.print_progress) {
26  auto progress_text = std::string("Reading model file") + filename;
27  auto pbar = utility::ConsoleProgressBar(100, progress_text, true);
28  params.update_progress = [pbar](double percent) mutable -> bool {
29  pbar.setCurrentCount(size_t(percent));
30  return true;
31  };
32  }
33  return ReadModelUsingAssimp(filename, model, params);
34 }
35 
36 } // namespace io
37 } // namespace cloudViewer
std::string filename
cmdLineReadable * params[]
bool ReadModelUsingAssimp(const std::string &filename, visualization::rendering::TriangleMeshModel &model, const ReadTriangleModelOptions &params)
Definition: FileASSIMP.cpp:312
bool ReadTriangleModel(const std::string &filename, visualization::rendering::TriangleMeshModel &model, ReadTriangleModelOptions params)
Definition: ModelIO.cpp:22
Generic file read and write utility for python interface.