File: example_pick_on_surface.rst

package info (click to toggle)
mayavi2 4.8.3-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 21,892 kB
  • sloc: python: 49,447; javascript: 32,885; makefile: 129; fortran: 60
file content (26 lines) | stat: -rw-r--r-- 729 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26


.. _example_pick_on_surface:

Pick on surface example
--------------------------------------------

 Example showing how to pick data on a surface, going all the way back
to the index in the numpy arrays.

In this example, two views of the same data are shown. One with the data
on a sphere, the other with the data flat.

We use the 'on_mouse_pick' method of the scene to register a callback on
clicking on the sphere. The callback is called with a picker object as
and an argument. We use the point_id of the point that has been picked,
and go back to the 2D index on the data matrix to find its position.


**Python source code:** :download:`pick_on_surface.py`

.. literalinclude:: pick_on_surface.py
    :lines: 12-