Commit 8af63faf authored by KLOCZKO Thibaud's avatar KLOCZKO Thibaud

Add controls to manage streamline properties

parent c72f5e9b
......@@ -87,6 +87,15 @@ public:
public:
QCheckBox *show_actor_cb = nullptr;
QCheckBox *show_source_actor_cb = nullptr;
public:
QComboBox *cb_integrator_direction = nullptr;
QComboBox *cb_integrator_type = nullptr;
QSpinBox *sp_integrator_max_steps = nullptr;
QDoubleSpinBox *sp_integrator_max_lengths = nullptr;
public:
QDoubleSpinBox *sp_radius = nullptr;
};
// ///////////////////////////////////////////////////////////////////
......@@ -110,14 +119,14 @@ dtkVisualizationDecoratorVectorStreamTracer::dtkVisualizationDecoratorVectorStre
d->streamtracer->SetSourceData(d->source_line_data);
d->streamtracer->SetIntegrationDirectionToBoth();
d->streamtracer->SetIntegratorTypeToRungeKutta4();
d->streamtracer->SetIntegratorTypeToRungeKutta45();
d->streamtracer->SetIntegrationStepUnit(vtkStreamTracer::Units::CELL_LENGTH_UNIT);
d->streamtracer->SetInitialIntegrationStep(0.2);
d->streamtracer->SetMinimumIntegrationStep(0.01);
d->streamtracer->SetMaximumIntegrationStep(0.5);
d->streamtracer->SetMaximumNumberOfSteps(2000);
d->streamtracer->SetMaximumPropagation(10); // To be set as the maximum size of the dataset
d->streamtracer->SetMaximumPropagation(20); // To be set as the maximum size of the dataset
d->streamtracer->SetTerminalSpeed(1.e-12);
d->streamtracer->SetMaximumError(1.e-6);
d->streamtracer->SetComputeVorticity(true);
......@@ -149,7 +158,35 @@ dtkVisualizationDecoratorVectorStreamTracer::dtkVisualizationDecoratorVectorStre
d->show_actor_cb = new QCheckBox;
d->show_source_actor_cb = new QCheckBox;
d->cb_integrator_direction = new QComboBox;
d->cb_integrator_direction->addItem(QStringLiteral("Forward"));
d->cb_integrator_direction->addItem(QStringLiteral("Backward"));
d->cb_integrator_direction->addItem(QStringLiteral("Both"));
d->cb_integrator_direction->setCurrentIndex(2);
d->cb_integrator_type = new QComboBox;
d->cb_integrator_type->addItem(QStringLiteral("RK2"));
d->cb_integrator_type->addItem(QStringLiteral("RK4"));
d->cb_integrator_type->addItem(QStringLiteral("RK45"));
d->cb_integrator_type->setCurrentIndex(2);
d->sp_integrator_max_steps = new QSpinBox;
d->sp_integrator_max_steps->setMaximum(999999);
d->sp_integrator_max_steps->setValue(2000);
d->sp_integrator_max_steps->setKeyboardTracking(false);
d->sp_integrator_max_lengths = new QDoubleSpinBox;
d->sp_integrator_max_lengths->setMaximum(9999999);
d->sp_integrator_max_lengths->setValue(20);
d->sp_integrator_max_lengths->setKeyboardTracking(false);
d->sp_radius = new QDoubleSpinBox;
d->show_source_actor_cb->setChecked(true);
d->sp_radius->setValue(0.01);
d->sp_radius->setSingleStep(0.1);
d->sp_radius->setDecimals(4);
d->sp_radius->setKeyboardTracking(false);
//////////
// Inspectors connections
......@@ -167,12 +204,49 @@ dtkVisualizationDecoratorVectorStreamTracer::dtkVisualizationDecoratorVectorStre
this->draw();
});
connect(d->cb_integrator_direction, QOverload<int>::of(&QComboBox::currentIndexChanged), [=] (int id)
{
d->streamtracer->SetIntegrationDirection(id);
this->draw();
});
connect(d->cb_integrator_type, QOverload<int>::of(&QComboBox::currentIndexChanged), [=] (int id)
{
d->streamtracer->SetIntegratorType(id);
this->draw();
});
connect(d->sp_integrator_max_steps, QOverload<int>::of(&QSpinBox::valueChanged), [=] (int val)
{
d->streamtracer->SetMaximumNumberOfSteps(val);
this->draw();
});
connect(d->sp_integrator_max_lengths, QOverload<double>::of(&QDoubleSpinBox::valueChanged), [=] (double val)
{
d->streamtracer->SetMaximumPropagation(val);
this->draw();
});
connect(d->sp_radius, QOverload<double>::of(&QDoubleSpinBox::valueChanged), [=] (double val)
{
d->tube_filter->SetRadius(val);
this->draw();
});
this->setObjectName("Vector Stream Tracer");
d->show_actor_cb->setObjectName("Display");
d->show_source_actor_cb->setObjectName("Display Source");
d_func()->inspectors << d->show_actor_cb << d->show_source_actor_cb;
d->cb_integrator_direction->setObjectName("Integration Direction");
d->cb_integrator_type->setObjectName("Integrator Type");
d->sp_integrator_max_steps->setObjectName("Maximum Steps");
d->sp_integrator_max_lengths->setObjectName("Maximum Streamline Length");
d->sp_radius->setObjectName("Tube Radius");
d_func()->inspectors << d->cb_integrator_direction << d->cb_integrator_type << d->sp_integrator_max_steps
<< d->sp_integrator_max_lengths << d->sp_radius
<< d->show_actor_cb << d->show_source_actor_cb;
}
dtkVisualizationDecoratorVectorStreamTracer::~dtkVisualizationDecoratorVectorStreamTracer(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