ó
a#nSc           @   s)   d  Z  d d l Z d d d „  ƒ  YZ d S(   s.    Tools to be used with Piddle/Sping canvases

iÿÿÿÿNt   ArrowLineToolc        	   B   s8   e  Z d  Z d „  Z d d d d d d d d d „ Z RS(   s5    supports drawing lines with arrows on the end(s)

  c      
   J   sÌ  d d d d d d d d d	 g	 } xJ | D]B } y d
 | | f d UWq( e  k
 ri d | | f d Uq( Xq( W|  j } | j | | | | d e d e ƒe |	 ƒ d e j }	 e r¼e j	 | | | | ƒ }
 e j |
 |	 } e j |
 |	 } | e
 e j | ƒ | e
 e j | ƒ f } | | f } | e
 e j | ƒ | e
 e j | ƒ f } e r’| j | | | g d e d e d e d d ƒq¼| j | | | | g d e d e ƒn  e rÈe j	 | | | | ƒ }
 e j |
 |	 } e j |
 |	 } | e
 e j | ƒ | e
 e j | ƒ f } | | f } | e
 e j | ƒ | e
 e j | ƒ f } e rž| j | | | g d e d e d e d d ƒqÈ| j | | | | g d e d e ƒn  d S(   s„   draws a line with arrow(s)

      **Arguments**

        - x1,y1,x2,y2: the endpoints of the line

      **Optional Keyword Arguments**

        - canvas: the canvas on which to draw

        - color: the color of the line

        - width: the width of the line

        - arrowBegin: toggles drawing an arrow at the beginning of the line

        - arrowEnd: toggles drawing an arrow at the end of the line

        - arrowAngle: the angle of the arrow's head

        - arrowLen: the length of the sides of the arrow

        - fillArrow: toggles filling the arrow head

        - arrowFillColor: the color used to fill the arrow head

    t   canvast   colort   widtht
   arrowBegint   arrowEndt
   arrowAnglet   arrowLent	   fillArrowt   arrowFillColors   %s = kwargs[%s]Ns   %s = self.%sg     €f@t	   edgeColort	   edgeWidtht	   fillColort   closedi   (   t	   NameErrorR   t   drawLineR   R   t   floatt   matht   piR   t   atan2R   t   cost   sinR   t   drawPolygonR	   t	   drawLinesR   (   t   selft   x1t   y1t   x2t   y2t   kwargst   optArgst   argR   R   t	   lineAnglet   ang1t   ang2t   p1t   p2t   p3(    (    sY   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/rdkit/utils/PiddleTools.pyt   draw   sD    	"..
*..
i    i   i   i
   c
   
      C   sU   | |  _  | |  _ | |  _ | |  _ | |  _ | |  _ | |  _ | |  _ |	 |  _ d S(   s   Constructor

      **Arguments**

        - canvas: the canvas on which to draw

        - color: the color of the line

        - width: the width of the line

        - arrowBegin: toggles drawing an arrow at the beginning of the line

        - arrowEnd: toggles drawing an arrow at the end of the line

        - arrowAngle: the angle of the arrow's head

        - arrowLen: the length of the sides of the arrow

        - fillArrow: toggles filling the arrow head

        - arrowFillColor: the color used to fill the arrow head


    N(	   R   R   R   R   R   R   R   R   R	   (
   R   R   R   R   R   R   R   R   R   R	   (    (    sY   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/rdkit/utils/PiddleTools.pyt   __init__U   s    								N(   t   __name__t
   __module__t   __doc__R&   t   NoneR'   (    (    (    sY   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/rdkit/utils/PiddleTools.pyR    	   s   	H(    (   R*   R   R    (    (    (    sY   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/rdkit/utils/PiddleTools.pyt   <module>   s   