7 namespace datapointsfilters
12 py::class_<OctreeGridDataPointsFilter, std::shared_ptr<OctreeGridDataPointsFilter>,
DataPointsFilter> octreegridClass(p_module,
"OctreeGridDataPointsFilter");
14 octreegridClass.doc() = R
"pbdoc(
15 Data Filter based on Octree representation
17 Processings are applyed via a Visitor through Depth-first search in the Octree (DFS)
18 i.e. for each node, the Visitor/Callback is called
22 py::class_<FirstPtsSampler> firstptssamplerClass(octreegridClass,
"FirstPtsSampler",
"Visitors class to apply processing");
24 firstptssamplerClass.def_readwrite(
"idx", &FirstPtsSampler::idx)
26 .def_readwrite(
"mapidx", &FirstPtsSampler::mapidx,
"Build map of (old index to new index), in case we sample pts at the begining of the pointcloud")
28 .def(py::init<DataPoints&>(), py::arg(
"dp"))
32 .def(
"finalize", &FirstPtsSampler::finalize);
35 py::class_<RandomPtsSampler, FirstPtsSampler>(firstptssamplerClass,
"RandomPtsSampler")
36 .def_readonly(
"seed", &RandomPtsSampler::seed)
38 .def(py::init<DataPoints&>(), py::arg(
"dp"))
39 .def(py::init<DataPoints&, const std::size_t>(), py::arg(
"dp"), py::arg(
"seed_"))
43 .def(
"finalize", &RandomPtsSampler::finalize);
46 py::class_<CentroidSampler, FirstPtsSampler>(firstptssamplerClass,
"CentroidSampler")
47 .def(py::init<DataPoints&>(), py::arg(
"dp"));
53 py::class_<MedoidSampler, FirstPtsSampler>(firstptssamplerClass,
"MedoidSampler",
"Nearest point from the centroid (contained in the cloud)")
54 .def(py::init<DataPoints&>(), py::arg(
"dp"));
60 py::enum_<SamplingMethod>(octreegridClass,
"SamplingMethod").value(
"FIRST_PTS", SamplingMethod::FIRST_PTS)
61 .value(
"RAND_PTS", SamplingMethod::RAND_PTS).value(
"CENTROID", SamplingMethod::CENTROID)
62 .value(
"MEDOID", SamplingMethod::MEDOID).export_values();
72 .def(py::init<const Parameters&>(), py::arg(
"params") =
Parameters(),
"Constructor, uses parameter interface")