[vtk-developers] Filters and active attributes

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Tue Jul 10 10:08:06 EDT 2018


Folks,

I have a philosophical question. Suppose I am writing a filter that
takes in an input dataset and generates a new vector field for the
input. Such a filter will do something like the following in its
RequestData:

output->ShallowCopy(input);
output->GetPointData()->SetVectors(newVectors);

Now the question is this: if the input had an active vectors array
set, what should the output look like? Should it (a) drop the input
vectors array entirely or should it (b) pass the input vectors array,
just not flag it as active vectors and instead mark my "newVectors" as
the active vectors.

My vote is (b), currently most filters do (a). The curious side effect
of A is that if I apply a filter like vtkGlyph3D to a dataset, the
output will have arrays passed on from the input based on whether or
not they were marked as active attributes on the input!

The change to fix this is quite non-intrusive. We simply change the
behavior of SetAttribute/SetVector etc. in vtkDataSetAttributes.

Thanks in advance

Utkarsh


More information about the vtk-developers mailing list