a
    «ˆc¬	  ã                   @   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d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d jd ¡ | ¡  |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Úcr
   r
   ú[/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/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_functionr   r
   r
   r   Ú_get_cut_functionD   s    zCutter._get_cut_functionc                 C   s"   | 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
   