From af7fa2ac51f906fc726452b5a8b51baf1286f019 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 10 Mar 2015 10:44:57 +0100 Subject: [PATCH] Add LSCM as parametrization method --- Polyhedron/demo/Polyhedron/MainWindow.ui | 12 +++++++++--- ...olyhedron_demo_parameterization_plugin.cpp | 19 +++++++++++++++++-- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/MainWindow.ui b/Polyhedron/demo/Polyhedron/MainWindow.ui index 1e183f30a21..581632e84ed 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.ui +++ b/Polyhedron/demo/Polyhedron/MainWindow.ui @@ -37,7 +37,7 @@ 0 0 978 - 21 + 26 @@ -94,6 +94,7 @@ + @@ -294,8 +295,8 @@ 0 0 - 545 - 178 + 534 + 174 @@ -646,6 +647,11 @@ &Preferences + + + Least square conformal maps + + diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_parameterization_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_parameterization_plugin.cpp index 8b3d53e2718..880c0e57019 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_parameterization_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_parameterization_plugin.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -34,7 +35,8 @@ public: // used by Polyhedron_demo_plugin_helper QStringList actionsNames() const { return QStringList() << "actionMVC" - << "actionDCP"; + << "actionDCP" + << "actionLSC"; } bool applicable(QAction*) const { @@ -44,9 +46,10 @@ public: public slots: void on_actionMVC_triggered(); void on_actionDCP_triggered(); + void on_actionLSC_triggered(); protected: - enum Parameterization_method { PARAM_MVC, PARAM_DCP }; + enum Parameterization_method { PARAM_MVC, PARAM_DCP, PARAM_LSC }; void parameterize(Parameterization_method method); }; // end Polyhedron_demo_parameterization_plugin @@ -90,6 +93,13 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio typedef CGAL::Discrete_conformal_map_parameterizer_3 Parameterizer; Parameterizer::Error_code err = CGAL::parameterize(adaptor,Parameterizer()); success = err == Parameterizer::OK; + } + case PARAM_LSC: + { + std::cout << "Parameterize (LSC)..."; + typedef CGAL::LSCM_parameterizer_3 Parameterizer; + Parameterizer::Error_code err = CGAL::parameterize(adaptor,Parameterizer()); + success = err == Parameterizer::OK; } } @@ -145,6 +155,11 @@ void Polyhedron_demo_parameterization_plugin::on_actionDCP_triggered() parameterize(PARAM_DCP); } +void Polyhedron_demo_parameterization_plugin::on_actionLSC_triggered() +{ + std::cerr << "LSC..."; + parameterize(PARAM_LSC); +} Q_EXPORT_PLUGIN2(Polyhedron_demo_parameterization_plugin, Polyhedron_demo_parameterization_plugin) #include "Polyhedron_demo_parameterization_plugin.moc"