a
    «ˆc¶  ã                   @   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
d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Úrecord© Zscalar_modeZdistance)ÚargsÚkwr   r   Z	poly_dataÚany)ZdatasetsZattribute_typesÚ
attributes)r   c                    s¦   t  ¡ t  ¡ t  ¡ t  ¡ t  ¡ t  ¡ t  ¡ t  ¡ t  	¡ t  
¡ t  ¡ t  ¡ t  ¡ t  ¡ t  ¡ dœ}|| _tt| ƒjf i |¤Ž | 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)ÚselfZtraitsÚfd©Ú	__class__r   úd/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/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*   Úvaluer   r   r.   Ú_function_changed]   s    z#ParametricSurface._function_changedc                 C   sB   | j | j_ |dur"|j| jdd� | | 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Únewr   r   r.   Ú_parametric_function_changedc   s    

z.ParametricSurface._parametric_function_changed)Ú__name__Ú
__module__Ú__qualname__Ú__version__r   r$   r   r   ZParametricFunctionr%   ZParametricFunctionSourcer&   r   Zoutput_infor   r   r!   r#   r0   r5   Ú__classcell__r   r   r,   r.   r	      s4   
üÿþþ	ÿÿ"r	   N)Ú__doc__Z
traits.apir   r   r   r   Ztvtk.apir   Zmayavi.core.sourcer   Zmayavi.core.pipeline_infor   r	   r   r   r   r.   Ú<module>   s
   	