[Paraview] Two python questions: client vtk object ->server; macro-> set plugin fields

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Mon Nov 8 09:46:00 EST 2010


A1> There are round about ways of doing that, but I'd not recommend
doing it. Sending data from client-to-server isn't the best strategy,
the question you should ask in such cases is "why can't I read the
data on  the server itself"?

A2> This sounds a better approach. There was a separate thread a while
ago that talked about how to popup a input widget from a python macro,
you might want to search for that. You wouldn't be setting attributes
on the python programmable filter, in this case, you'll indeed simply
change the python script used by the filter with the attributes
replaced using the user chosen values.

Utkarsh

On Sun, Nov 7, 2010 at 8:41 AM, Lawrence Angrave <angrave at illinois.edu> wrote:
> Hi,
> Some python client related questions -
>
> Some Background: I have a pure-vtk python project that reads in volumetric
> and time-series polydata. I'd like to convert this to be a paraview plugin
> and macros. Ideally this would be a pure python solution and it would create
> two paraview sources (an unstructured grid and polydata) when the user opens
> a custom config file.  Eventually it would be great to create a default
> pipeline of filters too.
>
> Q1 Is it possible to send a vtk unstructured grid object, built within a
> python macro, to the Paraview server? FYI I'll probably implement this with
> a python plugin instead but wondered if the above implementation is even
> possible with Paraview 3.8.1 (or later)?
>
> FYI I played with TrivialProducer and GetClientSideObject but did not see a
> way to push the data back to the server without saving to disk first i.e.
> the opposite of "Fetch" and then asking paraview to load the files.
>
>   import paraview.vtk as vtk
>    from paraview.simple import *
>    .. Create client vtk objects... Now want to display them in paraview...
>   tp=TrivialProducer()
>   # Proxy does not support SetOutput
>   tpclient=tp.GetClientSideObject()
>   tpclient.SetOutput( myvtkpolydata ) # Nothing appears on server :-(
>    # How do I send my poly data and ugrid to the server without saving to
> disk?
>
>
> Q2 Is about an alternative implementation idea -
> An alternative would be to create a python programmable filter that reads in
> the file and wrap it as a plugin. I'd need to two plugins (one for the UGrid
> and one of the poly data). Correct? How would you recommend that I control
> these from a python macro? e.g. The python macro would display a filename
> chooser, read in some basic config parameters and then set the relevant
> parameters on each filter before invoking the filter.
> I understand a filechooser may be possible using PyQt but am wondering if
> it's trivial to call custom methods and set attributes on a python
> programmable filter directly from a python macro (or other python plugin).
> Are there any code-snippets that you can recommend? I didnt see anything
> relevant on the wiki.
>
> By the way, thanks for the python bindings. We find python development so
> much faster than traditional C++ development - it's great not having to wait
> for a C++ build to complete.
>
> Thanks for your help!
> Lawrence.
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>


More information about the ParaView mailing list