ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
viewer.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 
9 
11 #include "pybind/docstring.h"
12 
13 namespace cloudViewer {
14 namespace visualization {
15 namespace app {
16 
17 void pybind_app(py::module &m) {
18  py::module m_app = m.def_submodule(
19  "app", "Functionality for running the cloudViewer viewer.");
20  m_app.def(
21  "run_viewer",
22  [](const std::vector<std::string> &args) {
23  const char **argv = new const char *[args.size()];
24  for (size_t it = 0; it < args.size(); it++) {
25  argv[it] = args[it].c_str();
26  }
27  RunViewer(args.size(), argv);
28  delete[] argv;
29  },
30  "args"_a);
32  m_app, "run_viewer",
33  {{"args",
34  "List of arguments containing the path of the calling program "
35  "(which should be in the same directory as the gui resources "
36  "folder) and the optional path of the geometry to visualize."}});
37 }
38 
39 } // namespace app
40 } // namespace visualization
41 } // namespace cloudViewer
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
void pybind_app(py::module &m)
Definition: viewer.cpp:17
void RunViewer(int argc, const char *argv[])
Definition: Viewer.cpp:26
Generic file read and write utility for python interface.