Once I learned that in the SM XML file for a filter that takes some data plus a selection input, this would describe the selection input:
<InputProperty command="SetSelectionConnection"
name="Selection">
<ProxyGroupDomain name="groups">
<Group name="sources"/>
<Group name="filters"/>
</ProxyGroupDomain>
<DataTypeDomain name="input_type">
<DataType value="vtkSelection"/>
</DataTypeDomain>
<Documentation>
The input that provides the selection object.
</Documentation>
<Hints>
<SelectionInput/>
</Hints>
</InputProperty>
In the C++ code I can access this input then as a vtkSelection
object and deal with it accordingly. I did all this, and in order to make sure I have nothing forgotten, I compared with the existing code of the Extract Selection
filter.
However there is now one thing different: If I select some geometry in the pipeline, then select some cells in that geometry with any of the selection tools, then add the Extract Selection
filter to my pipeline, I will see immediately my selection also in the “SelectionInput” widget of the properties panel.
If I do exactly the same thing with my own plugin, the “SelectionInput” widget is initially empty and I will see my previously defined selections only after pressing the “Copy Active Selection” button.
My question is: What is the trick to do this initial “Copy Active Selection” like the “Extract Selection” filter does it? Comparing as much code as I want, I do not find the difference!