Commit 8a373c36 authored by LE BRETON Come's avatar LE BRETON Come

Displays iso(lines-surfaces). Need to adjust the controls.

parent c4fad44b
......@@ -20,6 +20,7 @@
#include <dtkVisualization/dtkVisualizationView3D>
#include <dtkVisualization/dtkVisualizationDecoratorScalarColorMap>
#include <dtkVisualization/dtkVisualizationDecoratorScalarIsoline>
#include <dtkVisualization/dtkVisualizationVTKReader>
......@@ -150,11 +151,19 @@ void dtkVisualizationViewer::importDataSet(const QString& path)
}
vtkDataSet *dataset = dtkVisualizationVTKReader(path);
dtkVisualizationDecoratorScalarColorMap* decorator = new dtkVisualizationDecoratorScalarColorMap;
decorator->setCanvas(view_3d);
QVariant data = dtk::variantFromValue(dataset);
decorator->setData(data);
decorator->render();
dtkVisualizationDecoratorScalarColorMap *decorator_scalar_color_map = new dtkVisualizationDecoratorScalarColorMap;
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);
(*decorator_scalar_color_map) << decorator_scalar_isoline;
decorator_scalar_color_map->render();
}
void dtkVisualizationViewer::setRopeSource(QWidget *source)
......
......@@ -16,14 +16,21 @@
#include <dtkVisualizationExport>
#include <QtCore>
#include "dtkVisualizationDecorator.h"
#include <vtkSmartPointer.h>
#include <vtkColorTransferFunction.h>
#include <vtkPiecewiseFunction.h>
// ///////////////////////////////////////////////////////////////////
// dtkVisualizationDecoratorScalarIsoline declaration
// ///////////////////////////////////////////////////////////////////
class DTKVISUALIZATION_EXPORT dtkVisualizationDecoratorScalarIsoline : public dtkVisualizationDecorator
{
Q_OBJECT
public:
dtkVisualizationDecoratorScalarIsoline(void);
~dtkVisualizationDecoratorScalarIsoline(void);
......@@ -35,6 +42,25 @@ public:
protected:
void draw(void) override;
public:
QStringList eligibleFieldNames(void);
QString currentFieldName(void);
QPair<double, double> currentRange(void);
vtkSmartPointer<vtkColorTransferFunction> currentColorTransferFunction(void);
vtkSmartPointer<vtkPiecewiseFunction> currentOpacityTransferFunction(void);
public:
bool setCurrentFieldName(const QString&);
void setCurrentColorTransferFunction(vtkSmartPointer<vtkColorTransferFunction>);
void setCurrentOpacityTransferFunction(vtkSmartPointer<vtkPiecewiseFunction>);
void setCurrentRange(double min, double max);
signals:
void currentFieldNameChanged(const QString&);
void currentColorTransferFunctionChanged(vtkColorTransferFunction *);
void currentOpacityFunctionChanged(vtkPiecewiseFunction *);
void currentRangeChanged(double, double);
protected:
class dtkVisualizationDecoratorScalarIsolinePrivate *d = nullptr;
};
......
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