diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt index 1a4ec99a7eb..8b900eb6e16 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt @@ -89,10 +89,10 @@ and provides a list of the parameters that are used in this package. ## Meshing Functions ## - `CGAL::Polygon_mesh_processing::fair()` - `CGAL::Polygon_mesh_processing::refine()` -- `CGAL::Polygon_mesh_processing::angle_remeshing()` -- `CGAL::Polygon_mesh_processing::area_remeshing()` -- `CGAL::Polygon_mesh_processing::compatible_remeshing()` -- `CGAL::Polygon_mesh_processing::curvature_flow()` +- `CGAL::Polygon_mesh_processing::angle_smoothing()` +- `CGAL::Polygon_mesh_processing::area_smoothing()` +- `CGAL::Polygon_mesh_processing::compatible_smoothing()` +- `CGAL::Polygon_mesh_processing::mean_curvature_flow()` - `CGAL::Polygon_mesh_processing::triangulate_face()` - `CGAL::Polygon_mesh_processing::triangulate_faces()` - \link PMP_meshing_grp `CGAL::Polygon_mesh_processing::isotropic_remeshing()` \endlink diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Smoothing_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Smoothing_plugin.cpp index 3d133c46af5..3fb13d81503 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Smoothing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Smoothing_plugin.cpp @@ -65,7 +65,6 @@ public: connect(ui_widget.Run_convergence_button, SIGNAL(clicked()), this, SLOT(on_Run_convergence_clicked())); - } QList actions() const @@ -99,6 +98,7 @@ public: ui_widget.Area_spinBox->setSingleStep(1); ui_widget.Area_spinBox->setMinimum(1); + /* ui_widget.gd_dSpinBox->setSingleStep(0.0001); ui_widget.gd_dSpinBox->setDecimals(4); ui_widget.gd_dSpinBox->setMinimum(0.0001); @@ -113,6 +113,7 @@ public: ui_widget.gd_precision_label->setToolTip("Tradeoff between precision and speed. Less is more precise."); ui_widget.distance_label->setToolTip("Tradeoff between precision and speed. Less is more precise."); + */ ui_widget.iterations_spinBox->setValue(20); ui_widget.iterations_spinBox->setSingleStep(1); @@ -134,10 +135,14 @@ public Q_SLOTS: dock_widget->show(); dock_widget->raise(); + // needed? const Scene_interface::Item_id index = scene->mainSelectionIndex(); Scene_polyhedron_item* poly_item = qobject_cast(scene->item(index)); - if(poly_item) + Scene_polyhedron_selection_item* selection_item = + qobject_cast(scene->item(index)); + + if(poly_item || selection_item) { init_ui(); } @@ -146,18 +151,24 @@ public Q_SLOTS: void on_Apply_by_type_clicked() { const Scene_interface::Item_id index = scene->mainSelectionIndex(); + Scene_polyhedron_item* poly_item = qobject_cast(scene->item(index)); - Polyhedron& pmesh = *poly_item->polyhedron(); + + Scene_polyhedron_selection_item* selection_item = + qobject_cast(scene->item(index)); + + Polyhedron& pmesh = (poly_item != NULL) ? + * poly_item->polyhedron() : + * selection_item->polyhedron(); QApplication::setOverrideCursor(Qt::WaitCursor); if(ui_widget.Angle_checkBox->isChecked()) { unsigned int nb_iter = ui_widget.Angle_spinBox->value(); - bool use_weights = ui_widget.use_weights_checkBox->isChecked(); + //bool use_weights = ui_widget.use_weights_checkBox->isChecked(); angle_smoothing(pmesh, - parameters::number_of_iterations(nb_iter). - use_weights(use_weights)); + parameters::number_of_iterations(nb_iter)); poly_item->invalidateOpenGLBuffers(); Q_EMIT poly_item->itemChanged(); @@ -165,11 +176,11 @@ public Q_SLOTS: if(ui_widget.Area_checkBox->isChecked()) { + std::cout<<"Area_checkBox\n"; unsigned int nb_iter = ui_widget.Area_spinBox->value(); - double gd_precision = ui_widget.gd_dSpinBox->value(); + //double gd_precision = ui_widget.gd_dSpinBox->value(); area_smoothing(pmesh, - parameters::number_of_iterations(nb_iter). - gradient_descent_precision(gd_precision)); + parameters::number_of_iterations(nb_iter)); poly_item->invalidateOpenGLBuffers(); Q_EMIT poly_item->itemChanged(); @@ -182,7 +193,12 @@ public Q_SLOTS: { const Scene_interface::Item_id index = scene->mainSelectionIndex(); Scene_polyhedron_item* poly_item = qobject_cast(scene->item(index)); - Polyhedron& pmesh = *poly_item->polyhedron(); + Scene_polyhedron_selection_item* selection_item = + qobject_cast(scene->item(index)); + + Polyhedron& pmesh = (poly_item != NULL) ? + * poly_item->polyhedron() : + * selection_item->polyhedron(); QApplication::setOverrideCursor(Qt::WaitCursor); @@ -200,21 +216,22 @@ public Q_SLOTS: { const Scene_interface::Item_id index = scene->mainSelectionIndex(); Scene_polyhedron_item* poly_item = qobject_cast(scene->item(index)); - Polyhedron& pmesh = *poly_item->polyhedron(); + Scene_polyhedron_selection_item* selection_item = + qobject_cast(scene->item(index)); + + Polyhedron& pmesh = (poly_item != NULL) ? + * poly_item->polyhedron() : + * selection_item->polyhedron(); + QApplication::setOverrideCursor(Qt::WaitCursor); unsigned int nb_iter = ui_widget.curv_iterations_spinBox_2->value(); - std::cout<<"is_stiffness_matrix_setup= "<mainSelectionIndex(); Scene_polyhedron_item* poly_item = qobject_cast(scene->item(index)); - Polyhedron& pmesh = *poly_item->polyhedron(); + Scene_polyhedron_selection_item* selection_item = + qobject_cast(scene->item(index)); + + Polyhedron& pmesh = (poly_item != NULL) ? + * poly_item->polyhedron() : + * selection_item->polyhedron(); QApplication::setOverrideCursor(Qt::WaitCursor); unsigned int nb_iter = ui_widget.iterations_spinBox->value(); double dist = ui_widget.dist_dSpinBox->value(); - double gd_precision = ui_widget.gd_dSpinBox->value(); - bool use_weights = ui_widget.use_weights_checkBox->isChecked(); + //double gd_precision = ui_widget.gd_dSpinBox->value(); + //bool use_weights = ui_widget.use_weights_checkBox->isChecked(); compatible_smoothing(pmesh, parameters::number_of_iterations(nb_iter). - distance_precision(dist). - gradient_descent_precision(gd_precision). - use_weights(use_weights)); + distance_precision(dist)); poly_item->invalidateOpenGLBuffers(); Q_EMIT poly_item->itemChanged(); @@ -253,7 +273,6 @@ public Q_SLOTS: - private: QAction* actionSmoothing_; QDockWidget* dock_widget; diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Smoothing_plugin.ui b/Polyhedron/demo/Polyhedron/Plugins/PMP/Smoothing_plugin.ui index 2de5ce6a081..ccbc80f3a4c 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Smoothing_plugin.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Smoothing_plugin.ui @@ -6,276 +6,235 @@ 0 0 - 731 - 482 + 590 + 387 - - - - - Mesh smoothing + + + + 10 + 230 + 571 + 121 + + + + Shape smoothing + + + + + 10 + 40 + 551 + 33 + + + + + + + MCF + + + + + + + + + 10 + 80 + 551 + 33 + + + + + + + Modified MCF + + + + + + + + + + 10 + 0 + 571 + 227 + + + + Mesh smoothing + + + + + 10 + 30 + 551 + 183 + + + + Qt::Horizontal + + + + true - + + Qt::LeftToRight + + + + + + false + + + false + + - - - - - - - Gradient descent precision: - - - - - - - 4 - - - - + + + + + areas + + - - - - Qt::RightToLeft + + + + + + + Smooth + + + Qt::AlignCenter + + + + + + + Iterations + + + Qt::AlignCenter + + + + + + + + + + + 0 + 0 + - use weights + angles - - - Qt::Horizontal + + + Apply - - - true - - - Qt::LeftToRight - - - Remeshing by type - - - false - - - false - - - - - - - - area - - - - - - - - - - Type - - - Qt::AlignCenter - - - - - - - Iterations - - - Qt::AlignCenter - - - - - - - - - - - 0 - 0 - - - - angle - - - - - - - - - Apply - - - - - - - - Compatible remeshing algorithm - - - - - - - - Qt::RightToLeft - - - Hausdorff distance: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 4 - - - - - - - Qt::RightToLeft - - - max iterations: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - - - - Convergence criteria - - - - - - - - - Run to convergence - - - - - - - - + - Shape smoothing + - - - - 10 - 40 - 691 - 33 - - - - - - - MCF - - - - - - - Qt::LeftToRight - - - Iterations: - - - - - - - - - - - - 10 - 70 - 691 - 33 - - - - - - - Modified MCF - - - - - - - Iterations: - - - - - - - - + + + + + + + Qt::RightToLeft + + + Hausdorff distance: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 4 + + + + + + + Qt::RightToLeft + + + max iterations: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + + + + Convergence criteria + + + + + + + + + Run to convergence + + + + - - + +