<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
<div class="moz-text-flowed" style="font-family: -moz-fixed;
font-size: 12px;" lang="x-western">Hi,
<br>
Some python client related questions -
<br>
<br>
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.
<br>
<br>
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)?
<br>
<br>
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.
<br>
<br>
import paraview.vtk as vtk
<br>
from paraview.simple import *
<br>
.. Create client vtk objects... Now want to display them in
paraview...
<br>
tp=TrivialProducer()
<br>
# Proxy does not support SetOutput
<br>
tpclient=tp.GetClientSideObject()
<br>
tpclient.SetOutput( myvtkpolydata ) # Nothing appears on server
<span class="moz-smiley-s2" title=":-("><span>:-(</span></span>
<br>
# How do I send my poly data and ugrid to the server without
saving to disk?
<br>
<br>
<br>
Q2 Is about an alternative implementation idea -
<br>
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.
<br>
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.
<br>
<br>
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.
<br>
<br>
Thanks for your help!
<br>
Lawrence.
<br>
<br>
</div>
</body>
</html>