43 #include <pybind11/include/pybind11/pybind11.h> 44 #include <pybind11/include/pybind11/embed.h> 47 #include <NoisePlugin.hh> 51 #include <OpenFlipper/BasePlugin/PythonFunctions.hh> 52 #include <OpenFlipper/PythonInterpreter/PythonTypeConversions.hh> 58 PYBIND11_EMBEDDED_MODULE(Noise, m) {
60 QObject* pluginPointer = getPluginPointer(
"Noise");
63 std::cerr <<
"Error Getting plugin pointer for Plugin-Noise" << std::endl;
70 std::cerr <<
"Error converting plugin pointer for Plugin-Noise" << std::endl;
76 py::class_< NoisePlugin,std::unique_ptr<NoisePlugin, py::nodelete> > noise(m,
"Noise");
81 noise.def(py::init([plugin]() {
return plugin; }));
83 noise.def(
"addNoise",
static_cast<void (
NoisePlugin::*)(
int,
double)
>( &NoisePlugin::slotAddNoise),
84 QCoreApplication::translate(
"PythonDocNoise",
"Add Noise to an object").toLatin1().data(),
85 py::arg(QCoreApplication::translate(
"PythonDocNoise",
"ID of the object").toLatin1().data()),
86 py::arg(QCoreApplication::translate(
"PythonDocNoise",
"Maximal distance").toLatin1().data()) );