8 #include <pybind11/native_enum.h>
9 #include <pybind11/pybind11.h>
19 #include "../../src/casters.h"
22 using namespace pybind11::literals;
31 QWidget *parentWidget =
nullptr;
36 throw py::value_error(
"non null app pointer is not supported");
43 const std::string msg = errorMsg.toStdString();
44 throw std::runtime_error(msg.c_str());
51 m.attr(
"plugin_name") =
"qM3C2";
53 py::class_<qM3C2Dialog> pyM3C2Dialog(m,
"qM3C2Dialog");
55 py::native_enum<qM3C2Dialog::ExportOptions>(
56 pyM3C2Dialog,
"ExportOptions",
"enum.Enum",
"qM3C2Dialog::ExportOptions.")
57 .value(
"PROJECT_ON_CLOUD1", qM3C2Dialog::ExportOptions::PROJECT_ON_CLOUD1)
58 .value(
"PROJECT_ON_CLOUD2", qM3C2Dialog::ExportOptions::PROJECT_ON_CLOUD2)
59 .value(
"PROJECT_ON_CORE_POINTS", qM3C2Dialog::ExportOptions::PROJECT_ON_CORE_POINTS)
65 {
return new qM3C2Dialog(cloud1, cloud2,
nullptr); }),
68 py::return_value_policy::take_ownership)
71 .def(
"getCorePointsCloud",
73 py::return_value_policy::reference)
75 .def(
"getNormalsOrientationCloud",
77 py::return_value_policy::reference)
81 .def(
"loadParamsFromFile",
86 .def(
"exec", &qM3C2Dialog::exec);
88 py::class_<qM3C2Process>(m,
"qM3C2Process")
89 .def_static(
"Compute", &
ComputeWrapper,
"dialog"_a,
"allowsDialog"_a);
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Main application interface (for plugins)
M3C2 plugin's main dialog.
void setCorePointsCloud(ccPointCloud *cloud)
Sets the core points cloud.
void loadParamsFromFile()
void loadParamsFromPersistentSettings()
Loads parameters from persistent settings.
ccPointCloud * getNormalsOrientationCloud() const
Returns the cloud to be used for normals orientation (if any)
ExportOptions getExportOption() const
Returns selected export option.
ccPointCloud * getCloud2() const
Returns cloud #2.
ccPointCloud * getCloud1() const
Returns cloud #1.
ccPointCloud * getCorePointsCloud() const
Get core points cloud (if any)
int getMaxThreadCount() const
Returns the max number of threads to use.
bool keepOriginalCloud() const
void saveParamsToPersistentSettings()
Saves parameters to persistent settings.
static bool Compute(const qM3C2Dialog &dlg, QString &errorMessage, ccPointCloud *&outputCloud, bool allowDialogs, QWidget *parentWidget=nullptr, ecvMainAppInterface *app=nullptr)
PYBIND11_MODULE(pym3c2, m)
void define_m3c2_plugin(py::module_ &m)
ccPointCloud * ComputeWrapper(const qM3C2Dialog &dlg, bool allowDialogs)