a
    «ˆc†  ã                   @   sª   d Z ddlmZ ddlmZ ddlmZ dd	d
„Zdddddejdfdd„Z	dej
dfdd„Zdddejdfdd„Zddd„Zdddejdfdd„Zejddfdd„ZdS ) zdHelper functions to make a bunch of simple actors.  This is useful
when writing demo/example code.

é    )Útvtk)Úcolors)Úconfigure_input_data©r   r   r   ç      ð?ç{®Gáz”?é   c                 C   sX   t j| |dd�}t j||dd�}t||jƒ t  ¡ }t||jƒ t j|d�}| ¡  |S )z<Creates a simple axes actor and returns a tvtk.Actor object.é   )ÚoriginÚscale_factorZ	symmetricZvary_radius_off)ÚradiusZnumber_of_sidesZvary_radius)Úmapper)r   ZAxesZ
TubeFilterr   ÚoutputÚPolyDataMapperÚActorÚupdate)r
   r   r   ZsidesZaxesZtuber   Úactor© r   úU/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/tvtk/pyface/actors.pyÚ
axes_actor   s    ÿr   ç      à?)r	   r   r   éd   c                 C   sP   t j| ||||d�}t  ¡ }t||jƒ t j||d�}	t j||	d�}
| ¡  |
S )z8 Sets up a cone actor and returns the tvtk.Actor object.)ÚcenterÚheightr   Ú	directionÚ
resolution©ÚopacityÚcolor©r   Úproperty)r   Z
ConeSourcer   r   r   ÚPropertyr   r   )r   r   r   r   r   r   r   Úsourcer   Úpr   r   r   r   Ú
cone_actor)   s    þr$   c                 C   sH   t j| d�}t  ¡ }t||jƒ t j||d�}t j||d�}| ¡  |S )z, Creates a cube and returns the tvtk.Actor. )r   r   r   )r   Z
CubeSourcer   r   r   r!   r   r   )r   r   r   r"   r   r#   r   r   r   r   Ú
cube_actor8   s    r%   é@   c           	      C   sL   t j| ||d�}t  ¡ }t||jƒ t j||d�}t j||d�}| ¡  |S )z. Creates a cylinder and returns a tvtk.Actor. )r   r   r   r   r   )r   ZCylinderSourcer   r   r   r!   r   r   ©	r   r   r   r   r   r"   r   Úpropr   r   r   r   Úcylinder_actorD   s    ÿr)   c                 C   sJ   t j| ddd�}t  ¡ }t||jƒ t j|d�}t j||d�}| ¡  |S )z0 Creates an earth source and returns the actor. é   r   )r   Zon_ratioÚoutline)r   r   )r   ZEarthSourcer   r   r   r!   r   r   )r   r   r"   r   r(   r   r   r   r   Úearth_actorQ   s    r,   é    c           	      C   sN   t j| |||d�}t  ¡ }t||jƒ t j||d�}t j||d�}| ¡  |S )z) Creates a sphere and returns the actor. )r   r   Ztheta_resolutionZphi_resolutionr   r   )r   ZSphereSourcer   r   r   r!   r   r   r'   r   r   r   Úsphere_actor\   s    þr.   é   c                 C   sJ   t j||d�}t  ¡ }t||jƒ t j|| d�}t j||d�}| ¡  |S )z* Creates a 3D Arrow and returns an actor. )Ztip_resolutionZshaft_resolutionr   r   )r   ZArrowSourcer   r   r   r!   r   r   )r   r   r   r"   r   r(   r   r   r   r   Úarrow_actorj   s    ÿr0   N)r   r   r   r   )r   r   )Ú__doc__Ztvtk.apir   Zvtk.utilr   Ztvtk.commonr   r   Zredr$   Zbluer%   Zgreenr)   r,   Zpurpler.   Zpeacockr0   r   r   r   r   Ú<module>   s&   	  ÿ
þ
ÿ

ÿ
