Hello, I have defined a subclass of
vtkPolyData in my Python project. It works well and I am able to use standard
vtkXMLPolyDataWriter to save it to disk. However, when reloading the objects from file, I would like to cast the
vtkPolyData that I get from the
vtkXMLPolyDataReader to my subclass. I figured out it would be as simple as:
my_object = MyClass() # MyClass is derived from vtkPolyData pd_reader = vtk.vtkXMLPolyDataReader() pd_reader.SetFileName(<my_file_name>) pd_reader.Update() my_object.SafeDownCast(pd_reader.GetOutput()) my_object.Modified()
But I always get an empty
my_object (and I have checked: the output from
pd_reader is a proper
Could somebody help?
Thanks very much!