Commit f87b9b27 authored by LACROIX Romain's avatar LACROIX Romain

Moved implementation of Stream Tracer widget in its dedicated file.

parent e8ffac96
......@@ -121,7 +121,7 @@ public:
QCheckBox *show_source_actor_cb = nullptr;
public:
QComboBox *cb_source_type = nullptr;
QComboBox *cb_seed_type = nullptr;
QSpinBox *sp_integrator_max_steps = nullptr;
QSpinBox *sp_resolution = nullptr;
QDoubleSpinBox *sp_integrator_max_lengths = nullptr;
......@@ -210,10 +210,7 @@ dtkVisualizationDecoratorVectorStreamTracer::dtkVisualizationDecoratorVectorStre
auto *cb_integrator_type = dtkVisualizationWidgetsStreamTracer::createComboBox("Integrator Type", {"RK2", "RK4", "RK45"}, 0);
d->cb_source_type = new QComboBox;
d->cb_source_type->addItem(QStringLiteral("Line"));
d->cb_source_type->addItem(QStringLiteral("Sphere"));
d->cb_source_type->setCurrentIndex(1);
d->cb_seed_type = dtkVisualizationWidgetsStreamTracer::createComboBox("Type", { "Line", "Sphere" }, 1);
d->sp_resolution = new QSpinBox;
d->sp_resolution->setMaximum(1000);
......@@ -250,7 +247,7 @@ dtkVisualizationDecoratorVectorStreamTracer::dtkVisualizationDecoratorVectorStre
connect(d->show_source_actor_cb, &QCheckBox::stateChanged, [=] (int state)
{
if (d->cb_source_type->currentText() == "Sphere") {
if (d->cb_seed_type->currentText() == "Sphere") {
d->source_sphere_widget->SetEnabled(state == Qt::Checked);
} else {
d->source_line_widget->SetEnabled(state == Qt::Checked);
......@@ -270,7 +267,7 @@ dtkVisualizationDecoratorVectorStreamTracer::dtkVisualizationDecoratorVectorStre
this->draw();
});
connect(d->cb_source_type, &QComboBox::currentTextChanged, [=] (const QString& text)
connect(d->cb_seed_type, &QComboBox::currentTextChanged, [=] (const QString& text)
{
if (text == "Sphere") {
d->source_line_widget->SetEnabled(false);
......@@ -315,15 +312,15 @@ dtkVisualizationDecoratorVectorStreamTracer::dtkVisualizationDecoratorVectorStre
d->show_actor_cb->setObjectName("Display");
d->show_source_actor_cb->setObjectName("Display Source");
d->cb_source_type->setObjectName("Source 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->sp_resolution->setObjectName("Resolution");
auto *integrator_box = dtkVisualizationWidgetsStreamTracer::createCategory("Integrator", {cb_integrator_direction, cb_integrator_type});
auto *seed_box = dtkVisualizationWidgetsStreamTracer::createCategory("Seed", { d->cb_seed_type });
d_func()->inspectors << d->cb_source_type << integrator_box << d->sp_integrator_max_steps
d_func()->inspectors << seed_box << integrator_box << d->sp_integrator_max_steps
<< d->sp_integrator_max_lengths << d->sp_radius << d->sp_resolution
<< d->show_actor_cb << d->show_source_actor_cb;
}
......@@ -402,7 +399,7 @@ void dtkVisualizationDecoratorVectorStreamTracer::setData(const QVariant& data)
d->source_line_widget->SetInteractor(this->canvas()->renderer()->GetRenderWindow()->GetInteractor());
d->source_line_widget->On();
d->source_sphere_widget->On();
if (d->cb_source_type->currentText() == "Sphere") {
if (d->cb_seed_type->currentText() == "Sphere") {
d->source_line_widget->SetEnabled(false);
} else {
d->source_sphere_widget->SetEnabled(false);
......@@ -431,7 +428,7 @@ void dtkVisualizationDecoratorVectorStreamTracer::setCanvas(dtkVisualizationCanv
} else {
d->source_line_widget->On();
d->source_sphere_widget->On();
if (d->cb_source_type->currentText() == "Sphere") {
if (d->cb_seed_type->currentText() == "Sphere") {
d->source_line_widget->SetEnabled(false);
} else {
d->source_sphere_widget->SetEnabled(false);
......@@ -461,7 +458,7 @@ void dtkVisualizationDecoratorVectorStreamTracer::touch()
{
dtkVisualizationDecoratorWithClut::touch();
if (d->cb_source_type->currentText() == "Sphere") {
if (d->cb_seed_type->currentText() == "Sphere") {
d->source_sphere->GetPolyData(d->source_data);
} else {
d->source_line->GetPolyData(d->source_data);
......@@ -474,7 +471,7 @@ void dtkVisualizationDecoratorVectorStreamTracer::setVisibility(bool visible)
{
dtkVisualizationDecoratorWithClut::setVisibility(visible);
d->actor->SetVisibility(visible);
if (d->cb_source_type->currentText() == "Sphere") {
if (d->cb_seed_type->currentText() == "Sphere") {
d->source_sphere_widget->SetEnabled(visible);
} else {
d->source_line_widget->SetEnabled(visible);
......
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