Commit 952b2d03 authored by LACROIX Romain's avatar LACROIX Romain

Changed the settings pane of StreamTracer: all the styling fields go under a 'Styling' subcategory.

parent 5499767e
......@@ -4,6 +4,7 @@
#include "dtkVisualizationDecoratorVectorCurvedGlyphs.h"
#include "dtkVisualizationDecoratorWithClut_p.h"
#include "dtkVisualizationWidgetsStreamTracer.h"
#include "dtkVisualizationMetaType.h"
#include "dtkVisualizationView2D.h"
......@@ -300,7 +301,7 @@ dtkVisualizationDecoratorVectorCurvedGlyphs::dtkVisualizationDecoratorVectorCurv
d->sp_resolution->setObjectName("Resolution");
d_func()->inspectors << d->show_actor_cb << d->show_source_actor_cb
<< d_func()->field_components
<< d_func()->field_components->combobox()
<< d->cb_integrator_type << d->sp_integrator_max_steps
<< d->sp_integrator_max_lengths << d->sp_radius << d->sp_resolution;
......
......@@ -5,6 +5,8 @@
#include "dtkVisualizationDecoratorWithClut_p.h"
#include "dtkVisualizationWidgetsStreamTracer.h"
#include "dtkVisualizationMetaType.h"
#include "dtkVisualizationView2D.h"
......@@ -141,7 +143,7 @@ dtkVisualizationDecoratorVectorGlyphs::dtkVisualizationDecoratorVectorGlyphs(voi
d->glyphs_scale_factor_sb->setObjectName("Scale Factor");
d_func()->inspectors << d->show_actor_cb
<< d_func()->field_components
<< d_func()->field_components->combobox()
<< d->glyphs_scale_mode_cb
<< d->glyphs_stride_sb
<< d->glyphs_scale_factor_sb;
......
......@@ -318,10 +318,12 @@ dtkVisualizationDecoratorVectorStreamTracer::dtkVisualizationDecoratorVectorStre
QWidget *integrator_box = dtkVisualizationWidgetsStreamTracer::createCategory("Integrator", {cb_integrator_direction, cb_integrator_type});
QWidget *seed_box = dtkVisualizationWidgetsStreamTracer::createCategory("Seed", { d->cb_seed_type });
QWidget *styling_box = dtkVisualizationWidgetsStreamTracer::createCategory("Styling", { d_func()->field_components });
d_func()->inspectors << d->show_actor_cb << d->show_source_actor_cb
<< d_func()->field_components
<< seed_box << integrator_box << d->sp_integrator_max_steps
<< styling_box
<< seed_box << integrator_box
<< d->sp_integrator_max_steps
<< d->sp_integrator_max_lengths << d->sp_radius << d->sp_resolution;
}
......
......@@ -20,6 +20,7 @@
#include "dtkVisualizationCanvas.h"
#include "dtkVisualizationDecoratorClutEditorBase.h"
#include "dtkVisualizationWidgetsStreamTracer.h"
#include "dtkVisualizationView2D.h"
#include <dtkWidgets>
......@@ -251,7 +252,7 @@ dtkVisualizationDecoratorVectorStreamlines::dtkVisualizationDecoratorVectorStrea
start_pos_widget->setObjectName("Start Position");
d_func()->inspectors << d->show_actor_cb << d->show_source_actor_cb
<< d_func()->field_components
<< d_func()->field_components->combobox()
<< start_pos_widget
<< d->sp_radius;
}
......
......@@ -14,6 +14,7 @@
#include "dtkVisualizationDecoratorWithClut.h"
#include "dtkVisualizationDecoratorWithClut_p.h"
#include "dtkVisualizationWidgetsStreamTracer.h"
#include "dtkVisualizationMetaType.h"
#include "dtkVisualizationView2D.h"
#include <dtkVisualizationWidgets/dtkVisualizationWidgetsColorMapEditor.h>
......@@ -53,13 +54,7 @@ dtkVisualizationDecoratorWithClutPrivate::dtkVisualizationDecoratorWithClutPriva
this->fields_box = new QComboBox;
this->field_components = new QComboBox;
this->field_components->addItem("Uniform");
this->field_components->addItem("Magnitude");
this->field_components->addItem("X");
this->field_components->addItem("Y");
this->field_components->addItem("Z");
this->field_components->setCurrentIndex(0);
this->field_components = new dtkVisualizationWidgetsComboBox("Coloring", {"Uniform", "Magnitude", "X", "Y", "W"}, 0);
this->fixed_range = new QCheckBox;
this->min_range = new QLineEdit;
......@@ -358,7 +353,7 @@ dtkVisualizationDecoratorWithClut::dtkVisualizationDecoratorWithClut(void): dtkV
this->saveSettings("field_name", field_name);
this->touch();
});
connect(d->field_components, QOverload<int>::of(&QComboBox::currentIndexChanged), [=] (int component_id)
connect(d->field_components->combobox(), QOverload<int>::of(&QComboBox::currentIndexChanged), [=] (int component_id)
{
d->current_field_component = component_id;
this->saveSettings("field_component", component_id);
......
......@@ -24,6 +24,7 @@
class dtkVisualizationView2D;
class dtkVisualizationWidgetsColorMapEditor;
class dtkVisualizationWidgetsComboBox;
class QComboBox;
class QCheckBox;
......@@ -64,7 +65,7 @@ public:
QList<QWidget *> inspectors;
QComboBox *fields_box = nullptr;
QComboBox *field_components = nullptr;
dtkVisualizationWidgetsComboBox *field_components = nullptr;
QCheckBox *fixed_range = nullptr;
QLineEdit *min_range = nullptr;
QLineEdit *max_range = nullptr;
......
......@@ -4,6 +4,7 @@
dtkVisualizationWidgetsComboBox::dtkVisualizationWidgetsComboBox(const QString& name, const QVector<QString>& labels, const int index, QWidget *parent) : QGroupBox(parent), cbox(new QComboBox)
{
cbox->setObjectName(name);
for (const auto& label: labels)
{
cbox->addItem(label);
......@@ -33,23 +34,22 @@ QString dtkVisualizationWidgetsComboBox::currentText() const
return cbox->currentText();
}
int dtkVisualizationWidgetsComboBox::currentIndex() const
{
return cbox->currentIndex();
}
void dtkVisualizationWidgetsComboBox::setCurrentIndex(int index)
{
cbox->setCurrentIndex(index);
}
// class dtkVisualizationWidgetsStreamTracerPrivate
// {
// public:
// QCheckBox *enable_slicing = nullptr;
// QCheckBox *reset_pos = nullptr;
// QDoubleSpinBox *slice_position ;
// };
dtkVisualizationWidgetsStreamTracer::dtkVisualizationWidgetsStreamTracer(QWidget *parent) //: QWidget(parent), d(new dtkVisualizationWidgetsStreamTracerPrivate)
dtkVisualizationWidgetsStreamTracer::dtkVisualizationWidgetsStreamTracer(QWidget *parent)
{
}
dtkVisualizationWidgetsStreamTracer::~dtkVisualizationWidgetsStreamTracer()
{
// delete d;
}
// todo : change this static function to class, remove unused class
......
......@@ -15,14 +15,15 @@ public:
QComboBox *combobox();
QString currentText() const;
int currentIndex() const;
void setCurrentIndex(int index);
private:
QComboBox* cbox;
};
class DTKVISUALIZATIONWIDGETS_EXPORT dtkVisualizationWidgetsStreamTracer // : public QWidget
class DTKVISUALIZATIONWIDGETS_EXPORT dtkVisualizationWidgetsStreamTracer
{
/* Q_OBJECT */
public:
dtkVisualizationWidgetsStreamTracer(QWidget *parent = nullptr);
......@@ -30,20 +31,4 @@ public:
static QGroupBox *createCategory(const QString& name, const QVector<QWidget*>& widgets, QWidget* parent = nullptr);
/* public slots: */
/* void setValue(double value); */
/* void setChecked(bool); */
/* public: */
/* double value(void); */
/* void setCheckState(Qt::CheckState state); */
/* bool isChecked(void); */
/* signals: */
/* void valueChanged(double); */
/* void toggled(bool); */
/* void reset(void); */
/* private: */
/* class dtkVisualizationWidgetsStreamTracerPrivate *d; */
};
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