I’m making a “source” object, similar to vtkSphereSource
, so I have set up the requestData
method to construct and return a vtkPolyData
(“return” in the sense of filling the output parameter outData
)
Now every time I modify the source object, it rebuilds that vtkPolyData
completely. But I only need it to update the points array. It doesn’t need to rebuild topology or normals.
What’s the proper vtk way to make requestData
build everything initially, but then only rebuild the points array when the object gets modified?
(This is vtk.js, btw)
EDIT: One thought I had is to make two filters. One source object generates a vtkPolyData
with topology and normals, but no points (or a zero-initialized points array). Then a filter that takes a vtkPolyData
and just populates it with points. The properties that only affect the points array can be managed by the second filter, and updating those would only update the points array.
But is this the correct vtk way of thinking?
I don’t see it done elsewhere. For example, if I’m reading the code correctly, calling setRadius
on vtkSphereSource
causes it to rebuild an entire vtkPolyData
, even though it’s only the points array that changes, while normals and topology remain the same.