| 22 | namespace py = pybind11; |
| 23 | |
| 24 | PYBIND11_PLUGIN(libmodelpackage) { |
| 25 | py::module m("libmodelpackage", "Library to create, access and edit model packages"); |
| 26 | |
| 27 | py::class_<MPL::ModelPackageItemInfo, std::shared_ptr<MPL::ModelPackageItemInfo>>(m, "ModelPackageItemInfo") |
| 28 | .def("identifier", &MPL::ModelPackageItemInfo::identifier) |
| 29 | .def("path", &MPL::ModelPackageItemInfo::path) |
| 30 | .def("name", &MPL::ModelPackageItemInfo::name) |
| 31 | .def("author", &MPL::ModelPackageItemInfo::author) |
| 32 | .def("description", &MPL::ModelPackageItemInfo::description); |
| 33 | |
| 34 | py::class_<MPL::ModelPackage>(m, "ModelPackage") |
| 35 | .def(py::init<const std::string&>()) |
| 36 | .def("path", &MPL::ModelPackage::path) |
| 37 | .def("setRootModel", &MPL::ModelPackage::setRootModel) |
| 38 | .def("replaceRootModel", &MPL::ModelPackage::replaceRootModel) |
| 39 | .def("addItem", &MPL::ModelPackage::addItem) |
| 40 | .def("getRootModel", &MPL::ModelPackage::getRootModel) |
| 41 | .def("isValid", &MPL::ModelPackage::isValid) |
| 42 | .def("findItemByNameAuthor", py::overload_cast<const std::string&, const std::string&>(&MPL::ModelPackage::findItem, py::const_)); |
| 43 | |
| 44 | return m.ptr(); |
| 45 | } |
| 46 | |
| 47 | #pragma clang diagnostic pop |