43 #include <pybind11/include/pybind11/pybind11.h> 44 #include <pybind11/include/pybind11/embed.h> 47 #include <TypeLight.hh> 50 #include <QCoreApplication> 52 #include <OpenFlipper/BasePlugin/PythonFunctions.hh> 53 #include <OpenFlipper/PythonInterpreter/PythonTypeConversions.hh> 59 PYBIND11_EMBEDDED_MODULE(TypeLight, m) {
61 QObject* pluginPointer = getPluginPointer(
"TypeLight");
64 std::cerr <<
"Error Getting plugin pointer for Plugin-TypeLight" << std::endl;
71 std::cerr <<
"Error converting plugin pointer for Plugin-TypeLight" << std::endl;
77 py::class_< TypeLightPlugin,std::unique_ptr<TypeLightPlugin, py::nodelete> > light(m,
"TypeLight");
82 light.def(py::init([plugin]() {
return plugin; }));
86 QCoreApplication::translate(
"PythonDocLight",
"Creates a default Light (ObjectId is returned)").toLatin1().data() );
88 light.def(
"addDefaultLight", &TypeLightPlugin::addDefaultLight,
89 QCoreApplication::translate(
"PythonDocLight",
"Creates a default Light (ObjectId is returned)").toLatin1().data(),
90 py::arg(QCoreApplication::translate(
"PythonDocLight",
"Name of the light").toLatin1().data()) );
93 QCoreApplication::translate(
"PythonDocLight",
"Return supported datatype").toLatin1().data() );
int addEmpty()
Create an empty object.
DataType supportedType()
Return your supported object type( e.g. DATA_TRIANGLE_MESH )