Commit 716682b0 authored by WINTZ Julien's avatar WINTZ Julien

Really ? Took me two fucking hours to figure out.

An actor needs to be registered with a renderer when updated otherwise
one ends up with a ju pluging real screens to its fifties system. Hence
the two hours.
parent 99f78112
......@@ -195,6 +195,7 @@ void dtkVisualizationCanvas::draw(void)
if (d->GetInteractor()) {
d->GetInteractor()->Render();
}
// if (d->renderer) {
// d->renderer->GetRenderWindow()->Render();
// }
......
......@@ -75,6 +75,9 @@ public:
QCheckBox *show_axes_cb = nullptr;
QCheckBox *show_cube_axes_cb = nullptr;
public:
bool lock = false;
public slots:
void onCanvasFocused(void);
};
......@@ -116,7 +119,6 @@ dtkVisualizationDecoratorVolume::dtkVisualizationDecoratorVolume(void): dtkVisua
d->volume->SetProperty(d->volume_property);
d->volume->SetUserTransform(d->transform);
d->cube_axes_actor = vtkSmartPointer<vtkCubeAxesActor>::New();
d->cube_axes_actor->GetTitleTextProperty(0)->SetColor(0.8, 0.0, 0.0);
d->cube_axes_actor->GetLabelTextProperty(0)->SetColor(0.8, 0.0, 0.0);
......@@ -131,16 +133,17 @@ dtkVisualizationDecoratorVolume::dtkVisualizationDecoratorVolume(void): dtkVisua
d->cube_axes_actor->YAxisMinorTickVisibilityOff();
d->cube_axes_actor->ZAxisMinorTickVisibilityOff();
d->actor = vtkSmartPointer<vtkAssembly>::New();
d->actor->AddPart(d->volume);
d->actor->AddPart(d->outline_contour_actor);
d->actor->AddPart(d->cube_axes_actor);
d->axes = vtkAxesActor::New();
d->axes->SetConeRadius(0.3);
d->axes->SetCylinderRadius(0.005);
d->axes->SetAxisLabels(true);
d->actor = vtkSmartPointer<vtkAssembly>::New();
d->actor->AddPart(d->volume);
d->actor->AddPart(d->outline_contour_actor);
d->actor->AddPart(d->cube_axes_actor);
d->actor->AddPart(d->axes);
d->marker = vtkOrientationMarkerWidget::New();
d->marker->SetOutlineColor(0.9300, 0.5700, 0.1300);
d->marker->SetOrientationMarker(d->axes);
......@@ -318,13 +321,14 @@ void dtkVisualizationDecoratorVolume::setColorMap(const QMap<double, QColor>& ne
{
dtkVisualizationDecoratorWithClut::setColorMap(new_colormap);
if(d->lock)
return;
auto&& range = d_func()->ranges[d_func()->current_field_name];
double min = range[0];
double max = range[1];
double mid = (min + max) / 2.0;
qDebug() << Q_FUNC_INFO;
d->volume_property->SetColor(d_func()->color_function);
d->opacity_transfer_function->RemoveAllPoints();
......@@ -335,7 +339,6 @@ void dtkVisualizationDecoratorVolume::setColorMap(const QMap<double, QColor>& ne
d->volume_property->Modified();
d->mapper->Modified();
// d->volume->Update();
}
void dtkVisualizationDecoratorVolume::setAlphaMap(const QMap<double, double>& map)
......@@ -353,7 +356,8 @@ void dtkVisualizationDecoratorVolume::setAlphaMap(const QMap<double, double>& ma
d->opacity_transfer_function->Modified();
d->volume_property->Modified();
d->mapper->Modified();
// d->volume->Update();
d->lock = true;
}
// /////////////////////////////////////////////////////////////////////////////
......
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