[Paraview] New panel, widget update
Takuya OSHIMA
oshima at eng.niigata-u.ac.jp
Sat Aug 17 07:56:33 EDT 2013
I am now trying to migrate my custom reader panel to the new
architecture. In the old panel, my custom panel code rearranged the
auto-generated layout of properties as attached screenshot to keep the
height of the panel short. Note lined-up controls at the top,
two-column layout of array selections at the middle, and checkboxes on
a collapsible panel at the bottom. This rearrangement was easy because
the custom code was a subclass of a panel (a
pqAutoGeneratedObjectPanel). I believe this type of saving screen
space is more important for the new properties panel which combines
proxy and display properties in a single panel.
In the new panel, if I am not wrong a customization has to be done per
widget basis. I thought I'd create a propertyWidget and let its
constructor
MyPropertyWidget::MyPropertyWidget(vtkSMProxy *smproxy, vtkSMProperty *smproperty, QWidget *parentObject=0)
do the rearrangement, i.e. I hoped I could obtain the parent panel
object by parentObject of the above signature. However, I always
get a null pointer.
Perhaps this is because in pqProxyWidget::createWidgetForProperty() in
pqPropertyWidget.cxx, the createdWidgetForProperty() call to
pqPropertyWidgetInterface is not given parentObj unlinke other
property widgets (pqDoubleVectorPropertyWidget etc). Why? - Or is
there an alternative?
Takuya OSHIMA, Ph.D.
Faculty of Engineering, Niigata University
8050 Ikarashi-Ninocho, Nishi-ku, Niigata, 950-2181, JAPAN
From: Takuya OSHIMA <oshima at eng.niigata-u.ac.jp>
Subject: Re: [Paraview] New panel, widget update
Date: Thu, 08 Aug 2013 10:02:37 +0900 (JST)
> Utkarsh, thanks for the input about the behavior.
>
>> If you can point me to the code, I wouldn't mind taking a look. Also,
>> should we be moving this reader/panel code into ParaView itself?
>
> The code is available from (it's still an SVN project):
> svn checkout svn://svn.code.sf.net/p/of-interfaces/code/trunk/vtkPOFFReader
>
> I would be _very happy_ if you (or someone) integrate the code into
> ParaView itself.
>
> Takuya OSHIMA, Ph.D.
> Faculty of Engineering, Niigata University
> 8050 Ikarashi-Ninocho, Nishi-ku, Niigata, 950-2181, JAPAN
>
> From: Utkarsh Ayachit <utkarsh.ayachit at kitware.com>
> Subject: Re: [Paraview] New panel, widget update
> Date: Wed, 7 Aug 2013 11:20:57 -0400
>
>> Takuya,
>>
>> You can still continue to do what you're doing. You can add a custom
>> widget for some property that still listens to the dataUpdated() event
>> from the pqPipelineSource corresponding to the reader's proxy. But I
>> don't think logic, as this this for adding text to views should be in
>> the panel. It should be a separate component, e.g. the behaviors
>> (http://www.paraview.org/ParaView3/Doc/Nightly/www/cxx-doc/group__Behaviors.html).
>> That makes it possible to handle the cases where multiple views are
>> created/added more gracefully than one could with the panel.
>>
>> If you can point me to the code, I wouldn't mind taking a look. Also,
>> should we be moving this reader/panel code into ParaView itself?
>>
>> Utkarsh
>>
>> On Sat, Aug 3, 2013 at 10:23 PM, Takuya OSHIMA
>> <oshima at eng.niigata-u.ac.jp> wrote:
>>> Hi Felipe, Utkarsh,
>>>
>>> I'm interested in this too because the custom panel of my reader (the
>>> SourceForge version of the OpenFOAM reader) does a similar thing. In
>>> my scenario I wanted to add some text actors on the 3D views outside of
>>> the pipeline. The world coordinates of the actors are calculated by
>>> the reader during update and the panel pulls the results after the
>>> update. Then the panel instructs back the server to generate text
>>> actors outside of the pipeline and to superimpose them on the 3D
>>> views.
>>>
>>> I haven't tried the new panel architecture yet but in the old
>>> architecture, I created a slot (named onDataUpdated()) in my custom
>>> panel code and connected it to the dataUpdated() signal of the
>>> corresponding pqPipelineSource of the reader proxy (not the
>>> dataUpdated() of the pqProxyPanel). The methodology worked well for
>>> the old architecture. I wonder if by any chance it also works for the
>>> new one or not?
>>>
>>> Takuya OSHIMA, Ph.D.
>>> Faculty of Engineering, Niigata University
>>> 8050 Ikarashi-Ninocho, Nishi-ku, Niigata, 950-2181, JAPAN
>>>
>>> From: Utkarsh Ayachit <utkarsh.ayachit at kitware.com>
>>> Subject: Re: [Paraview] New panel, widget update
>>> Date: Thu, 1 Aug 2013 14:21:45 -0400
>>>
>>>> The short answer is this is not possible. The properties panel is not
>>>> really meant to show results produced by the filter/reader. You could
>>>> add a "information panel" i.e. a new dock widget that shows all such
>>>> relevant information ad then you can use custom information properties
>>>> on the proxy for the reader to query the current value for f2, for
>>>> example.
>>>>
>>>> We could extend the pqProxyWidget class to show widgets for
>>>> information-only properties, but that too won't solve your problem
>>>> since ParaView will not know when the information has changed.
>>>> Currently, it will do that when the property on that proxy was changed
>>>> and the user hit apply -- which is a good time to assume some of the
>>>> information-properties may have changed.
>>>>
>>>> Sorry, I don't have a direct answer for you, but I hope that gives you
>>>> some ideas.
>>>>
>>>> Utkarsh
>>>>
>>>> On Thu, Aug 1, 2013 at 8:43 AM, felipe.bordeu at ec-nantes.fr
>>>> <felipe.bordeu at ec-nantes.fr> wrote:
>>>>> Also, had I said before, my reader y capable of generate data based in the value of the slider. This value is send using a keyinformation downstream in the pipeline. Then I have an optimizer fiter capable of setting automatically this value(sending a request upstream). I whould like the properties panel to be updated with the final valiue.
>>>>>
>>>>> Felipe
>>>>> -----Message d'origine-----
>>>>> De:Felipe Bordeu
>>>>> Envoyé: 01/08/2013, 14:33
>>>>> A: Felipe Bordeu Weldt
>>>>> Sujet: RE: [Paraview] New panel, widget update
>>>>>
>>>>> -----Message d'origine-----
>>>>> De:Felipe Bordeu Weldt
>>>>> Envoyé: 30/07/2013, 21:23
>>>>> A: paraview at paraview.org
>>>>> Sujet: Re: [Paraview] New panel, widget update
>>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> the short story:
>>>>>
>>>>> In my custom reader select some values using some sliders. Then push
>>>>> the Apply, at that moment, I (I mean the reader) read the file make
>>>>> the calculations for the construction of a field and set the sliders
>>>>> to the real final values calculated by the reader (so the user is
>>>>> aware of with values are used).
>>>>>
>>>>> the long story:
>>>>>
>>>>> Ok, my solution can be written like this T(x,y,z,r,s,t) =
>>>>> f1(x,y,z)*f2(r,s,t) (this is a separation of variables). where f1 is
>>>>> a nodalfield in a mesh on the x,y,z space, and f2 is a nodalfield in a
>>>>> different mesh in the (r,s,t) space.
>>>>> So my file holds 2 (or more) meshes with associated fields.
>>>>> My field T (that lives in a 6 dimension space) cant be visualized in
>>>>> ParaView (or any visualization tool). So my idea is to fix (r,s,t) so
>>>>> the field T becomes T(x,y,z,r0,s0,t0) = T(x,y,z) (this is a 3D field
>>>>> and can be visualized in ParaView).
>>>>>
>>>>> In my custom reader I use 3 slider to select the values of r,s,t, and
>>>>> then internally I search for the closest point in the mesh (to get the
>>>>> value of f2). And with the older panel I used to update the slider so
>>>>> the user can know the point that is used for the calculation.
>>>>>
>>>>> In this video you can see the reader in action http://www.youtube.com/watch?v=o6Vzww_cmhA#at
>>>>> =26 (details in http://rom.research-centrale-nantes.com/overview/)
>>>>> but in this case I use the interpolation in the r,s,t space so no
>>>>> update is done.
>>>>>
>>>>>
>>>>> It this clear enough?
>>>>>
>>>>> Felipe
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Le 30 juil. 13 à 16:01, Utkarsh Ayachit a écrit :
>>>>>
>>>>>> Felipe,
>>>>>>
>>>>>> Can you elaborate on why you need to do this?
>>>>>>
>>>>>> Thanks
>>>>>> Utkarsh
>>>>>>
>>>>>> On Tue, Jul 30, 2013 at 2:35 AM, Felipe Bordeu Weldt
>>>>>> <felipe.bordeu at ec-nantes.fr> wrote:
>>>>>>> Hello,
>>>>>>>
>>>>>>> In the old panel system, the pqProxyPanel has a
>>>>>>> updateInformationAndDomains() and the dataUpdated() to update the
>>>>>>> panel AFTER the algorithm is executed.
>>>>>>> How can I achieve this in the new panel architecture ??
>>>>>>>
>>>>>>> My new panel is a subclass of pqPropertyWidget.
>>>>>>>
>>>>>>> Felipe
>>>>>>> _______________________________________________
>>>>>>> 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
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: customPanel.png
Type: image/png
Size: 93117 bytes
Desc: not available
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130817/c2901a69/attachment-0001.png>
More information about the ParaView
mailing list