Logging error messages for empty input data

Some filters, such as vtkTransformPolyDataFilter, logs lots of No input data messages when the input polydata happens to be empty. These messages clutter the application log and causes significant performance drop.

To avoid this error message, we need to add explicit update of the filter pipeline whenever the input data is changed (so that we can hide he actor, thus preventing update of the offending filter). However, this means that we must update the pipeline every time when input data is changed, instead of relying on the renderer pulling the data when needed. This causes performance degradation for real-time rendering of large data sets.

Having an empty input polydata is a completely valid input for vtkTransformPolyDataFilter (the output is an empty polydata). What is the reason error messages were added? Can we remove the error messages or at least convert to debug message?

There are a few more filters that may suffer from this issue, such as vtkmWarpVector, vtkHedgeHog, vtkWarpLens, vtkWarpTo, vtkWarpVector, vtkWeightedTransformFilter, vtkSMPWarpVector, vtkLabelPlacer. Hundreds of other filters work properly and don’t log these kind of unnecessary messages.

3 Likes

I agree, these shouldn’t be warnings/errors. I think the idea was to try to be helpful and signal when a dataset was empty with the thought that it would be useful for debugging filters upstream. However, as you cite, they can be very annoying and detrimental to an application.

How about changing the offending vtkWarningMacro/vtkErrorMacros to vtkDebugMacro or even the newer vtkLog(INFO, ...)?

Thank you for the response. I can create a pull request that changes the log type.

Currently, the filter returns early if no input is found:

I guess we should change this so that for an empty input point list is the output is set to empty, too.

2 Likes

How about in this case just shallow copy the input to the output and return? Then you won’t have to add a lot of if/else’s below to handle a null newPts object further down.