[Paraview-developers] Properties Question
Joshua Murphy
Joshua.Murphy at lasp.colorado.edu
Mon Mar 10 12:57:42 EDT 2014
Hi Utarsh,
Thanks for the great reply! I have one question at this point…
You state: then overridding those methods so that pqProxyWidget::setApplyChangesImmediately(...) doesn't override that behavior.
I am unsure what you mean by this. Do I need to override pqPropertyWidget::setAutoUpdateVTKObjects and pqPropertyWidget::setUseUncheckedProperties?And, if so, how does one prevent setApplyChangesImmediately from overriding this behavior? Can you elaborate a little on this? Or point me at some code I can go through??
Thanks,
Josh
From: Utkarsh Ayachit <utkarsh.ayachit at kitware.com<mailto:utkarsh.ayachit at kitware.com>>
Date: Sun, 9 Mar 2014 13:22:59 -0600
To: Joshua Murphy <joshua.murphy at lasp.colorado.edu<mailto:joshua.murphy at lasp.colorado.edu>>
Cc: "paraview-developers at paraview.org<mailto:paraview-developers at paraview.org>" <paraview-developers at paraview.org<mailto:paraview-developers at paraview.org>>
Subject: Re: [Paraview-developers] Properties Question
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<mailto: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<mailto: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/20140310/9e58eef1/attachment.html>
More information about the Paraview-developers
mailing list