[Paraview-developers] Announce: vtkPythonClassAlgorithm

Bob Pepin bobpepin at gmail.com
Wed Aug 16 07:50:31 EDT 2017


>
> Hi,
>


> > I also think that a vanilla vtkPythonAlgorithm can not meet all the
> needs of this feature. In my case I need for example to override
> processRequest on the C++ level in order to reload the module on a new
> request (and ideally only when the source code has changed, and only
> optionally).
>
> This is a use-case that I'm skeptical we can support robustly in
> ParaView esp. in all modes it operates (client-server etc). I am not
> convinced it's that useful besides debugging, however. We can sure add
> a "reload" button to manually reimport the module, but that's not
> exactly what you want. But I'll stay posted.
>
>
do you have a specific situation in mind regarding the reloading? Since the
module uses Python's native functionality for reloading modules, I would
assume that if we can load it, we can reload it. I agree however that
checking whether the source has changed is a bit more delicate.

Besides, I think that a Reload button would be perfect, especially if it
did an Apply at the same time. I was considering adding a checkbox that
ends up calling Modified() on the vtk Algorithm object upon
checking/unchecking, do you know of a better solution using only existing
ParaView features?


> > The main issue going forward I can see right now involves passing
> parameters to Python. Right now I have a C++ method SetStringProperty(name,
> value) and use a <StringVectorProperty> with 2 elements. Now suppose I want
> to have a FileName property so that SetStringProperty("filename", value) is
> called when the FileName property is set to value. Do you know how to
> achieve this with the existing mechanisms, for example is it possible to
> have a StringVectorProperty with 2 elements where the first one is hidden
> and set to a default value?
>
> Are you aware of this post:
>
> https://blog.kitware.com/easy-customization-of-the-paraview-python-programmable-filter-property-panel/


Thanks, This was exactly what I was looking for. Just out of curiosity, how
does the "magic" work here? I.e. how does PV decide whether to call
SetProperty(value) or SetProperty(name, value)?

I also added a HDF5 Reader plugin to the github repository as an example.

Best,
Bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20170816/ed5599f1/attachment.html>


More information about the Paraview-developers mailing list