From 9b8de4e3aa57690cace15fb6e57b4b6d2cb85465 Mon Sep 17 00:00:00 2001 From: geay Date: Wed, 25 Jun 2014 12:12:13 +0200 Subject: [PATCH] Bug correction : EDF 8407 PARAVIS - mantis 22610 --- src/Plugins/MEDReader/IO/vtkELNOFilter.cxx | 25 +++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/Plugins/MEDReader/IO/vtkELNOFilter.cxx b/src/Plugins/MEDReader/IO/vtkELNOFilter.cxx index 02241be2..aee584bc 100644 --- a/src/Plugins/MEDReader/IO/vtkELNOFilter.cxx +++ b/src/Plugins/MEDReader/IO/vtkELNOFilter.cxx @@ -24,10 +24,15 @@ #include "vtkPolyDataAlgorithm.h" #include "vtkPolyData.h" #include "vtkIdTypeArray.h" +#include "vtkFieldData.h" +#include "vtkCellData.h" +#include "vtkPointData.h" #include "vtkInformationQuadratureSchemeDefinitionVectorKey.h" #include "vtkQuadratureSchemeDefinition.h" #include "vtkUnstructuredGrid.h" +#include "MEDUtilities.hxx" + //vtkCxxRevisionMacro(vtkELNOFilter, "$Revision: 1.2.2.2 $"); vtkStandardNewMacro(vtkELNOFilter); @@ -116,7 +121,25 @@ int vtkELNOFilter::RequestData(vtkInformation *request, } start += np; } - + //// bug EDF 8407 PARAVIS - mantis 22610 + vtkFieldData *fielddata(usgIn->GetFieldData()); + for(int index = 0; index < fielddata->GetNumberOfArrays(); index++) + { + vtkDataArray *data(fielddata->GetArray(index)); + vtkInformation *info(data->GetInformation()); + const char *arrayOffsetName(info->Get(vtkQuadratureSchemeDefinition::QUADRATURE_OFFSET_ARRAY_NAME())); + bool isELNO(false); + if(arrayOffsetName) + { + vtkCellData *cellData(usgIn->GetCellData()); + vtkDataArray *offData(cellData->GetArray(arrayOffsetName)); + isELNO=offData->GetInformation()->Get(MEDUtilities::ELNO())==1; + } + if(isELNO) + { + pdOut->GetPointData()->AddArray(data); + } + } return 1; } -- 2.39.2