+
    Zi                        ^ RI Ht ^ RIt^ RIHtHtHtHtHtH	t	 ^ RI
HtHt ^ RIHt ^ RIHtHt ^ RIHtHtHt ^ RIHt ^ R	IHt ^ R
IHt ]] ! R R]],          4      4       4       tR# )    )annotationsN)IterableIteratorListMutableSequenceOptionaloverload)definefield)AbstractPen)AbstractPointPenPointToSegmentPen)BoundingBox	getBoundsgetControlBounds)Point)serde)GlyphSetc                  T   ] tR t^t$ Rt]! ]R7      tR]R&    ]! RRR7      t	R]R	&    R
 R lt
]R R l4       t]R R l4       tR R ltR R ltR R ltR R ltR R lt]R R l4       tR R ltR+R R llt]R  R! l4       tR+R" R# llt]R$ R% l4       tR& R' ltR( R) ltR*tR# ),Contoura  Represents a contour as a list of points.

Behavior:
    The Contour object has list-like behavior. This behavior allows you to interact
    with point data directly. For example, to get a particular point::

        point = contour[0]

    To iterate over all points::

        for point in contour:
            ...

    To get the number of points::

        pointCount = len(contour)

    To delete a particular point::

        del contour[0]

    To set a particular point to another Point object::

        contour[0] = anotherPoint
)factoryzList[Point]pointsNF)defaultreprzOptional[str]
identifierc                    V ^8  d   QhRRRR/# )   indexint | slicereturnNone )formats   "9/usr/lib/python3/dist-packages/ufoLib2/objects/contour.py__annotate__Contour.__annotate__5   s            c                	     V P                   V R # Nr   selfr   s   &&r$   __delitem__Contour.__delitem__5   s    KKr'   c                    V ^8  d   QhRRRR/# )r   r   intr    r   r"   )r#   s   "r$   r%   r&   9   s    3333r'   c                	    R # r)   r"   r+   s   &&r$   __getitem__Contour.__getitem__8   s    03r'   c                    V ^8  d   QhRRRR/# )r   r   slicer    zlist[Point]r"   )r#   s   "r$   r%   r&   <   s       ; r'   c                	    R # r)   r"   r+   s   &&r$   r2   r3   ;   s    r'   c                    V ^8  d   QhRRRR/# )r   r   r   r    zPoint | list[Point]r"   )r#   s   "r$   r%   r&   ?   s     " " "1D "r'   c                	(    V P                   V,          # r)   r*   r+   s   &&r$   r2   r3   ?   s    {{5!!r'   c               $    V ^8  d   QhRRRRRR/# )r   r   r   pointzPoint | Iterable[Point]r    r!   r"   )r#   s   "r$   r%   r&   B   s$       )@	r'   c                	   \        V\        4      '       d'   \        V\        4      '       d   W P                  V&   R# \        V\        4      '       da   \        V\
        4      '       dK   \        ;QJ d    R  V 4       F  '       d   K   RM	  RM! R  V 4       4      '       d   W P                  V&   R# \        R\        V4      P                   R24      h)c              3  B   "   T F  p\        V\        4      x  K  	  R # 5ir)   )
isinstancer   ).0ps   & r$   	<genexpr>&Contour.__setitem__.<locals>.<genexpr>J   s     8%QJq%((%s   FTz)Expected Point or Iterable[Point], found .N)
r=   r0   r   r   r5   r   all	TypeErrortype__name__)r,   r   r:   s   &&&r$   __setitem__Contour.__setitem__B   s     eS!!j&>&>!&KKue$$5(++8%88%888!&KK;DK<P<P;QQRS r'   c                   V ^8  d   QhRR/# )r   r    zIterator[Point]r"   )r#   s   "r$   r%   r&   R   s     ! !/ !r'   c                	,    \        V P                  4      # r)   )iterr   r,   s   &r$   __iter__Contour.__iter__R   s    DKK  r'   c                   V ^8  d   QhRR/# )r   r    r0   r"   )r#   s   "r$   r%   r&   U   s          r'   c                	,    \        V P                  4      # r)   )lenr   rL   s   &r$   __len__Contour.__len__U   s    4;;r'   c               $    V ^8  d   QhRRRRRR/# )r   r   r0   valuer   r    r!   r"   )r#   s   "r$   r%   r&   X   s!     ) )C ) )$ )r'   c                    \        V\        4      '       g#   \        R\        V4      P                   R24      hV P
                  P                  W4       R# )z<Insert Point object ``value`` into the contour at ``index``.zExpected Point, found rB   N)r=   r   rD   rE   rF   r   insert)r,   r   rU   s   &&&r$   rW   Contour.insertX   sA    %''4T%[5I5I4J!LMM5(r'   c                   V ^8  d   QhRR/# )r   r    boolr"   )r#   s   "r$   r%   r&   a   s     - -d -r'   c                j    V P                   '       g   R# V P                   ^ ,          P                  R8H  # )z.Returns whether the contour is open or closed.Tmove)r   rE   rL   s   &r$   openContour.open`   s)     {{{{{1~""f,,r'   c                    V ^8  d   QhRRRR/# )r   deltaztuple[float, float]r    r!   r"   )r#   s   "r$   r%   r&   g   s      - $ r'   c                N    V P                    F  pVP                  V4       K  	  R# )z#Moves contour by (x, y) font units.N)r   r\   )r,   r`   r:   s   && r$   r\   Contour.moveg   s    [[EJJu !r'   c                    V ^8  d   QhRRRR/# r   layerzGlyphSet | Noner    BoundingBox | Noner"   )r#   s   "r$   r%   r&   l   s     & & &:L &r'   c                    \        W4      # )zReturns the (xMin, yMin, xMax, yMax) bounding box of the glyph,
taking the actual contours into account.

Args:
    layer: Not applicable to contours, here for API symmetry.
r   r,   re   s   &&r$   r   Contour.getBoundsl   s     %%r'   c                   V ^8  d   QhRR/# r   r    rf   r"   )r#   s   "r$   r%   r&   v   s        *  r'   c                "    V P                  4       # )zzReturns the (xMin, yMin, xMax, yMax) bounding box of the glyph,
taking the actual contours into account.

|defcon_compat|
rh   rL   s   &r$   boundsContour.boundsu   s     ~~r'   c                    V ^8  d   QhRRRR/# rd   r"   )r#   s   "r$   r%   r&   ~   s     - -o -AS -r'   c                    \        W4      # )zReturns the (xMin, yMin, xMax, yMax) bounding box of the glyph,
taking only the control points into account.

Args:
    layer: Not applicable to contours, here for API symmetry.
r   ri   s   &&r$   r   Contour.getControlBounds~   s      ,,r'   c                   V ^8  d   QhRR/# rl   r"   )r#   s   "r$   r%   r&      s     ' '$6 'r'   c                "    V P                  4       # )z~Returns the (xMin, yMin, xMax, yMax) bounding box of the glyph,
taking only the control points into account.

|defcon_compat|
rr   rL   s   &r$   controlPointBoundsContour.controlPointBounds   s     $$&&r'   c                    V ^8  d   QhRRRR/# )r   penr   r    r!   r"   )r#   s   "r$   r%   r&      s     " " " "r'   c                >    \        V4      pV P                  V4       R# )zDraws contour into given pen.N)r   
drawPoints)r,   ry   pointPens   && r$   drawContour.draw   s    $S)!r'   c                    V ^8  d   QhRRRR/# )r   r|   r   r    r!   r"   )r#   s   "r$   r%   r&      s      #3  r'   c           	     ^    VP                  V P                  R7       V P                   FW  pVP                  VP                  VP
                  3VP                  VP                  VP                  VP                  R7       KY  	  VP                  4        R#   \         d    TP                  4        T P                   FL  pTP                  TP                  TP
                  3TP                  TP                  TP                  R7       KN  	  \        P                  ! R\        4        Li ; i)z-Draws points of contour into given point pen.)r   )segmentTypesmoothnamer   )r   r   r   zHThe pointPen needs an identifier kwarg. Identifiers have been discarded.N)	beginPathr   r   addPointxyrE   r   r   rD   warningswarnUserWarningendPath)r,   r|   r?   s   && r$   r{   Contour.drawPoints   s    	$//:[[!!SS!##J !88 || "  !& 	  
	 [[!!SS!##JAFF188!&& "  ! MM3
	s   BB BD,+D,r"   r)   )rF   
__module____qualname____firstlineno____doc__r   listr   __annotations__r   r-   r	   r2   rG   rM   rR   rW   propertyr]   r\   r   rn   r   rv   r}   r{   __static_attributes__r"   r'   r$   r   r      s    4  -FK-, %d ?J?8 3 3 " ! ) - -
&    - ' '"
 r'   r   )
__future__r   r   typingr   r   r   r   r   r	   attrsr
   r   fontTools.pens.basePenr   fontTools.pens.pointPenr   r   ufoLib2.objects.miscr   r   r   ufoLib2.objects.pointr   ufoLib2.serder   ufoLib2.typingr   r   r"   r'   r$   <module>r      sT    "  P P  . G I I '  # ^oe$ ^  ^r'   