43#include <pybind11/pybind11.h>
44#include <pybind11/embed.h>
47#include <MeshComparePlugin.hh>
51#include <OpenFlipper/BasePlugin/PythonFunctions.hh>
52#include <OpenFlipper/PythonInterpreter/PythonTypeConversions.hh>
54namespace py = pybind11;
58PYBIND11_EMBEDDED_MODULE(MeshCompare, m) {
60 QObject* pluginPointer = getPluginPointer(
"MeshCompare");
63 std::cerr <<
"Error Getting plugin pointer for Plugin-MeshCompare" << std::endl;
70 std::cerr <<
"Error converting plugin pointer for Plugin-MeshCompare" << std::endl;
76 py::class_< MeshComparePlugin,std::unique_ptr<MeshComparePlugin, py::nodelete> > compare(m,
"MeshCompare");
81 compare.def(py::init([plugin]() {
return plugin; }));
84 QCoreApplication::translate(
"PythonDocMeshCompare",
"Compares two meshes. Use the getter functions to retrieve the maximal deviations").toLatin1().data(),
85 py::arg(QCoreApplication::translate(
"PythonDocMeshCompare",
"ID of the first object").toLatin1().data()),
86 py::arg(QCoreApplication::translate(
"PythonDocMeshCompare",
"ID of the second object").toLatin1().data()),
87 py::arg(QCoreApplication::translate(
"PythonDocMeshCompare",
"Compute distance between meshes").toLatin1().data()) =
true,
88 py::arg(QCoreApplication::translate(
"PythonDocMeshCompare",
"Compute normal deviation between meshes").toLatin1().data()) =
true,
89 py::arg(QCoreApplication::translate(
"PythonDocMeshCompare",
"Compute Gauss curvature deviation between meshes").toLatin1().data()) =
true,
90 py::arg(QCoreApplication::translate(
"PythonDocMeshCompare",
"Compute mean curvature deviation between meshes").toLatin1().data()) =
true,
91 py::arg(QCoreApplication::translate(
"PythonDocMeshCompare",
"Compare only selected vertices").toLatin1().data()) =
false);
94 QCoreApplication::translate(
"PythonDocMeshCompare",
"Get the maximal distance of the last comparison (-1, if no comparison performed so far)").toLatin1().data() );
97 QCoreApplication::translate(
"PythonDocMeshCompare",
"Get the maximal normal deviation of the last comparison in degree (-1, if no comparison performed so far)").toLatin1().data() );
100 QCoreApplication::translate(
"PythonDocMeshCompare",
"Get the maximal mean curvature deviation of the last comparison (-1, if no comparison performed so far)").toLatin1().data() );
103 QCoreApplication::translate(
"PythonDocMeshCompare",
"Get the maximal Gauss curvature deviation of the last comparison (-1, if no comparison performed so far)").toLatin1().data() );
void compare(int _sourceId, int _targetId, bool _computeDist=true, bool _computeNormal=true, bool _computeGauss=true, bool _computeMean=true, bool _selection_=false)
double lastMaximalDistance()
Get the maximal distance of the last comparison (-1, if no comparison performed so far)
double lastMaximalGaussCurvatureDeviation()
Get the maximal gauss curvature deviation of the last comparison (-1, if no comparison performed so f...
double lastMaximalMeanCurvatureDeviation()
Get the maximal mean curvature deviation of the last comparison (-1, if no comparison performed so fa...
double lastMaximalNormalDeviation()
Get the maximal normal deviation of the last comparison in degree (-1, if no comparison performed so ...