ó
±™xTc           @   s”   d  d l  m Z d „  Z d e f d „  ƒ  YZ d „  Z d e f d „  ƒ  YZ d e f d	 „  ƒ  YZ d
 e f d „  ƒ  YZ d e f d „  ƒ  YZ	 d S(   iÿÿÿÿ(   t   divisionc         C   s   | j  d |  d | ƒ d S(   s,   
  An object without an altloc identifier
  t   datat   coordinatesN(   t   process_regular(   R   R   t	   processor(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/altloc.pyt   Empty   s    t	   Alternatec           B   s    e  Z d  Z d „  Z d „  Z RS(   s2   
  An object assigned with an altloc identifier
  c         C   s   | |  _  d  S(   N(   t
   identifier(   t   selfR   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/altloc.pyt   __init__   s    c         C   s#   | j  d | d | d |  j ƒ d  S(   NR   R   R   (   t   process_altlocR   (   R   R   R   R   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/altloc.pyt   __call__   s    	(   t   __name__t
   __module__t   __doc__R	   R   (    (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/altloc.pyR      s   	c         C   s!   |  j  ƒ  } | r | j St Sd  S(   N(   t   parentt   altlocR   (   t   atomR   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/altloc.pyt	   altid_for   s    t   Descriptionc           B   s    e  Z d  Z d „  Z d „  Z RS(   sE   
  An internal format to allow processing with the visitor pattern
  c         C   s:   | |  _  | |  _ | r- t d | ƒ |  _ n	 t |  _ d  S(   NR   (   R   R   R   t   strategyR   (   R   R   R   t   altid(    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/altloc.pyR	   .   s
    		c         C   s&   |  j  d |  j d |  j d | ƒ d  S(   NR   R   R   (   R   R   R   (   R   R   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/altloc.pyt   accept:   s    			(   R   R   R   R	   R   (    (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/altloc.pyR   )   s   	t   Indexerc           B   s    e  Z d  Z d „  Z d „  Z RS(   s,   
  Indexer that takes into account altloc
  c         C   s%   | |  _  |  j  ƒ  |  _ i  |  _ d  S(   N(   t   factoryt   regulart   altlocs(   R   R   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/altloc.pyR	   H   s    	c         C   s   |  j  ƒ  |  j | <d  S(   N(   R   R   (   R   R   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/altloc.pyt   addP   s    (   R   R   R   R	   R   (    (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/altloc.pyR   C   s   	t   Inserterc           B   s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   s#   
  Fills up an indexer with data
  c         C   s   | |  _  d  S(   N(   t   indexer(   R   R   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/altloc.pyR	   [   s    c         C   s    |  j  j j d | d | ƒ d  S(   Nt   objectt   position(   R   R   R   (   R   R   R   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/altloc.pyR   `   s    c         C   sL   | |  j  j k r( |  j  j d | ƒ n  |  j  j | j d | d | ƒ d  S(   NR   R   R   (   R   R   R   (   R   R   R   R   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/altloc.pyR
   e   s    (   R   R   R   R	   R   R
   (    (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/altloc.pyR   V   s   		t
   Aggregatorc           B   s8   e  Z d  Z d „  Z e d „  ƒ Z d „  Z d „  Z RS(   s?   
  Queries the indexer and returns altloc-correct neighbours
  c         C   s   | |  _  g  |  _ d  S(   N(   R   t   ranges(   R   R   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/altloc.pyR	   r   s    	c         C   s    d d l  m } | j |  j ƒ S(   Niÿÿÿÿ(   t   chain(   t	   itertoolsR"   t   from_iterableR!   (   R   R"   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/altloc.pyt   entitiesx   s    c         C   s_   |  j  j |  j j j d | ƒ ƒ x6 |  j j j ƒ  D]" } |  j  j | j d | ƒ ƒ q5 Wd  S(   Nt   centre(   R!   t   appendR   R   t   close_toR   t   values(   R   R   R   R   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/altloc.pyR      s    "c         C   sa   |  j  j |  j j j d | ƒ ƒ | |  j j k r] |  j  j |  j j | j d | ƒ ƒ n  d  S(   NR&   (   R!   R'   R   R   R(   R   (   R   R   R   R   (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/altloc.pyR
   ‡   s    "	(   R   R   R   R	   t   propertyR%   R   R
   (    (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/altloc.pyR    m   s
   		N(
   t
   __future__R    R   R   R   R   R   R   R   R    (    (    (    sC   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/geometry/altloc.pyt   <module>   s   		