a
    «ˆc^
  ã                   @   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 Volume 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 )ÚVolumeReaderzA Volume reader.
    r   Ú z File prefix for the volume files)Údesc© FT)ÚargsÚ
allow_noneÚrecordZ
image_data)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Úfile_prefix)Úselfr   Ú	configureZtraits©Ú	__class__r   ú_/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/mayavi/sources/volume_reader.pyr   0   s    zVolumeReader.__init__c                 C   s(   t | jƒdkrd S | j ¡  |  ¡  d S ©Nr   )Úlenr   r   ÚupdateÚrender©r   r   r   r   r    7   s    
zVolumeReader.updatec                 C   s   dS )z+ Return True as the reader has output port.Tr   r"   r   r   r   Úhas_output_port=   s    zVolumeReader.has_output_portc                 C   s   | j jS )z Return the reader output port.)r   Zoutput_portr"   r   r   r   Úget_output_objectA   s    zVolumeReader.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   Ú_file_prefix_changedH   s    z!VolumeReader._file_prefix_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%   O   s
    


z"VolumeReader._update_reader_output)r   T)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__version__r   r   r   r   ZVolume16Readerr   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   