Interactively pick single cells from an unstructured grid

For a number of my custom filters users need to pick a number of cells from an unstructured grid interactively. So far I am using the ParaView selection system for this: the user picks cells and the filter can process it.

One problem with this was initially the fact that selections cannot be saved to a state file, so I managed to save the list of cell IDs as a property, and the fact that always only one selection can exist in a pipeline is overcome by some tricky ways to restore the selection programmatically if the user displays an item, based on that IDs property.

However, it turns out that this “hackish” feature tends to always add some instability to the pipelines: users tend to lose their IDs property and the function of the pipeline “breaks down”. Mostly not, but sometimes, and people always have to be careful.

So what I am dreaming about: Some kind of separate “interaction system” that allows to select grid cells in a way that does not depend on the common ParaView selection system. A bit in a way like the “clip” filter has some interactive ways to specify the parameters of the clip surface etc.

I know that such things can be rather tricky, so I did not “dare” such a project yet. Anyway, if somebody could give me some helpful hints towards examples and/or tutorials, I would consider to give it a try!

This question did not get any response, so I would like to rephrase it to make it more easily understandable.

Some filters have obviously associated custom property widgets, and these property widgets are “linked” to interactive elements in the 3D view, like defining the cut plane for the “slice” filter - even in a very tricky way, allowing for plane, sphere, tube etc. to be specified interactively.

So what I am looking for would be a good beginner’s example of a property widget that uses such an interactive input widget in the 3D view, at first I would say "no matter what. What I finally want to define interactively is a list of cell ids by “picking” them with the mouse.

You need to defined and use your own VTK widgets in the XML, then links them with the property in the XML as well. Not trivial but you can find examples in 3d_widgets.xml