[Paraview] Custom Reader Issue

Takuya OSHIMA oshima at eng.niigata-u.ac.jp
Fri Mar 26 00:58:53 EDT 2010


Mark,

> There is only one side-effect that I haven't been able to work around:
> Updating the vtkDataArraySelection in this manner *will* cause the
> reader panel to notice that it has been changed (lighting up the Apply
> button). Pressing the Reset button fixes that while still retaining the
> changes that your custom Qt bits did.
> 
> It would still be nice to figure how to avoid this last bit.
> Perhaps someone from the mailing list, or from KitWare, has a good
> suggestion.

I haven't taken the problem so serious since (as you say) it can be
easily cancelled by pressing Reset, but if you do really care (I
recall you mentioned the problem some time ago as well), it looks like
it is because the client side essentially is not made to respect the
(un)modified state of the vtkDataArraySelection in the server side. As
you well know, vtkDataArraySelection remains unmodified when a new
array is added by AddArray(). If I try to fix the problem by somewhat
emulating the behavior in client side, it could be as attached
(pqSignalAdaptorSelectionTreeWidget.cxx.diff).

But I am unsure if it is a right fix and will not cause any unintended
side effects. Perhaps someone from the mailing list, or from KitWare,
has a good suggestion. :)

Anyway, I submitted a bug: http://paraview.org/Bug/view.php?id=10462

Takuya

Takuya OSHIMA, Ph.D.
Faculty of Engineering, Niigata University
8050 Ikarashi-Ninocho, Nishi-ku, Niigata, 950-2181, JAPAN

From: "Mark Olesen" <Mark.Olesen at faurecia.com>
Subject: Re: [Paraview] Custom Reader Issue
Date: Wed, 24 Mar 2010 13:21:45 +0100

> On Wed, 2010-03-24 at 12:02 +0000, Adriano Gagliardi wrote:
>> Yeah, that's what I am using at the moment. However, when I select my mesh
>> file initially using File->Open, RequestInformation is called. At this point
>> in time, no data file has been selected. I then have a vtkSetStringMacro
>> that allows me to browse for a second input file (the data file). However,
>> for this to then be read in to obtain the variables contained within (hence
>> populate the point array table), I need to click apply again so that
>> RequestInformation is called. I was just wondering if there was a workaround
>> so I could avoid having to reapply the filter.
> 
> Yes and no.
> 
> You should take a look at how to write custom panels
> http://www.cmake.org/Wiki/CustomObjectPanels
> 
> This will let you add various Qt elements to the reader panel.
> If you mark their corresponding properties with << is_internal="1" >> in
> the SM xml, you can set/unset the values directly.
> One of the elements could, for example, be used to populate/repopulate
> some vtkDataArraySelection containers.
> 
> For these purposes, inheriting from pqAutoGeneratedObjectPanel should be
> sufficient.
> 
> There is only one side-effect that I haven't been able to work around:
> Updating the vtkDataArraySelection in this manner *will* cause the
> reader panel to notice that it has been changed (lighting up the Apply
> button). Pressing the Reset button fixes that while still retaining the
> changes that your custom Qt bits did.
> 
> It would still be nice to figure how to avoid this last bit.
> Perhaps someone from the mailing list, or from KitWare, has a good
> suggestion.
> 
> /mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pqSignalAdaptorSelectionTreeWidget.cxx.diff
Type: text/x-patch
Size: 3091 bytes
Desc: not available
URL: <http://www.paraview.org/pipermail/paraview/attachments/20100326/47f011e0/attachment.bin>


More information about the ParaView mailing list