inspectors_impl.cpp
Go to the documentation of this file.
1 #include "inspectors_impl.h"
2 
4 
5 namespace python
6 {
7  namespace pointmatcher
8  {
9  namespace impls
10  {
11  void pybindInspectorsImpl(py::module& p_module)
12  {
14  py::class_<InspectorsImpl, std::shared_ptr<InspectorsImpl>> pyInspectorsImpl(p_module, "InspectorsImpl");
15 
16  using NullInspector = InspectorsImpl::NullInspector;
17  py::class_<NullInspector, std::shared_ptr<NullInspector>, Inspector>(pyInspectorsImpl, "NullInspector", "Clearer name when no inspector is required")
18  .def(py::init<>(), "This constructor is not required. It make the attribute className == \"NullInspector\" instead of 'unknown'")
19  .def_static("description", &NullInspector::description);
20 
21  using PerformanceInspector = InspectorsImpl::PerformanceInspector;
22  py::class_<PerformanceInspector, std::shared_ptr<PerformanceInspector>, Inspector>(pyInspectorsImpl, "PerformanceInspector")
23  .def(py::init<const std::string&, const ParametersDoc, const Parameters&>(), py::arg("className"), py::arg("paramsDoc"), py::arg("params"))
24  .def(py::init<const Parameters&>(), py::arg("params"))
25  .def_static("description", &PerformanceInspector::description)
26  .def_static("availableParameters", &PerformanceInspector::availableParameters)
27  .def_readonly("baseFileName", &PerformanceInspector::baseFileName)
28  .def_readonly("bDumpPerfOnExit", &PerformanceInspector::bDumpPerfOnExit)
29  .def_readonly("bDumpStats", &PerformanceInspector::bDumpStats)
30  .def("addStat", &PerformanceInspector::addStat).def("dumpStats", [](PerformanceInspector& self)
31  {
32  std::ostringstream oss;
33  self.dumpStats(oss);
34  py::print(oss.str());
35  }).def("dumpStatsHeader", [](PerformanceInspector& self)
36  {
37  std::ostringstream oss;
38  self.dumpStatsHeader(oss);
39  py::print(oss.str());
40  });
41 
42  using AbstractVTKInspector = InspectorsImpl::AbstractVTKInspector;
43  py::class_<AbstractVTKInspector, std::shared_ptr<AbstractVTKInspector>, PerformanceInspector>(pyInspectorsImpl, "AbstractVTKInspector")
44  .def("init", &AbstractVTKInspector::init)
45  .def("dumpDataPoints", (void (AbstractVTKInspector::*)(const DataPoints&, const std::string&)) &AbstractVTKInspector::dumpDataPoints, py::arg("cloud"), py::arg("name"))
46  .def("dumpMeshNodes", (void (AbstractVTKInspector::*)(const DataPoints&, const std::string&)) &AbstractVTKInspector::dumpMeshNodes, py::arg("cloud"), py::arg("name"))
47  .def("dumpIteration", &AbstractVTKInspector::dumpIteration)
48  .def("finish", &AbstractVTKInspector::finish);
49 
50  using VTKFileInspector = InspectorsImpl::VTKFileInspector;
51  py::class_<VTKFileInspector, std::shared_ptr<VTKFileInspector>, AbstractVTKInspector>(pyInspectorsImpl, "VTKFileInspector")
52  .def_static("description", &VTKFileInspector::description)
53  .def_static("availableParameters", &VTKFileInspector::availableParameters)
54 
55  .def_readonly("baseFileName", &VTKFileInspector::baseFileName)
56  .def_readonly("bDumpIterationInfo", &VTKFileInspector::bDumpIterationInfo)
57  .def_readonly("bDumpDataLinks", &VTKFileInspector::bDumpDataLinks)
58  .def_readonly("bDumpReading", &VTKFileInspector::bDumpReading)
59  .def_readonly("bDumpReference", &VTKFileInspector::bDumpReference)
60 
61  .def(py::init<const Parameters&>(), py::arg("params") = Parameters())
62 
63  .def("init", &VTKFileInspector::init).def("finish", &VTKFileInspector::finish);
64  }
65  }
66  }
67 }
::std::string string
Definition: gtest.h:1979
PM::Inspector Inspector
void pybindInspectorsImpl(py::module &p_module)
PM::Parameters Parameters


libpointmatcher
Author(s):
autogenerated on Sat May 27 2023 02:38:02