3
îÈ‘[y$  ã               @   sŠ   d Z ddlmZmZmZ ddlmZmZmZm	Z	m
Z
 ddlmZ ddlmZ ddlmZ ddlmZ G dd	„ d	ejƒZG d
d„ deƒZdS )z0Draws a simple axes using tvtk.CubeAxesActor2D.
é    )ÚInstanceÚPropertyÚtrue)ÚViewÚGroupÚHGroupÚItemÚBooleanEditor)Útvtk)Ústate_pickler)ÚModule)ÚPipelineInfoc               @   sö   e Zd ZdZeZedgdgdgd�Zee	e	e
dƒee
ddd�e
dd	d�e
d
dd�ƒddd�e	e
dƒee
ddd�ƒdd�e	e
dƒee
ddd�ƒdd�e	e
dƒe
dƒe
dƒe
dƒe
dƒe
dƒdd�ee
ddeƒ d�ƒe
dƒe
d ƒe
d!ƒdd"�	ddd#�Zd$S )%ÚCubeAxesActor2Dzd Just has a different view than the tvtk.CubesAxesActor2D, with an
        additional tick box.
    Úany)ÚdatasetsÚattribute_typesÚ
attributesZ
visibilityZx_axis_visibilityzX axis)ÚlabelZy_axis_visibilityzY axisZz_axis_visibilityzZ axisTZVisibity)Úshow_borderr   Z
use_rangesZranges)Úenabled_when)r   Úuse_data_boundsÚboundsznot use_data_boundsZx_labelZy_labelZz_labelZlabel_formatÚnumber_of_labelsÚfont_factorZshow_actual_boundszUse size bigger than screen)r   ÚeditorÚfly_modeÚcorner_offsetZlayer_number)Úspringy)Ú
scrollableÚ	resizableN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   Ú
input_infor   r   r   r   r	   Útraits_view© r&   r&   úV/home/yuhw/wc/wire-cell-python/venv/lib/python3.6/site-packages/mayavi/modules/axes.pyr      sR   



r   c            
       s"  e Zd ZdZeeddd�Zedd�Zedd�Z	edd�Z
eejƒZeejƒZeejƒZeeedddd�d dd	�eed
ddd�ddd	�eedddd�ddd	�eedddd�ddd	�ddddd�Zdd„ Zdd„ Zdd„ Zdd„ Z‡ fdd„Zdd„ Zdd „ Zd!d"„ Zd#d$„ Zd%d&„ Zd'd(„ Z‡  Z S ))ÚAxesr   FT)Ú
allow_noneÚrecord)r*   ÚaxesÚcustom)ÚnameÚstyler   )r   Úshow_labelsÚ	_propertyr   Ú_title_text_propertyz
Title TextÚ_label_text_propertyz
Label Textiô  iX  )r   r   ÚwidthÚheightc             C   s,   x&dD ]}t | |ƒ}tj||| ƒ qW d S )Nr+   r0   r1   r2   )r+   r0   r1   r2   )Úgetattrr   Ú	set_state)ÚselfÚstateÚpropÚobjr&   r&   r'   Ú__set_pure_state__€   s    
zAxes.__set_pure_state__c             C   s,   t dddddd�}d|j_d|j_|| _dS )a  Override this method so that it *creates* the tvtk
        pipeline.

        This method is invoked when the object is initialized via
        `__init__`.  Note that at the time this method is called, the
        tvtk data pipeline will *not* yet be setup.  So upstream data
        will not be available.  The idea is that you simply create the
        basic objects and setup those parts of the pipeline not
        dependent on upstream sources and filters.  You should also
        set the `actors` attribute up at this point.
        é   g      ø?Zouter_edgesg        F)r   r   r   r   ÚscalingN)r   Zaxis_title_text_propertyÚshadowZaxis_label_text_propertyr+   )r7   r+   r&   r&   r'   Úsetup_pipeline‰   s    zAxes.setup_pipelinec             C   sN   | j }|dks| jj r*| j| jdƒ dS |j}| j| j|jd ƒ d| _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 any of the inputs
        sends a `pipeline_changed` event.
        Nr   T)Zmodule_managerr+   r   Úconfigure_input_dataÚsourceÚconfigure_inputÚoutputsZpipeline_changed)r7   ÚmmÚsrcr&   r&   r'   Úupdate_pipeline¡   s    zAxes.update_pipelinec             C   s
   d| _ dS )zÌOverride this method so that it flushes the vtk pipeline if
        that is necessary.

        This method is invoked (automatically) when any of the inputs
        sends a `data_changed` event.
        TN)Zdata_changed)r7   r&   r&   r'   Úupdate_data°   s    zAxes.update_datac                s.   t t| ƒj||ƒ |j| j_| jd |jƒ d S )N)Úsuperr(   Ú_scene_changedÚcamerar+   Ú_foreground_changed_for_sceneÚ
foreground)r7   ÚoldÚnew)Ú	__class__r&   r'   rI   ½   s    
zAxes._scene_changedc             C   s$   || j _|| j_|| j_| jƒ  d S )N)ÚpropertyÚcolorÚlabel_text_propertyÚtitle_text_propertyÚrender)r7   rM   rN   r&   r&   r'   rK   Â   s    z"Axes._foreground_changed_for_scenec             C   sÊ   |d k	r@x*|| j | j| jfD ]}|j| jdd� qW | jj|ƒ | j}|d k	rV|j|_|j	| _ x"dD ]}t
| |t|d| ƒƒ qdW x&|| j | j| jfD ]}|j| jƒ q–W | jj|ƒ |d k	rÆ| jƒ  d S )NT)Úremover1   r2   Úaxis)r1   r2   )r0   r1   r2   Úon_trait_changerT   ZactorsrU   ÚscenerJ   rP   Úsetattrr5   ÚappendrF   )r7   rM   rN   r:   rX   r9   r&   r&   r'   Ú_axes_changedÉ   s$    zAxes._axes_changedc             C   s   | j S )N)r0   )r7   r&   r&   r'   Ú_get_propertyá   s    zAxes._get_propertyc             C   s   | j S )N)r1   )r7   r&   r&   r'   Ú_get_title_text_propertyä   s    zAxes._get_title_text_propertyc             C   s   | j S )N)r2   )r7   r&   r&   r'   Ú_get_label_text_propertyç   s    zAxes._get_label_text_propertyc             C   s   | j ƒ  dS )z‹ Updating the pipeline for this module is inexpensive and fits
            the actor to the source (if any). We are using it here.
        N)rF   )r7   r&   r&   r'   Ú!_use_data_bounds_changed_for_axesê   s    z&Axes._use_data_bounds_changed_for_axes)!r    r!   r"   Ú__version__r   r   r+   r   rP   rS   rR   r
   Z
Property2Dr0   ZTextPropertyr1   r2   r   r   r   Úviewr;   r?   rF   rG   rI   rK   r[   r\   r]   r^   r_   Ú__classcell__r&   r&   )rO   r'   r(   Q   sH   






	r(   N)r#   Ú
traits.apir   r   r   Útraitsui.apir   r   r   r   r	   Útvtk.apir
   Zapptools.persistencer   Zmayavi.core.moduler   Úmayavi.core.pipeline_infor   r   r(   r&   r&   r&   r'   Ú<module>   s   ;