-
Notifications
You must be signed in to change notification settings - Fork 383
Expand file tree
/
Copy pathPyHashGrid.cpp
More file actions
30 lines (26 loc) · 1.11 KB
/
Copy pathPyHashGrid.cpp
File metadata and controls
30 lines (26 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <memory>
#include <pybind11/pybind11.h>
#include <pybind11/eigen.h>
#include <pybind11/stl.h>
#include <Misc/HashGrid.h>
namespace py = pybind11;
using namespace PyMesh;
void init_HashGrid(py::module &m) {
py::class_<HashGrid, std::shared_ptr<HashGrid> > hash_grid(m, "HashGrid");
hash_grid.def_static("create",
[](Float cell_size, size_t dim) {
return HashGrid::create(cell_size, dim);
})
.def("insert", &HashGrid::insert)
.def("insert_bbox", &HashGrid::insert_bbox)
.def("insert_triangle", &HashGrid::insert_triangle)
.def("insert_multiple_triangles", &HashGrid::insert_multiple_triangles)
.def("insert_batch", &HashGrid::insert_batch)
.def("insert_multiple", &HashGrid::insert_multiple)
.def("remove", &HashGrid::remove)
.def("occupied", &HashGrid::occupied)
.def("bucket_count", &HashGrid::bucket_count)
.def("size", &HashGrid::size)
.def("get_items_near_point", &HashGrid::get_items_near_point)
.def("get_occupied_cell_centers", &HashGrid::get_occupied_cell_centers);
}