Trying to use the vtkInformation/vtkInformationKey system for own purposes

VTK/Paraview comes with a pretty nice information exchange system, based on the
vtkInformation and vtkInformationKey classes. In my own custom application, I would like to make use of it - if possible! -, instead of re-inventing one more wheel. I found this https://www.kitware.com/a-vtk-pipeline-primer-part-1/ to be a very helpful introduction into the subject.

1) information on the server side, down the pipeline

I have a source and an attached filter. The source produces a vtkTable, and the filter takes it as input. From the outputInfo of the source, I am getting access to the vtkTable object that I am supposed to fill with stuff, and from the inputInfo of the filter I can retrieve a pointer to a vtkTable with the stuff that I filled in before.

Amazing: the pointers are NOT the same! Looks like the input table of the filter is indeed another table than the output of the source (just a “shallow copy” of it?).

Not any more so amazing: If I am adding some custom information item (key, data) to the information object of the output table of the source, I cannot retrieve that information item from the input table of the filter…

This looked like a good way to “send” some info from the source to the filter, but it does not work: Is there another way provided in the pipeline architecture logic?

2) Passing information from server to client side

I have a filter class that again takes a vtkTable as input. Some of the properties are defined with their own domain, which is implemented in a vtkSM<domain> class. This domain class has a IsFilteredArray() function which receives an info object of vtkPVDataInformation class, with lots of info about the input table.

I know that the filter class object sits on the server side, and the domain class object sits on the client side, and it is always tricky to pass information between the two, but Paraview does a nice job of passing a nice little set of information about the table, including even the first 6 data rows - avoiding to push the entire data from the server to the client!

Again I would like to send some piece of custom information data from the server side to that domain function: Is there any way to do this within the software design logic of Paraview? Of course I can always “break the rules”, but with this, I am afraid to make things at the end even more complex…

Hi @cobo

  1. Info down pipeline

To transfer information for a filter to the next filter,use the “KEYS_TO_COPY” information key:

It will not go through the whole pipeline though.

It is possible to have keys copy themselves over and over but you need to create your own key class implementing CopyDefaultInformation (or use a existing one like vtkInformationDataObjectMetaDataKey)

  1. Info from server to client

Use Information Properties to send information from the server to the client. You can take a look at Examples/Plugins/PropertyWidgets/Plugin/PropertyWidgetsFilter.xml and it’s information_only property.

Thank you very much for these hints - I will immediately go and try them out!

My “solution” so far was rather ugly: I attached a “field data” object to the table that was passed to the next filter, with one attribute and one single row. That data item could be read as well in the next “downstream” filter, and it made it’s way also into a “domain” class that is used in a property widget, because it seems that the first 6 rows of any data table (including field data etc.) are accessible through some default information passing mechanism.

However, your solution looks much nicer to me!