Commit 4461d141 authored by KLOCZKO Thibaud's avatar KLOCZKO Thibaud

Merge branch 'feature/stream-tracer-widgets' into 'develop'

Feature/stream tracer widgets

See merge request !39
parents 3cec8909 2af0aaa2
......@@ -301,11 +301,11 @@ void dtkVisualizationViewer::importDataSet(const QString& path)
dtkVisualizationDecoratorInfo *decorator_info = new dtkVisualizationDecoratorInfo;
dtkVisualizationDecoratorAxes *decorator_axes = new dtkVisualizationDecoratorAxes;
dtkVisualizationDecoratorDelaunay2D *decorator_delaunay_2D = new dtkVisualizationDecoratorDelaunay2D;
dtkVisualizationDecoratorPoints *decorator_points = new dtkVisualizationDecoratorPoints;
dtkVisualizationDecoratorScalarColorMap *decorator_scalar_colormap = new dtkVisualizationDecoratorScalarColorMap;
dtkVisualizationDecoratorScalarGlyphs *decorator_scalar_glyphs = new dtkVisualizationDecoratorScalarGlyphs;
dtkVisualizationDecoratorScalarIsolines *decorator_scalar_isolines = new dtkVisualizationDecoratorScalarIsolines;
//dtkVisualizationDecoratorDelaunay2D *decorator_delaunay_2D = new dtkVisualizationDecoratorDelaunay2D;
//dtkVisualizationDecoratorPoints *decorator_points = new dtkVisualizationDecoratorPoints;
dtkVisualizationDecoratorSurfaceColor *decorator_surface_color = new dtkVisualizationDecoratorSurfaceColor;
//dtkVisualizationDecoratorScalarGlyphs *decorator_scalar_glyphs = new dtkVisualizationDecoratorScalarGlyphs;
dtkVisualizationDecoratorIsocontours *decorator_isocontours = new dtkVisualizationDecoratorIsocontours;
dtkVisualizationDecoratorSlices *decorator_slices = new dtkVisualizationDecoratorSlices;
dtkVisualizationDecoratorSnapshot *decorator_snapshot = new dtkVisualizationDecoratorSnapshot;
dtkVisualizationDecoratorVectorGlyphs *decorator_vector_glyphs = new dtkVisualizationDecoratorVectorGlyphs;
......@@ -315,11 +315,11 @@ void dtkVisualizationViewer::importDataSet(const QString& path)
dtkVisualizationDecoratorVolume *decorator_volume = new dtkVisualizationDecoratorVolume;
QList<dtkVisualizationDecorator *> decorators;
decorators << decorator_points
<< decorator_delaunay_2D
<< decorator_scalar_colormap
<< decorator_scalar_isolines
<< decorator_scalar_glyphs
decorators //<< decorator_points
//<< decorator_delaunay_2D
<< decorator_surface_color
<< decorator_isocontours
//<< decorator_scalar_glyphs
<< decorator_vector_glyphs
<< decorator_vector_curved_glyphs
<< decorator_vector_streamlines
......
......@@ -33,20 +33,20 @@ set(${PROJECT_NAME}_HEADERS
dtkVisualizationDecoratorClutEditorBase.h
dtkVisualizationDecoratorClutEditorSimple
dtkVisualizationDecoratorClutEditorSimple.h
dtkVisualizationDecoratorSurfaceColor
dtkVisualizationDecoratorSurfaceColor.h
dtkVisualizationDecoratorCollection
dtkVisualizationDecoratorCollection.h
dtkVisualizationDecoratorDelaunay2D
dtkVisualizationDecoratorDelaunay2D.h
dtkVisualizationDecoratorInfo
dtkVisualizationDecoratorInfo.h
dtkVisualizationDecoratorIsocontours
dtkVisualizationDecoratorIsocontours.h
dtkVisualizationDecoratorPoints
dtkVisualizationDecoratorPoints.h
dtkVisualizationDecoratorScalarColorMap
dtkVisualizationDecoratorScalarColorMap.h
dtkVisualizationDecoratorScalarGlyphs
dtkVisualizationDecoratorScalarGlyphs.h
dtkVisualizationDecoratorScalarIsolines
dtkVisualizationDecoratorScalarIsolines.h
dtkVisualizationDecoratorSlices
dtkVisualizationDecoratorSlices.h
dtkVisualizationDecoratorSnapshot
......@@ -99,13 +99,13 @@ set(${PROJECT_NAME}_SOURCES
dtkVisualizationDecoratorAxes.cpp
dtkVisualizationDecoratorClutEditor.cpp
dtkVisualizationDecoratorClutEditorSimple.cpp
dtkVisualizationDecoratorSurfaceColor.cpp
dtkVisualizationDecoratorCollection.cpp
dtkVisualizationDecoratorDelaunay2D.cpp
dtkVisualizationDecoratorInfo.cpp
dtkVisualizationDecoratorIsocontours.cpp
dtkVisualizationDecoratorPoints.cpp
dtkVisualizationDecoratorScalarColorMap.cpp
dtkVisualizationDecoratorScalarGlyphs.cpp
dtkVisualizationDecoratorScalarIsolines.cpp
dtkVisualizationDecoratorSlices.cpp
dtkVisualizationDecoratorSnapshot.cpp
dtkVisualizationDecoratorVectorCurvedGlyphs.cpp
......
......@@ -5,12 +5,12 @@
#include "dtkVisualizationDecoratorClutEditor.h"
#include "dtkVisualizationDecoratorClutEditorBase.h"
#include "dtkVisualizationDecoratorClutEditorSimple.h"
#include "dtkVisualizationDecoratorSurfaceColor.h"
#include "dtkVisualizationDecoratorCollection.h"
#include "dtkVisualizationDecoratorDelaunay2D.h"
#include "dtkVisualizationDecoratorInfo.h"
#include "dtkVisualizationDecoratorIsocontours.h"
#include "dtkVisualizationDecoratorPoints.h"
#include "dtkVisualizationDecoratorScalarColorMap.h"
#include "dtkVisualizationDecoratorScalarIsolines.h"
#include "dtkVisualizationDecoratorScalarGlyphs.h"
#include "dtkVisualizationDecoratorSlices.h"
#include "dtkVisualizationDecoratorSnapshot.h"
......
#include "dtkVisualizationDecoratorIsocontours.h"
......@@ -18,26 +18,27 @@
#include "dtkVisualizationDecoratorWithClut.h"
class DTKVISUALIZATION_EXPORT dtkVisualizationDecoratorScalarIsolines : public dtkVisualizationDecoratorWithClut
class DTKVISUALIZATION_EXPORT dtkVisualizationDecoratorIsocontours : public dtkVisualizationDecoratorWithClut
{
Q_OBJECT
public:
dtkVisualizationDecoratorScalarIsolines(void);
~dtkVisualizationDecoratorScalarIsolines(void);
dtkVisualizationDecoratorIsocontours(void);
~dtkVisualizationDecoratorIsocontours(void);
public:
void touch(void) override;
protected:
void touchRange(void) override;
public:
void setData(const QVariant&) override;
void setData(const QVariant&) override;
void setCanvas(dtkVisualizationCanvas *) override;
void unsetCanvas(void) override;
void unsetCanvas(void) override;
protected:
void restoreSettings(void) override;
void setCurrentRange(double, double) override;
bool setCurrentFieldName(const QString&) override;
bool setCurrentFieldName(const QString&) override;
void setColorMap(const QMap<double, QColor>&) override;
void setOpacity(double) override;
public:
void setVisibility(bool) override;
......@@ -46,8 +47,11 @@ public:
void setCurrentIsolinesCount(std::size_t);
protected:
class dtkVisualizationDecoratorScalarIsolinesPrivate *d = nullptr;
void updateContours(void);
protected:
class dtkVisualizationDecoratorIsocontoursPrivate *d = nullptr;
};
//
// dtkVisualizationDecoratorScalarIsolines.h ends here
// dtkVisualizationDecoratorIsocontours.h ends here
#include "dtkVisualizationDecoratorScalarColorMap.h"
\ No newline at end of file
......@@ -15,11 +15,11 @@
#include "dtkVisualizationDecoratorScalarGlyphs.h"
#include "dtkVisualizationDecoratorWithClut_p.h"
#include "dtkVisualizationMetaType.h"
#include "dtkVisualizationView2D.h"
#include <dtkVisualizationWidgetsCategory.h>
#include <dtkLog>
#include <QtGui>
......@@ -66,7 +66,6 @@ public:
vtkSmartPointer<vtkCellCenters> cell_centers;
public:
QCheckBox *show_actor_cb = nullptr;
QDoubleSpinBox *glyphs_size_sb = nullptr;
QComboBox *glyphs_source_cb = nullptr;
......@@ -130,18 +129,15 @@ dtkVisualizationDecoratorScalarGlyphs::dtkVisualizationDecoratorScalarGlyphs(voi
d->actor->SetMapper(d->mapper);
//////////
// Inspectors creation
// Inspectors
d->show_actor_cb = new QCheckBox;
d->glyphs_size_sb = new QDoubleSpinBox;
d->glyphs_source_cb = new QComboBox;
//////////
// Inspectors setup
d->glyphs_size_sb->setObjectName("Glyphs Size");
d->glyphs_size_sb->setMaximum(1000);
d->glyphs_size_sb->setKeyboardTracking(false);
d->glyphs_source_cb = new QComboBox;
d->glyphs_source_cb->setObjectName("Source Shape");
d->glyphs_source_cb->addItem("Arrow");
d->glyphs_source_cb->addItem("Cube");
d->glyphs_source_cb->addItem("Cylinder");
......@@ -151,7 +147,7 @@ dtkVisualizationDecoratorScalarGlyphs::dtkVisualizationDecoratorScalarGlyphs(voi
//////////
// Inspectors connections
connect(d->show_actor_cb, &QCheckBox::stateChanged, [=] (int state) {
connect(d_func()->show_actor_cb, &QCheckBox::stateChanged, [=] (int state) {
this->saveSettings("visibility",state == Qt::Checked);
this->setVisibility(state == Qt::Checked);
this->draw();
......@@ -191,11 +187,13 @@ dtkVisualizationDecoratorScalarGlyphs::dtkVisualizationDecoratorScalarGlyphs(voi
});
this->setObjectName("Scalar Glyphs");
d->show_actor_cb->setObjectName("Display");
d->glyphs_size_sb->setObjectName("Glyphs Size");
d->glyphs_source_cb->setObjectName("Source Shape");
d_func()->inspectors << d->show_actor_cb << d->glyphs_size_sb << d->glyphs_source_cb;
QWidget *styling_box = new dtkVisualizationWidgetsCategory("Styling", {
d->glyphs_size_sb,
d->glyphs_source_cb
});
d_func()->inspectors << styling_box;
}
dtkVisualizationDecoratorScalarGlyphs::~dtkVisualizationDecoratorScalarGlyphs(void)
......@@ -219,11 +217,6 @@ void dtkVisualizationDecoratorScalarGlyphs::restoreSettings(void)
d->default_glyph_size = settings.value(name+"_glyph_size", 1.0).toDouble();
d->default_glyph_shape = settings.value(name+"_glyph_shape", "Sphere").toString();
settings.endGroup();
d->actor->SetVisibility(d_func()->default_visibility);
d->show_actor_cb->blockSignals(true);
d->show_actor_cb->setChecked(d_func()->default_visibility);
d->show_actor_cb->blockSignals(false);
}
void dtkVisualizationDecoratorScalarGlyphs::setData(const QVariant& data)
......@@ -454,19 +447,6 @@ void dtkVisualizationDecoratorScalarGlyphs::setColorMap(const QMap<double, QColo
auto&& range = d_func()->ranges[d_func()->current_field_name];
d->mapper->SetScalarRange(range[0], range[1]);
d->mapper->Modified();
// Set opacity
// int size = opacity_function->GetSize();
// double val[4];
// double opacity_min = 1.;
// for(std::size_t i = 0; i < size; ++i) {
// opacity_function->GetNodeValue(i, val);
// if(val[1] < opacity_min) opacity_min = val[1];
// }
// d->actor->GetProperty()->SetOpacity(opacity_min);
// d->actor->Modified();
}
void *dtkVisualizationDecoratorScalarGlyphs::glyphs(void)
......
#include "dtkVisualizationDecoratorScalarIsolines.h"
......@@ -31,7 +31,9 @@ public:
void setCanvas(dtkVisualizationCanvas *) override;
void unsetCanvas(void) override;
void touch(void) override;
public:
bool isDecorating(void) override;
bool setCurrentFieldName(const QString&) override;
public:
......
#include "dtkVisualizationDecoratorSurfaceColor.h"
// Version: $Id$
//
//
// Commentary:
//
//
// Change Log:
//
// dtkVisualizationDecoratorSurfaceColor.cpp
//
// Code:
#include "dtkVisualizationDecoratorSurfaceColor.h"
#include "dtkVisualizationDecoratorScalarColorMap.h"
#include "dtkVisualizationDecoratorWithClut_p.h"
#include "dtkVisualizationMetaType.h"
#include "dtkVisualizationView2D.h"
#include <dtkVisualizationWidgetsCategory.h>
#include <dtkLog>
#include <QtGui>
......@@ -35,27 +27,21 @@
#include <vtkTransform.h>
// ///////////////////////////////////////////////////////////////////
// dtkVisualizationDecoratorScalarColorMapPrivate declaration
// dtkVisualizationDecoratorSurfaceColorPrivate declaration
// ///////////////////////////////////////////////////////////////////
class dtkVisualizationDecoratorScalarColorMapPrivate
class dtkVisualizationDecoratorSurfaceColorPrivate
{
public:
vtkSmartPointer<vtkActor> actor;
vtkSmartPointer<vtkDataSetMapper> mapper;
public:
QCheckBox *show_actor_cb = nullptr;
public slots:
void onCanvasFocused(void);
};
// ///////////////////////////////////////////////////////////////////
// dtkVisualizationDecoratorScalarColorMap implementation
// dtkVisualizationDecoratorSurfaceColor implementation
// ///////////////////////////////////////////////////////////////////
dtkVisualizationDecoratorScalarColorMap::dtkVisualizationDecoratorScalarColorMap(void): dtkVisualizationDecoratorWithClut(), d(new dtkVisualizationDecoratorScalarColorMapPrivate())
dtkVisualizationDecoratorSurfaceColor::dtkVisualizationDecoratorSurfaceColor(void): dtkVisualizationDecoratorWithClut(), d(new dtkVisualizationDecoratorSurfaceColorPrivate())
{
d->mapper = vtkSmartPointer<vtkDataSetMapper>::New();
d->mapper->SetColorModeToMapScalars();
......@@ -64,28 +50,26 @@ dtkVisualizationDecoratorScalarColorMap::dtkVisualizationDecoratorScalarColorMap
d->actor = vtkSmartPointer<vtkActor>::New();
d->actor->SetMapper(d->mapper);
//////////
// Inspectors creation
d->show_actor_cb = new QCheckBox;
//////////
// Inspectors connections
connect(d->show_actor_cb, &QCheckBox::stateChanged, [=] (int state) {
this->saveSettings("visibility", state == Qt::Checked);
this->setVisibility(state == Qt::Checked);
this->draw();
});
connect(d_func()->show_actor_cb, &QCheckBox::stateChanged, [=] (int state)
{
this->saveSettings("visibility",state == Qt::Checked);
this->setVisibility(state == Qt::Checked);
this->draw();
});
this->setObjectName("Scalar ColorMap");
d->show_actor_cb->setObjectName("Display");
this->setObjectName("Surface Color");
d_func()->inspectors << d->show_actor_cb;
QWidget *styling_box = new dtkVisualizationWidgetsCategory("Styling", {
d_func()->opacity_widget
});
d_func()->inspectors << styling_box;
}
dtkVisualizationDecoratorScalarColorMap::~dtkVisualizationDecoratorScalarColorMap(void)
dtkVisualizationDecoratorSurfaceColor::~dtkVisualizationDecoratorSurfaceColor(void)
{
this->unsetCanvas();
......@@ -93,7 +77,7 @@ dtkVisualizationDecoratorScalarColorMap::~dtkVisualizationDecoratorScalarColorMa
d = nullptr;
}
void dtkVisualizationDecoratorScalarColorMap::setData(const QVariant& data)
void dtkVisualizationDecoratorSurfaceColor::setData(const QVariant& data)
{
vtkDataSet *dataset = data.value<vtkDataSet *>();
if (!dataset) {
......@@ -104,6 +88,8 @@ void dtkVisualizationDecoratorScalarColorMap::setData(const QVariant& data)
d_func()->clear();
d_func()->retrieveScalarPoints(dataset);
d_func()->retrieveScalarCells(dataset);
d_func()->retrieveVectorPoints(dataset);
d_func()->retrieveVectorCells(dataset);
if (!this->isDecorating()) {
dtkWarn() << Q_FUNC_INFO << "vtkDataSet has no field to decorate. Nothing is done.";
......@@ -124,7 +110,7 @@ void dtkVisualizationDecoratorScalarColorMap::setData(const QVariant& data)
d_func()->enableScalarBar();
}
void dtkVisualizationDecoratorScalarColorMap::setCanvas(dtkVisualizationCanvas *canvas)
void dtkVisualizationDecoratorSurfaceColor::setCanvas(dtkVisualizationCanvas *canvas)
{
this->unsetCanvas();
......@@ -141,7 +127,7 @@ void dtkVisualizationDecoratorScalarColorMap::setCanvas(dtkVisualizationCanvas *
d_func()->enableScalarBar();
}
void dtkVisualizationDecoratorScalarColorMap::unsetCanvas(void)
void dtkVisualizationDecoratorSurfaceColor::unsetCanvas(void)
{
if (d_func()->view) {
d_func()->view->renderer()->RemoveActor(d->actor);
......@@ -152,24 +138,24 @@ void dtkVisualizationDecoratorScalarColorMap::unsetCanvas(void)
d_func()->view = nullptr;
}
void dtkVisualizationDecoratorScalarColorMap::setVisibility(bool visible)
void dtkVisualizationDecoratorSurfaceColor::setVisibility(bool visible)
{
d->actor->SetVisibility(visible);
dtkVisualizationDecoratorWithClut::setVisibility(visible);
}
void dtkVisualizationDecoratorScalarColorMap::restoreSettings(void)
void dtkVisualizationDecoratorSurfaceColor::setOpacity(double opacity)
{
dtkVisualizationDecoratorWithClut::restoreSettings();
d->actor->SetVisibility(d_func()->default_visibility);
d->show_actor_cb->blockSignals(true);
d->show_actor_cb->setChecked(d_func()->default_visibility);
d->show_actor_cb->blockSignals(false);
d->actor->GetProperty()->SetOpacity(opacity);
d->actor->Modified();
}
void dtkVisualizationDecoratorSurfaceColor::restoreSettings(void)
{
dtkVisualizationDecoratorWithClut::restoreSettings();
}
bool dtkVisualizationDecoratorScalarColorMap::setCurrentFieldName(const QString& field_name)
bool dtkVisualizationDecoratorSurfaceColor::setCurrentFieldName(const QString& field_name)
{
if (!dtkVisualizationDecoratorWithClut::setCurrentFieldName(field_name)) {
return false;
......@@ -188,7 +174,7 @@ bool dtkVisualizationDecoratorScalarColorMap::setCurrentFieldName(const QString&
return true;
}
void dtkVisualizationDecoratorScalarColorMap::setColorMap(const QMap<double, QColor>& new_colormap)
void dtkVisualizationDecoratorSurfaceColor::setColorMap(const QMap<double, QColor>& new_colormap)
{
dtkVisualizationDecoratorWithClut::setColorMap(new_colormap);
......@@ -197,29 +183,13 @@ void dtkVisualizationDecoratorScalarColorMap::setColorMap(const QMap<double, QCo
auto&& range = d_func()->ranges[d_func()->current_field_name];
d->mapper->SetScalarRange(range[0], range[1]);
d->mapper->Modified();
// -- set opacity
// int size = opacity_function->GetSize();
// double val[4];
// double opacity_min = 1.;
// for(std::size_t i = 0; i < size; ++i) {
// opacity_function->GetNodeValue(i, val);
// if(val[1] < opacity_min) opacity_min = val[1];
// }
// d->actor->GetProperty()->SetOpacity(opacity_min);
// d->actor->Modified();
}
void dtkVisualizationDecoratorScalarColorMap::setTransform(vtkTransform *transform)
void dtkVisualizationDecoratorSurfaceColor::setTransform(vtkTransform *transform)
{
d_func()->transform = transform;
d->actor->SetUserTransform(transform);
}
// /////////////////////////////////////////////////////////////////////////////
//
// dtkVisualizationDecoratorScalarColorMap.cpp ends here
// dtkVisualizationDecoratorSurfaceColor.cpp ends here
// Version: $Id$
// dtkVisualizationDecoratorSurfaceColor.h
//
//
// Commentary:
//
//
// Change Log:
//
//
// Code:
#pragma once
......@@ -18,13 +7,13 @@
#include "dtkVisualizationDecoratorWithClut.h"
class DTKVISUALIZATION_EXPORT dtkVisualizationDecoratorScalarColorMap : public dtkVisualizationDecoratorWithClut
class DTKVISUALIZATION_EXPORT dtkVisualizationDecoratorSurfaceColor : public dtkVisualizationDecoratorWithClut
{
Q_OBJECT
public:
dtkVisualizationDecoratorScalarColorMap(void);
~dtkVisualizationDecoratorScalarColorMap(void);
dtkVisualizationDecoratorSurfaceColor(void);
~dtkVisualizationDecoratorSurfaceColor(void);
public:
void setData(const QVariant&) override;
......@@ -35,17 +24,15 @@ public:
public:
void setVisibility(bool) override;
// /////////////////////////////////////////////////////////////////////////////
protected:
void restoreSettings(void) override;
bool setCurrentFieldName(const QString&) override;
void setColorMap(const QMap<double, QColor>&) override;
void restoreSettings(void) override;
void setOpacity(double) override;
protected:
class dtkVisualizationDecoratorScalarColorMapPrivate *d;
class dtkVisualizationDecoratorSurfaceColorPrivate *d;
};
//
// dtkVisualizationDecoratorScalarColorMap.h ends here
// dtkVisualizationDecoratorSurfaceColor.h ends here
......@@ -7,6 +7,8 @@
#include "dtkVisualizationMetaType.h"
#include "dtkVisualizationView2D.h"
#include <dtkVisualizationWidgets/dtkVisualizationWidgetsCategory>
#include <dtkLog>
#include <QtGui>
......@@ -94,7 +96,6 @@ public:
vtkSmartPointer<vtkActor> curves_actor;
public:
QCheckBox *show_actor_cb = nullptr;
QCheckBox *show_source_actor_cb = nullptr;
public:
......@@ -208,7 +209,6 @@ dtkVisualizationDecoratorVectorCurvedGlyphs::dtkVisualizationDecoratorVectorCurv
//////////
// Inspectors creation and setup
d->show_actor_cb = new QCheckBox;
d->show_source_actor_cb = new QCheckBox;
d->cb_integrator_type = new QComboBox;
......@@ -243,13 +243,6 @@ dtkVisualizationDecoratorVectorCurvedGlyphs::dtkVisualizationDecoratorVectorCurv
//////////
// Inspectors connections
connect(d->show_actor_cb, &QCheckBox::stateChanged, [=] (int state)
{
this->saveSettings("visibility",state == Qt::Checked);
this->setVisibility(state == Qt::Checked);
this->draw();
});
connect(d->show_source_actor_cb, &QCheckBox::stateChanged, [=] (int state)
{
d->source_sphere_widget->SetEnabled(state == Qt::Checked);
......@@ -291,7 +284,6 @@ dtkVisualizationDecoratorVectorCurvedGlyphs::dtkVisualizationDecoratorVectorCurv
this->setObjectName("Vector Curved Glyphs");
d->show_actor_cb->setObjectName("Display");
d->show_source_actor_cb->setObjectName("Display Source");
d->cb_integrator_type->setObjectName("Integrator Type");
d->sp_integrator_max_steps->setObjectName("Maximum Steps");
......@@ -299,8 +291,7 @@ dtkVisualizationDecoratorVectorCurvedGlyphs::dtkVisualizationDecoratorVectorCurv
d->sp_radius->setObjectName("Tube Radius");
d->sp_resolution->setObjectName("Resolution");
d_func()->inspectors << d->show_actor_cb << d->show_source_actor_cb
<< d_func()->field_components
d_func()->inspectors << d->show_source_actor_cb
<< d->cb_integrator_type << d->sp_integrator_max_steps
<< d->sp_integrator_max_lengths << d->sp_radius << d->sp_resolution;
......@@ -317,15 +308,7 @@ dtkVisualizationDecoratorVectorCurvedGlyphs::~dtkVisualizationDecoratorVectorCur
void dtkVisualizationDecoratorVectorCurvedGlyphs::restoreSettings(void)
{
if (this->objectName().isEmpty()) {
return;
}
dtkVisualizationDecoratorWithClut::restoreSettings();
d->arrows_actor->SetVisibility(d_func()->default_visibility);
d->curves_actor->SetVisibility(d_func()->default_visibility);
d->show_actor_cb->blockSignals(true);
d->show_actor_cb->setChecked(d_func()->default_visibility);
d->show_actor_cb->blockSignals(false);
}
void dtkVisualizationDecoratorVectorCurvedGlyphs::setData(const QVariant& data)
......@@ -421,7 +404,7 @@ void dtkVisualizationDecoratorVectorCurvedGlyphs::unsetCanvas(void)
d_func()->view = nullptr;
}
void dtkVisualizationDecoratorVectorCurvedGlyphs::touch()
void dtkVisualizationDecoratorVectorCurvedGlyphs::touch(void)
{
dtkVisualizationDecoratorWithClut::touch();
......
......@@ -2,13 +2,12 @@
//
#include "dtkVisualizationDecoratorVectorGlyphs.h"
#include "dtkVisualizationDecoratorWithClut_p.h"
#include "dtkVisualizationMetaType.h"
#include "dtkVisualizationView2D.h"
#include <dtkVisualizationWidgets/dtkVisualizationWidgetsCategory>
#include <dtkLog>
#include <QtGui>
......@@ -24,6 +23,7 @@
#include <vtkMaskPoints.h>
#include <vtkPointData.h>
#include <vtkPolyDataMapper.h>
#include <vtkProperty.h>
#include <vtkRenderer.h>
#include <vtkSmartPointer.h>
......@@ -43,7 +43,6 @@ public:
vtkSmartPointer<vtkGlyph3DMapper> glyphs_mapper;
public:
QCheckBox *show_actor_cb = nullptr;
QComboBox *glyphs_scale_mode_cb = nullptr;
QSpinBox *glyphs_stride_sb = nullptr;
QDoubleSpinBox *glyphs_scale_factor_sb = nullptr;
......@@ -80,7 +79,6 @@ dtkVisualizationDecoratorVectorGlyphs::dtkVisualizationDecoratorVectorGlyphs(voi
//////////
// Inspectors creation
d->show_actor_cb = new QCheckBox;
d->glyphs_scale_mode_cb = new QComboBox;
d->glyphs_stride_sb = new QSpinBox;
d->glyphs_scale_factor_sb = new QDoubleSpinBox;
......@@ -107,13 +105,6 @@ dtkVisualizationDecoratorVectorGlyphs::dtkVisualizationDecoratorVectorGlyphs(voi
//////////
// Inspectors connections
connect(d->show_actor_cb, &QCheckBox::stateChanged, [=] (int state)
{
this->saveSettings("visibility", state == Qt::Checked);
this->setVisibility(state == Qt::Checked);
this->draw();
});
connect(d->glyphs_scale_mode_cb, QOverload<int>::of(&QComboBox::currentIndexChanged), [=] (int component_id)
{
this->saveSettings("scaling_mode", component_id);
......@@ -135,16 +126,20 @@ dtkVisualizationDecoratorVectorGlyphs::dtkVisualizationDecoratorVectorGlyphs(voi
});
this->setObjectName("Vector Glyphs");
d->show_actor_cb->setObjectName("Display");
d->glyphs_scale_mode_cb->setObjectName("Scaling Mode");
d->glyphs_stride_sb->setObjectName("Every Nth point");
d->glyphs_scale_factor_sb->setObjectName("Scale Factor");
d_func()->inspectors << d->show_actor_cb
<< d_func()->field_components
<< d->glyphs_scale_mode_cb
<< d->glyphs_stride_sb
<< d->glyphs_scale_factor_sb;
QWidget *styling_box = new dtkVisualizationWidgetsCategory("Styling", {
d->glyphs_scale_mode_cb,
d->glyphs_stride_sb,
d->glyphs_scale_factor_sb,
d_func()->opacity_widget
});
d_func()->inspectors << styling_box;
}
dtkVisualizationDecoratorVectorGlyphs::~dtkVisualizationDecoratorVectorGlyphs(void)
......@@ -164,11 +159,6 @@ void dtkVisualizationDecoratorVectorGlyphs::restoreSettings(void)
dtkVisualizationDecoratorWithClut::restoreSettings();
d->actor->SetVisibility(d_func()->default_visibility);
d->show_actor_cb->blockSignals(true);
d->show_actor_cb->setChecked(d_func()->default_visibility);
d->show_actor_cb->blockSignals(false);
QSettings settings;
settings.beginGroup("canvas");
......@@ -363,5 +353,11 @@ void dtkVisualizationDecoratorVectorGlyphs::setColorMap(const QMap<double, QColo