3
5Ad]¬	  ã               @   sT   d Z ddlmZmZ ddlmZmZmZ ddlm	Z	 ddl
mZ G dd„ deƒZdS )	z$A simple wrapper for `tvtk.Cutter`.
é    )ÚInstanceÚProperty)ÚViewÚGroupÚItem)Útvtk)Ú	Componentc               @   s`   e Zd ZdZeejf d�ZeZ	e
eedddd�dd�dd	�Zd
d„ Zdd„ Zdd„ Zdd„ ZdS )ÚCutterr   )ÚargsÚcutterZcustomT)ÚnameÚstyleÚ	resizableF)Zshow_labels)r   c             C   sX   t | jƒdks"t | jd jƒdkr&dS | j}| j|| jd jd ƒ |jƒ  |g| _dS )zâOverride this method so that it *updates* the tvtk pipeline
        when data upstream is known to have changed.

        This method is invoked (automatically) when the input fires a
        `pipeline_changed` event.
        r   N)ÚlenÚinputsÚoutputsr   Zconfigure_inputÚupdate)ÚselfÚc© r   ú/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.6/site-packages/mayavi-4.7.1-py3.6-linux-x86_64.egg/mayavi/components/cutter.pyÚupdate_pipeline*   s    "zCutter.update_pipelinec             C   s
   d| _ dS )zÆOverride this method to do what is necessary when upstream
        data changes.

        This method is invoked (automatically) when any of the inputs
        sends a `data_changed` event.
        TN)Zdata_changed)r   r   r   r   Úupdate_data8   s    zCutter.update_datac             C   s   | j jS )N)r   Úcut_function)r   r   r   r   Ú_get_cut_functionD   s    zCutter._get_cut_functionc             C   s"   | j j}|| j _| jd||ƒ d S )Nr   )r   r   Ztrait_property_changed)r   ÚvalÚoldr   r   r   Ú_set_cut_functionG   s    zCutter._set_cut_functionN)Ú__name__Ú
__module__Ú__qualname__Ú__version__r   r   r	   r   r   r   r   r   r   Úviewr   r   r   r   r   r   r   r   r	      s   r	   N)Ú__doc__Z
traits.apir   r   Ztraitsui.apir   r   r   Ztvtk.apir   Zmayavi.core.componentr   r	   r   r   r   r   Ú<module>   s
   