[Paraview] How to set properties of custom vtkSMProxies (python)?
David E DeMarle
dave.demarle at kitware.com
Mon Dec 5 15:57:33 EST 2016
The immediate_update flag that you can set in XML doesn't quite do what you
want and it seems like it may be deprecated soon.
Internally vtkSMProxy::UpdateProperty takes an optional force flag, but I
don't see that exposed anywhere public that won't involve writing some
paraview SM code to use it.
What you might do is add a pure vtkProperty (not vtk*vector property) that
calls some method on your class. Those take no arguments so they always
execute on the server when asked for by the client.
David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909
On Mon, Dec 5, 2016 at 3:39 PM, Mario Schreiber <schreibermario40 at gmail.com>
wrote:
> Thank you, that works.
> However, I have modified the method SetMyProperty, so that it performs
> some additional logic. Now, the problem is, that I need SetMyProperty to be
> called even when setting the same value again. ParaView caches the
> property, so that SetMyProperty is only executed when the argument is
> different from a previous call. Is it possible to change a flag or
> something to force the remote procedure call even if the argument is the
> same?
>
> Thanks
> Mario
>
>
> 2016-12-05 15:26 GMT+01:00 David E DeMarle <dave.demarle at kitware.com>:
>
>> Try adding a Property element to the xml.
>>
>> On Sat, Dec 3, 2016 at 12:09 PM, Mario Schreiber <
>> schreibermario40 at gmail.com> wrote:
>>
>> ...
>>
>>
>>> class vtkMyObject : public vtkObject
>>> {
>>> public:
>>>
>> ...
>>
>>>
>>> vtkGetMacro(MyProperty,double);
>>> vtkSetMacro(MyProperty,double);
>>>
>>>
>> To make that callable by ParaView:
>>
>> 4. MyConfig.xml:
>> <ServerManagerConfiguration>
>> <ProxyGroup name="my">
>> <Proxy name="MyObject" class="vtkMyObject"
>> label="MyObject">
>>
>> <DoubleVectorProperty command="SetMyProperty"
>> default_values="0"
>> name="MyProperty"
>> number_of_elements="1"
>> panel_visibility="default">
>> <Documentation>Set MyProperty</Documentation>
>> </DoubleVectorProperty>
>>
>>
>>> </Proxy>
>>> </ProxyGroup>
>>> </ServerManagerConfiguration>
>>>
>>>
>> ...
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20161205/3304a847/attachment.html>
More information about the ParaView
mailing list