3
6Ad]¸  ã               @   sÂ  d Z ddlmZ ddlZddlmZmZmZmZm	Z	m
Z
mZmZmZ ddlmZ ddlmZ ddlmZmZ ddlmZ dd	lmZ d
Zeejƒ jƒZdd„ Zdbdd„Zdd„ Zdd„ Z dd„ Z!ddddgd
fdd„Z"dcdd„Z#dddd„Z$G dd„ deƒZ%G dd „ d e%ƒZ&G d!d"„ d"e&ƒZ'G d#d$„ d$e&ƒZ(G d%d&„ d&e&ƒZ)G d'd(„ d(e&ƒZ*G d)d*„ d*e&ƒZ+G d+d,„ d,e&ƒZ,G d-d.„ d.e%ƒZ-G d/d0„ d0e%ƒZ.G d1d2„ d2e%ƒZ/G d3d4„ d4e%ƒZ0G d5d6„ d6e0ƒZ1G d7d8„ d8e0ƒZ2G d9d:„ d:e0ƒZ3G d;d<„ d<e0ƒZ4G d=d>„ d>e3ƒZ5G d?d@„ d@e4ƒZ6G dAdB„ dBe0ƒZ7G dCdD„ dDe0ƒZ8G dEdF„ dFe0ƒZ9G dGdH„ dHeƒZ:dedIdJ„Z;dKdL„ Z<dMdN„ Z=dOdP„ Z>dQdR„ Z?dfdSdT„Z@dUdV„ ZAdWdX„ ZBdYdZ„ ZCd[d\„ ZDd]d^„ ZEd_d`„ ZFeGdak�r¾eFƒ  dS )ga�  A module that provides Matlab like 3d visualization functionality.

The general idea is shamelessly stolen from the `high-level API`_
provided by Octaviz_. Some of the test cases and demos are also
translated from there!

.. _Octaviz: http://octaviz.sourceforge.net/
.. _high-level API: http://octaviz.sourceforge.net/index.php?page=manpagesq

The implementation provided here is object oriented and each
visualization capability is implemented as a class that has traits.
So each of these may be configured.  Each visualization class derives
(ultimately) from MLabBase which is responsible for adding/removing
its actors into the render window.  The classes all require that the
RenderWindow be a `pyface.tvtk.scene.Scene` instance (this constraint
can be relaxed if necessary later on).

This module offers the following broad class of functionality:

`Figure`
  This basically manages all of the objects rendered.  Just like
  figure in any Matlab like environment.  A convenience function
  called `figure` may be used to create a nice Figure instance.

`Glyphs`
  This and its subclasses let one place glyphs at points specified as
  inputs.  The subclasses are: `Arrows`, `Cones`, `Cubes`,
  `Cylinders`, `Spheres`, and `Points`.

`Line3`
  Draws lines between the points specified at initialization time.

`Outline`
  Draws an outline for the contained objects.

`Title`
  Draws a title for the entire figure.

`LUTBase`
  Manages a lookup table and a scalar bar (legend) for it.  This is
  subclassed by all classes that need a LUT.

`SurfRegular`
  MayaVi1's imv.surf like functionality that plots surfaces given x
  (1D), y(1D) and z (or a callable) arrays.

`SurfRegularC`
  Also plots contour lines.

`TriMesh`
  Given triangle connectivity and points, plots a mesh of them.

`FancyTriMesh`
  Plots the mesh using tubes and spheres so its fancier.

`Mesh`
  Given x, y generated from numpy.mgrid, and a z to go with it.  Along
  with optional scalars.  This class builds the triangle connectivity
  (assuming that x, y are from numpy.mgrid) and builds a mesh and
  shows it.

`FancyMesh`
  Like mesh but shows the mesh using tubes and spheres.

`Surf`
  This generates a surface mesh just like Mesh but renders the mesh as
  a surface.

`Contour3`
  Shows contour for a mesh.

`ImShow`
  Allows one to view large numeric arrays as image data using an image
  actor.  This is just like MayaVi1's `mayavi.tools.imv.viewi`.

To see nice examples of all of these look at the `test_*` functions at
the end of this file.  Here is a quick example that uses these test
functions::

 >>> from tvtk.tools import mlab
 >>> f = mlab.figure()
 >>> mlab.test_surf(f) # Create a spherical harmonic.
 >>> f.pop() # Remove it.
 >>> mlab.test_molecule(f) # Show a caffeine molecule.
 >>> f.renwin.reset_zoom() # Scale the view.
 >>> f.pop() # Remove this.
 >>> mlab.test_lines(f) # Show pretty lines.
 >>> f.clear() # Remove all the stuff on screen.

é    )ÚStrictVersionN)	Ú	HasTraitsÚListÚInstanceÚAnyÚFloatÚBoolÚStrÚTraitÚInt)ÚGUI)Útvtk)ÚTVTKBaseÚvtk_color_trait)Úconfigure_input_data)ÚivtkTc              K   s8   t r(tjdd�}d|j_|jf | Ž |S tjf | ŽS dS )zyReturn a TVTK actor.  If `mlab.USE_LOD_ACTOR` is `True` it
    returns an LODActor if not it returns a normal actor.
    iÜ  )Znumber_of_cloud_pointsg       @N)ÚUSE_LOD_ACTORr   ZLODActorÚpropertyZ
point_sizeÚ	trait_setZActor)ÚkwargsÚr© r   úv/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.6/site-packages/mayavi-4.7.1-py3.6-linux-x86_64.egg/tvtk/tools/mlab.pyÚ_make_actort   s    r   c             C   sº   t | ƒ}t |ƒ}|dk	r@tj|ƒ}|| |ks@td|||f ƒ‚| d |d  }}| d | d  |d |d   }}	tj||df||df||	dfd�}
|dk	r¶tj|ƒ|
j_d|
jj_	|
S )a0  Creates a StructuredPoints object given input data in the form
    of numpy arrays.

    Input Arguments:
       x -- Array of x-coordinates.  These should be regularly spaced.

       y -- Array of y-coordinates.  These should be regularly spaced.

       z -- Array of z values for the x, y values given.  The values
       should be computed such that the z values are computed as x
       varies fastest and y next.  If z is None then no scalars are
       associated with the structured points.  Only the structured
       points data set is created.
    Nz6len(x)*len(y) != len(z)You passed nx=%d, ny=%d,  nz=%dr   é   )Ú
dimensionsÚoriginÚspacingÚscalars)
ÚlenÚnumpyÚsizeÚAssertionErrorr   ZStructuredPointsÚravelÚ
point_datar   Úname)ÚxÚyÚzÚnxÚnyZnzÚxminZyminÚdxÚdyÚspr   r   r   Ú _create_structured_points_direct�   s    
"
r/   c             O   sN   || dd…df t j|ƒ t j|dd…df t j| ƒ ƒf|ž|Ž}t j|ƒS )a  Samples a function at an array of ordered points (with equal
    spacing) and returns an array of scalars as per VTK's requirements
    for a structured points data set, i.e. x varying fastest and y
    varying next.

    Input Arguments:
        xa -- Array of x points.

        ya -- Array if y points.

        func -- function of x, and y to sample.

        args -- additional positional arguments for func()
        (default is empty)

        kwargs -- a dict of additional keyword arguments for func()
        (default is empty)
    N)r    Ú
zeros_likeÚ	transpose)ÚxaÚyaÚfuncÚargsr   Úretr   r   r   Úsampler¤   s     
r7   c             C   s´   dt |jƒ }t|jƒdks$t|ƒ‚t|jƒdkr°dt| ƒt|ƒ|jf }|jd |jd  t| ƒt|ƒ ksvt|ƒ‚dt|ƒt| ƒt |jƒf }|jt|ƒt| ƒfks°t|ƒ‚dS )zAChecks the given arrays to see if they are suitable for
    surf.zAOnly ravelled or 2D arrays can be viewed! This array has shape %sé   zElen(x)*len(y) != len(z.flat).  You passed nx=%d, ny=%d, shape of z=%sr   r   zUlength of y(%d) and x(%d) must match shape of z %s. (Maybe you need to swap x and y?)N)ÚstrÚshaper   r"   )r&   r'   r(   Úmsgr   r   r   Ú_check_sanity¾   s    ,r<   c             C   s:   t j| ƒ} t j| jƒ}t j| tt jt j|dƒ|ƒƒƒ}|S )z3Returns a with any ones from the shape of a removedr   )r    Úasarrayr:   ÚreshapeÚtupleÚcompressÚ	not_equal)ÚaÚbÚvalr   r   r   ÚsqueezeÐ   s
    
rE   r   g      ð?c             O   sD  t |ƒr6tjt| ||f|ž|Žƒ}t| ƒt|ƒ } }n<t| ƒt|ƒ } }t| ||ƒ tj|ƒ}t|ƒdksrtdƒ‚| |d  }	||d  }
t|	|
|ƒ}|sž|S |�rt	j
ƒ }t||ƒ t	j|d d�}t||jƒ t	jdd�}t||jƒ t	jt|ƒt|ƒfd�}t||jƒ n"t	jt|ƒt|ƒfd�}t||ƒ t|d	�}||fS )
aµ  Creates a surface given regularly spaced values of x, y and the
    corresponding z as arrays.  Also works if z is a function.
    Currently works only for regular data - can be enhanced later.

    Parameters
    ----------

        x -- Array of x points (regularly spaced)

        y -- Array if y points (regularly spaced)

        z -- A 2D array for the x and y points with x varying fastest
        and y next.  Also will work if z is a callable which supports
        x and y arrays as the arguments.

        warp -- If true, warp the data to show a 3D surface
        (default = 1).

        scale -- Scale the x, y and z axis as per passed values.
        Defaults to [1.0, 1.0, 1.0].

        make_actor -- also create actors suitably (default True)

        args -- additional positional arguments for func()
        (default is empty)

        kwargs -- a dict of additional keyword arguments for func()
        (default is empty)
    r   zz is empty - nothing to plot!r   r8   )Zscale_factoré-   )Zfeature_angle)Úscalar_range)Úmapper)Úcallabler    r#   r7   rE   r<   r   r"   r/   r   ZImageDataGeometryFilterr   Z
WarpScalarÚoutputZPolyDataNormalsÚPolyDataMapperÚminÚmaxr   )r&   r'   r(   ÚwarpÚscaleZ
make_actorr5   r   ZzvalÚxsZysÚdataZgeom_fZwarperZnormalsrH   Úactorr   r   r   Úmake_surf_actorÙ   s2     



rS   c             C   sv   t j| dƒ}|jd dks"tdƒ‚|d k	rDt|ƒtt j|ƒƒksDt‚tj||d�}|d k	rrt j|ƒ|j_	d|jj	_
|S )NÚlr   é   z!The list of polygons must be Nx3.)ÚpointsÚpolysr   )r    r=   r:   r"   r   r#   r   ÚPolyDatar$   r   r%   )Ú	trianglesrV   r   ÚtÚpdr   r   r   Úmake_triangle_polydata  s    
r\   c             C   sø  t | jƒdkstdƒ‚t |jƒdks,tdƒ‚t |jƒdksBtdƒ‚| j|jksVtdƒ‚|j|jksjtdƒ‚| j\}}tjd|d …d|d …f \}}tj|ƒtj|ƒ }}|| | |d | | |d | |d  f}|d | |d  || |d  || | f}	t |d ƒ}
tj|
d d	fd
ƒ}|\|d|
…df< |d|
…df< |d|
…df< |	\||
d…df< ||
d…df< ||
d…df< tj||d	fdƒ}| ||  |dd…dd…df< |dd…dd…df< |dd…dd…df< tj||| d	fƒ}||fS )a  Given x, y, and z co-ordinates made using numpy.mgrid and
    optional scalars.  This function returns triangles and points
    corresponding to a mesh formed by them.

    Parameters
    ----------

    - x : array
        A list of x coordinate values formed using numpy.mgrid.
    - y : array
        A list of y coordinate values formed using numpy.mgrid.
    - z : array
        A list of z coordinate values formed using numpy.mgrid.
    - scalars : array (optional)
        Scalars to associate with the points.
    r8   zArray x must be 2 dimensional.zArray y must be 2 dimensional.zArray z must be 2 dimensional.z$Arrays x and y must have same shape.z$Arrays y and z must have same shape.r   r   rU   rT   NÚd)r   r:   r"   r    Úmgridr#   Úzerosr>   )r&   r'   r(   r   r)   r*   ÚiÚjÚt1Út2ÚntrY   rV   r   r   r   Úmake_triangles_points'  s$    
"....Fre   c               @   sH   e Zd ZeeƒZeZdd„ Zdd„ Z	dd„ Z
dd„ Zd	d
„ Zdd„ ZdS )ÚMLabBasec             C   s   | j jƒ  d S )N)ÚrenwinÚrender)Úselfr   r   r   ÚupdateY  s    zMLabBase.updatec             C   s   | j r| j jƒ  d S )N)rg   rh   )ri   r   r   r   rh   \  s    zMLabBase.renderc             C   s4   |r|j | jƒ |jƒ  |r0|j| jƒ |jƒ  d S )N)Úremove_actorsÚactorsrh   Ú
add_actors)ri   ÚoldÚnewr   r   r   Ú_renwin_changed`  s    zMLabBase._renwin_changedc             C   s   | j ||ƒ d S )N)Ú_handle_actors)ri   rn   ro   r   r   r   Ú_actors_changedh  s    zMLabBase._actors_changedc             C   s   | j |j|jƒ d S )N)rq   ÚremovedÚadded)ri   Ú
list_eventr   r   r   Ú_actors_items_changedk  s    zMLabBase._actors_items_changedc             C   s*   | j }|r&|j|ƒ |j|ƒ |jƒ  d S )N)rg   rk   rm   rh   )ri   rs   rt   Úrwr   r   r   rq   n  s
    

zMLabBase._handle_actorsN)Ú__name__Ú
__module__Ú__qualname__r   r   rl   r   rg   rj   rh   rp   rr   rv   rq   r   r   r   r   rf   S  s   rf   c                   sV   e Zd ZeZeejf dddœƒZe	dƒZ
d‡ fdd„	Zdd	„ Zd
d„ Zdd„ Z‡  ZS )ÚGlyphsZ
use_vectorZdata_scaling_off)Zvector_modeZ
scale_modeç      ð?Nc       	         s"  t t| ƒjf |Ž |d k	r.t|ƒt|ƒks.t‚|d k	rJt|ƒt|ƒksJt‚|| _|| _|| _tj	dt|ƒddƒ}tj
|t|ƒdfƒ}tj||d�}| jd k	r®||j_d|jj_| jd k	rÊ||j_d|jj_|| _t| j|ƒ | jrî| jj| j_tj| jjd�}t|d�}| j|j_| jj|ƒ d S )	Nr   r   rT   )rV   rW   Úvectorsr   )Úinput)rH   )Úsuperr{   Ú__init__r   r"   rV   r}   r   r    Úaranger>   r   rX   r$   r%   Ú	poly_datar   ÚglyphÚglyph_sourcerJ   ÚsourcerK   r   Úcolorr   rl   Úappend)	ri   rV   r}   r   ÚtraitsrW   r[   rH   rR   )Ú	__class__r   r   r€   †  s2    





zGlyphs.__init__c             C   s   | j jƒ  | jjƒ  d S )N)r‚   rj   rg   rh   )ri   r   r   r   rj   §  s    
zGlyphs.updatec             C   s    | j r|| j d j_| jƒ  d S )Nr   )rl   r   r†   rh   )ri   rD   r   r   r   Ú_color_changed«  s    zGlyphs._color_changedc             C   s   |j | j_| jƒ  d S )N)rJ   rƒ   r…   rh   )ri   rD   r   r   r   Ú_glyph_source_changed°  s    
zGlyphs._glyph_source_changed)r|   r|   r|   )NN)rx   ry   rz   r   r„   r   r   ÚGlyph3Drƒ   r   r†   r€   rj   rŠ   r‹   Ú__classcell__r   r   )r‰   r   r{   z  s   

!r{   c               @   s   e Zd Zeejf ƒZdS )ÚArrowsN)rx   ry   rz   r   r   ZArrowSourcer„   r   r   r   r   rŽ   ¸  s   rŽ   c                   s>   e Zd Zeejf ƒZeddd�Zd	‡ fdd„	Z	dd„ Z
‡  ZS )
ÚConesgš™™™™™©?zradius of the cone)ÚdescNc                s(   t t| ƒj|||f|Ž | j| jƒ d S )N)r   r�   r€   Ú_radius_changedÚradius)ri   rV   r}   r   rˆ   )r‰   r   r   r€   Æ  s    zCones.__init__c             C   s   || j _| jƒ  d S )N)r„   r’   rh   )ri   rD   r   r   r   r‘   Ê  s    zCones._radius_changed)NN)rx   ry   rz   r   r   Z
ConeSourcer„   r   r’   r€   r‘   r�   r   r   )r‰   r   r�   ¿  s   r�   c                   s>   e Zd Zeejf ƒZeddd�Zd	‡ fdd„	Z	dd„ Z
‡  ZS )
ÚCubesgš™™™™™©?zside length of the cube)r�   Nc                s(   t t| ƒj|||f|Ž | j| jƒ d S )N)r   r“   r€   r‘   r’   )ri   rV   r}   r   rˆ   )r‰   r   r   r€   Ø  s    zCubes.__init__c             C   s$   || j _|| j _|| j _| jƒ  d S )N)r„   Zx_lengthZy_lengthZz_lengthrh   )ri   rD   r   r   r   Ú_length_changedÜ  s    zCubes._length_changed)NN)rx   ry   rz   r   r   Z
CubeSourcer„   r   Úlengthr€   r”   r�   r   r   )r‰   r   r“   Ò  s   r“   c               @   s   e Zd Zeejf ƒZdS )Ú	CylindersN)rx   ry   rz   r   r   ZCylinderSourcer„   r   r   r   r   r–   æ  s   r–   c                   sF   e Zd Zeejf dddœƒZeddd�Zd‡ fdd	„	Z	d
d„ Z
‡  ZS )ÚSpheresé   é   )Úphi_resolutionÚtheta_resolutiongš™™™™™©?zradius of the sphere)r�   Nc                s(   t t| ƒj|||f|Ž | j| jƒ d S )N)r   r—   r€   r‘   r’   )ri   rV   r}   r   rˆ   )r‰   r   r   r€   ö  s    zSpheres.__init__c             C   s   || j _| jƒ  d S )N)r„   r’   rh   )ri   rD   r   r   r   r‘   ú  s    zSpheres._radius_changed)NN)rx   ry   rz   r   r   ÚSphereSourcer„   r   r’   r€   r‘   r�   r   r   )r‰   r   r—   î  s   
r—   c               @   s    e Zd Zeejf dddœƒZdS )ÚPointsr   r   )r’   Znumber_of_pointsN)rx   ry   rz   r   r   ZPointSourcer„   r   r   r   r   r�     s   r�   c                   sf   e Zd Zeddd�Zeddd�Zeej	f ddiƒZ
edƒZ‡ fd	d
„Zdd„ Zdd„ Zdd„ Z‡  ZS )ÚLine3g{®Gáz„?zradius of the tubes)r�   Tz+specifies if the tube filter should be usedÚnumber_of_sidesé   ç      ð?c       	         sü   t t| ƒjf |Ž t|d ƒdks*tdƒ‚|| _t|ƒd }tj|dfdƒ}tjd|d ddƒ|d d …df< tjd|d ddƒ|d d …df< t	j
||d�}|| _t	jƒ }|| _| j}| j|_| jrØt||ƒ t||jƒ t|d	�}| j|j_| jj|ƒ d S )
Nr   rU   zThe points must be 3Dr   r8   rT   g      à?)rV   Úlines)rH   )r   rf   r€   r   r"   rV   r    r_   r�   r   rX   r‚   rK   rH   Útube_filterr’   Ú	use_tubesr   rJ   r   r†   r   rl   r‡   )	ri   rV   rˆ   Únpr¢   r[   rH   ÚtfrB   )r‰   r   r   r€     s&      


zLine3.__init__c             C   s   || j _| jƒ  d S )N)r£   r’   rh   )ri   rD   r   r   r   r‘   2  s    zLine3._radius_changedc             C   s@   |r&| j }t|| jƒ t| j|jƒ nt| j| jƒ | jƒ  d S )N)r£   r   r‚   rH   rJ   rh   )ri   rD   r¦   r   r   r   Ú_use_tubes_changed6  s    zLine3._use_tubes_changedc             C   s    | j r|| j d j_| jƒ  d S )Nr   )rl   r   r†   rh   )ri   rD   r   r   r   rŠ   ?  s    zLine3._color_changed)r¡   r¡   r¡   )rx   ry   rz   r   r’   r   r¤   r   r   Ú
TubeFilterr£   r   r†   r€   r‘   r§   rŠ   r�   r   r   )r‰   r   rž     s   	rž   c            
       sX   e Zd Zeejf dddddddœƒZeejf ƒZ‡ fdd	„Z	d
d„ Z
‡ fdd„Z‡  ZS )ÚOutlinez%4.2gZouter_edgesg      ô?é   g        r   )Zlabel_formatZfly_modeZfont_factorZnumber_of_labelsZcorner_offsetÚscalingc                s^   t t| ƒjf |Ž tj| jjd�}t|d�}| j}t	|dƒrD||_
n||_| jj||gƒ d S )N)r~   )rH   Ú	view_prop)r   r©   r€   r   rK   ÚoutlinerJ   r   ÚaxisÚhasattrr¬   Úproprl   Úextend)ri   rˆ   Z
out_mapperZ	out_actorr®   )r‰   r   r   r€   Q  s    

zOutline.__init__c             C   sv   | j rr| j }dd„ | jD ƒ\}}d| jd _d| jd _|jƒ  |jjƒ }|| j_|jƒ  || jd _|| jd _d S )Nc             S   s   g | ]
}|j ‘qS r   )Ú
visibility)Ú.0r&   r   r   r   ú
<listcomp>a  s    z"Outline.update.<locals>.<listcomp>r   r   )rg   rl   r²   rh   ÚrendererZcompute_visible_prop_boundsr­   Úbounds)ri   rw   Úv1Úv2r¶   r   r   r   rj   ^  s    
zOutline.updatec                sj   t t| ƒj||ƒ |r:|j| jddd� |j| jddd� |rf|jj| j_|j| jdƒ |j| jdƒ d S )NZactor_addedT)ÚremoveZactor_removed)	r   r©   rp   Zon_trait_changerj   rµ   Zactive_camerar®   Zcamera)ri   rn   ro   )r‰   r   r   rp   k  s    zOutline._renwin_changed)rx   ry   rz   r   r   ZCubeAxesActor2Dr®   ZOutlineSourcer­   r€   rj   rp   r�   r   r   )r‰   r   r©   H  s   r©   c                   s<   e Zd Zed dd�Zeejf ƒZ‡ fdd„Z	dd„ Z
‡  ZS )ÚTitleztext of the title)r�   c                sj   t t| ƒjf |Ž | j}tdkr4|jdd| jd� n|jdd| jd� |j}d|_d|_	| j
j| jƒ d S )Nz5.1r°   gš™™™™™©?)Ztext_scale_modeÚheightr~   T)Zscaled_textr»   r~   Únormalized_viewportç      Ð?çš™™™™™í?ç        )r½   r¾   r¿   )r   rº   r€   Ú
text_actorÚVTK_VERr   ÚtextÚposition_coordinateÚcoordinate_systemÚvaluerl   r‡   )ri   rˆ   ÚtaÚpc)r‰   r   r   r€   €  s    zTitle.__init__c             C   s   || j _| jƒ  d S )N)rÀ   r~   rh   )ri   rD   r   r   r   Ú_text_changed�  s    zTitle._text_changed)rx   ry   rz   r	   rÂ   r   r   Z	TextActorrÀ   r€   rÈ   r�   r   r   )r‰   r   rº   y  s   rº   c                   sš   e Zd Zeddddddd�Zeejf ƒZeej	f ddd	d
œƒZ
eejf ƒZeddd�Zeddd�Z‡ fdd„Zdd„ Zdd„ Zdd„ Z‡ fdd„Z‡  ZS )ÚLUTBasezred-bluezblue-redzblack-whitezwhite-blackzthe type of the lookup table)r�   Ú
horizontalgš™™™™™é?gÃõ(\�ÂÅ?)ÚorientationÚwidthr»   ZScalarzthe title of the legendFz'specifies if scalar bar is shown or notc                sd   t t| ƒjf |Ž d| j_| j| jƒ | jj| j| j	d� | jj
}d|_d	|_| jj| jdd� d S )
Né   )Úlookup_tableÚtitler¼   çš™™™™™¹?ç{®Gáz„?ç        F)Zscalar_bar_actorZkey_press_activation)rÐ   rÑ   rÒ   )r   rÉ   r€   ÚlutZnumber_of_colorsÚ_lut_type_changedÚlut_typeÚ
scalar_barr   Úlegend_textrÃ   rÄ   rÅ   Úscalar_bar_widget)ri   rˆ   rÇ   )r‰   r   r   r€   ¬  s    


zLUTBase.__init__c             C   s„   |dkrd}d}d}n@|dkr,d}d}d}n*|dkrBd}d}d}n|dkrVd}d}d}| j }|j|||dd	d
� |jƒ  | jƒ  d S )Nzred-blueç        çKÈ=›Uå?ç      ð?zblue-redzblack-whitezwhite-blackrÍ   Úsqrt)Ú	hue_rangeÚsaturation_rangeÚvalue_rangeZnumber_of_table_valuesÚramp)rÙ   rÚ   )rÛ   rÛ   )rÛ   rÛ   )rÚ   rÙ   )rÛ   rÛ   )rÛ   rÛ   )rÙ   rÙ   )rÙ   rÙ   )rÙ   rÛ   )rÙ   rÙ   )rÙ   rÙ   )rÛ   rÙ   )rÓ   r   Zforce_buildrh   )ri   rD   rÝ   rÞ   rß   rÓ   r   r   r   rÔ   ¸  s,    zLUTBase._lut_type_changedc             C   s   || j _| j jƒ  | jƒ  d S )N)rÖ   rÏ   Úmodifiedrh   )ri   rD   r   r   r   Ú_legend_text_changedÑ  s    
zLUTBase._legend_text_changedc             C   s   | j r|| j_| j jƒ  d S )N)rg   rØ   Úenabledrh   )ri   rD   r   r   r   Ú_show_scalar_bar_changedÖ  s    z LUTBase._show_scalar_bar_changedc                sJ   | j }|rd |_|jƒ  |r4|j|_| j|_|jƒ  tt| ƒj||ƒ d S )N)rØ   Z
interactorrh   Úshow_scalar_barrã   r   rÉ   rp   )ri   rn   ro   Zsbw)r‰   r   r   rp   Û  s    zLUTBase._renwin_changed)rx   ry   rz   r
   rÕ   r   r   ZLookupTablerÓ   ZScalarBarActorrÖ   ZScalarBarWidgetrØ   r	   r×   r   rå   r€   rÔ   râ   rä   rp   r�   r   r   )r‰   r   rÉ   ”  s    rÉ   c                   s,   e Zd Zddddgf df‡ fdd„	Z‡  ZS )ÚSurfRegularr   g      ð?Nc                sh   t t| ƒjf |Ž |d kri }t|||||f|ž|Ž\}	}
|	| _|
j}| j|_|j| j_	| j
j|
ƒ d S )N)r   ræ   r€   rS   rQ   rH   rÓ   rÎ   rG   Útable_rangerl   r‡   )ri   r&   r'   r(   rN   rO   Úf_argsÚf_kwargsrˆ   rQ   rR   rH   )r‰   r   r   r€   í  s    

zSurfRegular.__init__)rx   ry   rz   r€   r�   r   r   )r‰   r   ræ   ë  s   ræ   c                   sL   e Zd Zeddd�Zeejf ƒZddddgf df‡ fdd„	Z	d	d
„ Z
‡  ZS )ÚSurfRegularCé
   znumber of contours values)r�   r   g      ð?Nc                sº   t t| ƒjf |Ž |d kri }t|||||f|ž|Ž\}	}
|
j}| j|_|j| j_|	| _	|	j
jj}| j}t||	ƒ |j| j|d |d ƒ tj|j| jd�}t|d�}| jj|
|gƒ d S )Nr   r   )r~   rÎ   )rH   )r   rê   r€   rS   rH   rÓ   rÎ   rG   rç   rQ   r$   r   ÚrangeÚcontour_filterr   Úgenerate_valuesÚnumber_of_contoursr   rK   rJ   r   rl   r±   )ri   r&   r'   r(   rN   rO   rè   ré   rˆ   rQ   rR   rH   ÚdrÚcfÚ
cont_actor)r‰   r   r   r€     s     




zSurfRegularC.__init__c             C   s0   | j jjj}| jj||d |d ƒ | jƒ  d S )Nr   r   )rQ   r$   r   rì   rí   rî   rh   )ri   rD   rð   r   r   r   Ú_number_of_contours_changed  s    z(SurfRegularC._number_of_contours_changed)rx   ry   rz   r   rï   r   r   ÚContourFilterrí   r€   ró   r�   r   r   )r‰   r   rê     s
   rê   c                   sV   e Zd Zeddd�Zeddd�ZedƒZd‡ fdd	„	Zd
d„ Z	dd„ Z
dd„ Z‡  ZS )ÚTriMeshFzshow scalar visibility)r�   zshow as surface or wireframeç      à?ç      ð?Nc       
         sÄ   t t| ƒjf |Ž t|||ƒ| _tj| j| j| jd�}|dk	rft	j
|ƒ}t|ƒt|ƒf}||_|| j_t|d�}d}	| jr~d}	|	dkrž|jjdd| j|	d� n|jjdd| j|	d� | jj|ƒ dS )	aJ  
        Parameters
        ----------

        - triangles : array
          This contains a list of vertex indices forming the triangles.
        - points : array
          Contains the list of points referred to in the triangle list.
        - scalars : array (optional)
          Scalars to associate with the points.
        )r~   rÎ   Úscalar_visibilityN)rH   ÚwÚsg        g      ð?)ÚdiffuseÚambientr†   Úrepresentation)r   rõ   r€   r\   r[   r   rK   rÓ   rø   r    r#   rL   rM   rG   rç   r   Úsurfacer   r   r†   rl   r‡   )
ri   rY   rV   r   rˆ   rH   Úrsrð   rR   rý   )r‰   r   r   r€   2  s&    



zTriMesh.__init__c             C   s$   | j r| j d j}||_| jƒ  d S )Nr   )rl   rH   rø   rh   )ri   rD   rH   r   r   r   Ú_scalar_visibility_changedW  s    z"TriMesh._scalar_visibility_changedc             C   sV   | j rJd}|rd}| j d }|dkr8|jjdd|d� n|jjdd|d� | jƒ  d S )Nrù   rú   r   g        g      ð?)rû   rü   rý   )rl   r   r   rh   )ri   rD   rý   rR   r   r   r   Ú_surface_changed]  s    



zTriMesh._surface_changedc             C   s    | j r|| j d j_| jƒ  d S )Nr   )rl   r   r†   rh   )ri   rD   r   r   r   rŠ   l  s    zTriMesh._color_changed)rö   r÷   rö   )N)rx   ry   rz   r   rø   rþ   r   r†   r€   r   r  rŠ   r�   r   r   )r‰   r   rõ   (  s   %rõ   c                   s–   e Zd ZdZeddd�ZedƒZeddd�Z	edd	d�Z
eejf d
ddœƒZeejf dddœƒZd‡ fdd„	Zdd„ Zdd„ Zdd„ Zdd„ Z‡  ZS )ÚFancyTriMeshzOShows a mesh of triangles and draws the edges as tubes and
    points as balls.Fzshow scalar visibility)r�   ç      à?ç      ð?g        zradius of the tubeszradius of the spheresZvary_radius_offr    )Zvary_radiusrŸ   é   )r›   rš   Nc                s,  t t| ƒjf |Ž || _t|||ƒ| _| j| jƒ | j| j	ƒ | j
}tj| jd�| _| j}| jj|j| jd� tj| jj| j|d�}t|d�}| j|j_| j	| j_tjd| jj|jd�}	tj|	j| j|d�}
t|
d�}| j|j_|dk	�rtj|ƒ}t|ƒt|ƒf}|| j_||_||
_| jj ||gƒ dS )aJ  
        Parameters
        ----------

        - triangles : array
          This contains a list of vertex indices forming the triangles.
        - points : array
          Contains the list of points referred to in the triangle list.
        - scalars : array (optional)
          Scalars to associate with the points.
        )r~   )r~   r’   )r~   rÎ   rø   )rH   r   )r«   r…   r~   N)!r   r  r€   rV   r\   r[   Ú_tube_radius_changedÚtube_radiusÚ_sphere_radius_changedÚsphere_radiusrø   r   ZExtractEdgesZextract_filterr£   r   rJ   rK   rÓ   r   r†   r   Úsphere_sourcer’   rŒ   r    r#   rL   rM   rç   rG   rl   r±   )ri   rY   rV   r   rˆ   Z
scalar_visZ	extract_fZedge_mapperZ
edge_actorZspheresZsphere_mapperZsphere_actorrÿ   rð   )r‰   r   r   r€   �  s<    










zFancyTriMesh.__init__c             C   s*   | j rx| j D ]}||j_qW | jƒ  d S )N)rl   rH   rø   rh   )ri   rD   r`   r   r   r   r   Â  s    z'FancyTriMesh._scalar_visibility_changedc             C   sH   | j }|dk r.ttj|ƒƒttj|ƒƒ d }|| _|| j_| jƒ  d S )Ng•Ö&è.>g     @o@)	rV   rM   r    r#   rL   r  r£   r’   rh   )ri   rD   rV   r   r   r   r  È  s    z!FancyTriMesh._tube_radius_changedc             C   sH   | j }|dk r.ttj|ƒƒttj|ƒƒ d }|| _|| j_| jƒ  d S )Ng•Ö&è.>g      Y@)	rV   rM   r    r#   rL   r	  r
  r’   rh   )ri   rD   rV   r   r   r   r  Ñ  s    z#FancyTriMesh._sphere_radius_changedc             C   s    | j r|| j d j_| jƒ  d S )Nr   )rl   r   r†   rh   )ri   rD   r   r   r   rŠ   Ú  s    zFancyTriMesh._color_changed)r  r  r  )N)rx   ry   rz   Ú__doc__r   rø   r   r†   r   r  r	  r   r   r¨   r£   rœ   r
  r€   r   r  r  rŠ   r�   r   r   )r‰   r   r  u  s    

5		r  c                   s   e Zd Zd‡ fdd„	Z‡  ZS )ÚMeshNc                s.   t ||||ƒ\}}tt| ƒj|||f|Ž dS )a‡  
        Parameters
        ----------

        - x : array
          A list of x coordinate values formed using numpy.mgrid.
        - y : array
          A list of y coordinate values formed using numpy.mgrid.
        - z : array
          A list of z coordinate values formed using numpy.mgrid.
        - scalars : array (optional)
          Scalars to associate with the points.
        N)re   r   r  r€   )ri   r&   r'   r(   r   rˆ   rY   rV   )r‰   r   r   r€   ã  s    zMesh.__init__)N)rx   ry   rz   r€   r�   r   r   )r‰   r   r  â  s   r  c                   s   e Zd Zd‡ fdd„	Z‡  ZS )Ú	FancyMeshNc                s.   t ||||ƒ\}}tt| ƒj|||f|Ž dS )a‡  
        Parameters
        ----------

        - x : array
          A list of x coordinate values formed using numpy.mgrid.
        - y : array
          A list of y coordinate values formed using numpy.mgrid.
        - z : array
          A list of z coordinate values formed using numpy.mgrid.
        - scalars : array (optional)
          Scalars to associate with the points.
        N)re   r   r  r€   )ri   r&   r'   r(   r   rˆ   rY   rV   )r‰   r   r   r€   ù  s    zFancyMesh.__init__)N)rx   ry   rz   r€   r�   r   r   )r‰   r   r  ø  s   r  c                   sJ   e Zd Zeddd�ZedƒZd‡ fdd„	Zd	d
„ Zdd„ Z	dd„ Z
‡  ZS )ÚSurfTzshow scalar visibility)r�   ç      à?ç      ð?Nc                s¢   t t| ƒjf |Ž t||||ƒ\}}t|||ƒ| _tj| j| j| j	d�}|dk	rxt
j|ƒ}	t|	ƒt|	ƒf}
|
|_|
| j_t|d�}|jj| jd� | jj|ƒ dS )a‡  
        Parameters
        ----------

        - x : array
          A list of x coordinate values formed using numpy.mgrid.
        - y : array
          A list of y coordinate values formed using numpy.mgrid.
        - z : array
          A list of z coordinate values formed using numpy.mgrid.
        - scalars : array (optional)
          Scalars to associate with the points.
        )r~   rÎ   rø   N)rH   )r†   )r   r  r€   re   r\   r[   r   rK   rÓ   rø   r    r#   rL   rM   rG   rç   r   r   r   r†   rl   r‡   )ri   r&   r'   r(   r   rˆ   rY   rV   rH   rÿ   rð   rR   )r‰   r   r   r€     s    


zSurf.__init__c             C   s$   | j r| j d j}||_| jƒ  d S )Nr   )rl   rH   rø   rh   )ri   rD   rH   r   r   r   r   3  s    zSurf._scalar_visibility_changedc             C   s,   | j r d}|rd}|| j d j_| jƒ  d S )Nrù   rú   r   )rl   r   rý   rh   )ri   rD   rý   r   r   r   r  9  s    zSurf._surface_changedc             C   s    | j r|| j d j_| jƒ  d S )Nr   )rl   r   r†   rh   )ri   rD   r   r   r   rŠ   A  s    zSurf._color_changed)r  r  r  )N)rx   ry   rz   r   rø   r   r†   r€   r   r  rŠ   r�   r   r   )r‰   r   r    s   r  c                   s<   e Zd Zeddd�Zeejf ƒZ‡ fdd„Z	dd„ Z
‡  ZS )ÚContour3rë   znumber of contours values)r�   c                sž   t t| ƒjf |Ž t||||ƒ\}}t|||ƒ| _| jjjj}|| j	_
| j}	t|	| jƒ |	j| j|d |d ƒ tj|	j| j	|d�}
t|
d�}| jj|ƒ dS )a|  
        Parameters
        ----------

        - x : array
          A list of x coordinate values formed using numpy.mgrid.
        - y : array
          A list of y coordinate values formed using numpy.mgrid.
        - z : array
          A list of z coordinate values formed using numpy.mgrid.
        - scalars : array
          Scalars to associate with the points.
        r   r   )r~   rÎ   rG   )rH   N)r   r  r€   re   r\   r[   r$   r   rì   rÓ   rç   rí   r   rî   rï   r   rK   rJ   r   rl   r‡   )ri   r&   r'   r(   r   rˆ   rY   rV   rð   rñ   rH   rò   )r‰   r   r   r€   Q  s    
zContour3.__init__c             C   s0   | j jjj}| jj||d |d ƒ | jƒ  d S )Nr   r   )r[   r$   r   rì   rí   rî   rh   )ri   rD   rð   r   r   r   ró   o  s    z$Contour3._number_of_contours_changed)rx   ry   rz   r   rï   r   r   rô   rí   r€   ró   r�   r   r   )r‰   r   r  J  s   r  c                   s>   e Zd ZdZeddd�Zdddgf‡ fdd„	Zdd	„ Z‡  ZS )
ÚImShowzyAllows one to view a 2D numpy array as an image.  This works
    best for very large arrays (like 1024x1024 arrays).
    Fz)specifies if image should be interpolated)r�   g      ð?c                s  t t| ƒjf |Ž t|jƒdks(tdƒ‚|j\}}tj|ƒd \}}}tjd||d  d|  |dƒ}	tjd||d  d|  |dƒ}
tj	|ƒ}t
|ƒ}t|ƒ}t|	|
ƒ}| j}||f|_|j|ddƒ}||j_d|jj_d	|_d
|_tj|| jd�}| jj|ƒ dS )z½
        Parameters
        ----------
        - arr : Array to be viewed.

        - scale : Scale the x, y and z axis as per passed values.
          Defaults to [1.0, 1.0, 1.0].
        r8   zOnly 2D arrays can be viewed!g      ð?r   gš™™™™™¹?Úfr   r   Zunsigned_charé   )r~   ÚinterpolateN)r   r  r€   r   r:   r"   r    Úarrayr�   r#   rL   rM   r/   rÓ   rç   Zmap_scalarsr$   r   r%   Zscalar_typeZnumber_of_scalar_componentsr   Z
ImageActorr  rl   r‡   )ri   ÚarrrO   rˆ   r*   r)   r,   r-   Újunkr2   r3   Zarr_flatÚmin_valÚmax_valr.   rÓ   rB   Úia)r‰   r   r   r€   €  s&    	
  



zImShow.__init__c             C   s"   | j r| j d }||_| jƒ  d S )Nr   )rl   r  rh   )ri   rD   r  r   r   r   Ú_interpolate_changed£  s    
zImShow._interpolate_changed)	rx   ry   rz   r  r   r  r€   r  r�   r   r   )r‰   r   r  x  s   #r  c                   sX   e Zd ZdZeeƒZ‡ fdd„Zdd„ Zdd„ Z	dd	„ Z
d
d„ Zdd„ Zdd„ Z‡  ZS )ÚFigurezpA Figure manages varuous MLabBase objects.  Each of these
    objects contains an actor and does something neat.c                s   t t| ƒjf |Ž || _d S )N)r   r  r€   rg   )ri   rg   rˆ   )r‰   r   r   r€   ´  s    zFigure.__init__c             C   s   | j j|ƒ dS )z]Add an object to the figure.  This adds the actors of the
        object to the renderwindow.N)Úobjectsr‡   )ri   Úobjr   r   r   Úadd¸  s    z
Figure.addc             C   s
   | j jƒ S )zPops out the last object.)r  Úpop)ri   r   r   r   r!  ½  s    z
Figure.popc             C   s
   g | _ dS )z"Removes all objects in the figure.N)r  )ri   r   r   r   ÚclearÁ  s    zFigure.clearc             C   s   | j ||ƒ d S )N)Ú_handle_objects)ri   ro   rn   r   r   r   Ú_objects_changedÅ  s    zFigure._objects_changedc             C   s   | j |j|jƒ d S )N)r#  rs   rt   )ri   ru   r   r   r   Ú_objects_items_changedÈ  s    zFigure._objects_items_changedc             C   sB   x|D ]
}d |_ qW | j }x|D ]
}||_ q W |jƒ  |jƒ  d S )N)rg   Ú
reset_zoomrh   )ri   rs   rt   r  rw   r   r   r   r#  Ë  s    



zFigure._handle_objects)rx   ry   rz   r  r   rf   r  r€   r   r!  r"  r$  r%  r#  r�   r   r   )r‰   r   r  ­  s   r  c             C   s6   t j|ƒ}t|jƒ}| r(tƒ }|j|ƒ |jjƒ  |S )ar  Simple helper function that returns a usable figure.

    Parameters
    ----------

    - outline : `bool` (default: True)

      If True, create an outline bounding box along with an axes
      marker for the scene.

    - browser : `bool` (default, True)

      If True, creates an IVTK scene with an embedded PipelineBrowser.
      If False, does not create it.
    )r   Zviewerr  Úscener©   r   r&  )r­   ZbrowserÚvr  Úor   r   r   ÚfigureÕ  s    



r*  c             C   s<   t dddgdddggdddgdddggdd�}| j|ƒ d S )Nr   r   )r†   éÿÿÿÿr+  r+  )r   r   r   )rŽ   r   )ÚfigrB   r   r   r   Útest_arrowsñ  s    .r-  c             C   sü   d\}}t j}|d }t jdd| d|  |dƒ}|| }t j|ƒdt j|| | ƒd   }t j|ƒdt j|| | ƒd   }t j|| | ƒd }	t jt|ƒd	fdƒ}
|||	  |
d
d
…df< |
d
d
…df< |
d
d
…df< t|
ddd�}| j|ƒ d
S )z Generates a pretty set of lines.r    é   g     @�@ç        r8   g      à?r]   r   rU   Nr   gš™™™™™©?çš™™™™™é?)r’   r†   )r    r.  )r/  r/  r0  )	r    Úpir�   ÚcosÚsinr_   r   rž   r   )r,  Zn_merZn_longr1  ÚdphiÚphiÚmur&   r'   r(   ÚptsrT   r   r   r   Ú
test_linesö  s    $$4r8  c       
      C   s.  dddgdddgg}dddgd	d
dgdddgdddgg}dddgdddgd
d
dgdddgd	ddgdddgdddgdd d!gg}d"dd#gdd$dgd%dd$gd&ddgd'd d!gd(ddgd)d*dgdddgd+d,d-gd$ddgg
}t |dd0d.�}t |dd1d.�}t |dd2d.�}t |dd3d.�}x ||||fD ]}	| j|	ƒ �qW d/S )4z(Generates and shows a Caffeine molecule.r™   é>   é   é   é   rë   é   r.  é   é*   é   é7   é.   é   é8   é   é   rª   é1   r˜   é2   é   é+   é   é   r  é    r    é?   é$   é;   é<   é   é   é   r   é%   éI   éE   é6   é9   éB   r   é,   é   )r’   r†   N)r   r   r   )r   r   r   )r   r   r   )r   r   r   )r—   r   )
r,  r)  ÚnÚcÚhZoxygenZnitrogenZcarbonZhydrogenr`   r   r   r   Útest_molecule  s    $((,r`  c             C   st   t jdddgdddgdddggdƒ}dddgg}t||ƒ}| j|ƒ |jƒ }d|dd…df< t||ƒ}| j|ƒ dS )zTest for simple triangle mesh.g        r   g      ð?r   r]   r8   N)r    r  rõ   r   Úcopyr  )r,  r7  rY   rb   Zpts1rc   r   r   r   Útest_trimesh  s    $


rb  c             C   sP   dd„ }t jd
ddƒ}t jdddƒ}|r6t|||ƒ}nt|||ƒ}| j|ƒ d	S )z7Test Surf on regularly spaced co-ordinates like MayaVi.c             S   s   t j| | ƒ| |  S )N)r    r3  )r&   r'   r   r   r   r  &  s    ztest_surf_regular.<locals>.fg      @g333333@gš™™™™™¹?g      @g333333@gš™™™™™©?Ng      Àg      À)r    r�   rê   ræ   r   )r,  Zcontourr  r&   r'   rú   r   r   r   Útest_surf_regular$  s    rc  c             C   sF   t jddd…ddd…f \}}|}t|||t j|dƒƒ}| j|ƒ dS )z-Test Surf with a simple collection of points.r   rU   r   r]   N)r    r^   r  r=   r   )r,  r&   r'   r(   rú   r   r   r   Útest_simple_surf2  s    rd  c             C   s  t j}t j}t j}|d |d  }}t jd||d  |…dd| |d  |…f \}}d}d}	d}
d}d}d}d}d}||| ƒ|	 ||
| ƒ|  ||| ƒ|  ||| ƒ|  }|||ƒ ||ƒ }|||ƒ }|||ƒ ||ƒ }t||||ƒ}| j|ƒ dS )	zUA very pretty picture of spherical harmonics translated from
    the octaviz example.g     @o@r   g      ø?r8   r  rU   r    N)r    r1  r2  r3  r^   r  r   )r,  r1  r2  r3  r4  Zdthetar5  ÚthetaZm0Úm1Úm2Zm3Zm4Zm5Zm6Zm7r   r&   r'   r(   rú   r   r   r   Ú	test_surf9  s&    2       @rh  c             C   s®   t j}t j}t j}|d |d  }}t jd||d  |…dd| |d  |…f \}}d}|||ƒ ||ƒ }	|||ƒ ||ƒ }
|||ƒ }t|	|
||dd�}| j|ƒ d	S )
z)Create a simple sphere and test the mesh.g      4@g{®Gáz„?g      ø?r   r8   g      ð?T)rø   N)r    r1  r2  r3  r^   r  r   )r,  r1  r2  r3  ÚduÚdvr5  re  r   r&   r'   r(   rú   r   r   r   Útest_mesh_sphereJ  s    2rk  c             C   sú   t j}t j}t j}|d |d  }}t jd||d  |…dd| |d  |…f \}}d||ƒ ||d| d  ƒ ||d| d  ƒ d	 }d||ƒ ||d| d  ƒ ||d| d  ƒ d	 }	||d| d  ƒ}
t||	|
|
d
d�}| j|ƒ dS )z9Create a fancy looking mesh (example taken from octaviz).g      4@g{®Gáz„?g      ø?r   r8   r   rU   g      @g      à?T)rø   N)r    r1  r2  r3  r^   r  r   )r,  r1  r2  r3  ri  rj  Úur(  r&   r'   r(   Úmr   r   r   Ú	test_meshX  s    288rn  c             C   s"   t jjdƒ}t|ƒ}| j|ƒ dS )zShow a large random array.é   é   N)ro  rp  )r    Úrandomr  r   )r,  Zz_larger`   r   r   r   Útest_imshowf  s    rr  c              C   sR   t ƒ } tjdd�}|jƒ  t|jƒ}tƒ }|j|ƒ t|ƒ |jj	ƒ  | j
ƒ  d S )Né   éX  )r!   )rs  rt  )r   r   ZIVTKWithCrustAndBrowserÚopenr  r'  r©   r   rh  r&  Zstart_event_loop)ÚguiÚwindowr  r)  r   r   r   Úmainm  s    


rx  Ú__main__)N)N)N)TT)r   )Hr  Údistutils.versionr   r    Z
traits.apir   r   r   r   r   r   r	   r
   r   Z
pyface.apir   Ztvtk.apir   Ztvtk.tvtk_baser   r   Ztvtk.commonr   Z
tvtk.toolsr   r   ÚVersionZvtk_versionrÁ   r   r/   r7   r<   rE   rS   r\   re   rf   r{   rŽ   r�   r“   r–   r—   r�   rž   r©   rº   rÉ   ræ   rê   rõ   r  r  r  r  r  r  r  r*  r-  r8  r`  rb  rc  rd  rh  rk  rn  rr  rx  rx   r   r   r   r   Ú<module>Z   sn   ,
#	
?

,'>	=1W'Mm<.5(


