From: Anthony Geay Date: Wed, 25 Jan 2017 09:11:56 +0000 (+0100) Subject: [EDF14077] : vtkLongArray are managed by MEDWriter X-Git-Tag: SHAPER_2.7.0~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6f6c63ca25c71031e389ff3ac4a40656ea0485d6;p=modules%2Fparavis.git [EDF14077] : vtkLongArray are managed by MEDWriter --- 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 !";