From 284b018c44a6411fa0dbb40675e4a57445cbba98 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 3 Sep 2020 10:59:06 +0200 Subject: [PATCH 1/7] Update Mehs_plane_detection_plugin with CGAL Region growing --- .../Plugins/Surface_mesh/CMakeLists.txt | 1 + .../Mesh_plane_detection_dialog.ui | 34 +++- .../Mesh_plane_detection_plugin.cpp | 148 +++++++----------- 3 files changed, 85 insertions(+), 98 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt index 45c1eccb50e..b18a2d6cc51 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt @@ -33,6 +33,7 @@ polyhedron_demo_plugin(offset_meshing_plugin Offset_meshing_plugin ${remeshingUI target_link_libraries(offset_meshing_plugin PUBLIC scene_surface_mesh_item scene_polygon_soup_item) if(TARGET CGAL::Eigen_support) target_link_libraries(offset_meshing_plugin PUBLIC CGAL::Eigen_support) + target_link_libraries(mesh_plane_detection_plugin PUBLIC CGAL::Eigen_support) endif() if(TARGET CGAL::TBB_support) target_link_libraries(offset_meshing_plugin PUBLIC CGAL::TBB_support) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_dialog.ui b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_dialog.ui index e855d47f55c..31e0913c575 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_dialog.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_dialog.ui @@ -6,8 +6,8 @@ 0 0 - 349 - 117 + 272 + 139 @@ -19,18 +19,18 @@ - Minimum area + Maximum distance to plane - + Maximum deviation from normal - + ° @@ -47,9 +47,29 @@ - + - 0.01 + 1.0 + + + + + + + Minimum region size + + + + + + + 1 + + + 9999999 + + + 1 diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_plugin.cpp index 4e29d3aa423..317587a04d8 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_plugin.cpp @@ -20,6 +20,8 @@ #include #include #include +#include +#include #include "ui_Mesh_plane_detection_dialog.h" @@ -75,100 +77,63 @@ private: QAction* actionPlaneDetection; - template - void detect_planes_in_mesh (SMesh& mesh, const double area_min, - const double angle_max, - OutputIterator output) + //template + void detect_planes_in_mesh (SMesh& polygon_mesh, + const double max_distance_to_plane, + const double max_accepted_angle, + const std::size_t min_region_size, + std::vector& indices) { - typedef SMesh::size_type size_type; + + typedef EPICK::FT FT; + using Polygon_mesh = SMesh; + using Face_range = typename Polygon_mesh::Face_range; + using Neighbor_query = CGAL::Shape_detection::Polygon_mesh::One_ring_neighbor_query; + using Region_type = CGAL::Shape_detection::Polygon_mesh::Least_squares_plane_fit_region; + using Sorting = CGAL::Shape_detection::Polygon_mesh::Least_squares_plane_fit_sorting; std::cerr << "Detecting planes with:" << std::endl - << " * Area min = " << area_min << std::endl - << " * Min cos angle = " << angle_max << std::endl; - std::vector label_region(mesh.number_of_faces(), 0); - int class_index = 0; + << " * Max distance to plane = " << max_distance_to_plane << std::endl + << " * Max angle = " << max_accepted_angle << std::endl + << " * Minimum region size = " << min_region_size << std::endl; - for (typename SMesh::Face_iterator f = mesh.faces_begin(); f != mesh.faces_end(); ++f) - { - if (label_region[*f] != 0) - continue; - class_index++; - label_region[*f] = class_index; - double area = PMP::face_area (*f, mesh, PMP::parameters::geom_traits(EPICK())); + using Region = std::vector; + using Regions = std::vector; + using Vertex_to_point_map = typename Region_type::Vertex_to_point_map; + using Region_growing = CGAL::Shape_detection::Region_growing; + const Face_range face_range = faces(polygon_mesh); - //characteristics of the seed - EPICK::Vector_3 normal_seed = PMP::compute_face_normal (*f, mesh, PMP::parameters::geom_traits(EPICK())); - EPICK::Point_3 pt_seed = mesh.point(target(halfedge(*f, mesh), mesh)); - EPICK::Plane_3 optimal_plane(pt_seed, normal_seed); - // Kernel::Plane_3 optimal_plane = f->plane(); - - //initialization containers - std::vector index_container (1,*f); - std::vector index_container_former_ring (1, *f); - std::list index_container_current_ring; - - //propagation - bool propagation = true; - do{ - - propagation = false; - - for (size_type k = 0; k < index_container_former_ring.size(); k++) - { - typename SMesh::Halfedge_around_face_circulator - circ( mesh.halfedge(SMesh::Face_index(index_container_former_ring[k])), mesh) - , start = circ; - - do - { - if (is_border(*circ, mesh)) - continue; - - typename SMesh::Face_index - neighbor = mesh.face(opposite(*circ, mesh)); - size_type neighbor_index = neighbor; - if (label_region[neighbor_index] == 0) - { - EPICK::Vector_3 normal - = PMP::compute_face_normal (neighbor, mesh, PMP::parameters::geom_traits(EPICK())); - - if (std::fabs(normal * optimal_plane.orthogonal_vector()) > angle_max) - { - label_region[neighbor_index] = class_index; - propagation = true; - index_container_current_ring.push_back(neighbor_index); - area += PMP::face_area (neighbor, mesh, PMP::parameters::geom_traits(EPICK())); - } - } - } - while (++ circ != start); - } - - //update containers - index_container_former_ring.clear(); - for (std::list::iterator it = index_container_current_ring.begin(); - it != index_container_current_ring.end(); ++it) - { - index_container_former_ring.push_back(*it); - index_container.push_back(*it); - } - index_container_current_ring.clear(); - - } while (propagation); - - //Test the number of inliers -> reject if inferior to Nmin - if (area < area_min) - { - class_index--; - label_region[*f] = 0; - for (size_type k = 0; k < index_container.size(); k++) - label_region[index_container[k]] = 0; - } + // Create instances of the classes Neighbor_query and Region_type. + Neighbor_query neighbor_query(polygon_mesh); + const Vertex_to_point_map vertex_to_point_map( + get(CGAL::vertex_point, polygon_mesh)); + Region_type region_type( + polygon_mesh, + max_distance_to_plane, max_accepted_angle, min_region_size, + vertex_to_point_map); + // Sort face indices. + Sorting sorting( + polygon_mesh, neighbor_query, + vertex_to_point_map); + sorting.sort(); + // Create an instance of the region growing class. + Region_growing region_growing( + face_range, neighbor_query, region_type, + sorting.seed_map()); + // Run the algorithm. + Regions regions; + region_growing.detect(std::back_inserter(regions)); + std::cerr << regions.size()<< " planes detected" << std::endl; + indices.resize(polygon_mesh.number_of_faces()); + for (std::size_t id = 0; idsetMinimum(0.00001); + ui.maxDistanceToPlane->setMinimum(0.00001); // check user cancellation if(dialog.exec() == QDialog::Rejected) return; @@ -203,11 +168,12 @@ void Polyhedron_demo_mesh_plane_detection_plugin::on_actionPlaneDetection_trigge QApplication::processEvents(); //check_and_set_ids (&pmesh); - std::vector indices; + std::vector indices; detect_planes_in_mesh (pmesh, - ui.minimumAreaDoubleSpinBox->value(), - std::fabs(std::cos (CGAL_PI * ui.maximumDeviationFromNormalSpinBox->value() / 180.)), - std::back_inserter (indices)); + ui.maxDistanceToPlane->value(), + std::fabs(ui.maximumDeviationFromNormalSpinBox->value()), + ui.minRegionSize->value(), + indices); //poly_item->set_color_vector_read_only(true); colorize_segmentation (poly_item, indices, poly_item->color_vector()); From f64eb35b3e0bf10a2ed7919ab4baa713f035557b Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 3 Sep 2020 11:00:44 +0200 Subject: [PATCH 2/7] Change subdirectory name to Shape Detection --- .../Plugins/Surface_mesh/Mesh_plane_detection_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_plugin.cpp index 317587a04d8..11a531370ce 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_plugin.cpp @@ -51,7 +51,7 @@ class Polyhedron_demo_mesh_plane_detection_plugin : this->scene = scene_interface; this->mw = mainWindow; actionPlaneDetection = new QAction("Mesh Plane Detection", mw); - actionPlaneDetection->setProperty("subMenuName", "Triangulated Surface Mesh Segmentation"); + actionPlaneDetection->setProperty("subMenuName", "Shape Detection"); actionPlaneDetection->setObjectName("actionPlaneDetection"); // adding slot for itemAboutToBeDestroyed signal, aim is removing item from item-functor map. From 0a44140fe1f7070ef4833c2b587c3b9b488c07dc Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 3 Sep 2020 12:03:38 +0200 Subject: [PATCH 3/7] Fix Shape_detection plugin for Surface_meshes and remove Mesh_plane_detection_plugin, which was an alpha version of Shape_detection. --- .../Point_set_shape_detection_plugin.cpp | 30 ++- .../Point_set_shape_detection_plugin.ui | 4 +- .../Mesh_plane_detection_dialog.ui | 145 ------------ .../Mesh_plane_detection_plugin.cpp | 216 ------------------ 4 files changed, 27 insertions(+), 368 deletions(-) delete mode 100644 Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_dialog.ui delete mode 100644 Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_plugin.cpp diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp index a4218856893..2173f0ddc9e 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp @@ -201,7 +201,7 @@ private: const double max_distance_to_plane = dialog.epsilon(); const double max_accepted_angle = - (std::acos(dialog.normal_tolerance()) * 180.0) / CGAL_PI; + dialog.normal_tolerance(); const std::size_t min_region_size = dialog.min_points(); @@ -248,7 +248,19 @@ private: 64 + rnd.get_int(0, 192), 64 + rnd.get_int(0, 192))); } - + if(color_vector.empty()) + { + for(const auto& f : faces(fg)) + { + fg.property_map("f:patch_id").first[f] = + static_cast(0); + } + CGAL::Random rnd(static_cast(0)); + color_vector.push_back(QColor( + 64 + rnd.get_int(0, 192), + 64 + rnd.get_int(0, 192), + 64 + rnd.get_int(0, 192))); + } colored_item->invalidateOpenGLBuffers(); scene->addItem(colored_item); } @@ -273,7 +285,7 @@ private: const double max_distance_to_plane = dialog.epsilon(); const double max_accepted_angle = - (std::acos(dialog.normal_tolerance()) * 180.0) / CGAL_PI; + dialog.normal_tolerance(); const std::size_t min_region_size = dialog.min_points(); @@ -648,7 +660,7 @@ private: CGAL::Shape_detection::Plane_map(), CGAL::Shape_detection::Point_to_shape_index_map(*points, planes), true, true, true, true, - 180 * std::acos (op.normal_threshold) / CGAL_PI, op.epsilon); + op.normal_threshold, op.epsilon); std::cerr << "done" << std::endl; } @@ -927,8 +939,14 @@ void Polyhedron_demo_point_set_shape_detection_plugin::on_actionDetectShapesSM_t dialog.label_4->setEnabled(false); dialog.m_cluster_epsilon_field->setEnabled(false); dialog.groupBox_3->setEnabled(false); - + //todo: check default values + dialog.m_epsilon_field->setValue(0.01*sm_item->diagonalBbox()); + std::size_t nb_faces = mesh->number_of_faces(); + dialog.m_min_pts_field->setValue((std::max)(static_cast(0.01*nb_faces), 1)); if(!dialog.exec()) return; + + if(dialog.m_min_pts_field->value() > nb_faces) + dialog.m_min_pts_field->setValue(nb_faces); QApplication::setOverrideCursor(Qt::WaitCursor); if (dialog.region_growing()) { detect_shapes_with_region_growing_sm(sm_item, dialog); @@ -969,6 +987,8 @@ void Polyhedron_demo_point_set_shape_detection_plugin::on_actionDetect_triggered Point_set_demo_point_set_shape_detection_dialog dialog; if(!dialog.exec()) return; + if(dialog.min_points() > points->size()) + dialog.m_min_pts_field->setValue(points->size()); QApplication::setOverrideCursor(Qt::WaitCursor); if (dialog.region_growing()) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.ui b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.ui index 684acace812..98fc4f751c5 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.ui @@ -152,7 +152,7 @@ - Normal Tolerance: + Normal Tolerance (in degrees): @@ -165,7 +165,7 @@ - 0.90 + 30 diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_dialog.ui b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_dialog.ui deleted file mode 100644 index 31e0913c575..00000000000 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_dialog.ui +++ /dev/null @@ -1,145 +0,0 @@ - - - Mesh_plane_detection_dialog - - - - 0 - 0 - 272 - 139 - - - - Mesh Plane Detection - - - - - - - - Maximum distance to plane - - - - - - - Maximum deviation from normal - - - - - - - ° - - - 1 - - - 90 - - - 30 - - - - - - - 1.0 - - - - - - - Minimum region size - - - - - - - 1 - - - 9999999 - - - 1 - - - - - - - - - Qt::Vertical - - - - 20 - 13 - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - DoubleEdit - QLineEdit -
CGAL_double_edit.h
-
-
- - - - buttonBox - accepted() - Mesh_plane_detection_dialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - Mesh_plane_detection_dialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - -
diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_plugin.cpp deleted file mode 100644 index 11a531370ce..00000000000 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Mesh_plane_detection_plugin.cpp +++ /dev/null @@ -1,216 +0,0 @@ -#include -#include - -#include "Scene_surface_mesh_item.h" -#include "Scene.h" -#include "Color_map.h" - -#include -#include -#include -#include -#include -#include -#include -#include -//#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ui_Mesh_plane_detection_dialog.h" - -namespace PMP = CGAL::Polygon_mesh_processing; - -using namespace CGAL::Three; -class Polyhedron_demo_mesh_plane_detection_plugin : - public QObject, - public Polyhedron_demo_plugin_helper -{ - Q_OBJECT - Q_INTERFACES(CGAL::Three::Polyhedron_demo_plugin_interface) - Q_PLUGIN_METADATA(IID "com.geometryfactory.PolyhedronDemo.PluginInterface/1.0") - - public: - - QList actions() const { - return QList() << actionPlaneDetection; - } - - bool applicable(QAction*) const { - return - qobject_cast(scene->item(scene->mainSelectionIndex())); - } - - void init(QMainWindow* mainWindow, CGAL::Three::Scene_interface* scene_interface, Messages_interface*) { - this->scene = scene_interface; - this->mw = mainWindow; - actionPlaneDetection = new QAction("Mesh Plane Detection", mw); - actionPlaneDetection->setProperty("subMenuName", "Shape Detection"); - actionPlaneDetection->setObjectName("actionPlaneDetection"); - - // adding slot for itemAboutToBeDestroyed signal, aim is removing item from item-functor map. - if( Scene* scene = dynamic_cast(scene_interface) ) { - connect(scene, SIGNAL(itemAboutToBeDestroyed(CGAL::Three::Scene_item*)), this, SLOT(itemAboutToBeDestroyed(CGAL::Three::Scene_item*))); - } - - autoConnectActions(); - } - virtual void closure() - { - } - - template - void colorize_segmentation(Scene_surface_mesh_item* item, SegmentPropertyMap& segment_ids, std::vector& color_vector); - - void check_and_set_ids(SMesh *sm); - -public Q_SLOTS: - void on_actionPlaneDetection_triggered(); - void itemAboutToBeDestroyed(CGAL::Three::Scene_item*); -private: - QAction* actionPlaneDetection; - - - //template - void detect_planes_in_mesh (SMesh& polygon_mesh, - const double max_distance_to_plane, - const double max_accepted_angle, - const std::size_t min_region_size, - std::vector& indices) - { - - typedef EPICK::FT FT; - using Polygon_mesh = SMesh; - using Face_range = typename Polygon_mesh::Face_range; - using Neighbor_query = CGAL::Shape_detection::Polygon_mesh::One_ring_neighbor_query; - using Region_type = CGAL::Shape_detection::Polygon_mesh::Least_squares_plane_fit_region; - using Sorting = CGAL::Shape_detection::Polygon_mesh::Least_squares_plane_fit_sorting; - - std::cerr << "Detecting planes with:" << std::endl - << " * Max distance to plane = " << max_distance_to_plane << std::endl - << " * Max angle = " << max_accepted_angle << std::endl - << " * Minimum region size = " << min_region_size << std::endl; - - - using Region = std::vector; - using Regions = std::vector; - using Vertex_to_point_map = typename Region_type::Vertex_to_point_map; - using Region_growing = CGAL::Shape_detection::Region_growing; - const Face_range face_range = faces(polygon_mesh); - - // Create instances of the classes Neighbor_query and Region_type. - Neighbor_query neighbor_query(polygon_mesh); - const Vertex_to_point_map vertex_to_point_map( - get(CGAL::vertex_point, polygon_mesh)); - Region_type region_type( - polygon_mesh, - max_distance_to_plane, max_accepted_angle, min_region_size, - vertex_to_point_map); - // Sort face indices. - Sorting sorting( - polygon_mesh, neighbor_query, - vertex_to_point_map); - sorting.sort(); - // Create an instance of the region growing class. - Region_growing region_growing( - face_range, neighbor_query, region_type, - sorting.seed_map()); - // Run the algorithm. - Regions regions; - region_growing.detect(std::back_inserter(regions)); - std::cerr << regions.size()<< " planes detected" << std::endl; - indices.resize(polygon_mesh.number_of_faces()); - for (std::size_t id = 0; idmainSelectionIndex(); - - Scene_surface_mesh_item* poly_item = - qobject_cast(scene->item(index)); - - if (poly_item) - { - SMesh& pmesh =*poly_item->polyhedron(); - - QDialog dialog(mw); - Ui::Mesh_plane_detection_dialog ui; - ui.setupUi(&dialog); - ui.maxDistanceToPlane->setMinimum(0.00001); - // check user cancellation - if(dialog.exec() == QDialog::Rejected) - return; - - QElapsedTimer time; - time.start(); - std::cerr << "Detecting planes... "; - QApplication::setOverrideCursor(Qt::WaitCursor); - QApplication::processEvents(); - - //check_and_set_ids (&pmesh); - std::vector indices; - detect_planes_in_mesh (pmesh, - ui.maxDistanceToPlane->value(), - std::fabs(ui.maximumDeviationFromNormalSpinBox->value()), - ui.minRegionSize->value(), - indices); - - //poly_item->set_color_vector_read_only(true); - colorize_segmentation (poly_item, indices, poly_item->color_vector()); - - std::cerr << "ok (" << time.elapsed() << " ms, " - << pmesh.number_of_halfedges() / 2 << " edges)" << std::endl; - - poly_item->invalidateOpenGLBuffers(); - scene->itemChanged(index); - QApplication::restoreOverrideCursor(); - } - -} - -template -void Polyhedron_demo_mesh_plane_detection_plugin::colorize_segmentation( - Scene_surface_mesh_item* item, - SegmentPropertyMap& segment_ids, - std::vector& color_vector) -{ - item->setItemIsMulticolor(true); - item->computeItemColorVectorAutomatically(true); - SMesh* sm = item->face_graph(); - color_vector.clear(); - std::size_t max_segment = 0; - for(SMesh::Face_iterator facet_it = sm->faces_begin(); - facet_it != sm->faces_end(); ++facet_it) - { - std::size_t segment_id = segment_ids[static_cast(*facet_it)]; - sm->property_map("f:patch_id").first[*facet_it] = static_cast(segment_id); - max_segment = (std::max)(max_segment, segment_id); - } - color_vector.push_back(QColor(0, 0, 0)); - for(std::size_t i = 1; i <= max_segment; ++i) - color_vector.push_back (QColor (CGAL::get_default_random().get_int (41, 255), - CGAL::get_default_random().get_int (35, 238), - CGAL::get_default_random().get_int (35, 255))); -} - -#include "Mesh_plane_detection_plugin.moc" From be26e0308ecb56dc401c8a0324257e50f548fedd Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 3 Sep 2020 12:28:18 +0200 Subject: [PATCH 4/7] Updtae CMakeLists.txt --- .../demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt index b18a2d6cc51..f849310c106 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt @@ -20,10 +20,6 @@ qt5_wrap_ui( segmentationUI_FILES Mesh_segmentation_widget.ui) polyhedron_demo_plugin(mesh_segmentation_plugin Mesh_segmentation_plugin ${segmentationUI_FILES}) target_link_libraries(mesh_segmentation_plugin PUBLIC scene_surface_mesh_item) -qt5_wrap_ui( mesh_plane_detectionUI_FILES Mesh_plane_detection_dialog.ui) -polyhedron_demo_plugin(mesh_plane_detection_plugin Mesh_plane_detection_plugin ${mesh_plane_detectionUI_FILES}) -target_link_libraries(mesh_plane_detection_plugin PUBLIC scene_surface_mesh_item) - qt5_wrap_ui( mesh_simplificationUI_FILES Mesh_simplification_dialog.ui) polyhedron_demo_plugin(mesh_simplification_plugin Mesh_simplification_plugin ${mesh_simplificationUI_FILES}) target_link_libraries(mesh_simplification_plugin PUBLIC scene_surface_mesh_item scene_selection_item) @@ -33,7 +29,6 @@ polyhedron_demo_plugin(offset_meshing_plugin Offset_meshing_plugin ${remeshingUI target_link_libraries(offset_meshing_plugin PUBLIC scene_surface_mesh_item scene_polygon_soup_item) if(TARGET CGAL::Eigen_support) target_link_libraries(offset_meshing_plugin PUBLIC CGAL::Eigen_support) - target_link_libraries(mesh_plane_detection_plugin PUBLIC CGAL::Eigen_support) endif() if(TARGET CGAL::TBB_support) target_link_libraries(offset_meshing_plugin PUBLIC CGAL::TBB_support) From 0f0c69d4bfbd7c19d3af47c071719fd1712e2700 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Fri, 4 Sep 2020 08:37:24 +0200 Subject: [PATCH 5/7] Fix warning --- .../Plugins/Point_set/Point_set_shape_detection_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp index 2173f0ddc9e..0da951ca1d9 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp @@ -945,7 +945,7 @@ void Polyhedron_demo_point_set_shape_detection_plugin::on_actionDetectShapesSM_t dialog.m_min_pts_field->setValue((std::max)(static_cast(0.01*nb_faces), 1)); if(!dialog.exec()) return; - if(dialog.m_min_pts_field->value() > nb_faces) + if(dialog.min_points() > nb_faces) dialog.m_min_pts_field->setValue(nb_faces); QApplication::setOverrideCursor(Qt::WaitCursor); if (dialog.region_growing()) { From 721a6aafd16cd7d5f64db199918beae6179283fb Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 8 Sep 2020 10:02:23 +0200 Subject: [PATCH 6/7] Fix comparison warning --- .../Plugins/Point_set/Point_set_shape_detection_plugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp index 0da951ca1d9..5efcf64b836 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp @@ -945,7 +945,7 @@ void Polyhedron_demo_point_set_shape_detection_plugin::on_actionDetectShapesSM_t dialog.m_min_pts_field->setValue((std::max)(static_cast(0.01*nb_faces), 1)); if(!dialog.exec()) return; - if(dialog.min_points() > nb_faces) + if(dialog.min_points() > static_cast(nb_faces)) dialog.m_min_pts_field->setValue(nb_faces); QApplication::setOverrideCursor(Qt::WaitCursor); if (dialog.region_growing()) { @@ -987,7 +987,7 @@ void Polyhedron_demo_point_set_shape_detection_plugin::on_actionDetect_triggered Point_set_demo_point_set_shape_detection_dialog dialog; if(!dialog.exec()) return; - if(dialog.min_points() > points->size()) + if(dialog.min_points() > static_cast(points->size())) dialog.m_min_pts_field->setValue(points->size()); QApplication::setOverrideCursor(Qt::WaitCursor); From 301f0be305666b35b20739cfa0d1557589035fe9 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Fri, 11 Sep 2020 09:14:46 +0200 Subject: [PATCH 7/7] Fix warnings --- .../Plugins/Point_set/Point_set_shape_detection_plugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp index 5efcf64b836..d71f08a2274 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_shape_detection_plugin.cpp @@ -946,7 +946,7 @@ void Polyhedron_demo_point_set_shape_detection_plugin::on_actionDetectShapesSM_t if(!dialog.exec()) return; if(dialog.min_points() > static_cast(nb_faces)) - dialog.m_min_pts_field->setValue(nb_faces); + dialog.m_min_pts_field->setValue(static_cast(nb_faces)); QApplication::setOverrideCursor(Qt::WaitCursor); if (dialog.region_growing()) { detect_shapes_with_region_growing_sm(sm_item, dialog); @@ -988,7 +988,7 @@ void Polyhedron_demo_point_set_shape_detection_plugin::on_actionDetect_triggered if(!dialog.exec()) return; if(dialog.min_points() > static_cast(points->size())) - dialog.m_min_pts_field->setValue(points->size()); + dialog.m_min_pts_field->setValue(static_cast(points->size())); QApplication::setOverrideCursor(Qt::WaitCursor); if (dialog.region_growing())