From 4795987f3467ceb005f996d9e396feafa9dc3271 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Tue, 27 Mar 2018 08:22:31 +0200 Subject: [PATCH] Improve SimpleMode plugin ergonomy --- src/Plugins/SimpleMode/IO/vtkSimpleMode.cxx | 9 ++++++--- .../ParaViewPlugin/Resources/SimpleModeServer.xml | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Plugins/SimpleMode/IO/vtkSimpleMode.cxx b/src/Plugins/SimpleMode/IO/vtkSimpleMode.cxx index 7942578b..9a351f4b 100644 --- a/src/Plugins/SimpleMode/IO/vtkSimpleMode.cxx +++ b/src/Plugins/SimpleMode/IO/vtkSimpleMode.cxx @@ -96,7 +96,6 @@ vtkSmartPointer ForceTo3Compo(vtkDoubleArray *arr) if(nbCompo==3) { vtkSmartPointer ret(arr); - arr->Register(0); return ret; } if(nbCompo==6) @@ -410,12 +409,16 @@ int vtkSimpleMode::RequestData(vtkInformation *request, vtkInformationVector **i vtkDataArray *dummy(0); ExtractInfo3(ds,this->Internal->getFieldForReal(),dummy,idx2); } - ds->GetPointData()->SetActiveAttribute(idx2,vtkDataSetAttributes::SCALARS); // vtkInformation *outInfo(outputVector->GetInformationObject(0)); vtkPolyData *output(vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()))); output->ShallowCopy(ds); - + + vtkDataArray* array = ds->GetPointData()->GetArray(idx2); + vtkSmartPointer result = vtkSmartPointer::Take(vtkDataArray::CreateDataArray(array->GetDataType())); + result->ShallowCopy(array); + result->SetName("Result"); + output->GetPointData()->SetScalars(result); } catch(MZCException& e) { diff --git a/src/Plugins/SimpleMode/ParaViewPlugin/Resources/SimpleModeServer.xml b/src/Plugins/SimpleMode/ParaViewPlugin/Resources/SimpleModeServer.xml index 45b9c0a3..68a0714a 100644 --- a/src/Plugins/SimpleMode/ParaViewPlugin/Resources/SimpleModeServer.xml +++ b/src/Plugins/SimpleMode/ParaViewPlugin/Resources/SimpleModeServer.xml @@ -61,7 +61,6 @@ Select the array that represents the requested mode. command="SetAnimationTime" default_values="0" name="AnimationTime" - panel_visibility="advanced" number_of_elements="1"> The value of this property sets the scale factor applied for all nodes displacement. -- 2.39.2