[Paraview-developers] Properties Question

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Sun Mar 9 15:22:59 EDT 2014


Joshua,

Just to make it easier to discuss, let's take a specific case:

We have a VTK algorithm, *vtkMyFilter*. It has a property *Alpha* which
calls the method *SetAlpha*. When *SetAlpha* is classed, *vtkMyFilter*computes
*BetaRange*. On our proxy, we have  an information property
*BetaRangeInfo*which is calls
*GetBetaRange*. We have another property *Beta* which we want to reset to
middle of the *BetaRange * every time *Alpha* is changed by the user.

Let's say we let pqPropertiesPanel create a default widget for *Alpha.* Now,
when the user changes the widget, *SetAlpha* isn't immediately called. It
will be called only when the user hits the Apply button (or auto-apply is
ON). So even if we called UpdatePropertyInformation() on the filter
proxy, *BetaRangeInfo
*will not reflect any changes.

So first step, we'll need to create a custom subclass of pqPropertyWidget
that forces auto-update by calling
pqPropertyWidget::setAutoUpdateVTKObjects(true),
pqPropertyWidget::setUseUncheckedProperties(false) and then overridding
those methods so that pqProxyWidget::setApplyChangesImmediately(...)
doesn't override that behavior.

Next, in this custom widget for *Alpha,* we will need to
override pqPropertyWidget::apply() to call
proxy->UpdatePropertyInformation().

Moving on, we now need *Beta* to reset whenever *BetaRangeInfo* changes. If
possible, I tend to do this in domain. Write a domain that depends on the
info property and the domain will update when the  info property changes.
But since we don't merely want to change the domain, but also the property
value, we can create a custom widget for *Beta* where we add observers to
the info property to update the widget value every time the info property
changes as appropriate.

Hope that helps.
Utkarsh



On Thu, Mar 6, 2014 at 3:00 PM, Joshua Murphy <
Joshua.Murphy at lasp.colorado.edu> wrote:

> Hello,
>
> I am working on some properties for a custom filter, and I am trying to
> figure out how to get the following functionality.
>
> I need to be able to:
>
>
>    1. set a property to change a condition in the filter
>    2. Have that changed condition update information within another
>    property to display on the panel.
>
>
> This would be akin to the way manipulating the plane in a slice filter
> render view updates the position of the plane in the properties panel.
>
> So, how do I force the properties panel to update to new values within
> information properties when values change?
>
> Thanks,
> Josh
>
> _______________________________________________
> Paraview-developers mailing list
> Paraview-developers at paraview.org
> http://public.kitware.com/mailman/listinfo/paraview-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20140309/0007a9fe/attachment.html>


More information about the Paraview-developers mailing list