3
îÈ‘[¶  ã               @   sT   d Z ddlmZmZmZmZ ddlmZ ddlm	Z	 ddl
mZ G dd„ de	ƒZdS )	z”A module that displays Parametric Surfaces, which are generated by
sets of equations describing the deformation of the real plane into
the surface.
é    )ÚInstanceÚEnumÚDictÚStr)Útvtk)ÚSource)ÚPipelineInfoc                   s¨   e Zd ZdZedddddddd	d
dddddddd�Zeejddd�Z	eej
f ddiddd�Zedgdgdgd�Zeeeejdd�ƒZ‡ fdd„Zdd „ Zd!d"„ Z‡  ZS )#ÚParametricSurfacer   ÚboyÚconic_spiralÚcapÚdiniÚ	ellipsoidÚenneperÚfigure8kleinÚkleinÚmobiusÚrandom_hillsÚromanÚsplineÚsuper_ellipsoidÚsuper_toroidÚtorusz$which parametric function to be used)ÚdescFT)Ú
allow_noneÚrecordZscalar_modeÚdistance)ÚargsÚkwr   r   Ú	poly_dataÚany)ÚdatasetsÚattribute_typesÚ
attributes)r   c                s¢   t jƒ t jƒ t jƒ t jƒ t jƒ t jƒ t jƒ t jƒ t j	ƒ t j
ƒ t jƒ t jƒ t jƒ t jƒ t jƒ dœ}|| _tt| ƒjf |Ž | j| j | _| jj| jƒ | jg| _d S )N)r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   ZParametricBoyZParametricConicSpiralZParametricCrossCapZParametricDiniZParametricEllipsoidZParametricEnneperZParametricFigure8KleinZParametricKleinZParametricMobiusZParametricRandomHillsZParametricRomanZParametricSplineZParametricSuperEllipsoidZParametricSuperToroidZParametricTorusÚ_function_dictÚsuperr	   Ú__init__ÚfunctionÚparametric_functionÚsourceÚon_trait_changeÚrenderÚoutputs)ÚselfÚtraitsÚfd)Ú	__class__© úd/home/yuhw/wc/wire-cell-python/venv/lib/python3.6/site-packages/mayavi/sources/parametric_surface.pyr&   ;   s(    zParametricSurface.__init__c             C   s   | j | j | _dS )z]This method is invoked (automatically) when the `function`
        trait is changed.
        N)r$   r'   r(   )r-   Úvaluer1   r1   r2   Ú_function_changed]   s    z#ParametricSurface._function_changedc             C   sB   | j | j_ |dk	r"|j| jdd� |j| jƒ | jjƒ  d| _dS )zlThis method is invoked (automatically) when the
        `parametric_function` attribute is changed.
        NT)Úremove)r(   r)   r*   r+   ÚupdateZdata_changed)r-   ÚoldÚnewr1   r1   r2   Ú_parametric_function_changedc   s    

z.ParametricSurface._parametric_function_changed)Ú__name__Ú
__module__Ú__qualname__Ú__version__r   r'   r   r   ZParametricFunctionr(   ZParametricFunctionSourcer)   r   Úoutput_infor   r   r$   r&   r4   r9   Ú__classcell__r1   r1   )r0   r2   r	      s(   




"r	   N)Ú__doc__Ú
traits.apir   r   r   r   Útvtk.apir   Zmayavi.core.sourcer   Úmayavi.core.pipeline_infor   r	   r1   r1   r1   r2   Ú<module>   s
   