diff --git a/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property.ui b/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property.ui index d1e5e795e71..0a824308300 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property.ui +++ b/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property.ui @@ -3,7 +3,7 @@ DisplayPropertyWidget - false + true @@ -39,9 +39,18 @@ + + true + Property + + false + + + false + 6 @@ -82,174 +91,47 @@ + + + + true + + + 0 + + + 100 + + + true + + + Qt::Horizontal + + + false + + + false + + + QSlider::TicksAbove + + + + + + + true + + + Expanding Radius: 0 + + + - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Color Visualization - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Random colors - - - - - - - - - - - - - - - - - First color - - - - - - - Max color - - - - - - - Color Ramp - - - true - - - - - - - - - - - - - - - - - - - - - Min color - - - - - - - 0 - - - 100 - - - true - - - Qt::Horizontal - - - QSlider::TicksAbove - - - - - - - Expanding Radius: 0 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - true - - - - - 0 - 0 - 236 - 397 - - - - - - - RAMP DISPLAYING - - - - - - - - - @@ -313,6 +195,148 @@ + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + true + + + + + 0 + 0 + 236 + 335 + + + + + + + RAMP DISPLAYING + + + + + + + + + + + Color Visualization + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + Max color + + + + + + + + + + + + + + + + + Color Ramp + + + true + + + + + + + + + + + + + + Min color + + + + + + + First color + + + + + + + Random colors + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + diff --git a/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp index 037d5bb4982..33a48a19e0e 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp @@ -89,8 +89,8 @@ private: double gI = 1.; double bI = 0.; - double expand_radius = 0; - double maxEdgeLength = -1; + double expand_radius = 0.; + double maxEdgeLength = -1.; Color_ramp color_ramp; std::vector color_map; @@ -209,8 +209,8 @@ public: connect(dock_widget->zoomToMaxButton, &QPushButton::pressed, this, &Display_property_plugin::on_zoomToMaxButton_pressed); - connect(dock_widget->expandingRadiusSlider, SIGNAL(valueChanged(int)), - this, SLOT(setExpandingRadius(int))); + connect(dock_widget->expandingRadiusSlider, &QSlider::valueChanged, + this, &Display_property_plugin::setExpandingRadius); } private Q_SLOTS: @@ -512,6 +512,15 @@ private Q_SLOTS: { dock_widget->setEnabled(true); disableExtremeValues(); // only available after coloring + + // Curvature property-specific slider + const std::string& property_name = dock_widget->propertyBox->currentText().toStdString(); + const bool is_curvature_property = (property_name == "Interpolated Corrected Mean Curvature" || + property_name == "Interpolated Corrected Gaussian Curvature"); + dock_widget->expandingRadiusLabel->setVisible(is_curvature_property); + dock_widget->expandingRadiusSlider->setVisible(is_curvature_property); + dock_widget->expandingRadiusLabel->setEnabled(is_curvature_property); + dock_widget->expandingRadiusSlider->setEnabled(is_curvature_property); } else // no or broken property { @@ -854,11 +863,12 @@ private: displaySMProperty("f:display_plugin_area", *sm); } - void setExpandingRadius(const int val_int) +private Q_SLOTS: + void setExpandingRadius() { double sliderMin = dock_widget->expandingRadiusSlider->minimum(); double sliderMax = dock_widget->expandingRadiusSlider->maximum() - sliderMin; - double val = val_int - sliderMin; + double val = dock_widget->expandingRadiusSlider->value() - sliderMin; sliderMin = 0; Scene_item* item = scene->item(scene->mainSelectionIndex()); @@ -878,7 +888,7 @@ private: if(num_edges(smesh) == 0) { expand_radius = 0; - dock_widget->expandingRadiusLabel->setText(tr("Expanding Radius : %1").arg(expand_radius)); + dock_widget->expandingRadiusLabel->setText(tr("Expanding Radius: %1").arg(expand_radius)); return; } @@ -901,9 +911,10 @@ private: double outMax = 5 * maxEdgeLength, base = 1.2; expand_radius = (pow(base, val) - 1) * outMax / (pow(base, sliderMax) - 1); - dock_widget->expandingRadiusLabel->setText(tr("Expanding Radius : %1").arg(expand_radius)); + dock_widget->expandingRadiusLabel->setText(tr("Expanding Radius: %1").arg(expand_radius)); } +private: void displayInterpolatedCurvatureMeasure(Scene_surface_mesh_item* item, CurvatureType mu_index) {