consistent code
This commit is contained in:
parent
118247111b
commit
38c7e6a8e4
|
@ -558,20 +558,18 @@ class VTK:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
cell_data = self.vtk_data.GetCellData()
|
cell_data = self.vtk_data.GetCellData()
|
||||||
for a in range(cell_data.GetNumberOfArrays()):
|
if label in [cell_data.GetArrayName(a) for a in range(cell_data.GetNumberOfArrays())]:
|
||||||
if cell_data.GetArrayName(a) == label:
|
try:
|
||||||
try:
|
return vtk_to_numpy(cell_data.GetArray(label))
|
||||||
return vtk_to_numpy(cell_data.GetArray(a))
|
except AttributeError:
|
||||||
except AttributeError:
|
vtk_array = cell_data.GetAbstractArray(label) # string array
|
||||||
vtk_array = cell_data.GetAbstractArray(a) # string array
|
|
||||||
|
|
||||||
point_data = self.vtk_data.GetPointData()
|
point_data = self.vtk_data.GetPointData()
|
||||||
for a in range(point_data.GetNumberOfArrays()):
|
if label in [point_data.GetArrayName(a) for a in range(point_data.GetNumberOfArrays())]:
|
||||||
if point_data.GetArrayName(a) == label:
|
try:
|
||||||
try:
|
return vtk_to_numpy(point_data.GetArray(label))
|
||||||
return vtk_to_numpy(point_data.GetArray(a))
|
except AttributeError:
|
||||||
except AttributeError:
|
vtk_array = point_data.GetAbstractArray(label) # string array
|
||||||
vtk_array = point_data.GetAbstractArray(a) # string array
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# string array
|
# string array
|
||||||
|
|
Loading…
Reference in New Issue