3
îÈ‘[^
  ã               @   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	f 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)ÚdescFT)ÚargsÚ
allow_noneÚrecordÚ
image_data)ÚdatasetsÚreaderÚcustom)ÚnameÚstyleÚ	resizable)Úshow_labels)r   c                s2   t t| ƒjf |Ž |r$| jjdd� | jj| _d S )NÚ	livemodal)Úkind)Úsuperr
   Ú__init__r   Úedit_traitsÚfile_prefix)Úselfr   Z	configureÚtraits)Ú	__class__© ú_/home/yuhw/wc/wire-cell-python/venv/lib/python3.6/site-packages/mayavi/sources/volume_reader.pyr   0   s    zVolumeReader.__init__c             C   s(   t | jƒdkrd S | jjƒ  | 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   Úoutput_port)r   r!   r!   r"   Úget_output_objectA   s    zVolumeReader.get_output_objectc             C   s$   t |ƒdkrd S || j_| jƒ  d S )Nr   )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 j| jƒ | j g| _d| _d S )NT)r   r$   Zupdate_informationÚon_trait_changer%   ÚoutputsZdata_changed)r   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	   Úoutput_infor   r   r   Úviewr   r$   r&   r(   r+   r)   Ú__classcell__r!   r!   )r    r"   r
      s    

r
   N)r1   Ú
traits.apir   r   Útraitsui.apir   r   r   Útvtk.apir   Zmayavi.core.sourcer   Úmayavi.core.pipeline_infor	   r
   r!   r!   r!   r"   Ú<module>   s   