From: Anthony Geay Date: Tue, 16 Jun 2020 11:38:38 +0000 (+0200) Subject: Deal with new VTK unstructuredgrid memory storage X-Git-Tag: V9_5_0rc2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9b0bebdd3b6e36c7662e635c7842c027d9799d3d;p=tools%2Fmedcoupling.git Deal with new VTK unstructuredgrid memory storage --- diff --git a/src/MEDCoupling_Swig/vtk2medcoupling.py b/src/MEDCoupling_Swig/vtk2medcoupling.py index 5b1069d23..1e3bb97f0 100644 --- a/src/MEDCoupling_Swig/vtk2medcoupling.py +++ b/src/MEDCoupling_Swig/vtk2medcoupling.py @@ -11,6 +11,8 @@ def mesh_convertor(fileName): return mesh_convertor_mem(ug),ug def mesh_convertor_mem(ug): + from distutils.version import LooseVersion + # pts = numpy_support.vtk_to_numpy(ug.GetPoints().GetData()) # cla = numpy_support.vtk_to_numpy(ug.GetCellLocationsArray()) @@ -20,6 +22,10 @@ def mesh_convertor_mem(ug): ct=mc.DataArrayInt(np.array(ctvtk,dtype=np.int32))[:] c=mc.DataArrayInt(conn)[:] ci=mc.DataArrayInt(cla)[:] + # for pv580 + if LooseVersion(vtk.VTK_VERSION) >= LooseVersion("8.90.0"): + ci = ci.deltaShiftIndex()+1 + ci.computeOffsetsFull() # vtk2med = mc.DataArrayInt(mc.vtk2med_cell_types()) #