diff --git a/Polyhedron/demo/Polyhedron/MainWindow.ui b/Polyhedron/demo/Polyhedron/MainWindow.ui index 49f8766f817..765d62d966a 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.ui +++ b/Polyhedron/demo/Polyhedron/MainWindow.ui @@ -37,7 +37,7 @@ 0 0 978 - 21 + 26 @@ -95,6 +95,7 @@ + @@ -652,6 +653,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 9d76eb00f1f..957f7e3d4f1 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 @@ -35,7 +36,8 @@ public: // used by Polyhedron_demo_plugin_helper QStringList actionsNames() const { return QStringList() << "actionMVC" - << "actionDCP"; + << "actionDCP" + << "actionLSC"; } bool applicable(QAction*) const { @@ -45,9 +47,10 @@ public: public Q_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 @@ -91,6 +94,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; } } @@ -146,4 +156,10 @@ 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); +} + #include "Polyhedron_demo_parameterization_plugin.moc" diff --git a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/Eigen_parameterization.cpp b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/Eigen_parameterization.cpp index 7c97b3f8823..0d0300fbee9 100644 --- a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/Eigen_parameterization.cpp +++ b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/Eigen_parameterization.cpp @@ -3,7 +3,7 @@ #include #include #include - +#include #include #include @@ -17,7 +17,7 @@ typedef CGAL::Simple_cartesian Kernel; typedef CGAL::Polyhedron_3 Polyhedron; - +typedef CGAL::Timer Timer; // ---------------------------------------------------------------------------- // main() @@ -65,7 +65,8 @@ int main(int argc, char * argv[]) typedef CGAL::Parameterization_polyhedron_adaptor_3 Parameterization_polyhedron_adaptor; - + Timer t; + t.start(); Parameterization_polyhedron_adaptor mesh_adaptor(mesh); //*************************************** @@ -77,16 +78,17 @@ int main(int argc, char * argv[]) typedef CGAL::Circular_border_arc_length_parameterizer_3 Border_parameterizer; // Eigen solver - typedef CGAL::Eigen_solver_traits<> Solver; + typedef CGAL::Eigen_solver_traits::EigenType, Eigen::IncompleteLUT< double > > > Solver; // Floater Mean Value Coordinates parameterization // (circular border) with Eigen solver typedef CGAL::Mean_value_coordinates_parameterizer_3 + Solver> Parameterizer; Parameterizer::Error_code err = CGAL::parameterize(mesh_adaptor, Parameterizer()); + t.stop(); switch(err) { case Parameterizer::OK: // Success @@ -119,6 +121,6 @@ int main(int argc, char * argv[]) double v = mesh_adaptor.info(pVertex->halfedge())->uv().y(); std::cout << "(u,v) = (" << u << "," << v << ")" << std::endl; } - + std::cerr << t.time() << "sec." << std::endl; return EXIT_SUCCESS; }