[Paraview-developers] Where does the vtkSelection come from?
Utkarsh Ayachit
utkarsh.ayachit at kitware.com
Tue Jan 17 17:03:02 EST 2017
The vtkSelection comes from a "Selection Source" proxy that ParaView
internally creates that defines the selection. sources.xml [1] defines
several types of selection sources, e.g. ThresholdSelectionSource,
IDSelectionSource, SelectionQuerySource.
To make your filter behave like the "Extract Selection" filter where
it automatically sets up the selection, make sure you have the
<SelectionInput> hint [2].
Utkarsh
[1] https://gitlab.kitware.com/paraview/paraview/blob/master/ParaViewCore/ServerManager/SMApplication/Resources/sources.xml#L1590-1904
[2] https://gitlab.kitware.com/paraview/paraview/blob/master/ParaViewCore/ServerManager/SMApplication/Resources/filters.xml#L11911-11916
On Tue, Jan 17, 2017 at 11:45 AM, Cornelis Bockemühl
<cornelis.bockemuehl at gmail.com> wrote:
> All day I am already struggling now with some possibly very "simple"
> problem: I am trying to write a filter that applies some operations only to
> selected cells of an "unstructured grid".
>
> I am taking the "extract selection" filter as an example. This filter takes
> the "data" stuff at input port 0 and a vtkSelection object at input port 1,
> then does the proper processing. However, from a user perspective the filter
> is attached to one single input data set with selections. Like exactly the
> unstructured grid with some cells selected: I can easily extract them with
> the "extract selection" filter - and I do not have to specify a second data
> item for input port 1!
>
> But if I am simulating exactly the code in the server XML (specifying two
> input ports, for "input" and "selection"), then copying all the relevant
> stuff from the cxx files of vtkPVExtractSelection.cxx,
> vtkExtractSelection.cxx and vtkExtractSelecitonBase.cxx - I do not get the
> same behaviour!
>
> Instead I am getting exactly what I would have expected otherwise: my filter
> asks for a second input data item - but what should I choose? And then it
> stops because indeed it does not find any vtkSelection data object at port
> 1.
>
> While the latter looks somehow logical to me I still wonder how the extract
> seleciton filter does the apparent "magic" of having that selection object
> at port 1 for further processing!
>
> Any hint where I should have a look into the code, or what else I might have
> forgotten?
>
> As I said I simulated the server XML and the cxx code, but now I guess that
> maybe there are still other places in the code where I should have a look??
>
> Thanks in advance for any helpful hints!
> Cornelis
>
> --
> Cornelis Bockemühl
> Basel, Schweiz
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at:
> http://markmail.org/search/?q=Paraview-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview-developers
>
More information about the Paraview-developers
mailing list