From 6f6c63ca25c71031e389ff3ac4a40656ea0485d6 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Wed, 25 Jan 2017 10:11:56 +0100 Subject: [PATCH] [EDF14077] : vtkLongArray are managed by MEDWriter --- src/Plugins/MEDWriter/IO/vtkMEDWriter.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Plugins/MEDWriter/IO/vtkMEDWriter.cxx b/src/Plugins/MEDWriter/IO/vtkMEDWriter.cxx index d268f5e4..7adc0d57 100644 --- a/src/Plugins/MEDWriter/IO/vtkMEDWriter.cxx +++ b/src/Plugins/MEDWriter/IO/vtkMEDWriter.cxx @@ -22,6 +22,7 @@ #include "vtkAdjacentVertexIterator.h" #include "vtkIntArray.h" +#include "vtkLongArray.h" #include "vtkCellData.h" #include "vtkPointData.h" #include "vtkFloatArray.h" @@ -152,6 +153,13 @@ DataArrayInt *ConvertVTKArrayToMCArrayInt(vtkDataArray *data) std::copy(pt,pt+nbElts,ptOut); return ret.retn(); } + vtkLongArray *d1(vtkLongArray::SafeDownCast(data)); + if(d1) + { + const long *pt(d1->GetPointer(0)); + std::copy(pt,pt+nbElts,ptOut); + return ret.retn(); + } std::ostringstream oss; oss << "ConvertVTKArrayToMCArrayInt : unrecognized array \"" << typeid(*data).name() << "\" type !"; throw MZCException(oss.str()); @@ -201,7 +209,8 @@ DataArray *ConvertVTKArrayToMCArray(vtkDataArray *data) if(d0 || d1) return ConvertVTKArrayToMCArrayDouble(data); vtkIntArray *d2(vtkIntArray::SafeDownCast(data)); - if(d2) + vtkLongArray *d3(vtkLongArray::SafeDownCast(data)); + if(d2 || d3) return ConvertVTKArrayToMCArrayInt(data); std::ostringstream oss; oss << "ConvertVTKArrayToMCArray : unrecognized array \"" << typeid(*data).name() << "\" type !"; -- 2.39.2