[Paraview] Extract Selection using Python

Sebastien Jourdain sebastien.jourdain at kitware.com
Mon Jan 27 16:06:30 EST 2014


Hi Kyr,

1) The rectangle should show up with master or 4.1 release.

2) The version 4.1 does have a protocol that manage selection, you may want
to start looking into that.

Seb


On Mon, Jan 27, 2014 at 7:18 AM, Albrecht Kyrieleis <akyrieleis at gmail.com>wrote:

> Hi,
>
> I am trying to write a Python function that can be used in ParaviewWeb to
> extract the values of a point data set after a selection has been made (I
> am using basically pv_web_visualizer with a custom protocol that contains
> my python functions). I am struggling with 2 problems:
>
> 1) I cannot figure out how to display the rectangle for the selection in
> ParaviewWeb. With
>
>  RenderView1 = simple.GetRenderView()
>  RenderView1.InteractionMode = "Selection"
>
> only the mouse mode is changed, but no rectangle is shown.
>
>
> 2)  Using the normal Paraview GUI, after I have made a selection I can do
> in the Python shell:
>
> sel=ExtractSelection()
>
> this creates the Extract Selection filter which I need to finalize using
> the 'Apply' button.
>
> In the Python shell I can then access the data in that selection using:
>
> datsel=servermanager.Fetch(sel)
> ar0=datsel.GetPointData().GetArray(0)
> ar0.GetTuple1(0)
>
> In ParavewWeb, ExtractSelection  does not pick up any selection that I
> have made. But it might also be that using the code in 1) is not enough to
> enable the selection tool.
>
> in ParaviewWeb, how can I obtain the IDs of the points in the selection so
> that I can fetch the values ?
>
> Any help or ideas would be greatly appreciated.
>
> Thank you very much
>
> kyr.
>
>
>
> _______________________________________________
> 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/20140127/4502ecd3/attachment.html>


More information about the ParaView mailing list