Replacement for IsFieldNeeded

Is there a replacement attribute or method for the IsFieldNeeded test in vtkCPInputDataDescription given that it is deprecated?

This test seems ubiquitous in Catalyst examples, but I can’t figure out what I am supposed to do now to test if I need to add a field.

The old signature for the IsFieldNeeded method only took in a const char* for the name of the field and that was deprecated since it wasn’t descriptive enough. The new, replaced method is actually still called IsFieldNeeded but now also takes in a type which corresponds to the vtkDataObject::AttributeTypes enum. The basic idea here is that a simulation could provide the same field name in both a point data field and a cell data field and in the old IsFieldNeeded form there was no way of knowing which one the adaptor should provide.

Thanks, Andy!! It will be a relief to clean up my logs again… Are there any documented examples using the new arguments?

If you do a search through the examples under the Examples/Catalyst directory of the main ParaView source code for IsFieldNeeded you’ll see some examples.

Anyone coming across this in the future, the usage is just

isFieldNeeded(“Pressure”, vtkDataObject::POINT)

or CELL or whatever your data type