Commit a7b865a8 authored by LE BRETON Come's avatar LE BRETON Come

Renames isoline to isolines.

parent 8a373c36
......@@ -20,7 +20,7 @@
#include <dtkVisualization/dtkVisualizationView3D>
#include <dtkVisualization/dtkVisualizationDecoratorScalarColorMap>
#include <dtkVisualization/dtkVisualizationDecoratorScalarIsoline>
#include <dtkVisualization/dtkVisualizationDecoratorScalarIsolines>
#include <dtkVisualization/dtkVisualizationVTKReader>
......@@ -157,11 +157,11 @@ void dtkVisualizationViewer::importDataSet(const QString& path)
decorator_scalar_color_map->setCanvas(view_3d);
decorator_scalar_color_map->setData(data);
dtkVisualizationDecoratorScalarIsoline *decorator_scalar_isoline = new dtkVisualizationDecoratorScalarIsoline;
decorator_scalar_isoline->setCanvas(view_3d);
decorator_scalar_isoline->setData(data);
dtkVisualizationDecoratorScalarIsolines *decorator_scalar_isolines = new dtkVisualizationDecoratorScalarIsolines;
decorator_scalar_isolines->setCanvas(view_3d);
decorator_scalar_isolines->setData(data);
(*decorator_scalar_color_map) << decorator_scalar_isoline;
(*decorator_scalar_color_map) << decorator_scalar_isolines;
decorator_scalar_color_map->render();
}
......
......@@ -26,8 +26,8 @@ set(${PROJECT_NAME}_HEADERS
dtkVisualizationDecorator.h
dtkVisualizationDecoratorScalarColorMap
dtkVisualizationDecoratorScalarColorMap.h
dtkVisualizationDecoratorScalarIsoline
dtkVisualizationDecoratorScalarIsoline.h
dtkVisualizationDecoratorScalarIsolines
dtkVisualizationDecoratorScalarIsolines.h
dtkVisualizationPlot2D
dtkVisualizationPlot2D.h
dtkVisualizationPlot3D
......@@ -53,7 +53,7 @@ set(${PROJECT_NAME}_SOURCES
dtkVisualizationCanvas.cpp
dtkVisualizationDecorator.cpp
dtkVisualizationDecoratorScalarColorMap.cpp
dtkVisualizationDecoratorScalarIsoline.cpp
dtkVisualizationDecoratorScalarIsolines.cpp
dtkVisualizationPlot2D.cpp
dtkVisualizationPlot3D.cpp
dtkVisualizationVTKReader.cpp
......
#include "dtkVisualizationCanvas.h"
#include "dtkVisualizationDecorator.h"
#include "dtkVisualizationDecoratorScalarColorMap.h"
#include "dtkVisualizationDecoratorScalarIsoline.h"
#include "dtkVisualizationDecoratorScalarIsolines.h"
#include "dtkVisualizationPlot2D.h"
#include "dtkVisualizationPlot3D.h"
#include "dtkVisualizationVTKReader.h"
......
#include "dtkVisualizationDecoratorScalarIsoline.h"
#include "dtkVisualizationDecoratorScalarIsolines.h"
......@@ -12,7 +12,7 @@
// Code:
#include "dtkVisualizationDecoratorScalarIsoline.h"
#include "dtkVisualizationDecoratorScalarIsolines.h"
#include "dtkVisualizationCanvas.h"
#include "dtkVisualizationView2D.h"
......@@ -43,10 +43,10 @@
#include <vtkSmartPointer.h>
// ///////////////////////////////////////////////////////////////////
// dtkVisualizationDecoratorScalarIsolinePrivate declaration
// dtkVisualizationDecoratorScalarIsolinesPrivate declaration
// ///////////////////////////////////////////////////////////////////
class dtkVisualizationDecoratorScalarIsolinePrivate
class dtkVisualizationDecoratorScalarIsolinesPrivate
{
public:
enum Support {
......@@ -79,10 +79,10 @@ public:
};
// ///////////////////////////////////////////////////////////////////
// dtkVisualizationDecoratorScalarIsoline implementation
// dtkVisualizationDecoratorScalarIsolines implementation
// ///////////////////////////////////////////////////////////////////
dtkVisualizationDecoratorScalarIsoline::dtkVisualizationDecoratorScalarIsoline(void): d(new dtkVisualizationDecoratorScalarIsolinePrivate())
dtkVisualizationDecoratorScalarIsolines::dtkVisualizationDecoratorScalarIsolines(void): d(new dtkVisualizationDecoratorScalarIsolinesPrivate())
{
d->isolines = vtkSmartPointer<vtkContourFilter>::New();
......@@ -97,14 +97,14 @@ dtkVisualizationDecoratorScalarIsoline::dtkVisualizationDecoratorScalarIsoline(v
d->actor->SetVisibility(true);
}
dtkVisualizationDecoratorScalarIsoline::~dtkVisualizationDecoratorScalarIsoline(void)
dtkVisualizationDecoratorScalarIsolines::~dtkVisualizationDecoratorScalarIsolines(void)
{
d->dataset = nullptr;
delete d;
d = nullptr;
}
void dtkVisualizationDecoratorScalarIsoline::draw(void)
void dtkVisualizationDecoratorScalarIsolines::draw(void)
{
if (!d->dataset || d->current_field_name.isEmpty()) {
dtkWarn() << Q_FUNC_INFO << "Set dataset and field name before updating actor.";
......@@ -137,7 +137,7 @@ void dtkVisualizationDecoratorScalarIsoline::draw(void)
}
}
void dtkVisualizationDecoratorScalarIsoline::setData(const QVariant& data)
void dtkVisualizationDecoratorScalarIsolines::setData(const QVariant& data)
{
vtkDataSet *dataset = data.value<vtkDataSet *>();
if (!dataset) {
......@@ -160,7 +160,7 @@ void dtkVisualizationDecoratorScalarIsoline::setData(const QVariant& data)
if (d->dataset->GetPointData()->GetArray(i)->GetNumberOfComponents() == 1) {
QString field_name = QString::fromUtf8(d->dataset->GetPointData()->GetArrayName(i));
d->eligible_field_names << field_name;
d->supports[field_name] = dtkVisualizationDecoratorScalarIsolinePrivate::Support::Point;
d->supports[field_name] = dtkVisualizationDecoratorScalarIsolinesPrivate::Support::Point;
d->dataset->GetPointData()->SetActiveScalars(qPrintable(field_name));
double *range = static_cast<vtkDataArray *>(d->dataset->GetPointData()->GetScalars())->GetRange();
......@@ -190,7 +190,7 @@ void dtkVisualizationDecoratorScalarIsoline::setData(const QVariant& data)
if (d->dataset->GetCellData()->GetArray(i)->GetNumberOfComponents() == 1) {
QString field_name = QString::fromUtf8(d->dataset->GetCellData()->GetArrayName(i));
d->eligible_field_names << field_name;
d->supports[field_name] = dtkVisualizationDecoratorScalarIsolinePrivate::Support::Cell;
d->supports[field_name] = dtkVisualizationDecoratorScalarIsolinesPrivate::Support::Cell;
d->dataset->GetCellData()->SetActiveScalars(qPrintable(field_name));
double *range = static_cast<vtkDataArray *>(d->dataset->GetCellData()->GetScalars())->GetRange();
......@@ -226,7 +226,7 @@ void dtkVisualizationDecoratorScalarIsoline::setData(const QVariant& data)
d->mapper->Modified();
}
void dtkVisualizationDecoratorScalarIsoline::setCanvas(dtkVisualizationCanvas *canvas)
void dtkVisualizationDecoratorScalarIsolines::setCanvas(dtkVisualizationCanvas *canvas)
{
dtkVisualizationView2D *old = dynamic_cast<dtkVisualizationView2D *>(this->canvas());
if (old) {
......@@ -253,13 +253,13 @@ void dtkVisualizationDecoratorScalarIsoline::setCanvas(dtkVisualizationCanvas *c
pane_item->addWidget(clut_editor);
canvas_pane->addWidget(pane_item);
connect(this, &dtkVisualizationDecoratorScalarIsoline::currentRangeChanged, [=] (double min, double max) {
connect(this, &dtkVisualizationDecoratorScalarIsolines::currentRangeChanged, [=] (double min, double max) {
clut_editor->blockSignals(true);
clut_editor->setRange(min, max);
clut_editor->blockSignals(false);
});
connect(this, &dtkVisualizationDecoratorScalarIsoline::currentColorTransferFunctionChanged, [=] (vtkColorTransferFunction *color_transfer_function) {
connect(this, &dtkVisualizationDecoratorScalarIsolines::currentColorTransferFunctionChanged, [=] (vtkColorTransferFunction *color_transfer_function) {
clut_editor->blockSignals(true);
clut_editor->setColorTransferFunction(color_transfer_function);
clut_editor->blockSignals(false);
......@@ -272,32 +272,32 @@ void dtkVisualizationDecoratorScalarIsoline::setCanvas(dtkVisualizationCanvas *c
});
}
QStringList dtkVisualizationDecoratorScalarIsoline::eligibleFieldNames(void)
QStringList dtkVisualizationDecoratorScalarIsolines::eligibleFieldNames(void)
{
return d->eligible_field_names;
}
QString dtkVisualizationDecoratorScalarIsoline::currentFieldName(void)
QString dtkVisualizationDecoratorScalarIsolines::currentFieldName(void)
{
return d->current_field_name;
}
QPair<double, double> dtkVisualizationDecoratorScalarIsoline::currentRange(void)
QPair<double, double> dtkVisualizationDecoratorScalarIsolines::currentRange(void)
{
return d->ranges[d->current_field_name];
}
vtkSmartPointer<vtkColorTransferFunction> dtkVisualizationDecoratorScalarIsoline::currentColorTransferFunction(void)
vtkSmartPointer<vtkColorTransferFunction> dtkVisualizationDecoratorScalarIsolines::currentColorTransferFunction(void)
{
return d->color_transfer_functions[d->current_field_name];
}
vtkSmartPointer<vtkPiecewiseFunction> dtkVisualizationDecoratorScalarIsoline::currentOpacityTransferFunction(void)
vtkSmartPointer<vtkPiecewiseFunction> dtkVisualizationDecoratorScalarIsolines::currentOpacityTransferFunction(void)
{
return d->opacity_functions[d->current_field_name];
}
bool dtkVisualizationDecoratorScalarIsoline::setCurrentFieldName(const QString& scalar_field_name)
bool dtkVisualizationDecoratorScalarIsolines::setCurrentFieldName(const QString& scalar_field_name)
{
if (scalar_field_name.isEmpty()) {
dtkWarn() << Q_FUNC_INFO << "Scalar field name is empty, nothing is done.";
......@@ -319,9 +319,9 @@ bool dtkVisualizationDecoratorScalarIsoline::setCurrentFieldName(const QString&
vtkSmartPointer<vtkColorTransferFunction> color_function = d->color_transfer_functions[d->current_field_name];
if (d->supports[d->current_field_name] == dtkVisualizationDecoratorScalarIsolinePrivate::Support::Point) {
if (d->supports[d->current_field_name] == dtkVisualizationDecoratorScalarIsolinesPrivate::Support::Point) {
d->dataset->GetPointData()->SetActiveScalars(qPrintable(d->current_field_name));
} else if (d->supports[d->current_field_name] == dtkVisualizationDecoratorScalarIsolinePrivate::Support::Cell) {
} else if (d->supports[d->current_field_name] == dtkVisualizationDecoratorScalarIsolinesPrivate::Support::Cell) {
d->dataset->GetCellData()->SetActiveScalars(qPrintable(d->current_field_name));
}
......@@ -346,7 +346,7 @@ bool dtkVisualizationDecoratorScalarIsoline::setCurrentFieldName(const QString&
return true;
}
void dtkVisualizationDecoratorScalarIsoline::setCurrentColorTransferFunction(vtkSmartPointer<vtkColorTransferFunction> color_function)
void dtkVisualizationDecoratorScalarIsolines::setCurrentColorTransferFunction(vtkSmartPointer<vtkColorTransferFunction> color_function)
{
if (d->current_field_name.isEmpty()) {
return;
......@@ -368,7 +368,7 @@ void dtkVisualizationDecoratorScalarIsoline::setCurrentColorTransferFunction(vtk
emit this->currentColorTransferFunctionChanged(color_function);
}
void dtkVisualizationDecoratorScalarIsoline::setCurrentOpacityTransferFunction(vtkSmartPointer<vtkPiecewiseFunction> opacity_function)
void dtkVisualizationDecoratorScalarIsolines::setCurrentOpacityTransferFunction(vtkSmartPointer<vtkPiecewiseFunction> opacity_function)
{
if (d->current_field_name.isEmpty()) {
return;
......@@ -385,7 +385,7 @@ void dtkVisualizationDecoratorScalarIsoline::setCurrentOpacityTransferFunction(v
emit this->currentOpacityFunctionChanged(d->opacity_functions[d->current_field_name]);
}
void dtkVisualizationDecoratorScalarIsoline::setCurrentRange(double min, double max)
void dtkVisualizationDecoratorScalarIsolines::setCurrentRange(double min, double max)
{
if (d->current_field_name.isEmpty()) {
return;
......@@ -405,4 +405,4 @@ void dtkVisualizationDecoratorScalarIsoline::setCurrentRange(double min, double
}
//
// dtkVisualizationDecoratorScalarIsoline.cpp ends here
// dtkVisualizationDecoratorScalarIsolines.cpp ends here
......@@ -25,15 +25,15 @@
#include <vtkPiecewiseFunction.h>
// ///////////////////////////////////////////////////////////////////
// dtkVisualizationDecoratorScalarIsoline declaration
// dtkVisualizationDecoratorScalarIsolines declaration
// ///////////////////////////////////////////////////////////////////
class DTKVISUALIZATION_EXPORT dtkVisualizationDecoratorScalarIsoline : public dtkVisualizationDecorator
class DTKVISUALIZATION_EXPORT dtkVisualizationDecoratorScalarIsolines : public dtkVisualizationDecorator
{
Q_OBJECT
public:
dtkVisualizationDecoratorScalarIsoline(void);
~dtkVisualizationDecoratorScalarIsoline(void);
dtkVisualizationDecoratorScalarIsolines(void);
~dtkVisualizationDecoratorScalarIsolines(void);
public:
void setData(const QVariant&) override;
......@@ -62,8 +62,8 @@ signals:
void currentRangeChanged(double, double);
protected:
class dtkVisualizationDecoratorScalarIsolinePrivate *d = nullptr;
class dtkVisualizationDecoratorScalarIsolinesPrivate *d = nullptr;
};
//
// dtkVisualizationDecoratorScalarIsoline.h ends here
// dtkVisualizationDecoratorScalarIsolines.h ends here
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