#include #include #include #include "ConstructionWrapper.hh" #include "SystemBuilder.hh" namespace py = pybind11; template void makeConstructionWrapper(M & m, std::string name){ py::class_(m, name.data()).def(py::init()) .def("addLayer", &ConstructionWrapper::addLayer, py::arg("thickness"), py::arg("material"), py::arg("isActive")=true, py::arg("nx")=1, py::arg("ny")=-1) .def("getNSensors", &ConstructionWrapper::getNSensors); } template void makeSystemBuilder(M& m, std::string name){ py::class_(m, name.data()).def(py::init()) .def("init", &SystemBuilder::init, py::arg("cw"), py::arg("gui")=false) .def("run_gui", &SystemBuilder::run_gui) .def("run_batch", &SystemBuilder::run_batch) .def("visualize", &SystemBuilder::visualize); } PYBIND11_MODULE(bindings, m) { m.doc() = "pybind11 example plugin"; // optional module docstring makeConstructionWrapper(m, "ConstructionWrapper"); makeSystemBuilder(m, "SystemBuilder"); }