%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/reportlab/graphics/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/reportlab/graphics/__pycache__/shapes.cpython-312.pyc

�

׸�e������dZdZddlZddlZddlmZmZmZmZm	Z	m
Z
ddlmZddl
mZmZmZmZmZddlmZddlmZdd	l�dd
lmZmZeedd��Zdd	l�ddlm Z dd
l!m"Z"ddl#m$Z$ddl%m&Z&m'Z'e$edd�Z(e$edd�Z)e$edd�Z*dZ+dZ,idd�dejZ�dd�dd�dd�dd�dd�dd�dd�dd�dd�d d�d!ejZ�d"e&�d#d�d$e�d%d&�Z.dd	l/�d'�Z0d(�Z1Gd)�d*�Z2Gd+�d,�Z3d-�Z4d.�Z5d/�Z6d0�Z7Gd1�d2e3e2�Z8Gd3�d4e8�Z9dld5�Z:dld6�Z;dmd7�Z<d8�Z=Gd9�d:e9e�Z>Gd;�d<�Z?Gd=�d>e@�ZAeA�ZAGd?�d@e8�ZBGdA�dBeB�ZCGdC�dDeB�ZDeEeFdE��\ZGZHZIZJdFZKgdG�ZLdndH�ZMdde'e'dIe'dJe'e&e&dKe&dLe&iZNGdM�dNeD�ZOeO�ZPdodO�ZQGdP�dQeO�ZRgdddfdR�ZSGdS�dTeD�ZTGdU�dVeD�ZUGdW�dXeD�ZVGdY�dZeD�ZWGd[�d\eD�ZXGd]�d^eD�ZYGd_�d`eB�ZZGda�dbeO�Z[defdc�Z\Gdd�dee8�Z]Gdf�dge2�Z^Gdh�die8�Z_dj�Z`eadkk(re`�yy)pz3.5.60z9Core of the graphics library - defines Drawing and Shapes�N)�pi�cos�sin�sqrt�radians�floor)�Flowable)�
shapeChecking�verbose�defaultGraphicsFontName�_unset_�
decimalSymbol)�logger)�colors)�*)�isSeq�asBytes�)�fp_str)�stringWidth)�tt2ps)�
FILL_EVEN_ODD�
FILL_NON_ZEROzNon-Zero WindingzEven-Odd�	transform�rrrrrr�strokeColor�strokeWidth�
strokeLineCap�strokeLineJoin�strokeMiterLimit�
�strokeDashArray�
strokeOpacity�fillOpacity�
fillOverprintF�strokeOverprint�
overprintMask�	fillColor�fillMode�fontSize�fontName�
textAnchor�startc	�x�d}|D]}t|t|||��}�t|�|z}|}	|ddk(r	|}
|	|z
}	n|ddk(rd}
n|dz}
|	|
z}	|ddk(r|}|dk(rd}nI|dk(r|}n@|dz}n9|dd	k(rd}|dk(r|}n'|dk(rd}n|dz}n|dz}|dk(r|}n
|dk(r|}nd}||
||||	fS)
Nr�s�ng@����e�endr-�w)�maxr�len)
�text�fontr*�leadingr,�	boxAnchorr4�t�h�yt�yb�xb�xts
             �;/usr/lib/python3/dist-packages/reportlab/graphics/shapes.py�_textBoxLimitsrBCs(��	�A�
�1����+�a��h�/�0��1�	�D�	�'��A�	�B���|�S���R��
�!�V��	�1��s�	�
���R��V��
�"�W����}�c���R���u��1�b�
��
 ��r�"��2�c�6�b�	�2���	�
���u��1�b�
��
 �q�"��S�5�b��R��V���u��B�3�b�
��
 �r�"��b�
�r�1�a��R���c	��tt|�||f||z|f||z||zf|||zff�}|D�cgc]}|d��	}}|D�cgc]}|d��	}}t|�t|�t|�t|�|fScc}wcc}w)z�
    Find the corner points of the rotated w x h sized box at x,y
    return the corner points and the min max points in the original space
    rr)�zTransformPoints�rotate�minr5)�x�yr4r<�angle�C�X�Ys        rA�_rotatedBoxLimitsrNes���
	�����1��q��s�1�g�q��s�1�Q�3�i��1�Q�3��'H�I�A���!��1���A����!��1���A���q�6�3�q�6�3�q�6�3�q�6�1�,�,��	��s�A=�Bc��eZdZdZd�Zy)�_DrawTimeResizeablez:Addin class to provide the horribleness of _drawTimeResizec��t|d�rG|j}|j}||c|_|_t|d�r|j||�yyy)N�_canvas�_drawTimeResize)�hasattrrR�_drawing�width�heightrS)�selfr4r<�canvas�drawings     rArSz#_DrawTimeResizeable._drawTimeResizeqsS���4�	�"��\�\�F��o�o�G�,-�q�)�G�M�7�>��v�/�0��&�&�q��+�1�	#rCN)�__name__�
__module__�__qualname__�__doc__rS�rCrArPrPos
��D�,rCrPc��eZdZifd�Zy)�_SetKeyWordArgsc�N�|j�D]\}}t|||��y)z9In general properties may be supplied to the constructor.N)�items�setattr)rX�keywords�key�values    rA�__init__z_SetKeyWordArgs.__init__zs(��"�.�.�*�	&�J�C���D�#�u�%�	&rCN)r[r\r]rhr_rCrArarays
�� "�&rCrac��|D�cgc]}|��|��	}}|sy|d\}}}}|ddD]$\}}}	}
||kr|}|	|kDr|	}||kr|}|
|kDs�#|
}�&||||fScc}w�Nrrr_)�rectListrH�L�xMin�yMin�xMax�yMax�x1�y1�x2�y2s           rA�getRectsBoundsru�s����.�q��
��.�A�.��T��q�T��D�$��d��a�b�E����R��R�
��9��D�
��9��D�
��9��D�
��9��D��
�$��d�#�#��	/s
�A�Ac���|d||z
zz
|z
}d|d|zz
|zz}||z
}|g}||zd|z|zz
}|dk\r�t|�}|dkr|}d||zz}	g}
	|
j|	|z�	|
j||	z�|dz}|dz}|
D]4}d|cxkrdks�n�|j||||z|zz|zz|z��6|j|�|S#Y�oxYw#Y�axYw)ag
    this is used to find if a curveTo path operator has extrema in its range
    The curveTo operator is defined by the points y0, y1, y2, y3

        B(t):=(1-t)^3*y0+3*(1-t)^2*t*y1+3*(1-t)*t^2*y2+t^3*y3
            :=t^3*(y3-3*y2+3*y1-y0)+t^2*(3*y2-6*y1+3*y0)+t*(3*y1-3*y0)+y0
    and is a cubic bezier curve.

    The differential is a quadratic
        t^2*(3*y3-9*y2+9*y1-3*y0)+t*(6*y2-12*y1+6*y0)+3*y1-3*y0

    The extrema must be at real roots, r, of the above which lie in 0<=r<=1

    The quadratic coefficients are
        a=3*y3-9*y2+9*y1-3*y0 b=6*y2-12*y1+6*y0 c=3*y1-3*y0
    or
        a=y3-3*y2+3*y1-y0 b=2*y2-4*y1+2*y0 c=y1-y0  (remove common factor of 3)
    or
        a=y3-3*(y2-y1)-y0 b=2*(y2-2*y1+y0) c=y1-y0

    The returned value is [y0,x1,x2,y3] where if found x1, x2 are any extremals that were found;
    there can be 0, 1 or 2 extremals
    ���rg�g�?r)r�append)�y0rrrt�y3�a�b�crM�d�q�Rr;s            rA�_getBezierExtremar��s$��0	��B�r�E��l�2�o�A���A�b�D����n�A���e�A�	��A�	
�!��a��c�!�e��A��!�t���G���Q�3�Q�B���!�A�#�J����	�
�H�H�Q�q�S�M�	�
�H�H�Q�q�S�M�	
�S���	�Q����	-�A��!�w�Q�w�����A�q��s�1�u�I�a�K���+�,�	-��H�H�R�L��H��	���	��s�C�+C�C�C c
��t|�}|fd�}tt|td|d���}tt|td|d���}t	|�t	|�t|�t|�fS)Nc��||S�Nr_)�i�ps  rA�<lambda>zgetPathBounds.<locals>.<lambda>�s
��Q�q�T�rCrrxr)r6�list�map�rangerGr5)�pointsr0�f�xs�yss     rA�
getPathBoundsr��sd���F��A��!�A�	
�c�!�E�!�A�a�L�!�	"�B�	
�c�!�E�!�A�a�L�!�	"�B���G�S��W�c�"�g�s�2�w�/�/rCc���|d}t|�rN|D�cgc]}|d��	}}|D�cgc]}|d��	}}t|�t|�t|�t|�fSt|�Scc}wcc}w)z"Helper function for list of pointsrr)rrGr5r�)�	pointList�first�xyr�r�s     rA�getPointsBoundsr��sr���a�L�E��U�|�'�
(��b��e�
(��
(�'�
(��b��e�
(��
(��B���R��#�b�'�3�r�7�3�3��Y�'�'��	)��
(s
�A*�A/c�R�eZdZdZe�Zd�Zd
d�Zd�Zdd�Z	d�Z
er	d�Zd�Z
y	)�Shapea1Base class for all nodes in the tree. Nodes are simply
    packets of data to be created, stored, and ultimately
    rendered - they don't do anything active.  They provide
    convenience methods for verification but do not
    check attribiute assignments or use any clever setattr
    tricks this time.c�F�td|jjz��)zReturn a clone of this shape.z!No copy method implemented for %s)�NotImplementedError�	__class__r[�rXs rA�copyz
Shape.copy�s��"�"E����H_�H_�"_�`�`rCc�j�i}|jj�D]\}}|dddk7s�|||<�|S)zDInterface to make it easy to extract automatic
        documentationrr�_)�__dict__rc)rX�recur�propsrfrgs     rA�
getPropertieszShape.getProperties�sF�����-�-�-�-�/�	#�J�C���1�Q�x�3��"��c�
�	#��rCc�:�|jj|�y)zfSupports the bulk setting if properties from,
        for example, a GUI application or a config file.N)r��update)rXr�s  rA�
setPropertieszShape.setProperties�s��	
�
�
���U�#rCc��t|j�j��}|j�|r|dz}|D]\}}t	|�|�d|����y)z�Convenience. Lists them on standard output.  You
        may provide a prefix - mostly helps to generate code
        samples for documentation.�.z = N)r�r�rc�sort�print)rX�prefix�propList�namergs     rA�dumpPropertieszShape.dumpPropertiessW��
��*�*�,�2�2�4�5���
�
����c�\�F�%�	7�M�T�5����u�5�6�	7rCc��|j��|jj�D]&}|ddk7s�||jvr�Jd|�d|����|jj�D]_\}}t	||�s
Jd|�d|����t||�}|j
|�r�=Jd|�d	|�d
|jj����yy)a.If the programmer has provided the optional
        _attrMap attribute, this checks all expected
        attributes are present; no unwanted attributes
        are present; and (if a checking function is found)
        checks each attribute.  Either succeeds or raises
        an informative exception.Nrr�zUnexpected attribute z
 found in zMissing attribute z from zInvalid value z for attribute z
 in class )	�_attrMapr��keysrcrT�getattr�validater�r[)rXrf�attr�	metavaluergs     rA�verifyzShape.verifys����=�=�$��}�}�)�)�+�
e���q�6�S�=��$�-�-�/�d�Z]�_c�1d�d�/�
e�$(�=�=�#6�#6�#8�
K���i��t�T�*�Y�d�TX�,Y�Y�*���d�+�� �)�)�%�0�K�ej�lp�rv�sA�sA�sJ�sJ�3K�K�0�
K�	%rCc��t|||�y)zSBy default we verify.  This could be off
            in some parallel base classes.N)�validateSetattr)rXr�rgs   rA�__setattr__zShape.__setattr__%s��
�D��e�,rCc��td��)�5Returns bounding rectangle of object as (x1,y1,x2,y2)z+Shapes and widgets must implement getBounds�r�r�s rA�	getBoundszShape.getBounds*s��!�"O�P�PrCN)r)�)r[r\r]r^�AttrMapr�r�r�r�r�r�r
r�r�r_rCrAr�r��s@����y�H�a��$�
7�K�"�	6�	-�
QrCr�c��eZdZdZeeedd��eed��eed��eedd��eed	d���
�Z	d�Z
d�Zdd�Zd�Z
dd�Zd�Zd�Zd�Zd d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zy
)!�GroupaGroups elements together.  May apply a transform
    to its contents.  Has a publicly accessible property
    'contents' which may be used to iterate over contents.
    In addition, child nodes may be given a name in which
    case they are subsequently accessible as properties.z"Coordinate transformation to applyr��desc�
advancedUsagezContained drawable elements�r��Turn on stroke overprinting�Turn on fill overprinting�overprinting for ordinary CMYK)r�contentsr&r%r'c��|jj�|_g|_d|_|D]}|j	|��t
j
||�y)z�Initial lists of elements may be provided to allow
        compact definitions in literal Python code.  May or
        may not be useful.rN)r��cloner�r�addrarh)rX�elementsre�elts    rArhzGroup.__init__=sR���
�
�+�+�-��
���
�&����	�C��H�H�S�M�	�	� � ��x�0rCc��|rO|t|jj��vrtt�|j|<t|||�yy)zLif name is not None add an attribute pointing to node and add to the attrMapN)r�r�r��AttrMapValue�isValidChildrd)rXr��nodes   rA�
_addNamedNodezGroup._addNamedNodeMsC����4��
�
� 2� 2� 4�5�5�&2�<�&@��
�
�d�#��D�$��%�rCNc��|�@t|�sJd��|jj|�|j||�yy)z�Appends non-None child node to the 'contents' attribute. In addition,
        if a name is provided, it is subsequently accessible by name
        Nz1Can only add Shape or UserNode objects to a Group)r�r�rzr�)rXr�r�s   rAr�z	Group.addTsE��
����%�Z�'Z�Z�%��M�M� � ��&����t�D�)�rCc�B�|j|�|jdS)Nr1)r�r�)rXr�s  rA�_nnz	Group._nn^s��������}�}�R� � rCc��|�Wt|�sJd��|dkr|g|j||n|jj||�|j||�yy)z4Inserts sub-node n in contents at specified locationNz4Can only insert Shape or UserNode objects in a Groupr)r�r��insertr�)rXr�r0r�s    rAr�zGroup.insertbs[���=���?�Z�$Z�Z�?���s�%&�C��
�
�a��"��
�
�$�$�Q�q�)����t�A�&�
rCc�(�t|t�xr t|j|j�xs
t	�}|j
j
�|_t|d�r|jdd|_|j}|jj}|D]\}t|t�r|j�}n1t|t�r|j�}n|j�}||��^|j|�|S)z9Return a new object which only contains primitive shapes.rN)�
isinstance�DrawingrVrWr�r�r�rTrr�rz�UserNode�provideNode�expandUserNodesr��_copyNamedContents)rX�obj�
self_contentsr}�child�newChilds      rAr�zGroup.expandUserNodesls�����g�&�J�7�4�:�:�d�k�k�+J�U�e�g���}�}�*�*�,����3�{�#�T�^�^�A�5F�S�]��
�
�
��L�L����"�	�E��%��*� �,�,�.���E�5�)� �0�0�2�� �:�:�<��
�h�K�	�	
����$��
rCc�6�t�}t|d�r|j|_t|d�r|jdd|_|j	�dd}|r�|jd�}t
|t�r |j|j��nxt
|t�rW|j�}|jdk(r&|jj|j�n#|j|�n|j|�|r��|S)z return a fully expanded object�	__label__rNrr)r�rTr�r�getContents�popr�r�rzr��_exploder��extendr�)rXr��Pr0s    rAr�zGroup._explode�s����g���4��$��.�.�C�M��3�{�#�T�^�^�A�5F�S�]�����q�!������a��A��!�X�&��������)��A�u�%��J�J�L���;�;�
�-��L�L�'�'��
�
�3��G�G�A�J�����
���
rCc�\�|jD]}|jj|��yr�)r�rz)rXr�r�s   rA�
_copyContentszGroup._copyContents�s'���]�]�	'�E��L�L����&�	'rCc�P�ddlm}|j}|s#t|jj	��}|j
j
�D]R\}}||vr,|j|�}t|||j|��6||vs�;||vs�@t||||���Ty)Nr)r�)	r�r�r�r�r�r�rc�indexrd)	rXr��aKeys�noCopyr�r��k�v�poss	         rAr�zGroup._copyNamedContents�s�����
�
�
��d�4�=�=�#5�#5�#7�8�e��M�M�'�'�)�	)�D�A�q��M�!�#�)�)�!�,����Q����S� 1�2��e�������Q��Q��(�	)rCc��|jj�|_|j|�|j|�|S)z
copies to obj)r�r�r�r��rXr�s  rA�_copyzGroup._copy�s7���}�}�*�*�,������3������$��
rCc�@�|j|j��S)zreturns a copy)r�r�r�s rAr�z
Group.copy�s���z�z�$�.�.�*�+�+rCc�L�t|jt|��|_y�z&Convenience to help you set transformsN)�mmultrrF)rX�thetas  rArFzGroup.rotate�s���t�~�~�v�e�}�=��rCc�N�t|jt||��|_yr�)r�r�	translate)rX�dx�dys   rAr�zGroup.translate�s���t�~�~�y��R�/@�A��rCc�N�t|jt||��|_yr�)r�r�scale)rX�sx�sys   rArzGroup.scale�s���t�~�~�u�R��}�=��rCc�r�tt|jt|��t|��|_yr�)r�r�skewX�skewY)rX�kx�kys   rA�skewz
Group.skew�s#���u�T�^�^�U�2�Y�?��b�	�J��rCc�6�|jdd||fz|_y)z2Convenience function to set the origin arbitrarilyN���)r�rXrHrIs   rA�shiftzGroup.shift�s�������,�a��U�2��rCc��t|_|jj|j�||_||_y)z| Convenience function to make a drawing from a group
            After calling this the instance will be a drawing!
        N)r�r�r�r��_xtraAttrMaprVrW)rXrVrWs   rA�	asDrawingzGroup.asDrawing�s1��!����
�
���T�.�.�/���
���rCc�P�t|dd�}|j}|r
||vr|g|z}|S)z[Return the list of things to be rendered
        override to get more complicated behaviour�
backgroundN)r�r�)rXr~rKs   rAr�zGroup.getContents�s3��
�D��d�+���M�M����!��!��Q��Q��rCc�<�|jr�g}|jD]!}|j|j���#t|�}|�y|\}}}}|j}||g||g||g||gg}g}	|D]}
|	jt||
���t
|	�Syr�)r�rzr�rur�transformPointr�)rXr~�elemrqrrrsrt�trans�corners�
newCorners�corners           rAr�zGroup.getBounds�s����=�=��A��
�
�
+��������)�*�
+���"�B��z�$��N�B��B���N�N�E��2�w��R��2�r�(�R��G�<�G��J�!�
A���!�!�.���"?�@�
A�"�:�.�.�rCr�)N)r�)r[r\r]r^r�r��isTransform�isListOfShapes�	isBooleanr�rhr�r�r�r�r�r�r�r�r�r�rFr�rr	r
rr�r�r_rCrAr�r�.s���<�� ��2V�ef�g���4Q�R�&�y�6S�T�$�Y�4O�^_�`�$�Y�4T�cd�e�
�H�1� &�*�!�'��,�*'�	)��,�>�B�>�K�3���rCr�c��ddlm}|j}||�j}|xs|j}||vr|g||<y|||vr||j	|�yy)z7add an import of obj's class to a dictionary of importsr)�	getmoduleN)�inspectrr�r[rz)r��Ir0rr�ms      rA�
_addObjImportr"�s[��!��
�
�A��!����A�	��Q�Z�Z�A���z��s��!��	
�!�A�$��	�!����A��
rCc�z�t|t�rt|�St|�rRd}|D]}|dt	||�zz}�t|t
�rd|ddzSd|dd�t
|�dk(xrdxsd�d	�S|tur|r
t||d
�y
t|t��r|rt||�ddl
m}||j�\}}}}}	}
}|r|t
|�d}|t
|�d�=ng}|j�}
|jjdz}|ddD]&}|
j!|d�}|dt	||�zz
}�(|D])}|
j!|d�}||�d
t	||��d�z
}�+|
j#�D]\}}|
|}||�d
t	||��d�z
}�!|ddd	zSt%|�S)zEreturn a repr style string with named fixed args first, then keywordsr�z%s,z[%s]Nr1�(r�,�)�
EmptyClipPathr)�getfullargspec�=)r��floatrr�_reprr�r6r'r"r�rr(rhr�r�r[r�rc�repr)rXr r/r�r(�args�varargs�varkw�defaults�
kwonlyargs�kwonlydefaults�annotations�kargsr�r0s               rAr+r+�s����$�u���d�|��	�t�����	'�A��E�E�!�A�J�&�&�A�	'��d�4� ��A�c�r�F�?�"�!� !��"�v�c�$�i��l�&:�s�&@�b�&@�A�A�	
��	��m�D��?�3��	�D��	��m�D��#�*�R`�ae�an�an�Ro�O��g�u�h�
�N�K���#�h�-���)�E��c�(�m�^�_�%��E���� ���N�N�#�#�C�'���a�b��	$�A����a��
�A�
���q���#�#�A�	$��	+�A����a��
�A�
�Q�u�Q�q�z�*�*�A�	+��7�7�9�	,�C�A�a��!��A�
�Q��a��
�+�+�A�	,���"�v�c�z���D�z�rCc	�T�d}t|dd�}|r||�|�dt|��d�z}|j}|D]o}t|t�rFd|z}|dz
}t|dd�}	|	rd|	z}	||�|�d	|�d
|	�d�z}|t|||||�z}|dz}�Y||�|�dt||��d�z}�q|S)
Nr�rz
.transform = �
zv%drr��#r)z
._nn(Group())z.add(z)
)r�r+r�r�r��_renderGroupPy)
�G�pfxr r��indentr/rKr0�npfx�ls
          rAr8r8s���
�A���+�d�#�A��a�f�S��q��B�C�!�	
���A�
�
?���a����1�9�D�
��F�A���+�b�)�A��C��E�!��&��c�!�D�D�A��N�1�T�!�A�f�5�5�A�
��F�A���s�5��1�:�>�>�A�
?�
�HrCc���|j|j�t|�}|j�D��cic]\}}|j	|�s�||d|��c}}Scc}}wr�)r�r�r6rc�
startswith)rXr:�kwr0r�r�s      rA�_extraKWrA/sN���I�I�d�m�m���C��A�!�x�x�z�?���!�Q�\�\�#�->�A�a�b�E�!�G�?�?��?s�A �A c��eZdZdZhd�Zehd�z
Zeeed��eed��ed�ee	d��ee
d	d
dd�d
��ee
dddd�d��eed��eed��eed����	Z
eeeee
e�dd��d����Zej#e
�d$d�Zd�Zefd�Zd�Zd�Zd�Zd �Zd%d!�Zd&d"�Zd'd#�Zy)(r�zOutermost container; the thing a renderer works on.
    This has no properties except a height, width and list
    of contents.>�ps�py�bmp�eps�gif�jpg�pct�pdf�png�svg�tif�jpeg�pict�tiff�tiff1�tiffl�tiffp>rCrDrFrJrLzDrawing width in points.r�zDrawing height in points.Nz=Background widget for the drawing e.g. Rect(0,0,width,height)�LEFT�RIGHT�CENTER�CENTREz+Horizontal alignment within parent document�TOP�BOTTOMz)Vertical alignment within parent documentzGlobal scaling for renderingz.override the STATE_DEFAULTS value for fontNamez.override the STATE_DEFAULTS value for fontSize)	rVrW�canvr�hAlign�vAlign�renderScale�initialFontName�initialFontSizerr)�lo�emptyOKzOne or more plot modes)�BASE�formatsc��d|_tj|g|��i|��||_||_d|_d|_d|_y)NrTrY��?)rr�rhrVrWr[r\r])rXrVrW�nodesres     rArhzDrawing.__init__dsC�����
���t�.�U�.�X�.���
������������rCc	�x�gd�gd�d�}t|j�d|�}d|jjz}d}|j	�D]-\}}|d|�dt|�d	d
j
dd��d
�z}�/|d|zz}|d|j�d|j�d�z}|dz}||z}|d|zz}|S)N)�_DrawingEditorMixinr�r�)�Color�	CMYKColor�
PCMYKColor)zreportlab.graphics.shapeszreportlab.lib.colorsrX�ExplodedDrawing_z0#Autogenerated by ReportLab guiedit do not edit
zfrom z import rr1�'r�r6z(
class %s(_DrawingEditorMixin,Drawing):
z	def __init__(self,width=z,height=z,*args,**kw):
z1		Drawing.__init__(self,width,height,*args,**kw)
zZ

if __name__=="__main__": #NORUNTESTS
	%s().save(formats=['pdf'],outDir='.',fnRoot=None)
)	r8r�r�r[rc�str�replacerVrW)rXr r9r0r/r!�os       rA�	_renderPyzDrawing._renderPyms���-V�(J�
��
�4�=�=�?�6�!�4������!8�!8�8��?���G�G�I�	M�D�A�q��Q�s�1�v�a��|�/C�/C�C��/K�L�L�A�	M�
�<�q�@�@��
�4�:�:�VZ�Va�Va�b�b��
�F�F��
��E��
�u�xy�y�y���rCc��ddlm}|j||jdd|tur|��yt|dt���y)z�This is used by the Platypus framework to let the document
        draw itself in a story.  It is specific to PDF and should not
        be used directly.r��	renderPDF�
_showBoundary��showBoundaryN)�reportlab.graphicsrt�drawrZr
r�)rXrwrts   rAryzDrawing.draw~sI��	1����t�T�Y�Y��1�-9��-H�\�	�	u�NU�VZ�[j�kr�Ns�	�	urCc�p�|j}|j}|j}|dk7r
||z}||z}||fS)Nre)rVrWr])rX�
availWidth�availHeightrVrWr]s      rA�wrapzDrawing.wrap�sE���
�
�������&�&������[� �E��k�!�F��f�}�rCc�t�tj|�}|j|_|j|_|S)z:Return a new drawing which only contains primitive shapes.)r�r�rVrWr�s  rAr�zDrawing.expandUserNodes�s-���#�#�D�)���J�J��	��[�[��
��
rCc�l�|j|j|j|j��S)zReturns a copy)r�r�rVrWr�s rAr�zDrawing.copy�s$���z�z�$�.�.����T�[�[�A�B�BrCc�6�|jt|i|���Sr�)r�r�)rXr-r@s   rA�asGroupzDrawing.asGroup�s���z�z�%��+��+�,�,rCc
�:�|jdd�}t|t�rd|z}nd}|dz
}ddlm}d}	|s`t|d|jjdz�}t|d	d�}
t|
d
�r|
|�}
t|d
�r	||
�}n	||
z}|�
t|d
d�}t|d
�r||�}tjj|�r#tjj|�\}}n|xs
t|d
d�}|j!�j!tj"�}|sd}tjj|�sYtjj%t|dtjj't(j*d��|�}tjj-|�stj.|�tjj1tjj%||��}tjj3|�}
|
dddj5�|j6vr|
d}|xst|ddg�D�cgc]}|j5���}
}|duxr|fxst|d|�fd}t8j:j<t8j>j<f}|xt8j:_t8j>_d|
vr�ddl m!}|dz}|rtE|d|fz�|jF|||fdt|d|jH�itK|dfi|����|	dz}	t(jLdk(r:ddl'}ddl(}|jS|�jUdd�|jW|�|jXD]�}||
vs�ddl m-}|�d|��}|rtE|||fz�t|dd�}|r2t|d|g�}||vrt|d d�s|j]�nd}|jF||f|t|d|jH�d!�tK|d"fi|����|	d#z|z}	|s��|j_|���d$|
vr�	dd%l0m1}|d'z}|rtE|d(|fz�|jF||f|t|d)d*g�dt|d)dd+g�dt|d,|jh�t|d|jH�t|d-|jj�d.�tK|d/fi|����|	d0z}	d1|
vrXdd2l m6}|d3z}|rtE|d4|fz�|jF||fdt|d|jH�itK|d5fi|����|	d6z}	d7|
vrXdd&l m3}|d8z}|rtE|d(|fz�|jF||fdt|d|jH�itK|d/fi|����|	d9z}	d:|
vrw|d;z}|rtE|d:|fz�to|d<�5}|jqts|ju�jwd=tjx���ddd�|	d>z}	|\t8j:_t8j>_t|d?�r|j{||	�|	xr||	ddzxsdS#t$r)}t|�jd�dkr�Yd}~��Td}~wwxYwcc}w#td$r
dd&l m3}Y��xwxYw#1swY��xYw)@z�Saves copies of self in desired location and formats.
        Multiple formats can be supported in one call

        the extra keywords can be of the form
        _renderPM_dpi=96 (which passes dpi=96 to renderPM)
        �	seqNumberr�z%4d: zgenerating %s file %sr��	rl_config�fileNamePatternz%03d�chartId�__call__znot all arguments convertedN�outDirr��
_override_CWDrrcrJrrsz.pdf�PDFrw�
showBorder�_renderPDF_z/.pdf�mac�CAROzPDF ��renderPM�_drawTimeCollector�disabled��fmtrw�
_renderPM_z/.rF��renderPS_SEP��renderPSz.eps�EPS�EPS_info�Testing�	ReportLab�preview�	ttf_embed)�title�dept�companyr�rwr��
_renderPS_z/.epsrL��	renderSVGz.svg�SVG�_renderSVG_z/.svgrCz.psz/.psrDz.py�wbr6z/.py�
saveLogger)>r�r��int�	reportlabr�r�r�r[rT�	TypeErrorrn�find�os�path�isabs�split�rstrip�sep�join�dirname�sys�argv�isdir�makedirs�normpath�splitext�lower�
_saveModesr�warnOnce�enabled�infoOncerxrtr��
drawToFilerwrA�platform�macfs�
macostools�FSSpec�SetCreatorType�touched�_bmModesr��clear�save�rlextra.graphicsr��ImportErrorr��eps_preview�
eps_ttf_embedr��open�writerrqro�linesepr�)rXrcr�fnRootr�r�r@�genFmtr��extr��err�fnroot�plotModerH�_savedrt�filenamer�r��bmFmtr��dtc�dtcfmtsr�r�r�s                           rAr�zDrawing.save�s*������B�'���f�S�!��v�%�F��F��)�)��'�����T�"3�T�^�^�5L�5L�V�5S�U�F��d�9�Q�/�G��w�z�*�!�$�-���v�j�)�����O�#�g�-�F��>��T�(�4�0�F��6�*�%��D�\�F�
�7�7�=�=�� ��W�W�]�]�6�2�N�F�F��9�w�t�H�S�9�F�����'�'����/����v��w�w�}�}�V�$�r�w�w�|�|�G�D��Y[�Y`�Y`�Yh�Yh�il�iq�iq�rs�it�Yu�<v�w}�/~�f��w�w�}�}�V�$�b�k�k�&�&9����!�!�"�'�'�,�,�v�f�"=�>���7�7�#�#�F�+���A�;�q�r�?� � �"�d�o�o�5��a�[�F�(/�(R�7�4�	�5�'�3R�T�!�A�G�G�I�T��T��$�&�5�G�:�[�'�$�y�QX�:Y�9[�]^�_�����(�(�&�/�/�*A�*A�A��<C�C�����&�/�/�"9��H��4��f�}�H���f��h�'7�7�8� �I� � ��x��
\�W�T�R^�_h�_u�_u�Ev�
\�zB�CG�HU�z[�XZ�z[�
\���.�C��|�|�U�"�(����X�&�5�5�f�f�E��"�"�8�,��]�]�	+�E��� �7�&,�U�3���E�&�E�(�+;�";�<��d�#7��=���%�c�)�U�G�<�G���'���J�q�0I��	�	��"��#��#�#�D�(�`�u�'�RV�Wc�dm�dz�dz�J{�`�G�HL�MY�_�\^�_�`��D�j�5�(�������*�	+� �H��
8�E��f�}�H���f��h�'7�7�8��H���� (�
D�(.�'.�t�J�	�{�'K�A�'N�*1�$�z�2�k�BR�*S�TU�*V�*1�$�y��AV�AV�*W�-4�T�,�y�G]�G]�-^�*1�$�{�9�CZ�CZ�*[�
D�#+�4��"B�r�"B�
D���.�C��H��4��f�}�H���f��h�'7�7�8� �I� � �� (�
D�-4�T�,�y�G]�G]�-^�
D�ai�jn�o|�bC�@B�bC�
D���.�C��8��3��e�|�H���f��h�'7�7�8��H����h�
S�W�T�,�W`�Wm�Wm�=n�
S�qy�z~�@L�rR�OQ�rR�
S���-�C��8���e�|�H���f��X��6�7��h�t�$�
L��������� 0� 8� 8��b�j�j� I�J�K�
L���-�C�;A�8��������!8��4��%��O�O�F�3�'��%�v�c�!�"�g�~�+��+��C!�O��3�x�}�}�%B�C�a�G��G��O��,U��D�
8�7�7�
8��D
L�
L�s=�[�[6�[;�A\�	[3�
[.�.[3�;\�
\�\c	��||jvs
Jd|z��ddlm}|dk(rddlm}|j|�S||jvr<ddlm}|j
|f|t|d|j�d�t|d	fi|����S|d
k(r0	ddlm}|j||t|d|j��
�S|dk(r.ddlm}|j|t|d|j���S|dk(r|j�S|dk(r;ddlm}	|	j
|fdt|d|j�it|dfi|����Sy#t$r	ddlm}Y��wxYw)z,Converts to an 8 bit string in given format.zUnknown file format "%s"rr�rJrsr�r�r�r�rFr�r�)r�rwrCrvrDrLr�rwr�N)r�r�r�rxrt�drawToStringr�r�r�rwrAr�r�r�r�rqr�)
rX�formatrr�r@r�rtr�r�r�s
          rA�asStringzDrawing.asStrings�������(�M�*D�v�*M�M�(�'��U�?�4��)�)�$�/�/�
�t�}�}�
$�3�(�8�(�(��X�6�w�t�T`�%�2�2�H4�X�6>�t�L�6V�SU�6V�X�
X�
�u�_�
8�E��(�(��*1�-4�T�,�y�G]�G]�-^�)�`�
`��t�^�3��(�(��G�D��V_�Vl�Vl�<m�(�n�n�
�t�^��>�>�#�#�
�u�_�4�)�9�)�)�$�S�G�D��V_�Vl�Vl�<m�S�px�y}�L�qR�OQ�qR�S�
S����
8�7�
8�s�E�E�Ec�,�|j�}|j}|j}t||g|���}	|	j	�\}
}}}
|dk(s|dk(rO|
|ks|||z
kDs
||ks|
||z
kDr5||
z
|z|z|	_|
|z
|z|z|	_dddd||
z
||z
f|	_|	S|dk(s|dk(r/|
|ks|||z
kDr"||
z
|z|z|	_dddd||
z
df|	_|	S|dk(s|dk(r-||ks|
||z
kDr |
|z
|z|z|	_ddddd||z
f|	_|	S)	z?return a base class drawing which ensures all the contents fits�fit�expandrr�fitx�expandx�fity�expandy)r�rVrWr�r�r)rX�kind�lpad�rpad�bpad�tpadrK�oW�oHrZ�xL�yL�xH�yHs              rA�resizedzDrawing.resized7sg�������
�Z�Z��
�[�[���"�R�#��#���'�'�)���2�b����;�4��>�r�$�w�"�R��W�*��4��SU�VX�Y]�V]�S]��r�E�$�J�t�O�G�M���U�4�Z��_�G�N�!"�1�Q�q��b���b�� 9�G����
�6�\�d�I�o�2�d�7�b��D��j��r�E�$�J�t�O�G�M�!"�1�Q�q��b��� 3�G�����6�\�d�I�o�2�d�7�b��D��j���U�4�Z��_�G�N�!"�1�Q�q��4��7� 3�G���rC)i���)NNNNr�)Nr)r�rrrr)r[r\r]r^r�r�r�r��isNumber�isValidChildOrNone�OneOf�isStringOrNone�isNumberOrNonerr��
SequenceOfr�r�rhrqr
ryr}r�r�r�r�r�r�r_rCrAr�r�4s����J�(�9�9�H���X�+E�F��h�,G�H��D�!�!�"4�:y�z��e�F�G�X�x�H�O|�}��e�E�8�X�x�H�Oz�{�#�8�1O�P�&�~�;k�l�&�~�;k�l�
�L��E�"�:��z�"��Q�$ �&>�@��H�

�O�O�L�!���" '�u���C�-�z,�xS�<rCr�c��eZdZdZdd�Zy)rhz<This is a mixin to provide functionality for edited drawingsNc�x�t|�}|r\t|d�rPd|jvr|jj	�|_|r|�t}t||�|j|<t|d�r+|r)|r|j
|||�y|j||�y|rt|||�ytd��)zb
        effectively setattr(obj,name,value), but takes care of things with _attrMaps etc
        r�Nr�zCan't add, need name)
r�rTr�r�r�r�r�r�rd�
ValueError)rXr�rgr�r�r�r��ivcs        rA�_addz_DrawingEditorMixin._addLs����5�!���G�C�
�+�����-�"�|�|�1�1�3����x�'�L��!-�h�t�!<�C�L�L����3�u��#���
�
�3�u�T�*�����d�#�
��C��U�#��3�4�4rC�NNNN)r[r\r]r^rr_rCrArhrhJs
��F�5rCrhc��eZdZd�Zy)�isStrokeDashArrayc��tj|�xs6t|ttf�xrt|d�xrt
|d�Srj)�isListOfNumbersOrNone�testr�r��tupler��isListOfNumbers)rXrHs  rArzisStrokeDashArray.testasG��$�)�)�!�,�y��A�t�E�l�1K�1x�PX�YZ�[\�Y]�P^�1x�cr�st�uv�sw�cx�yrCN)r[r\r]rr_rCrArr`s��zrCrc���eZdZeee�ee�eeddd�d��eeddd�d��eed��eed��ee	d	��ee
d
��ee
dd���
�	Zd�Zy)�	LineShaperrrxz#Line cap 0=butt, 1=round & 2=squarer�z$Line join 0=miter, 1=round & 2=bevelz$miter limit control miter line joinsz[numbers] or [phase,[numbers]]zEThe level of transparency of the line, any real number betwen 0 and 1r�r�r�)	rrrrr r"r#r&r'c��td|_d|_d|_d|_d|_d|_d|_|j|�y)Nrrr)	�STATE_DEFAULTSrrrrr r"r#r��rXr@s  rArhzLineShape.__init__tsM��)�-�8������������ !���#���!������2�rCN)
r[r\r]r�r��
isColorOrNoner�r�r�	isOpacityrr�rhr_rCrAr
r
es����"�=�1�"�8�,�$�U�1�Q�q�\�7\�]�%�e�A�a��l�8^�_�'��6\�]�&�'8�>^�_�$�Y�4{�|�&�y�6S�T�$�Y�4T�cd�e�

�H�rCr
c
�r�eZdZeeeed��eed��eed��eed����Zd�Zd�Z	y)�Liner�r�)rbrqrrrsrtc�h�tj||�||_||_||_||_yr�)r
rhrqrrrsrt)rXrqrrrsrtr@s      rArhz
Line.__init__�s.�����4��$������������rCc�^�|j|j|j|jfS)r�)rqrrrsrtr�s rAr�zLine.getBounds�s!��������$�'�'�4�7�7�3�3rCN)
r[r\r]r�r
r�r�r�rhr�r_rCrArr~s@���I�
�(��
+�
�(��
+�
�(��
+�
�(��
+�	
�H��4rCrc
��eZdZeeeed��eed��eed��eedd��ee	e
e����Zd	�Z
y
)�
SolidShapez$filling color of the shape, e.g. redr�zGthe level of transparency of the color, any real number between 0 and 1r�r�rr�)rbr(r$r%r'r)c�Z�td|_d|_tj	||�y)Nr()rr(r$r
rhr
s  rArhzSolidShape.__init__�s(��'��4������	���4��$rCN)r[r\r]r�r
r�rrrr�rrr�rhr_rCrArr�sS���I� ��4Z�[�"�9�2{�|�$�Y�4O�P�$�Y�4T�cd�e���m�M� B�C�
�H�%rCrry)rxrx�r)�moveTo�lineTo�curveTo�	closePathc�R�|j}d}d}d}|}|jD]]}	|	tk(r'|r |r
tk7r|dz
}|r|t�|dz
}t|	}||z}||	|||�|}|	tk(r|dz
}|	}
�_|r |r
tk7r|dz
}|r|t�||k(S)zHelper function for renderers.rr)r��	operators�_MOVETO�
_CLOSEPATH�_PATH_OP_ARG_COUNT)
r��	drawFuncs�	countOnly�
forceCloser�r��hadClosePath�	hadMoveTo�active�opr��nArgs�js
             rA�_renderPathr*�s����[�[�F�	�A��L��I��]�F��n�n���
��=����j�� �A�%�L��-�	�*�-�/���N�I�"�2�&��
��I���	�"�
�v�a��{�#�
��
����A��L�����i�C��O������!�I�j�!�#���$�$rCznon-zero�nonzerozeven-odd�evenoddc���eZdZdZeeee�ee�ee�ee	e
dd���ee
ee����Z
ddddefd�Zd�Zd	�Zd
�Zd�Zd�Zd
�Zy)�Pathz2Path, made up of straight lines and bezier curves.rLrJ)rbr�r�
isClipPath�	autocloser)Nrc��tj||�|�g}|�g}t|�dzdk(sJd��||_||_||_||_||_y�Nrxr�-Point list must have even number of elements!)rrhr6r�rr/r0r))rXr�rr/r0r)r@s       rArhz
Path.__init__�sf�����D�"�%��>��F����I��6�{�Q��!�#�T�%T�T�#����"���$��� ��� ��
rCc��|j|jdd|jdd�}|j|j	��|Sr�)r�r�rr�r��rX�news  rAr�z	Path.copy�s?���n�n�T�[�[��^�T�^�^�A�->�?�����$�,�,�.�/��
rCc�|�|jj||g�|jjt�yr�)r�r�rrzrrs   rArzPath.moveTo��*�������A�q�6�"������g�&rCc�|�|jj||g�|jjt�yr�)r�r�rrz�_LINETOrs   rArzPath.lineTo�r8rCc��|jj||||||g�|jjt�yr�)r�r�rrz�_CURVETO)rXrqrrrsrt�x3r|s       rArzPath.curveTo�s3�������B��B��B��3�4������h�'rCc�B�|jjt�yr�)rrzrr�s rArzPath.closePath�s�������j�)rCc	��|j}	g}|j}|j}g}|j}|j}d}|jD]}	t|	}
||
z}|
dk(r|||�|||dz�nN|
dk(rI|||d�\}}
}|t|d||
|��||dz|d�\}}}|t|d|||��|}��t
|�t
|�t|�t|�fS#t|�cYSxYw)Nrrxrrr1)	r�rzr�rr r�rGr5r�)rXr�rL�aX�eXrM�aY�eYr�r'r(r)rqrsr=rrrtr|s                  rAr�zPath.getBounds�s'������	)��A����B����B��A����B����B��A��n�n�

��*�2�.����I���!�8��v�a�y�M��v�a��c�{�O��A�X�%�a��!�e�}�H�B�r�"��(��2��r�"�R�8�9�%�a��c�!�A�g��H�B�r�"��(��2��r�"�R�8�9���

��q�6�#�a�&��Q���A��.�.��	)� ��(�(�s�C-C<�<
D)r[r\r]r^r�rr�rr�NoneOrr�rrr�rhr�rrrrr�r_rCrAr.r.�s}��<��J��o�.� ��1�!�)�,� ���e�E�(:�!;�<���m�M� B�C�
�H�#�d�q�D�[h�!��
'�'�(�*�)rCr.c	���|�|}g}tdz}	||	z}
||	z}||
kr|dtzz}||
kr�t||
z
�}|j}
|dkDr;t||xsd�}||	z}t	t||zdz�d�}||z}|dz
}nd}d}t
|�D]2}|
||zz}|
||t|�zz||t|�zzf��4|r|j�|S)N��f@rx���MbP?re��?rr)
rr*rzrGr5r�r�rr�reverse)�centerx�centery�radius�startangledegrees�endangledegrees�yradius�degreedeltarIr��degreestoradians�
startangle�endanglerJr}�radiansdeltar0s                rA�getArcPointsrUs!����&��
�F��%�x��"�#3�3�J��/�/�H�
�:�
��A�b�D�=���:�
��(�Z�'�(�E��
�
�A��T�z��%�� 1�r�2��"�#3�3����E�,�&�s�*�+�A�.���Q�w��	�Q���
�����q��B���5��-�-��	�7�6�#�e�*�$�$�W�W�S��Z�-?�%?�
@�A�B����� ��MrCc��eZdZdZdd�Zy)�ArcPathzPath with an addArc methodNc

���t||||||||	��}
|st|j�s!|j|
dd|
dd�|
d=|
D]\}}|j	||��y)N)rOrPrIrr)rUr6rrr)
rXrJrKrLrMrNrOrPrrIr�rHrIs
             rA�addArczArcPath.addArc6st����'�6�3D�o�_f�t�JQ�
R����T�^�^�,��K�K��!��Q���!��Q��(��!���'�D�A�q�t�{�{�1�Q�'�'rCr)r[r\r]r^rYr_rCrArWrW4s
��$�(rCrWc��g}g}|D]�}t|�s|}g}	n
|d}|dd}	|tvrtd|z��tj|�}
t	|	�t
|
k7rt|�dt
|	�����|j|
�|jt|	����|df|dffD]+\}}t|t	|�d�D]
}
||
|z||
<��-|jdd�}|�rdD�]}||||dzf}|d�|d��||dd�}t|�t|�}}|d��|d��t|�t|�}}||z
}t|�dk\r5||z
|z}t|t	|�d�D]}
||||
|z
zz||
<���t|t	|�d�D]
}
||zd	z||
<���|d�|d|z
n|d|z
}t|t	|�d�D]}
||
xx|z
cc<���t|||fi|��S)
Nrrzbad operator name %sz bad arguments rx�bbox)rrg���ư>rH)r�_PATH_OP_NAMESr�r�r6r rnrzr�r�r�r�rGr5�absr.)�pathSegsr/r�r�r@�Or��seg�opNamer-r'r�rpr�r[r)r}r~r�facs                    rA�
definePathrc=sp��
�A�
�A��
���S�z��F��D���V�F��q�r�7�D���'��3�f�<�=�=�
�
!�
!�&�
)���t�9�(��,�,��f�S��Y�G�H�H�	�����	����d���
��1�v��1�v�~����!��q��Q���"�	�A��Q�4��6�A�a�D�	���6�6�&���D���	�A��Q���Q�q�S�	�!�A���t�|��!���h��!�$�Q�$��A��q�6�3�q�6�q�A���t��A�a�D�$4��1�v�s�1�v�1����s���s�8�T�>��Q�3��)�C�"�1�S��V�A�.�0�� �3��!��Q��<�/��!��0�#�1�S��V�A�.�+�� !�A��s�{��!��+�
!"�!�� 0�A�a�D�1�H�a��d�Q�h���q��Q���*��A��a�D�A�I�D��)	�.��!�J�$��$�$rCc��eZdZdZeeee�ee�eed��eed��ee�ee���Zd
d�Z	d�Z
d�Zy	)�Rectz)Rectangle, possibly with rounded corners.�width of the object in pointsr��height of the objects in points)rbrHrIrVrW�rx�ryc��tj||�||_||_||_||_||_||_yr�)rrhrHrIrVrWrhri)rXrHrIrVrWrhrir@s        rArhz
Rect.__init__{s<�����D�"�%���������
���������rCc��|j|j|j|j|j�}|j|j
��|Sr�)r�rHrIrVrWr�r�r5s  rAr�z	Rect.copy�sB���n�n�T�V�V�T�V�V�T�Z�Z����E�����$�,�,�.�/��
rCc��|j|j|j|jz|j|jzfSr��rHrIrVrWr�s rAr�zRect.getBounds�s3�������������� 3�T�V�V�d�k�k�5I�J�JrCN)rr)r[r\r]r^r�rr�r�r�rhr�r�r_rCrArereosW��3��J���"���"��X�+J�K��h�,M�N�
�(�
#�
�(�
#�

�H���
KrCrec
��eZdZdZeeee�ee�eed��eed��ed���Z	d�Z
d�Zd	�Zy)
�Imagez
Bitmap image.rfr�rgN)rbrHrIrVrWr�c�v�tj||�||_||_||_||_||_yr�)rrhrHrIrVrWr�)rXrHrIrVrWr�r@s       rArhzImage.__init__�s5�����D�"�%���������
������	rCc���|j|j|j|j|j|j
�}|j
|j��|Sr�)r�rHrIrVrWr�r�r�r5s  rAr�z
Image.copy�sH���n�n�T�V�V�T�V�V�T�Z�Z����d�i�i�P�����$�,�,�.�/��
rCc��|j|j|j|jz|j|jzfSr�rmr�s rAr�zImage.getBounds�s3�������������� 3�T�V�V�d�k�k�5I�J�JrC)
r[r\r]r^r�rr�r�r�r�rhr�r�r_rCrAroro�sO����J���"���"��^�1P�Q��n�2S�T��D�!�
�H���
KrCroc	�f�eZdZeeeed��eed��eed����Zd�Zd�Z	d�Z
y	)
�Circle�x of the centrer��y of the centre�radius in points)rb�cx�cy�rc�Z�tj||�||_||_||_yr�)rrhrxryrz)rXrxryrzr@s     rArhzCircle.__init__�s'�����D�"�%���������rCc��|j|j|j|j�}|j	|j��|Sr�)r�rxryrzr�r�r5s  rAr�zCircle.copy�s<���n�n�T�W�W�d�g�g�t�v�v�6�����$�,�,�.�/��
rCc���|j|jz
|j|jz
|j|jz|j|jzfSr�)rxrzryr�s rAr�zCircle.getBounds�sH�����$�&�&� �$�'�'�D�F�F�"2�D�G�G�d�f�f�4D�d�g�g�PT�PV�PV�FV�W�WrCN�r[r\r]r�rr�r�r�rhr�r�r_rCrArtrt�s?���J�
�(�(9�
:�
�(�(9�
:���'9�:�
�H���
XrCrtc
�x�eZdZeeeed��eed��eed��eed����Zd�Zd�Z	d	�Z
y
)�Ellipserur�rvzx radiuszy radius)rbrxryrhric�h�tj||�||_||_||_||_yr�)rrhrxryrhri)rXrxryrhrir@s      rArhzEllipse.__init__�s.�����D�"�%������������rCc��|j|j|j|j|j�}|j|j
��|Sr�)r�rxryrhrir�r�r5s  rAr�zEllipse.copy�sB���n�n�T�W�W�d�g�g�t�w�w����@�����$�,�,�.�/��
rCc���|j|jz
|j|jz
|j|jz|j|jzfSr�)rxrhryrir�s rAr�zEllipse.getBounds�sH���G�G�d�g�g�%�t�w�w����'8�$�'�'�D�G�G�:K�T�W�W�W[�W^�W^�M^�_�_rCNr~r_rCrAr�r��sH���J�
�(�(9�
:�
�(�(9�
:�
�(�
�
3�
�(�
�
3�	
�H���
`rCr�c���eZdZdZeeeed��eed��eed��ee�ee�ee�ee�ee�ee	d����
Z
dZ		dd
�Zd�Z
d�Zd
�Zd�Zy	)�WedgeznA "slice of a pie" by default translates to a polygon moves anticlockwise
       from start angle to end anglerur�rvrwztreat as annular ring)
rbrJrKrLrMrNrO�radius1�yradius1�annularrNc��tj||�||kr|dz}||kr�|||||f\|_|_|_|_|_||_||_y)Nih)	rrhrJrKrLrMrNrOr�)	rXrJrKrLrMrNrOr�r@s	         rArhzWedge.__init__�sk�����D�"�%��/�/�-�c�1�O��/�/�
�W�f�&7��H�	^���d�l�D�K��1G��I]������rCc�~�t|dd�}|�|j}t|dd�}t|d|�}|�|}|||fS)NrOr�r�)r�rL)rXrOr�r�s    rA�
_xtraRadiizWedge._xtraRadii�sO���$�	�4�0���?�d�k�k�G��$�y�$�/���4�
�7�3���?�h�G����)�)rCc�*�|j}|j}|j}|j�\}}}|j}|j
}tdz}	||	z}
||	z}||
kr|dtzz}||
kr�t||
z
�}g}
|dkDrEt|jxsd|�}||	z}tdt||zdz��}||z}|dz
}nd}d}g}|j}|
j}t|�D]&}|
||zz}|t|�t|�f��(|D]!\}}||||zz�||||zz��#|dk(s|�|dk(s|�||�||�n6|j!�|D]!\}}||||zz�||||zz��#|j"r�t%t'|dt(��	�}|j+|
d|
d�tdd|zd�D]}|j-|
||
|dz��|j/�|j+|
d|z|
d|zdz�td|zdzd
|zd�D]}|j-|
||
|dz��|j/�|St1|
�S)NrFrxrGrerrHrr))r)ry)rJrKrLr�rMrNrr*rGrPr5r�rzr�rrrIr�r.r�rrrr�Polygon)rXrJrKrLrOr�r�rMrNrQrRrSrJr�rPrTr0�CA�CAAr}rr/r�rHs                        rA�	asPolygonzWedge.asPolygon�s��������,�,������%)�_�_�%6�"���(� �2�2���.�.���e�8��&�'7�7�
�"�#3�3���z�!���"��}�H��z�!��h�z�)�*������;��d�.�.�4�"�U�;�K�&�'7�7�L��A�c�%��,�S�0�1�2�A� ��7�L�
��F�A��A��L�
���i�i���M�M���1�X�	)�E��u�\�1�1�E���U��C��J�'�(�	)��	!�C�A�a�
�g�f�Q�h���
�g�g�a�i�� �	!�
�Q�J�'�/��!��x�?O�
�g�J��'�
��J�J�L��
&���!��'�'�!�)�#�$��'�(�1�*�$�%�
&��<�<��g�d�:�}�E�F�A�
�H�H�V�A�Y�v�a�y�)��1�Q�q�S��^�
0��������6�!�A�#�;�/�
0�
�K�K�M�
�H�H�V�A�a�C�[���!��A���/��1�Q�3�q�5��1��Q�'�
0��������6�!�A�#�;�/�
0�
�K�K�M��H��6�?�"rCc���|j|j|j|j|j|j
�}|j
|j��|Sr�)r�rJrKrLrMrNr�r�r5s  rAr�z
Wedge.copy4sT���n�n�T�\�\��L�L��K�K��*�*��(�(�	*��
	���$�,�,�.�/��
rCc�>�|j�j�Sr�)r�r�r�s rAr�zWedge.getBounds=s���~�~��)�)�+�+rC)NF)r[r\r]r^r�rr�r�r�rr�rPrhr�r�r�r�r_rCrAr�r��s���(��J��x�->�?��x�->�?��h�,>�?�(��2�&�x�0��~�.��~�.���/��y�.E�F�

�H��K�]a��	�*�4#�l�,rCr�c�J�eZdZdZeeeed����Zgfd�Z	d�Z
d�Zy)	r�zKDefines a closed shape; Is implicitly
    joined back to the start for you.�5list of numbers in the form x1, y1, x2, y2 ... xn, ynr��rbr�c�v�tj||�t|�dzdk(sJd��|xsg|_yr2)rrhr6r�)rXr�r@s   rArhzPolygon.__init__Hs9�����D�"�%��6�{�Q��!�#�T�%T�T�#��l���rCc�z�|j|j�}|j|j��|Sr��r�r�r�r�r5s  rAr�zPolygon.copyM�0���n�n�T�[�[�)�����$�,�,�.�/��
rCc�,�t|j�Sr��r�r�r�s rAr�zPolygon.getBoundsR����t�{�{�+�+rCN)r[r\r]r^r�rr�rr�rhr�r�r_rCrAr�r�@s4��)��J��o�3j�k�
�H�!�#�
�
,rCr�c�J�eZdZdZeeeed����Zgfd�Z	d�Z
d�Zy)	�PolyLinez�Series of line segments.  Does not define a
    closed shape; never filled even if apparently joined.
    Put the numbers in the list, not two-tuples.r�r�r�c� �tj||�|xsg}t|�}|r^t|d�r8g}|D]'\}}|j	|�|j	|��)|}||_yt|�dzdk(sJd��||_y)Nrrxr3)r
rhr6rrzr�)rXr�r@�	lenPointsrlrHrIs       rArhzPolyLine.__init__^s������4��$���2����K�	���V�A�Y����#� �E�Q�q��H�H�Q�K��H�H�Q�K� �������6�{�Q��!�+�\�-\�\�+���rCc�z�|j|j�}|j|j��|Sr�r�r5s  rAr�z
PolyLine.copymr�rCc�,�t|j�Sr�r�r�s rAr�zPolyLine.getBoundsrr�rCN)r[r\r]r^r�r
r�rr�rhr�r�r_rCrAr�r�Us4��4��I��o�3j�k�
�H�!�
��
,rCr�c��eZdZdZeeeeee	ed��fd�d��eee
edf�d��eee
ed	f�d
����Zdd
gfd�Zy)�Hatchingz\define a hatching of a set of polygons defined by lists of the form [x0,y0,x1,y1,....,xn,yn]r)r`z
xy list(s)z8list(s) of numbers in the form x1, y1, x2, y2 ... xn, ynr�zangle(s)zCthe angle or list of angles at which hatching lines should be drawnzspacings(s)z-orthogonal distance(s) between hatching lines)rb�xyLists�angles�spacingsrx�-c
�L�tj|fi|��t|�r|f}t|�r|f}t|�r|f}t	|�t	|�z
}|dkDrt|�||dgzz}||_||_||_|j}|j}t|�D�]�\}}||}	t|�}t|�}
t|�}d}|}
|D]I}tdt	|�d�D].}||dz|
z|||zz
}t!||�}t#||
�}
�0�Kt%t'||	z��dz
}t%t'|
|	z��dz}t||�D�]4}g}|	|z}|D]�}t	|�dz
}tdt	|�d�D]�}||}||dz}||
z||zz}||
z||zz
}||}||dz}||
z||zz}||
z||zz
}||kr||k\s
||kr(||k\r#|j)|||z
||z
z||z
zz�|}����|j+�tdt	|�d�D]R}|||
z||zz
}||
z|||zz}||dz|
z||zz
}||
z||dz|zz}|||�|||��T��7���y)Nrr1i���rxr)r.rhrr�r6r�r�r�r�rr�	enumeraterrrr�rGr5r�rrzr�)rXr�r�r��kwdsr�rrr��spacing�cosTheta�sinTheta�spanMin�spanMaxr�r)rI�	spanStart�spanEnd�step�nodeX�stripeYr�r}r~�a1�b1rHrqrrs                              rArhzHatching.__init__~s4���
�
�d�#�d�#��7�#��z�G��F���Y�F��H�� �{�H���K��H�
�%���Q�3��H�~�a��"���&6�6�H������� ��
���������!�&�)�:	 �H�A�u��q�k�G��E�N�E��5�z�H��5�z�H� �G��h�G��
-���q��Q���*�-�A��!�A�#��x���!��X�
�5�A�!�!�G�n�G�!�!�G�n�G�	-�
-��E�'�'�/�2�3�a�7�I��5����1�2�Q�6�G��i��0�$
 ����!�$�,��!��A��A��q��A�"�1�S��V�A�.����a�D���a��c�F���x�Z�!�H�*�4���x�Z�!�H�*�4���a�D���a��c�F���x�Z��(�
�2���x�Z��(�
�2���w�J�2�w�;�2�g�:�"�g�+�!�L�L��R��U�W�R�Z�,@�"�R�%�,H�)H�I�����&�
�
���q��U��A�.�	 �A��a���)�G�H�,<�<�A���(��q��(�):�:�A��a��c�
�8�+�g�h�.>�>�A���(�5��1��:�h�+>�>�A��1�Q�K��1�Q�K�	 �7$
 �-:	 rCN)
r[r\r]r^r�r.r��EitherOrrr�r�r�rhr_rCrAr�r�us���f��D��x���O�WX�9Y�(Z�[g�h�oi�j��h����'L�M�TY�Z���(�?�=�)Q� R�YH�I�
�H�!"�"�b�M rCr�c��t|d|�}|j|�}|dk\r!t|dd�}	|	t|d||||�z}|S)N�_dpr�_dpLen)r��rfindr)
�tAr7r4r+r*�encoding�pivotCharacter�dpr��dpOffss
          rA�
numericXShiftr��sR��	��E�.�	)�B��
�
�2��A��!�t���H�Q�'���[��b�q��(�8�H�E�E���HrCc��eZdZdZeeed��eed��eed��edd��eed��eed	��ee	d
ddd
�d��ee�ee	dddddddd�d����	Z
dZd�Zd�Z
d�Zd�Zy)�StringziNot checked against the spec, just a way to make something work.
    Can be anchored left, middle or end.zx point of anchoringr�zy point of anchoringzthe text of the stringNz_font name of the text - font is either acrobat standard or registered when using external font.z	font sizezcolor of the fontr-�middler3�numericz(treat (x,y) as one of the options below.rrrxrwry�r�z.Control whether text is filled/stroked etc etc)	rHrIr7r+r*r(r,r��textRenderMode�utf8c��||_||_||_d|_td|_td|_td|_|j|�y)Nr-r+r*r()	rHrIr7r,rr+r*r(r�)rXrHrIr7r@s     rArhzString.__init__�sP����������	�!���&�z�2��
�&�z�2��
�'��4������2�rCc��|jt|j|j|j|j
�zSr�)rHrr7r+r*r�r�s rA�getEastzString.getEast�s,���v�v��D�I�I�d�m�m�D�M�M�4�=�=�Y�Y�YrCc��|j|j|j|j�}|j	|j��|Sr�)r�rHrIr7r�r�r5s  rAr�zString.copy�s<���n�n�T�V�V�T�V�V�T�Y�Y�7�����$�,�,�.�/��
rCc	��|j}t||j|j|j�}|j
}|j}|dk7rO|dk(r	|d|zz}nA|dk(r||z}n6|dk(r1|t||||j|j|j�z}||jd|jzz
||z|j|jzfS)Nr-r�rHr3r�g�������?)	r7rr+r*r�r,rHr�rI)rXr;r4r�rHs     rAr�zString.getBounds�s����I�I����$�-�-��
�
�d�m�m�D��
�_�_���F�F��
�w�;��8�|��S��U�
���U���Q����Y���]�2�a��$�-�-��
�
�d�m�m�T�T���4�6�6�C�$�-�-�/�/��1��d�f�f�t�}�}�6L�M�MrC)r[r\r]r^r�r�r��isStringrr�r�r�rhr�r�r�r_rCrAr�r��s���,����'=�>���'=�>��H�*B�C���+L�M���k�:� ��4G�H�!�%����y�"I�Oy�z���)�%�e�A�a��!�A�a��!�&<�Br�s�

�H��H��Z��

NrCr�c��eZdZdZd�Zy)r�akA simple template for creating a new node.  The user (Python
    programmer) may subclasses this.  provideNode() must be defined to
    provide a Shape primitive when called by a renderer.  It does
    NOT inherit from Shape, as the renderer always replaces it, and
    your own classes can safely inherit from it without getting
    lots of unintended behaviour.c��td��)z�Override this to create your own node. This lets widgets be
        added to drawings; they must create a shape (typically a group)
        so that the renderer can draw the custom node.�4this method must be redefined by the user/programmerr�r�s rAr�zUserNode.provideNodes��
"�"X�Y�YrCN)r[r\r]r^r�r_rCrAr�r�s
��%�ZrCr�c��eZdZdZd�Zy)�
DirectDrawz"try to draw directly on the canvasc��td��)Nr�r�)rXrYs  rA�drawDirectlyzDirectDraw.drawDirectlys��!�"X�Y�YrCN)r[r\r]r^r�r_rCrAr�r�s��,�ZrCr�c�4�tdddd�}ddl}|j}tjj}|d�||j��|d�|j
�|d�|d�|`|d	�|j
�y)
Nr!r��2rz
a Rectangle: z
verifying...z OK
zdeleting rect.width zverifying...)re�pprintr��stdoutr�r�r�rV)rzr��ppr4s    rArrs~���R��3�r��A��	���B��
�
���A��o���q���������H�H�J��g�J����	���n���H�H�JrC�__main__r�)rz		)FF)NNN)b�__version__r^r�r��mathrrrrrr�reportlab.platypusr	�reportlab.rl_configr
rr�_baseGFontNamer
r�
reportlab.librr�reportlab.lib.validators�reportlab.lib.utilsrrrD�isNumberInRanger�reportlab.lib.attrmap�reportlab.lib.rl_accelr�reportlab.pdfbase.pdfmetricsr�reportlab.lib.fontsr�reportlab.pdfgen.canvasrr�_baseGFontNameB�_baseGFontNameI�_baseGFontNameBI�NON_ZERO_WINDING�EVEN_ODD�blackrrrBrNrPrarur�r�r�r�r�r"r+r8rAr�rh�	Validatorrr
rrr�r�rr:r<rr r\r*�_fillModeMapr.r'rUrWrcrerortr�r�r�r�r�r�r�r�r�rr[r_rCrA�<module>r�sx��

��G���3�3�'�y�y� � �&�.��?�1�Q�'�(�	�#�)�4�%�@���q��+����q��+�����!�,��&���������6�<�<�	�
�1���Q�
��a������t���T���4���U���u���Q�� ����!�"�
�#�&��'�(��)�*�7�+��6�  �D-�,�,�&�&�$�"3
�j0�(�KQ�O�/�KQ�Z{�E�{�z	�%�N
�$@�
T�e�X�T�l5�5�,z�	�z�&�'�����24�9�4�&%��%�&*.�e�A�h��&���(�J�!��8��%�<	
�d��}��M��=��}��M��=�
��F)�:�F)�P�f�
��6(�d�(��a�A�!�0%�dK�:�K�:K�J�K�8X�Z�X�,`�j�`�.i,�J�i,�V,�j�,�*,�y�,�@V �t�V �p8<�=�
�1N�U�1N�f
Z�"�
Z�Z��Z�
�"�Z���F�rC

Zerion Mini Shell 1.0