Commit 0d790cfd authored by KLOCZKO Thibaud's avatar KLOCZKO Thibaud

Make streamlines 2D with color and more interactions

But it is still unstable.
parent c66a01a5
......@@ -137,8 +137,7 @@ public:
dtkVisualizationDecoratorVectorStreamTracer::dtkVisualizationDecoratorVectorStreamTracer(void): dtkVisualizationDecoratorWithClut(), d(new dtkVisualizationDecoratorVectorStreamTracerPrivate())
{
d->source_data = vtkSmartPointer<vtkPolyData> ::New();
d->source_data = vtkSmartPointer<vtkPolyData>::New();
d->source_line = vtkSmartPointer<vtkLineRepresentation>::New();
d->source_line->SetResolution(50);
......@@ -207,6 +206,7 @@ dtkVisualizationDecoratorVectorStreamTracer::dtkVisualizationDecoratorVectorStre
d->show_actor_cb = new QCheckBox;
d->show_source_actor_cb = new QCheckBox;
d->show_source_actor_cb->setChecked(true);
d->cb_integrator_direction = new QComboBox;
d->cb_integrator_direction->addItem(QStringLiteral("Forward"));
......@@ -241,8 +241,6 @@ dtkVisualizationDecoratorVectorStreamTracer::dtkVisualizationDecoratorVectorStre
d->sp_integrator_max_lengths->setKeyboardTracking(false);
d->sp_radius = new QDoubleSpinBox;
d->show_source_actor_cb->setChecked(true);
d->sp_radius->setValue(1.0);
d->sp_radius->setSingleStep(0.1);
d->sp_radius->setDecimals(4);
......@@ -383,14 +381,13 @@ void dtkVisualizationDecoratorVectorStreamTracer::setData(const QVariant& data)
this->restoreSettings();
double bounds[6];
double center[3];
dataset->GetBounds(bounds);
dataset->GetCenter(center);
vtkBoundingBox box;
box.SetBounds(bounds);
double center[3]; box.GetCenter(center);
double pos1[3]; pos1[0] = bounds[0]; pos1[1] = bounds[2]; pos1[2] = bounds[4];
double pos2[3]; pos2[0] = bounds[1]; pos2[1] = bounds[3]; pos2[2] = bounds[5];
vtkBoundingBox box;
box.SetBounds(bounds);
d->sp_integrator_max_lengths->blockSignals(true);
d->sp_integrator_max_lengths->setValue(box.GetDiagonalLength());
d->streamtracer->SetMaximumPropagation(box.GetDiagonalLength());
......@@ -472,7 +469,7 @@ void dtkVisualizationDecoratorVectorStreamTracer::unsetCanvas(void)
d_func()->view = nullptr;
}
void dtkVisualizationDecoratorVectorStreamTracer::touch()
void dtkVisualizationDecoratorVectorStreamTracer::touch(void)
{
dtkVisualizationDecoratorWithClut::touch();
......
......@@ -30,6 +30,7 @@ public:
void setData(const QVariant&) override;
void setCanvas(dtkVisualizationCanvas *) override;
void unsetCanvas(void) override;
void touch(void) override;
protected:
void restoreSettings(void) 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