Skip to content

Commit

Permalink
Fixed bugs of segment area slider.
Browse files Browse the repository at this point in the history
  • Loading branch information
WeixiaoGao committed May 18, 2021
1 parent 4e1a10c commit a6fe1b9
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 80 deletions.
7 changes: 0 additions & 7 deletions src/Plugins/Classification/Classification_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ class Polyhedron_demo_classification_plugin :
connect(ui_widget.ProbSpin, SIGNAL(valueChanged(int)), this, SLOT(on_probability_threshold_changed(int)));
connect(ui_widget.ProbSwitcher, SIGNAL(currentIndexChanged(int)), this, SLOT(on_probability_switcher_changed(int)));

connect(ui_widget.SegAreaSlider, SIGNAL(valueChanged(int)), ui_widget.SegAreadoubleSpinBox, SLOT(setValue(int)));
connect(ui_widget.SegAreadoubleSpinBox, SIGNAL(valueChanged(double)), ui_widget.SegAreaSlider, SLOT(setValue(double)));
connect(ui_widget.SegAreadoubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(on_segarea_threshold_changed(double)));
connect(ui_widget.SegAreaSwitcher, SIGNAL(currentIndexChanged(int)), this, SLOT(on_segarea_switcher_changed(int)));
connect(ui_widget.SegAreadoubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(segarea_double_to_int()));
Expand Down Expand Up @@ -785,7 +783,6 @@ public Q_SLOTS:
ui_widget.ProbSlider->setEnabled(false);
ui_widget.ProbSpin->setEnabled(false);
ui_widget.ProbSwitcher->setEnabled(false);
ui_widget.label_2->setEnabled(false);
ui_widget.label->setEnabled(false);
ui_widget.estimated_prg->setEnabled(false);
ui_widget.progressBar_2->setEnabled(false);
Expand All @@ -797,7 +794,6 @@ public Q_SLOTS:
ui_widget.ProbSlider->setVisible(false);
ui_widget.ProbSpin->setVisible(false);
ui_widget.ProbSwitcher->setVisible(false);
ui_widget.label_2->setVisible(false);
ui_widget.label->setVisible(false);
ui_widget.estimated_prg->setVisible(false);
ui_widget.progressBar_2->setVisible(false);
Expand Down Expand Up @@ -828,7 +824,6 @@ public Q_SLOTS:
ui_widget.ProbSlider->setEnabled(true);
ui_widget.ProbSpin->setEnabled(true);
ui_widget.ProbSwitcher->setEnabled(true);
ui_widget.label_2->setEnabled(true);
ui_widget.label->setEnabled(true);
ui_widget.estimated_prg->setEnabled(true);
ui_widget.progressBar_2->setEnabled(true);
Expand All @@ -840,7 +835,6 @@ public Q_SLOTS:
ui_widget.ProbSlider->setVisible(true);
ui_widget.ProbSpin->setVisible(true);
ui_widget.ProbSwitcher->setVisible(true);
ui_widget.label_2->setVisible(true);
ui_widget.label->setVisible(true);
ui_widget.view->setVisible(true);
ui_widget.estimated_prg->setVisible(true);
Expand Down Expand Up @@ -872,7 +866,6 @@ public Q_SLOTS:
ui_widget.ProbSlider->setEnabled(false);
ui_widget.ProbSpin->setEnabled(false);
ui_widget.ProbSwitcher->setEnabled(false);
ui_widget.label_2->setEnabled(false);
ui_widget.label->setEnabled(false);
ui_widget.segment_area_label->setEnabled(false);
ui_widget.SegAreaSlider->setEnabled(false);
Expand Down
134 changes: 62 additions & 72 deletions src/Plugins/Classification/Classification_widget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -43,41 +43,6 @@
</property>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="2">
<widget class="QComboBox" name="ProbSwitcher">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="currentText">
<string>below</string>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<property name="maxVisibleItems">
<number>2</number>
</property>
<item>
<property name="text">
<string>below</string>
</property>
</item>
<item>
<property name="text">
<string>above</string>
</property>
</item>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label">
<property name="enabled">
Expand Down Expand Up @@ -126,17 +91,58 @@
</item>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_2">
<item row="0" column="2">
<widget class="QComboBox" name="ProbSwitcher">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="currentText">
<string>below</string>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<property name="maxVisibleItems">
<number>2</number>
</property>
<item>
<property name="text">
<string>below</string>
</property>
</item>
<item>
<property name="text">
<string>above</string>
</property>
</item>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="segment_area_label">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string></string>
<string>Segment Area</string>
</property>
</widget>
</item>
<item row="0" column="5">
<item row="0" column="4">
<widget class="QSpinBox" name="ProbSpin">
<property name="enabled">
<bool>false</bool>
Expand All @@ -158,7 +164,7 @@
</property>
</widget>
</item>
<item row="0" column="4">
<item row="0" column="3">
<widget class="QSlider" name="ProbSlider">
<property name="enabled">
<bool>false</bool>
Expand Down Expand Up @@ -189,19 +195,25 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="segment_area_label">
<item row="1" column="4">
<widget class="QDoubleSpinBox" name="SegAreadoubleSpinBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="accelerated">
<bool>true</bool>
</property>
<property name="text">
<string>Segment Area</string>
<property name="decimals">
<number>1</number>
</property>
<property name="maximum">
<double>100.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>100.000000000000000</double>
</property>
</widget>
</item>
Expand Down Expand Up @@ -231,7 +243,7 @@
</item>
</widget>
</item>
<item row="1" column="4">
<item row="1" column="3">
<widget class="QSlider" name="SegAreaSlider">
<property name="enabled">
<bool>false</bool>
Expand All @@ -253,28 +265,6 @@
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QDoubleSpinBox" name="SegAreadoubleSpinBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="accelerated">
<bool>true</bool>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="maximum">
<double>100.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>100.000000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
</layout>
Expand Down
2 changes: 1 addition & 1 deletion src/Scene_surface_mesh_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1708,7 +1708,7 @@ void Scene_surface_mesh_item::unemphasize()
setRenderingMode(default_renderingmode);
d->chosen_segments.clear();
//d->compute_elements(ALL);
d->item->is_in_annotation = true;
d->item->is_in_annotation = false;

Q_EMIT itemChanged();
//invalidateOpenGLBuffers();
Expand Down

0 comments on commit a6fe1b9

Please sign in to comment.