8 #include <pybind11/pybind11.h>
9 #include <pybind11/stl.h>
10 #include <pybind11/stl_bind.h>
16 using namespace pybind11::literals;
23 py::class_<cloudViewer::KDTree> a(cccorelib,
"KDTree");
24 py::bind_vector<std::vector<unsigned>>(a,
"IndicesVector", py::module_local(
true));
28 .def(
"getAssociatedCloud",
30 py::return_value_policy::reference)
32 "findNearestNeighbour",
40 unsigned nearestIndex{0};
41 py::object ret = py::none();
42 if (
self.findNearestNeighbour(
point, nearestIndex, maxDist))
44 ret = py::cast(nearestIndex);
51 "findNearestNeighbourWithMaxDist",
58 return self.findNearestNeighbourWithMaxDist(
point, maxDist);
65 py::sequence &queryPoint,
68 std::vector<unsigned> &
points)
74 return self.radiusSearch(
point, distance, tolerance,
points);
float PointCoordinateType
Type of the coordinates of a (N-D) point.
void define_KdTree(py::module &cccorelib)
GenericIndexedCloud * getAssociatedCloud() const
Gets the point cloud from which the tree has been build.
bool buildFromCloud(GenericIndexedCloud *cloud, GenericProgressCallback *progressCb=nullptr)
Builds the KD-tree.