ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
database.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 
10 #include "pipelines/database.h"
11 #include "pybind/docstring.h"
12 
13 namespace cloudViewer {
14 namespace reconstruction {
15 namespace database {
16 
17 // Reconstruction feature functions have similar arguments, sharing arg
18 // docstrings
19 static const std::unordered_map<std::string, std::string>
21  {"database_path",
22  "Path to database in which to store the extracted data"},
23  {"first_database_path",
24  "The first imported database directory."},
25  {"second_database_path",
26  "The other imported database directory"},
27  {"merged_database_path", "The merged database directory"},
28  {"type", "supported type {all, images, features, matches}"}};
29 
30 void pybind_database_methods(py::module &m) {
31  m.def("clean_database", &CleanDatabase,
32  py::call_guard<py::gil_scoped_release>(),
33  "Function for the clearance of database", "database_path"_a,
34  "type"_a);
35  docstring::FunctionDocInject(m, "clean_database",
37 
38  m.def("create_database", &CreateDatabase,
39  py::call_guard<py::gil_scoped_release>(),
40  "Function for the creation of database", "database_path"_a);
41  docstring::FunctionDocInject(m, "create_database",
43 
44  m.def("merge_database", &MergeDatabase,
45  py::call_guard<py::gil_scoped_release>(),
46  "Function for the merge between two databases",
47  "first_database_path"_a, "second_database_path"_a,
48  "merged_database_path"_a);
49  docstring::FunctionDocInject(m, "merge_database",
51 }
52 
53 void pybind_database(py::module &m) {
54  py::module m_submodule =
55  m.def_submodule("database", "Reconstruction Database.");
56  pybind_database_methods(m_submodule);
57 }
58 
59 } // namespace database
60 } // namespace reconstruction
61 } // 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_database(py::module &m)
Definition: database.cpp:53
void pybind_database_methods(py::module &m)
Definition: database.cpp:30
static const std::unordered_map< std::string, std::string > map_shared_argument_docstrings
Definition: database.cpp:20
Generic file read and write utility for python interface.