From b182311bcae9cc6fe2c42f5f165eac85698b23f4 Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Mon, 10 Apr 2017 10:08:23 +0200 Subject: [PATCH] Reorganize selection plugin --- .../Plugins/PMP/Selection_plugin.cpp | 16 +- .../Plugins/PMP/Selection_widget.ui | 962 +++++++++--------- 2 files changed, 509 insertions(+), 469 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp index ee0d2dbf057..30016fd8664 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp @@ -105,7 +105,7 @@ public: connect(ui_widget.validateButton, SIGNAL(clicked()), this, SLOT(on_validateButton_clicked())); connect(ui_widget.Expand_reduce_button, SIGNAL(clicked()), this, SLOT(on_Expand_reduce_button_clicked())); connect(ui_widget.Select_sharp_edges_button, SIGNAL(clicked()), this, SLOT(on_Select_sharp_edges_button_clicked())); - connect(ui_widget.modeBox, SIGNAL(currentIndexChanged(int)), this, SLOT(on_ModeBox_changed(int))); + connect(ui_widget.selectionOrEuler, SIGNAL(currentChanged(int)), this, SLOT(on_SelectionOrEuler_changed(int))); connect(ui_widget.editionBox, SIGNAL(currentIndexChanged(int)), this, SLOT(on_editionBox_changed(int))); ui_widget.Add_to_selection_button->hide(); @@ -149,7 +149,7 @@ public Q_SLOTS: connect(new_item,SIGNAL(simplicesSelected(CGAL::Three::Scene_item*)), scene_ptr, SLOT(setSelectedItem(CGAL::Three::Scene_item*))); connect(new_item,SIGNAL(isCurrentlySelected(Scene_polyhedron_item_k_ring_selection*)), this, SLOT(isCurrentlySelected(Scene_polyhedron_item_k_ring_selection*))); scene->setSelectedItem(item_id); - on_ModeBox_changed(ui_widget.modeBox->currentIndex()); + on_SelectionOrEuler_changed(ui_widget.selectionOrEuler->currentIndex()); if(last_mode == 0) on_Selection_type_combo_box_changed(ui_widget.Selection_type_combo_box->currentIndex()); } @@ -293,7 +293,7 @@ public Q_SLOTS: // all other arrangements (putting inside selection_item_map), setting names etc, // other params (e.g. k_ring) will be set inside new_item_created Scene_polyhedron_selection_item* new_item = new Scene_polyhedron_selection_item(poly_item, mw); - ui_widget.modeBox->setCurrentIndex(last_mode); + ui_widget.selectionOrEuler->setCurrentIndex(last_mode); connectItem(new_item); } void on_LassoCheckBox_changed(bool b) @@ -580,7 +580,7 @@ public Q_SLOTS: return; } - void on_ModeBox_changed(int index) + void on_SelectionOrEuler_changed(int index) { Scene_polyhedron_selection_item* selection_item = getSelectedItem(); if(selection_item) @@ -590,15 +590,11 @@ public Q_SLOTS: { //Selection mode case 0: - ui_widget.selection_groupBox->setVisible(true); - ui_widget.edition_groupBox->setVisible(false); Q_EMIT set_operation_mode(-1); on_Selection_type_combo_box_changed(ui_widget.Selection_type_combo_box->currentIndex()); break; //Edition mode case 1: - ui_widget.selection_groupBox->setVisible(false); - ui_widget.edition_groupBox->setVisible(true); Q_EMIT save_handleType(); on_editionBox_changed(ui_widget.editionBox->currentIndex()); break; @@ -610,7 +606,7 @@ public Q_SLOTS: Scene_polyhedron_selection_item* selection_item = getSelectedItem(); if(selection_item) selection_item->on_Ctrlz_pressed(); - if(ui_widget.modeBox->currentIndex() == 0) + if(ui_widget.selectionOrEuler->currentIndex() == 0) { Q_EMIT set_operation_mode(-1); } @@ -744,7 +740,7 @@ public Q_SLOTS: connect(selection_item,SIGNAL(simplicesSelected(CGAL::Three::Scene_item*)), scene_ptr, SLOT(setSelectedItem(CGAL::Three::Scene_item*))); connect(selection_item,SIGNAL(isCurrentlySelected(Scene_polyhedron_item_k_ring_selection*)), this, SLOT(isCurrentlySelected(Scene_polyhedron_item_k_ring_selection*))); on_LassoCheckBox_changed(ui_widget.lassoCheckBox->isChecked()); - on_ModeBox_changed(ui_widget.modeBox->currentIndex()); + on_SelectionOrEuler_changed(ui_widget.selectionOrEuler->currentIndex()); if(last_mode == 0) on_Selection_type_combo_box_changed(ui_widget.Selection_type_combo_box->currentIndex()); } diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_widget.ui b/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_widget.ui index 5a35ebe472d..2cc148be005 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_widget.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_widget.ui @@ -6,62 +6,77 @@ 0 0 - 508 - 713 + 597 + 334 Selection - + - + - - - - Selection Mode - - - - - Edition Mode - - + + + + 75 + true + + + + Create Selection Item + - - - Qt::Horizontal + + + - - - 40 - 20 - + + Clear Selection Item - + - - - Selection Operations + + + Qt::Vertical - - - - - - - Selection by Type - - - - + + + 20 + 40 + + + + + + + + 0 + + + + Selection + + + + + + + + 0 + + + + Simplices + + @@ -103,14 +118,27 @@ - - - Lasso + + + Qt::Vertical - + + + 20 + 40 + + + - + + + + + Lasso + + + @@ -146,448 +174,464 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Insertion + + + true + + + + + + + Removal + + + + + + + Brush &size: + + + Brush_size_spin_box + + + + + + + + + + + + + Components + + + + + + + + + 0 + 0 + + + + Threshold: + + + Threshold_size_spin_box + + + + + + + + 0 + 0 + + + + 999999999 + + + 8 + + + + + + + + 0 + 0 + + + + &Get Minimum + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Select &Isolated Components Below Threshold + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Sharp edges angle: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + 180 + + + 60 + + + + + + + Select + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + 0 + 0 + + + + Expand/Reduce + + + + + + + + 0 + 0 + + + + -50 + + + 50 + + + - - - - - - - - - Insertion - - - true - - - - - - - Removal - - - - - - - - - - - - - Brush &size: - - - Brush_size_spin_box - - - - - - - - - - - - - - - - - - - - - Select &All - - - - - - - - - - Invert Selection - - - - - - - - - - &Clear - - - - - - + + + + + + &Clear + + + + + + + + + + Invert Selection + + + + + + + + + + Select &All + + + + + + + Qt::Vertical + + + + 20 + 40 + + + - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - + + + + + + + + + + Create Point Set Item from Selected Vertices + + + + + Create Polyline Item from Selected Edges + + + + + Create Polyhedron Item from Selected Facets + + + + + Erase Selected Facets from Polyhedron Item + + + + + Keep Connected Components of Selected Facets + + + + + Convert from Edge Selection to Facets Selection + + + + + Convert from Edge Selection to Point Selection + + + + + Convert from Facet Selection to Boundary Edge Selection + + + + + Convert from Facet Selection to Point Selection + + + + + + + + Validate + + + + + + + + + + Edition + + + + + + Euler Operations + + - + + + Qt::Vertical + + + + 20 + 40 + + + + + + - + + + + Join vertex + + + + + Split vertex + + + + + Split edges + + + + + Join face + + + + + Split face + + + + + Collapse edge + + + + + Flip edge + + + + + Add center vertex + + + + + Remove center vertex + + + + + Add vertex and face to border (Advanced) + + + + + Add face to border (Advanced) + + + + + Move point + + + + + + - Isolated &Component Size: - - - Threshold_size_spin_box + Instructions + + - - - 999999999 - - - 8 + + + - + - &Get Minimum + Ctrl+Z to cancel the temporary selection. - - - - Select &Isolated Components Below Threshold - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Sharp edges angle: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - 180 - - - 60 - - - - - - - Select - - - - - - - - - - - Expand or reduce selection: - - - - - - - -50 - - - 50 - - - - - - - Apply - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - Create Point Set Item from Selected Vertices - - - - - Create Polyline Item from Selected Edges - - - - - Create Polyhedron Item from Selected Facets - - - - - Erase Selected Facets from Polyhedron Item - - - - - Keep Connected Components of Selected Facets - - - - - Convert from Edge Selection to Facets Selection - - - - - Convert from Edge Selection to Point Selection - - - - - Convert from Facet Selection to Boundary Edge Selection - - - - - Convert from Facet Selection to Point Selection - - - - - - - - Validate - - - - - - - - + + + + - - - - - - 75 - true - - - - Create Selection Item - - - - - - - - - - Clear Selection Item - - - - - - - - - Editions Operations - - - - - - - - - Join vertex - - - - - Split vertex - - - - - Split edges - - - - - Join face - - - - - Split face - - - - - Collapse edge - - - - - Flip edge - - - - - Add center vertex - - - - - Remove center vertex - - - - - Add vertex and face to border (Advanced) - - - - - Add face to border (Advanced) - - - - - Move point - - - - - - - - Instructions - - - - - - - - - - - - - - - - Ctrl+Z to cancel the temporary selection. - - - - - - - - - - + Qt::Vertical