Commit 160e6bb4 authored by KLOCZKO Thibaud's avatar KLOCZKO Thibaud

Add isolines !!!!

parent 594474b6
......@@ -25,7 +25,7 @@
#include <QtWidgets>
#include <vtkActor.h>
#include <vtkCellCenters.h>
#include <vtkCellDataToPointData.h>
#include <vtkCellData.h>
#include <vtkColorTransferFunction.h>
#include <vtkContourFilter.h>
......@@ -52,7 +52,7 @@ public:
public:
vtkSmartPointer<vtkContourFilter> isolines;
vtkSmartPointer<vtkCellCenters> cell_centers;
vtkSmartPointer<vtkCellDataToPointData> c2p_filter;
public:
QCheckBox *show_actor_cb = nullptr;
......@@ -72,7 +72,7 @@ dtkVisualizationDecoratorScalarIsolines::dtkVisualizationDecoratorScalarIsolines
d->isolines = vtkSmartPointer<vtkContourFilter>::New();
d->cell_centers = vtkSmartPointer<vtkCellCenters>::New();
d->c2p_filter = vtkSmartPointer<vtkCellDataToPointData>::New();
d->mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
d->mapper->SetInputConnection(d->isolines->GetOutputPort());
......@@ -160,7 +160,7 @@ void dtkVisualizationDecoratorScalarIsolines::setData(const QVariant& data)
d_func()->dataset = dataset;
d->cell_centers->SetInputData(dataset);
d->c2p_filter->SetInputData(dataset);
d->isolines_counts.clear();
for (auto field_name : d_func()->eligible_field_names) {
......@@ -265,9 +265,10 @@ bool dtkVisualizationDecoratorScalarIsolines::setCurrentFieldName(const QString&
if(support == Support::Point) {
d->isolines->SetInputData(d_func()->dataset);
} else if(support == Support::Cell) {
d->cell_centers->Update();
d->isolines->SetInputData(d->cell_centers->GetOutput());
d->c2p_filter->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_CELLS, qPrintable(field_name));
d->isolines->SetInputConnection(d->c2p_filter->GetOutputPort());
d->isolines->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS, qPrintable(field_name));
d->c2p_filter->Modified();
}
d->isolines->Modified();
......
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