Selection in ColumnBasedSelection chart with multiple sources behave incorrectly
When selecting a line in a column based selection chart, ParaView behave incorrectly which provide unexpected results.
Steps to reproduce:
- Run ParaView
- Load BagPlotAndViewsFilters plugin (only ColumnBasedSelection chart in native paraview)
- Open sineWaves.csv, Apply
- Filters -> ExtractBagPlots -> Apply
- Filters -> PassArray, select only y11, Apply
- click on ExtractBagPlots in pipeline browser to make it active
- Filters -> PassArray, select only y12, Apply
- In a functionnalBagChartView, show only PassArrays1 and PassArrays2
- in PassArrays1, show y11
- in PassArrays2, show y12
- Select ExtractBagPlots as active source in pipeline browser
- Create an empty selection using rectangle selection
- PassArrays2 is selected, unexpected
- Select ExtractBagPlots as active source in pipeline browser
- Create a selection of y11 using rectangle selection
- PassArrays2 become active and a y12 appears selected, unexpected
- in PassArrays2, hide y12
- repeat selection steps, behavior is the same, still unexpected
- in Pipelinebroswer, hide PasseArrays2
- Create an empty selection using rectangle selection
- PassArrays1 is selected, unexpected
- Select ExtractBagPlots as active source in pipeline browser
- Create a selection of y11 using rectangle selection
- PassArrays1 become active and a y11 appears selected, expected
All this behavior is caused by a "non-selecting" loop in pqContextView::setSelection, where the last representation is considered to be selected, not the actual selected representation. https://gitlab.kitware.com/paraview/paraview/-/blob/master/Qt/Core/pqContextView.cxx#L204
The selection failure of this issue may be related to functionnalBagPlot code specifically, but the active source change is not.
Edited by Mathieu Westphal (Kitware)