needed for out of place behavior

pickle/deepcopy does not work
This commit is contained in:
Martin Diehl 2022-02-21 12:12:17 +01:00
parent 22fa9c9772
commit c975a5b437
1 changed files with 17 additions and 0 deletions

View File

@ -38,6 +38,23 @@ class VTK:
self.vtk_data = vtk_data self.vtk_data = vtk_data
def copy(self):
if isinstance(self.vtk_data,vtk.vtkImageData):
dup = vtk.vtkImageData()
elif isinstance(self.vtk_data,vtk.vtkUnstructuredGrid):
dup = vtk.vtkUnstructuredGrid
elif isinstance(self.vtk_data,vtk.vtkPolyData):
dup = vtk.vtkPolyData
elif isinstance(self.vtk_data,vtk.vtkRectilinearGrid):
dup = vtk.vtkRectilinearGrid
else:
raise TypeError
dup.DeepCopy(self.vtk_data)
return VTK(dup)
@property @property
def N_points(self) -> int: def N_points(self) -> int:
"""Number of points in vtkdata.""" """Number of points in vtkdata."""