ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
random.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 #include "pybind/utility/utility.h"
13 
14 namespace cloudViewer {
15 namespace utility {
16 namespace random {
17 void pybind_random(py::module &m) {
18  py::module m_random =
19  m.def_submodule("random", "Random number generation utilities.");
20 
21  m_random.def("seed", &Seed, "seed"_a,
22  "Set the global random seed for CloudViewer random number "
23  "generation.");
24  docstring::FunctionDocInject(m_random, "seed",
25  {{"seed", "The seed value to set."}});
26 }
27 
28 } // namespace random
29 } // namespace utility
30 } // 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_random(py::module &m)
Definition: random.cpp:17
void Seed(const int seed)
Set CloudViewer global random seed.
Definition: Random.cpp:53
Generic file read and write utility for python interface.