[Paraview] Updating DataArraySelection Problem

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Mon Apr 25 11:39:11 EDT 2011


Brian,

The problem is the state of the "lbSelection" property. ParaView will
never clear the values in the property. The problem arises because
ParaView GUI assumes that such selection lists never changed. It won't
be too hard to fix, but would take some time.

ParaView provides another mechanism to help with such "double level"
selection for arrays. To see what I mean by this, open up tube.exii
from ParaViewData. You'll see that in the panel, it shows mutliple
tabs like "Blocks", "Assemblies", "Materials" etc. Selection on one
can affect the selection on others. So in your case, we can create two
tabs (I am just making things up here since I don't know what your
exact use case is), "Sources", "Arrays". Now the user can select
either the sources he wants or the arrays. If use chooses all the
arrays, then reader will read both the sources. If this setup works
for your use case, I can give you details on how to use it.

Another alternative is you take over the "lbSelection" property state
setup altogether. Override   pqObjectPanel::accept() and set the value
for the "lbSleection" property using the latest state of the
checkboxes making sure any old values are removed from the property.

Utkarsh


On Mon, Apr 25, 2011 at 9:19 AM, Brian C. Panneton (CONTR)
<brian.c.panneton.ctr at us.army.mil> wrote:
> I forgot to include the tarball.
>
> Brian C. Panneton (CONTR) wrote:
>>
>> While working on my custom panel, I thought I had everything correct to
>> allow a single QComboBox to populate a checkable QListWidget based on what
>> was selected. However, now I am running into an issue where items added to
>> the DataArraySelection do not get removed when I had thought they would. I
>> have an example reader plugin which shows the problem. It is based off of
>> the CSVImageReader, just so I can implement the panel.
>>
>> Once you load a file, the QComboBox and QListWidget get populated like
>> they should. Then if you press accept, you can see that the RequestData is
>> run with the correct information. Then if you switch to the second option in
>> the QComboBox, you can see that the QListWidget gets repopulated correctly.
>> Then if you hit apply again, it seems to prepend the new options to the
>> DataArraySelection when it should delete the current list and then add the
>> new items. At this point if you check any box, updateSelection segfaults
>> since there are more items in the DataArraySelection then on the GUI.
>>
>> In my SetSource function, you can tell that there are only two items in
>> the DataArraySelection. SetSource is the only place that adds/removes from
>> the DataArraySelection, so I'm stumped as to why the previous items are
>> still there.
>>
>> I included a tarball of the test. It contains a csvim file to load.
>> Quick Steps: Load Plugin, Load csvim file, Press Accept, Switch QComboBox
>> to 'Value 2', Press Accept, Click first checkbox = segfault.
>>
>> Any help would be appreciated.
>> Thanks,
>> Brian Panneton
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the ParaView Wiki at:
>> http://paraview.org/Wiki/ParaView
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.paraview.org/mailman/listinfo/paraview
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>


More information about the ParaView mailing list