[Paraview-developers] Properties Question

Joshua Murphy Joshua.Murphy at lasp.colorado.edu
Mon Mar 10 14:11:56 EDT 2014


Hi Utkarsh,

This may show my lack of super-detailed knowledge of C++, but maybe you
can help with thisŠ

I am trying to create the custom subclass of pqPropertyWidget, but setting
the autoupdate requires access to the private members of the superclass.
Is there a way around this without re-implementing everything in the class?

Thanks,
Josh

On 3/10/14 11:06 AM, "Utkarsh Ayachit" <utkarsh.ayachit at kitware.com> wrote:

>Joshua,
>
>pqPropertyWidget currently is not designed to dictate whether it
>auto-applies. Auto-apply is controlled by pqProxyWidget. pqProxyWidget
>as a consequence will call setAutoUpdate...() method on each of
>pqPropertyWidget instances whenever it deems appropriate. Thus if you
>subclass pqPropertyWidget to set the flag in its constructor it could
>potentially be changed. Hence the suggested hack. I would make sense
>to add ability to pqPropertyWidget to dictate an "auto-apply"
>behaviour irrespective of the application/pqProxyWidget, but that'd
>need to thought up and coded.
>
>Utkarsh
>
>On Mon, Mar 10, 2014 at 12:57 PM, Joshua Murphy
><Joshua.Murphy at lasp.colorado.edu> wrote:
>> 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>
>> Date: Sun, 9 Mar 2014 13:22:59 -0600
>> To: Joshua Murphy <joshua.murphy at lasp.colorado.edu>
>> Cc: "paraview-developers at paraview.org"
>><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> 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:
>>>
>>> set a property to change a condition in the filter
>>> 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
>>>
>>



More information about the Paraview-developers mailing list