Is it possible to write a ParaView filter in such a way that the number of output pipes is defined only during execution of the RequestData(...)
function?
Or in more general terms: a filter where the number of output pipes depends on the input data.
The opposite is obviously different and easier: a filter where the number of input pipes is not fixed - like with the vtkAppendDataSets
filter. The difference is obviously that the number of input pipes is still clear already before any further calculations are done, calling the Update()
function which in turn results in calling the RequestData(...)
function.
Possible use case: you have an input data set with an attribute that can act like a category, let’s call it “Level”, and then we want to split that input data set into as many data sets as we have levels. The specific use case that I have in mind is actually a “reader” type filter, i.e. which has an input file as input, but that may not be such a big difference.
So what would be requred is a function call that happens BEFORE the output data objects are generated, but where the input data are already known so the number of “Levels” could be counted.
Ideally there would be an existing filter that does the trick, but so far I did not find one!
In the past I had only cases that were slightly easier, like “minimum 4 and maximum 6 output pipes”: In these cases I specified the filter to have 6 output pipes which in some cases were simply not all filled (and for some I did not open a view by default, with some Hint in the SM XML file).