43 #include <pybind11/include/pybind11/pybind11.h> 44 #include <pybind11/include/pybind11/embed.h> 47 #include <SmootherPlugin.hh> 51 #include <OpenFlipper/BasePlugin/PythonFunctions.hh> 52 #include <OpenFlipper/PythonInterpreter/PythonTypeConversions.hh> 58 PYBIND11_EMBEDDED_MODULE(Smoother, m) {
60 QObject* pluginPointer = getPluginPointer(
"Smoother");
63 std::cerr <<
"Error Getting plugin pointer for Plugin-Smoother" << std::endl;
70 std::cerr <<
"Error converting plugin pointer for Plugin-Smoother" << std::endl;
76 py::class_< SmootherPlugin,std::unique_ptr<SmootherPlugin, py::nodelete> > smoother(m,
"Smoother");
81 smoother.def(py::init([plugin]() {
return plugin; }));
85 QCoreApplication::translate(
"PythonDocSmoother",
"Smooth a mesh").toLatin1().data(),
86 py::arg(QCoreApplication::translate(
"PythonDocSmoother",
"ID of the object").toLatin1().data()),
87 py::arg(QCoreApplication::translate(
"PythonDocSmoother",
"Number of iterations").toLatin1().data()),
88 py::arg(QCoreApplication::translate(
"PythonDocSmoother",
"Direction (String containing either tangential,normal or tangential+normal )").toLatin1().data()),
89 py::arg(QCoreApplication::translate(
"PythonDocSmoother",
"Continuity (String containing either C0 or C1 )").toLatin1().data()),
90 py::arg(QCoreApplication::translate(
"PythonDocSmoother",
"Max distance the smoothed mesh is allowed to differ from the original").toLatin1().data()),
91 py::arg(QCoreApplication::translate(
"PythonDocSmoother",
"Respect features?").toLatin1().data()));
void smooth(int _objectId, int _iterations, QString _direction, QString _continuity, double _maxDistance=-1.0, bool _respectFeatures=true)
smooth an object