[Paraview] mouse interaction when scripting python

pat marion pat.marion at kitware.com
Wed Jul 28 17:42:10 EDT 2010


Paraview python scripting has the concept of active objects and active
views.  At the python console, type 'help(Show)' and you'll see that it
takes optional object and view arguments.  If the arguments are not
specified it uses the 'active' object and view.  When you create a view
(CreateRenderView()) or create an object (Sphere()) they become the active
objects.  The active object concept is explained on the python scripting
wiki page.

Pat

On Wed, Jul 28, 2010 at 5:30 PM, Lars Freemail <larsfreemail at yahoo.de>wrote:

> cool, it works perfectly!
>
> I'll try to figure out, what is happening under the hood.
>
> Maybe you can help me with the first step? How does the sequence "Sphere();
> Show(); Render()" in your example know that it should render into the
> previously created "iren"? Does paraview.simple keep track of opened windows
> and reuse them when one is available?
>
> Thanks
> Lars
>
> ------------------------------
> *Von:* pat marion <pat.marion at kitware.com>
> *An:* Lars Freemail <larsfreemail at yahoo.de>
> *CC:* paraview at paraview.org
> *Gesendet:* Mittwoch, den 28. Juli 2010, 23:19:18 Uhr
> *Betreff:* Re: [Paraview] mouse interaction when scripting python
>
> Hi Lars,
>
> Currently it is not possible with paraview-python.  But you can make it
> work using vtk-python (which looks very similar to your c++ example.)  See
> this email:
>
> http://markmail.org/message/sjt6pbkyc56l2wgl
>
> Pat
>
> On Wed, Jul 28, 2010 at 5:00 PM, Lars Freemail <larsfreemail at yahoo.de>wrote:
>
>> Dear all,
>> I started with a simple python scripting example as described in this
>> paragraph:
>> http://www.paraview.org/Wiki/ParaView/Python_Scripting#Rendering
>>
>> Unfortunately I don't see any possibility to interact with the render
>> window
>> using the mouse (to rotate the camera, zoom, pan, ...) as I did before in
>> C++:
>>
>> ...
>> // an interactor
>> vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
>> iren->SetRenderWindow(renWin);
>> // add actors
>> ren1->AddActor(...);
>> // render an image
>> renWin->Render();
>> // begin mouse interaction
>> iren->Start();
>>
>> Is it possible to use mouse interaction in combination with python
>> scripting?
>>
>> Thanks
>> Lars
>>
>>
>>
>>
>> _______________________________________________
>> 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
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20100728/f0d03eda/attachment.htm>


More information about the ParaView mailing list