[prev in list] [next in list] [prev in thread] [next in thread] 

List:       paraview
Subject:    Re: [Paraview] Python usage
From:       Pat Marion <pat.marion () kitware ! com>
Date:       2013-06-18 23:43:31
Message-ID: CAMetC=Se+UHu=h2z9y=0HndxpOw0TvcMjax-kWmjivB4PNYO4A () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi John,

For render window interaction via pvpython, see the example script here:

http://www.paraview.org/pipermail/paraview/2010-June/018059.html

You probably need to update the library name in the 2nd import statement.


As for your 2nd question, it is possible to create a custom ParaView app
(with GUI) from Python, but it takes some setup.  It's not a use case that
is supported with examples and documentation, but if you're clever you can
do it using a python Qt library like PyQt4.  My preferred library is called
PythonQt, with a c++ plugin you can expose much of the ParaView pq api to
python.  I don't have documentation for it, yet, but it's here
(PythonQtPlugin-pv4.0 branch):

https://github.com/patmarion/ParaView/tree/PythonQtPlugin-pv4.0

Pat


On Mon, Jun 17, 2013 at 4:12 AM, Biddiscombe, John A. <biddisco@cscs.ch>wro=
te:

>  I don=92t use python much so haven=92t really explored the paraview+pyth=
on
> capabilities, however my tests the other day tell me that****
>
> ** **
>
> The python interface within paraview is very nice and you can create
> visualizations entirely from script with nice GUI interface thrown in.***=
*
>
> ** **
>
> If you run a raw python shell and import paraview, the renderviews are no=
t
> interactive, so although you can setup reasonably decent visualizations,
> you can=92t =91play=92 with them.****
>
> ** **
>
> Is there a way of having a pure python interface (i.e. no paraview gui),
> but still keep some of the interactive features that the paraview gui giv=
es
> you (i.e. an event loop for interaction and some other basic functionalit=
y)
> ****
>
> ** **
>
> =85Is it possible to go further and create a mini paraview entirely in
> python? (I=92m not sure what I=92m asking for here, but I am curious as t=
o what
> you can do).****
>
> ** **
>
> Thanks****
>
> ** **
>
> JB****
>
> ** **
>
> -- ****
>
> John Biddiscombe,                        email:biddisco @.at.@ cscs.ch***=
*
>
> http://www.cscs.ch/****
>
> CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.07***=
*
>
> Via Trevano 131, 6900 Lugano, Switzerland   | Fax:  +41 (91) 610.82.82***=
*
>
> ** **
>
> _______________________________________________
> 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
>
>

[Attachment #5 (text/html)]

<div dir="ltr"><div><div><div>Hi John,<br><br></div>For render window interaction via \
pvpython, see the example script here:<br><br><a \
href="http://www.paraview.org/pipermail/paraview/2010-June/018059.html">http://www.paraview.org/pipermail/paraview/2010-June/018059.html</a><br>


<br></div>You probably need to update the library name in the 2nd import \
statement.<br><br><br></div>As for your 2nd question, it is possible to create a \
custom ParaView app (with GUI) from Python, but it takes some setup.  It&#39;s not a \
use case that is supported with examples and documentation, but if you&#39;re clever \
you can do it using a python Qt library like PyQt4.  My preferred library is called \
PythonQt, with a c++ plugin you can expose much of the ParaView pq api to python.  I \
don&#39;t have documentation for it, yet, but it&#39;s here (PythonQtPlugin-pv4.0 \
branch):<br>

<br><a href="https://github.com/patmarion/ParaView/tree/PythonQtPlugin-pv4.0">https:// \
github.com/patmarion/ParaView/tree/PythonQtPlugin-pv4.0</a><br><br>Pat<br></div><div \
class="gmail_extra"><br><br><div class="gmail_quote">

On Mon, Jun 17, 2013 at 4:12 AM, Biddiscombe, John A. <span dir="ltr">&lt;<a \
href="mailto:biddisco@cscs.ch" target="_blank">biddisco@cscs.ch</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex">







<div link="blue" vlink="purple" lang="EN-GB">
<div>
<p class="MsoNormal">I don’t use python much so haven’t really explored the \
paraview+python capabilities, however my tests the other day tell me \
that<u></u><u></u></p> <p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The python interface within paraview is very nice and you can \
create visualizations entirely from script with nice GUI interface thrown \
in.<u></u><u></u></p> <p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">If you run a raw python shell and import paraview, the \
renderviews are not interactive, so although you can setup reasonably decent \
visualizations, you can’t ‘play’ with them.<u></u><u></u></p> <p \
class="MsoNormal"><u></u> <u></u></p> <p class="MsoNormal">Is there a way of having a \
pure python interface (i.e. no paraview gui), but still keep some of the interactive \
features that the paraview gui gives you (i.e. an event loop for interaction and some \
other basic functionality)<u></u><u></u></p>


<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">…Is it possible to go further and create a mini paraview \
entirely in python? (I’m not sure what I’m asking for here, but I am curious as to \
what you can do).<u></u><u></u></p> <p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">JB<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;" lang="EN-US">-- <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;" lang="EN-US">John Biddiscombe,                        email:biddisco \
@.at.@ <a href="http://cscs.ch" target="_blank">cscs.ch</a><u></u><u></u></span></p>


<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;" lang="EN-US"><a href="http://www.cscs.ch/" target="_blank"><span \
style="color:windowtext">http://www.cscs.ch/</span></a><u></u><u></u></span></p>


<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;" lang="EN-US">CSCS, Swiss National Supercomputing Centre  | Tel:  <a \
href="tel:%2B41%20%2891%29%20610.82.07" value="+41916108207" target="_blank">+41 (91) \
610.82.07</a><u></u><u></u></span></p>


<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;" lang="IT-CH">Via Trevano 131, 6900 Lugano, Switzerland   | Fax:  <a \
href="tel:%2B41%20%2891%29%20610.82.82" value="+41916108282" target="_blank">+41 (91) \
610.82.82</a><u></u><u></u></span></p>


<p class="MsoNormal"><span lang="IT-CH"><u></u> <u></u></span></p>
</div>
</div>

<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a \
href="http://www.kitware.com/opensource/opensource.html" \
target="_blank">http://www.kitware.com/opensource/opensource.html</a><br> <br>
Please keep messages on-topic and check the ParaView Wiki at: <a \
href="http://paraview.org/Wiki/ParaView" \
target="_blank">http://paraview.org/Wiki/ParaView</a><br> <br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" \
target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br> \
<br></blockquote></div><br></div>



_______________________________________________
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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic