Commit 0b22efb8 authored by LE BRETON Come's avatar LE BRETON Come

Connects the range for isolines.

parent 8662906c
......@@ -257,12 +257,16 @@ void dtkVisualizationDecoratorScalarIsolines::setCanvas(dtkVisualizationCanvas *
QCheckBox *show_cb = new QCheckBox;
QSpinBox *isolines_counts_sb = new QSpinBox;
QDoubleSpinBox *isolines_min_sb = new QDoubleSpinBox;
QDoubleSpinBox *isolines_max_sb = new QDoubleSpinBox;
dtkVisualizationWidgetsClutEditor *clut_editor = new dtkVisualizationWidgetsClutEditor;
QWidget *model_widget = new QWidget;
QFormLayout *form_layout = new QFormLayout(model_widget);
form_layout->addRow("Display", show_cb);
form_layout->addRow("Count", isolines_counts_sb);
form_layout->addRow("Min", isolines_min_sb);
form_layout->addRow("Max", isolines_max_sb);
dtkWidgetsOverlayPaneItem *pane_item = new dtkWidgetsOverlayPaneItem;
pane_item->setTitle("Scalar Isolines");
......@@ -277,6 +281,46 @@ void dtkVisualizationDecoratorScalarIsolines::setCanvas(dtkVisualizationCanvas *
else this->hide();
});
// isolines_counts_sb connections
connect(isolines_counts_sb, QOverload<int>::of(&QSpinBox::valueChanged), [=] (int value) {
this->blockSignals(true);
this->setCurrentIsolinesCount(value);
this->blockSignals(false);
});
connect(this, &dtkVisualizationDecoratorScalarIsolines::currentIsolinesCountChanged, [=] (int value) {
isolines_counts_sb->blockSignals(true);
isolines_counts_sb->setValue(value);
isolines_counts_sb->blockSignals(false);
});
// isolines_min_sb connections
connect(isolines_min_sb, QOverload<double>::of(&QDoubleSpinBox::valueChanged), [=] (int value) {
this->blockSignals(true);
this->setCurrentIsolinesRange(value, isolines_max_sb->value());
this->blockSignals(false);
});
connect(this, &dtkVisualizationDecoratorScalarIsolines::currentIsolinesRangeChanged, [=] (double min, double max) {
isolines_min_sb->blockSignals(true);
isolines_min_sb->setValue(min);
isolines_min_sb->blockSignals(false);
});
// isolines_max_sb connections
connect(isolines_max_sb, QOverload<double>::of(&QDoubleSpinBox::valueChanged), [=] (int value) {
this->blockSignals(true);
this->setCurrentIsolinesRange(isolines_min_sb->value(), value);
this->blockSignals(false);
});
connect(this, &dtkVisualizationDecoratorScalarIsolines::currentIsolinesRangeChanged, [=] (double min, double max) {
isolines_max_sb->blockSignals(true);
isolines_max_sb->setValue(max);
isolines_max_sb->blockSignals(false);
});
// clut_editor connections
connect(this, &dtkVisualizationDecoratorScalarIsolines::currentRangeChanged, [=] (double min, double max) {
clut_editor->blockSignals(true);
......@@ -295,13 +339,6 @@ void dtkVisualizationDecoratorScalarIsolines::setCanvas(dtkVisualizationCanvas *
this->setCurrentColorTransferFunction(reinterpret_cast<vtkColorTransferFunction *>(clut_editor->colorTransferFunction()));
this->blockSignals(false);
});
// isolines_counts_sb connections
connect(isolines_counts_sb, QOverload<int>::of(&QSpinBox::valueChanged), [=] (int value) {
this->blockSignals(true);
this->setCurrentIsolinesCount(value);
this->blockSignals(false);
});
}
void dtkVisualizationDecoratorScalarIsolines::unsetCanvas(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment