Commit eed26fe8 authored by NICLAUSSE Nicolas's avatar NICLAUSSE Nicolas

fix restore of slices

parent 8af63faf
......@@ -104,8 +104,12 @@ public:
dtkSliceActorObserver *observer_y = nullptr;
dtkSliceActorObserver *observer_z = nullptr;
public:
bool start_on = false;
public:
void setupSlices(void);
void setVisibility(bool);
public slots:
void onCanvasFocused(void);
......@@ -129,19 +133,34 @@ void dtkVisualizationDecoratorSlicesPrivate::setupSlices(void)
this->volume_slice_z->SetPlaneOrientationToZAxes();
this->volume_slice_z->SetSlicePosition(origin[2]);
this->volume_slice_x->On();
this->volume_slice_x->InteractionOn();
this->volume_slice_y->On();
this->volume_slice_y->InteractionOn();
this->volume_slice_z->On();
this->volume_slice_z->InteractionOn();
this->observer_x->origin = origin[0];
this->observer_y->origin = origin[1];
this->observer_z->origin = origin[2];
if (this->start_on) {
this->setVisibility(true);
this->start_on = false;
}
}
void dtkVisualizationDecoratorSlicesPrivate::setVisibility(bool visible)
{
if (visible) {
this->volume_slice_x->On();
this->volume_slice_x->InteractionOn();
this->volume_slice_y->On();
this->volume_slice_y->InteractionOn();
this->volume_slice_z->On();
this->volume_slice_z->InteractionOn();
} else {
this->volume_slice_x->SetEnabled(visible);
this->volume_slice_y->SetEnabled(visible);
this->volume_slice_z->SetEnabled(visible);
}
}
// ///////////////////////////////////////////////////////////////////
// dtkVisualizationDecoratorSlices implementation
......@@ -327,12 +346,11 @@ void dtkVisualizationDecoratorSlices::unsetCanvas(void)
void dtkVisualizationDecoratorSlices::setVisibility(bool visible)
{
d->volume_slice_x->SetEnabled(visible);
d->volume_slice_y->SetEnabled(visible);
d->volume_slice_z->SetEnabled(visible);
d->setVisibility(visible);
dtkVisualizationDecoratorWithClut::setVisibility(visible);
}
void dtkVisualizationDecoratorSlices::restoreSettings(void)
{
QString name = this->objectName();
......@@ -344,6 +362,8 @@ void dtkVisualizationDecoratorSlices::restoreSettings(void)
d->show_actor_cb->blockSignals(true);
d->show_actor_cb->setChecked(d_func()->default_visibility);
d->show_actor_cb->blockSignals(false);
d->start_on = d_func()->default_visibility;
}
void dtkVisualizationDecoratorSlices::touch(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