Commit cb011803 authored by NICLAUSSE Nicolas's avatar NICLAUSSE Nicolas

fix update of slices decorator + reuse the same slice position when

changing field
parent ce7e51f9
......@@ -343,6 +343,23 @@ void dtkVisualizationDecoratorSlices::restoreSettings(void)
d->show_actor_cb->blockSignals(false);
}
void dtkVisualizationDecoratorSlices::touch(void)
{
dtkVisualizationDecoratorWithClut::touch();
vtkSmartPointer<vtkImageData> data = vtkImageData::SafeDownCast(d->c2p_filter->GetOutput());
d->c2p_filter->Update();
data->GetPointData()->SetActiveScalars(qPrintable(d_func()->current_field_name));
d->volume_slice_x->SetInputData(data);
d->volume_slice_y->SetInputData(data);
d->volume_slice_z->SetInputData(data);
d->volume_slice_x->SetSlicePosition(d->enable_slicing_x->value());
d->volume_slice_y->SetSlicePosition(d->enable_slicing_y->value());
d->volume_slice_z->SetSlicePosition(d->enable_slicing_z->value());
}
bool dtkVisualizationDecoratorSlices::setCurrentFieldName(const QString& field_name)
{
......@@ -366,6 +383,11 @@ bool dtkVisualizationDecoratorSlices::setCurrentFieldName(const QString& field_n
d->volume_slice_y->SetInputData(d_func()->dataset);
d->volume_slice_z->SetInputData(d_func()->dataset);
}
d->volume_slice_x->SetSlicePosition(d->enable_slicing_x->value());
d->volume_slice_y->SetSlicePosition(d->enable_slicing_y->value());
d->volume_slice_z->SetSlicePosition(d->enable_slicing_z->value());
return true;
}
......
......@@ -30,7 +30,7 @@ public:
void setData(const QVariant&) override;
void setCanvas(dtkVisualizationCanvas *) override;
void unsetCanvas(void) override;
void touch(void) override;
public:
bool setCurrentFieldName(const QString&) override;
......
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