diff --git a/Polyhedron/demo/Polyhedron/MainWindow.h b/Polyhedron/demo/Polyhedron/MainWindow.h index 629982e8660..d2b3a27e48f 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.h +++ b/Polyhedron/demo/Polyhedron/MainWindow.h @@ -47,7 +47,8 @@ protected slots: void on_actionActivatePolyhedron_triggered(); void on_actionSetPolyhedronA_triggered(); void on_actionSetPolyhedronB_triggered(); - void on_actionInsideOut_triggered(); + void on_actionInsideOut_triggered(); + void on_actionMVC_triggered(); // save // TODO: save all, save current (do we store the current file name?) diff --git a/Polyhedron/demo/Polyhedron/MainWindow.ui b/Polyhedron/demo/Polyhedron/MainWindow.ui index 286ac838b3c..7efef3bfb50 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.ui +++ b/Polyhedron/demo/Polyhedron/MainWindow.ui @@ -183,12 +183,19 @@ + + + Parameterization + + + + @@ -523,6 +530,11 @@ Remeshing + + + Mean value coordinates + + diff --git a/Polyhedron/demo/Polyhedron/MainWindow_parameterization.cpp b/Polyhedron/demo/Polyhedron/MainWindow_parameterization.cpp new file mode 100644 index 00000000000..2e6fb138711 --- /dev/null +++ b/Polyhedron/demo/Polyhedron/MainWindow_parameterization.cpp @@ -0,0 +1,33 @@ +#include +#include + +#include "MainWindow.h" +#include "Scene.h" +#include "Polyhedron_type.h" + +#include +#include + +#include + +void MainWindow::on_actionMVC_triggered() +{ + QApplication::setOverrideCursor(Qt::WaitCursor); + + int index = getSelectedPolygonIndex(); + + // get active polyhedron + Polyhedron* pMesh = scene->polyhedron(index); + + // parameterize + QTime time; + time.start(); + typedef CGAL::Parameterization_polyhedron_adaptor_3 Adaptor; + typedef CGAL::Parameterizer_traits_3 Parameterizer; + Adaptor adaptor(*pMesh); + std::cerr << "Parameterize..." << std::endl; + Parameterizer::Error_code err = CGAL::parameterize(adaptor); + std::cout << "ok (" << time.elapsed() << " ms)" << std::endl; + + QApplication::setOverrideCursor(Qt::ArrowCursor); +} diff --git a/Polyhedron/demo/Polyhedron/main.cpp b/Polyhedron/demo/Polyhedron/main.cpp index 2dfdde1a735..e2bb76e2073 100644 --- a/Polyhedron/demo/Polyhedron/main.cpp +++ b/Polyhedron/demo/Polyhedron/main.cpp @@ -54,4 +54,5 @@ int main(int argc, char **argv) # include "MainWindow_self_intersection.cpp" # include "MainWindow_simplify.cpp" # include "MainWindow_subdivision_methods.cpp" +# include "MainWindow_parameterization.cpp" #endif