a
    «ˆcP
  ã                   @   s`   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 ddlmZ G dd„ deƒZd	S )
zA Chaco file reader.
é    )ÚInstanceÚStr)ÚViewÚGroupÚItem)Útvtk)ÚSource)ÚPipelineInfoc                       s–   e Zd ZdZdZeddd�Zeej	dddd	�Z
ed
gd�Zeeedddd�dd�dd�Zd‡ fdd„	Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Z‡  ZS )ÚChacoReaderzA Chaco reader.
    r   Ú zbasename of the Chaco files)Údesc© FT)ÚargsÚ
allow_noneÚrecordZunstructured_grid)ZdatasetsÚreaderZcustom)ÚnameÚstyleÚ	resizable)Zshow_labels)r   c                    s6   t t| ƒjf i |¤Ž |r(| jjdd� | jj| _d S )NZ	livemodal)Úkind)Úsuperr
   Ú__init__r   Zedit_traitsÚ	base_name)Úselfr   Ú	configureZtraits©Ú	__class__r   ú^/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/mayavi/sources/chaco_reader.pyr   /   s    zChacoReader.__init__c                 C   s(   t | jƒdkrd S | j ¡  |  ¡  d S ©Nr   )Úlenr   r   ÚupdateÚrender©r   r   r   r   r    5   s    
zChacoReader.updatec                 C   s   dS )z+ Return True as the reader has output port.Tr   r"   r   r   r   Úhas_output_port;   s    zChacoReader.has_output_portc                 C   s   | j jS )z Return the reader output port.)r   Zoutput_portr"   r   r   r   Úget_output_object?   s    zChacoReader.get_output_objectc                 C   s$   t |ƒdkrd S || j_|  ¡  d S r   )r   r   r   Ú_update_reader_output)r   Úvaluer   r   r   Ú_base_name_changedF   s    zChacoReader._base_name_changedc                 C   s6   | j  ¡  | j  ¡  | j  | j¡ | j g| _d| _d S )NT)r   r    Zupdate_informationZon_trait_changer!   ÚoutputsZdata_changedr"   r   r   r   r%   M   s
    


z!ChacoReader._update_reader_output)r   T)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__version__r   r   r   r   r
   r   r	   Zoutput_infor   r   r   Úviewr   r    r#   r$   r'   r%   Ú__classcell__r   r   r   r   r
      s(   
ÿ
ÿþýr
   N)r,   Z
traits.apir   r   Ztraitsui.apir   r   r   Ztvtk.apir   Zmayavi.core.sourcer   Zmayavi.core.pipeline_infor	   r
   r   r   r   r   Ú<module>   s   