Ë
    £èh¤j  ã                  óÖ  — U d dl mZ d dlmZmZmZmZ d dlmZm	Z	 d dl
mZ d dlmZ d dlmZ d dlmZmZmZmZmZ d dlmZ d d	lmZ d d
lmZmZmZmZmZmZm Z  d dl!m"Z"m#Z#m$Z$ d dl%m&Z&m'Z' ddl(m)Z)m*Z*m+Z+m,Z, er$d dl-m.Z. d dl/m0Z0 d dl
m1Z1 d dl2m3Z3 d dl4m5Z5 d dlm6Z6 g d¢Z7h d£Z8 ed eddejr                  ¬«       edddejt                  ¬«       edd dejv                  e¬!«       ed"d dejx                  e¬!«       ed#d$edejz                  ej|                  ¬%«       ed&d'edej~                  e¬%«       ed(d ed¬)«       ed*ed¬+«       ed,ed¬+«       ed-edej€                  ¬.«       ed/ed¬+«       ed0ed¬+«       ed1ed¬+«       ed2edd¬3«       ed4ed¬+«      d5œ«      ZAd6eBd7<    eeA«      ZCdBd8„ZD G d9„ d:e)«      ZEejŒ                   G d;„ d<eE«      «       ZGdCd=„ZHdDd>„ZIdEd?„ZJdFd@„ZKyA)Gé    )Úannotations)ÚTYPE_CHECKINGÚOptionalÚIterableÚAny)ÚSelfÚ	TypeGuard)Úfactory)Úoptions)Ú	validator)ÚDXFAttrÚDXFAttributesÚDefSubclassÚRETURN_DEFAULTÚgroup_code_mapping)Úcolors)Úconst)ÚDXF12ÚDXF2000ÚDXF2004ÚDXF2007ÚDXF2013ÚSUBCLASS_MARKERÚTRANSPARENCY_BYBLOCK)ÚOCSÚMatrix44ÚUVec)Úload_proxy_graphicÚexport_proxy_graphicé   )Ú	DXFEntityÚ
base_classÚSubclassProcessorÚDXFTagStorage)ÚAuditor)ÚDrawing)ÚDXFNamespace)Ú
BaseLayout)ÚAbstractTagWriter)Úxref)	Ú
DXFGraphicÚacdb_entityÚacdb_entity_group_codesÚSeqEndÚ
add_entityÚreplace_entityÚelevation_to_z_axisÚis_graphic_entityÚget_font_name>   ÚcolorÚlayerÚltscaleÚlinetypeÚ
color_nameÚ
lineweightÚ
true_colorÚtransparencyÚ
AcDbEntityé   Ú0)Údefaultr   é   ÚBYLAYERT)r?   Úoptionalr   é>   é   )r?   rB   r   ÚfixeréC   ir  éÿÿÿÿ)r?   Ú
dxfversionrB   r   rE   é0   g      ð?é<   )r?   rH   rB   i¤  )rH   rB   i®  i¸  )rH   rB   r   i  i[  i\  i|  )rH   r?   rB   i†  )r5   r7   r4   Ú
paperspacer9   r6   Ú	invisibler:   r8   r;   Úshadow_modeÚmaterial_handleÚvisualstyle_handleÚplotstyle_enumÚplotstyle_handler   r,   c                ó  — | j                  d«      rq| j                  }| j                  d«       |dk(  ry |D ]H  }| j                  |«      }|€Œ|j                  dk(  sŒ'| j                  ||j                  |¬«      «       ŒJ y y )NÚ	elevationr   )Úz)ÚhasattrrS   ÚdiscardÚgetrT   ÚsetÚreplace)ÚdxfÚnamesrS   ÚnameÚvs        ú5lib/python3.12/site-packages/ezdxf/entities/dxfgfx.pyr1   r1   –   su   € ð ‡{�{�;ÔØ—M‘Mˆ	à�‰�KÔ Ø˜Š>ØãˆDØ—‘˜“ˆAð
 ‰} §¡¨£Ø—‘˜˜aŸi™i¨)˜iÓ4Õ5ñ ð  ó    c                  ó6  ‡ — e Zd ZU dZdZddiZded<    eee	«      Z
	 d,	 	 	 d-ˆ fd„Zd.d„Zed/d	„«       Zej                  d0d
„«       Zej                   d.d„«       Zed1d„«       Zej                  d2d„«       Zed3d„«       Zed3d„«       Zd4d„Zd5d„Zd6d7d„Zd8d„Zd9d„Zd9d„Zd:d„Zd.d„Z	 d,	 	 	 	 	 d;d„Zd<d„Zd=ˆ fd„Zd>d„Zd?d„Z ed3d„«       Z!d@d„Z"dAd„Z#dBd „Z$dCd!„Z%dDd"„Z&dDd#„Z'dDd$„Z(d3d%„Z)	 	 dE	 	 	 	 	 dFd&„Z*dGd'„Z+d,dHˆ fd(„Z,dId)„Z-dJˆ fd*„Z.dKˆ fd+„Z/ˆ xZ0S )Lr+   zÂCommon base class for all graphic entities, a subclass of
    :class:`~ezdxf.entities.dxfentity.DXFEntity`. These entities resides in
    entity spaces like modelspace, paperspace or block.
    ÚDXFGFXr5   r>   zdict[str, Any]ÚDEFAULT_ATTRIBSc                óB  •— t         ‰| �  |«      }|€|S |j                  }|j                  «        t        j
                  rG|j                  r|j                  t        k  rd}nd}t        |j                  |rdnd   |¬«      | _
        |j                  |t        d«       |S )zŒAdds subclass processing for 'AcDbEntity', requires previous base
        class processing by parent class.

        (internal API)
        é\   é    r   r    )Úlength_code)ÚsuperÚload_dxf_attribsÚr12Ú append_base_class_to_acdb_entityr   Úload_proxy_graphicsrH   r   r   Ú
subclassesÚproxy_graphicÚfast_load_dxfattribsr-   )ÚselfÚ	processorrZ   ri   ÚcodeÚ	__class__s        €r^   rh   zDXFGraphic.load_dxf_attribs¼   s›   ø€ ô ‰gÑ& yÓ1ˆØÐØˆJØ�m‰mˆà×2Ñ2Ô4ô ×&Ò&à×#Ò#¨	×(<Ñ(<¼wÒ(FØ‘à�Ü!3Ø×$Ñ$©#¡Q°1Ñ5Ø ô"ˆDÔð 	×&Ñ& sÔ,CÀQÔGØˆ
r_   c                óÐ   — | j                   rZ| j                  j                  | j                   j                  vr-t	        j
                  d| j                  j                  › d�«      ‚yy)z`Post-processing and integrity validation after entity creation.

        (internal API)
        z
Linetype "z" not defined.N)ÚdocrZ   r7   Ú	linetypesr   ÚDXFInvalidLineType©ro   s    r^   Úpost_new_hookzDXFGraphic.post_new_hookÚ   s[   € ð
 �8Š8Ø�x‰x× Ñ ¨¯©×(:Ñ(:Ñ:Ü×.Ñ.Ø  §¡×!2Ñ!2Ð 3°>ÐBóð ð ;ð r_   c                ó–   — | j                   j                  d«      r.t        j                  | j                   j	                  d«      «      S y)zKReturns RGB true color as (r, g, b) tuple or None if true_color is not set.r:   N)rZ   rU   ÚclrÚint2rgbrW   rw   s    r^   ÚrgbzDXFGraphic.rgbå   s5   € ð �8‰8×Ñ˜LÔ)Ü—;‘;˜tŸx™xŸ|™|¨LÓ9Ó:Ð:Ør_   c                ób   — | j                   j                  dt        j                  |«      «       y)z�Set RGB true color as (r, g , b) tuple e.g. (12, 34, 56).

        Raises:
            TypeError: input value `rgb` has invalid type
        r:   N)rZ   rX   rz   Úrgb2int)ro   r|   s     r^   r|   zDXFGraphic.rgbì   s   € ð 	�‰�‰�\¤3§;¡;¨sÓ#3Õ4r_   c                ó:   — | j                   j                  d«       y)zDelete RGB true color value.r:   N)rZ   rV   rw   s    r^   r|   zDXFGraphic.rgbõ   s   € ð 	�‰×Ñ˜Õ&r_   c                óØ   — | j                   j                  d«      rO| j                   j                  d«      }t        j                  |«      r|t
        z  ryt        j                  |«      S y)zœGet transparency as float value between 0 and 1, 0 is opaque and 1
        is 100% transparent (invisible). Transparency by block returns always 0.
        r;   g        )rZ   rU   rW   r   Úis_transparencyr   rz   Útransparency2float)ro   Úvalues     r^   r;   zDXFGraphic.transparencyú   sV   € ð
 �8‰8×Ñ˜NÔ+Ø—H‘H—L‘L Ó0ˆEÜ×(Ñ(¨Ô/ØÔ/Ò/ØÜ×-Ñ-¨eÓ4Ð4Ør_   c                ób   — | j                   j                  dt        j                  |«      «       y)ztSet transparency as float value between 0 and 1, 0 is opaque and 1
        is 100% transparent (invisible).
        r;   N)rZ   rX   rz   Úfloat2transparency)ro   r;   s     r^   r;   zDXFGraphic.transparency  s!   € ð
 	�‰�‰�^¤S×%;Ñ%;¸LÓ%IÕJr_   c                ó:   — | j                   j                  d«       S )z<Returns ``True`` if entity inherits transparency from layer.r;   )rZ   rU   rw   s    r^   Úis_transparency_by_layerz#DXFGraphic.is_transparency_by_layer  s   € ð —8‘8×#Ñ# NÓ3Ð3Ð3r_   c                óH   — | j                   j                  dd«      t        k(  S )z<Returns ``True`` if entity inherits transparency from block.r;   r   )rZ   rW   r   rw   s    r^   Úis_transparency_by_blockz#DXFGraphic.is_transparency_by_block  s   € ð �x‰x�|‰|˜N¨AÓ.Ô2FÑFÐFr_   c                ó¤   — t        «       }t        D ]<  }| j                  j                  |«      sŒ| j                  j	                  |«      ||<   Œ> |S )z•Returns the important common properties layer, color, linetype,
        lineweight, ltscale, true_color and color_name as `dxfattribs` dict.
        )ÚdictÚGRAPHIC_PROPERTIESrZ   rU   rW   )ro   ÚattribsÚkeys      r^   Úgraphic_propertieszDXFGraphic.graphic_properties  sD   € ô “&ˆß%ˆCØ�x‰x×Ñ Õ$Ø#Ÿx™xŸ|™|¨CÓ0�˜’ð &ð ˆr_   c                óœ   — | j                   j                  d«      r(| j                   j                  dd¬«      }t        |«      S t        «       S )zºReturns object coordinate system (:ref:`ocs`) for 2D entities like
        :class:`Text` or :class:`Circle`, returns a pass-through OCS for
        entities without OCS support.
        Ú	extrusion)r   r   r    )r?   )rZ   Úis_supportedrW   r   )ro   r‘   s     r^   ÚocszDXFGraphic.ocs"  s=   € ð �8‰8× Ñ  Ô-ØŸ™Ÿ™ [¸)˜ÓDˆIÜ�y“>Ð!ä“5ˆLr_   c                ó„   — || j                   _        |r|| j                   _        y| j                   j                  d«       y)z7Set owner attribute and paperspace flag. (internal API)rK   N)rZ   ÚownerrK   rV   )ro   r•   rK   s      r^   Ú	set_ownerzDXFGraphic.set_owner.  s.   € àˆ�‰ŒÙØ",ˆD�H‰HÕà�H‰H×Ñ˜\Õ*r_   c                 ó   — y)zàStore linked or attached entities. Same API for both types of
        appended data, because entities with linked entities (POLYLINE, INSERT)
        have no attached entities and vice versa.

        (internal API)
        N© )ro   Úentitys     r^   Úlink_entityzDXFGraphic.link_entity6  s   € ð 	r_   c                ó&   — | j                  |«       y)z7Export entity specific data as DXF tags. (internal API)N)Úexport_acdb_entity)ro   Ú	tagwriters     r^   Úexport_entityzDXFGraphic.export_entity?  s   € ð 	×Ñ 	Õ*r_   c                óN  — |j                   t        kD  }|r$|j                  t        t        j
                  «       | j                  j                  |g d¢«       | j                  rB|r?t        j                  r.t        | j                  ||j                   t        k  rdnd¬«       yyyy)z8Export subclass 'AcDbEntity' as DXF tags. (internal API))rK   r5   r7   rN   r4   r9   r6   rL   r:   r8   r;   rP   rQ   rM   rO   rd   re   )r�   rf   N)rH   r   Ú
write_tag2r   r,   r\   rZ   Úexport_dxf_attribsrm   r   Ústore_proxy_graphicsr   r   )ro   r�   Únot_r12s      r^   rœ   zDXFGraphic.export_acdb_entityE  s�   € ð ×&Ñ&¬Ñ.ˆÙØ× Ñ ¤´+×2BÑ2BÔCà�‰×#Ñ#Øòô	
ð* ×Ò¡'¬g×.JÒ.Jä Ø×"Ñ"Ø#Ø#,×#7Ñ#7¼'Ò#A™RÀsöð /K 'Ðr_   c                ó”  — | j                   j                  �| j                  €y	 | j                  j                  j	                  | j                   j                  «      S # t
        j                  $ r Y nw xY w	 | j                  j                  j                  | j                   j                  «      S # t
        j                  $ r Y yw xY w)zfReturns the owner layout or returns ``None`` if entity is not
        assigned to any layout.
        N)
rZ   r•   rt   ÚlayoutsÚget_layout_by_keyr   ÚDXFKeyErrorÚblocksÚget_block_layout_by_handleÚDXFTableEntryErrorrw   s    r^   Ú
get_layoutzDXFGraphic.get_layouti  sœ   € ð �8‰8�>‰>Ð! T§X¡XÐ%5Øð	Ø—8‘8×#Ñ#×5Ñ5°d·h±h·n±nÓEÐEøÜ× Ñ ò 	Ùð	úð	Ø—8‘8—?‘?×=Ñ=¸d¿h¹h¿n¹nÓMÐMøÜ×'Ñ'ò 	Ùð	ús#   ¥8A ÁA4Á3A4Á88B1 Â1CÃCc                ó¶   — | j                   st        d«      ‚| j                  €d| j                  _        y| j                  «       }|r|j                  | «       yy)a-  
        Unlink entity from associated layout. Does nothing if entity is already
        unlinked.

        It is more efficient to call the
        :meth:`~ezdxf.layouts.BaseLayout.unlink_entity` method of the associated
        layout, especially if you have to unlink more than one entity.
        z Can not unlink destroyed entity.N)Úis_aliveÚ	TypeErrorrt   rZ   r•   r«   Úunlink_entity)ro   Úlayouts     r^   Úunlink_from_layoutzDXFGraphic.unlink_from_layoutx  sQ   € ð �}Š}ÜÐ>Ó?Ð?à�8‰8Ðà!ˆD�H‰HŒNØà—‘Ó"ˆÙØ× Ñ  Õ&ð r_   c                óz   — |€'| j                  «       }|€t        j                  d«      ‚|j                  | |«       y)aÿ  
        Move entity from model space or a paper space layout to another layout.
        For block layout as source, the block layout has to be specified. Moving
        between different DXF drawings is not supported.

        Args:
            layout: any layout (model space, paper space, block)
            source: provide source layout, faster for DXF R12, if entity is
                    in a block layout

        Raises:
            DXFStructureError: for moving between different DXF drawings
        Nz#Source layout for entity not found.)r«   r   ÚDXFValueErrorÚmove_to_layout)ro   r°   Úsources      r^   r´   zDXFGraphic.move_to_layout�  s<   € ð  ˆ>Ø—_‘_Ó&ˆFØˆ~Ü×)Ñ)Ð*OÓPÐPØ×Ñ˜d FÕ+r_   c                ó¤   — | j                   |j                   k7  rt        j                  d«      ‚| j                  «       }|j	                  |«       |S )a_  
        Copy entity to another `layout`, returns new created entity as
        :class:`DXFEntity` object. Copying between different DXF drawings is
        not supported.

        Args:
            layout: any layout (model space, paper space, block)

        Raises:
            DXFStructureError: for copying between different DXF drawings
        z8Copying between different DXF drawings is not supported.)rt   r   ÚDXFStructureErrorÚcopyr/   )ro   r°   Ú
new_entitys      r^   Úcopy_to_layoutzDXFGraphic.copy_to_layout£  sK   € ð �8‰8�v—z‘zÒ!Ü×)Ñ)ØJóð ð —Y‘Y“[ˆ
Ø×Ñ˜*Ô%ØÐr_   c                óP  •— | j                   |j                   u sJ d«       ‚| j                  syt        ‰| �  |«       |j	                  | «       | j
                  }|j                  d«      r|j                  | «       |j                  d«      r|j                  | «       |j                  d«      r|j                  | «       |j                  d«      r|j                  | «       |j                  d«      r|j                  | «       |j                  d«      r|j                  | «       yy)	aJ  Audit and repair graphical DXF entities.

        .. important::

            Do not delete entities while auditing process, because this
            would alter the entity database while iterating, instead use::

                auditor.trash(entity)

            to delete invalid entities after auditing automatically.
        z#Auditor for different DXF document.Nr5   r7   r4   r9   r‘   r;   )rt   r­   rg   ÚauditÚcheck_owner_existrZ   rU   Úcheck_for_valid_layer_nameÚcheck_entity_linetypeÚcheck_entity_color_indexÚcheck_entity_lineweightÚcheck_extrusion_vectorÚcheck_transparency)ro   ÚauditorrZ   rr   s      €r^   r¼   zDXFGraphic.audit¸  sï   ø€ ð �x‰x˜7Ÿ;™;Ñ&ÐMÐ(MÓMÐ&Ø�}Š}Øä‰‰�gÔØ×!Ñ! $Ô'Ø�h‰hˆØ�;‰;�wÔØ×.Ñ.¨tÔ4Ø�;‰;�zÔ"Ø×)Ñ)¨$Ô/Ø�;‰;�wÔØ×,Ñ,¨TÔ2Ø�;‰;�|Ô$Ø×+Ñ+¨DÔ1Ø�;‰;�{Ô#Ø×*Ñ*¨4Ô0Ø�;‰;�~Ô&Ø×&Ñ& tÕ,ð 'r_   c                ó   — t        «       ‚)z§Inplace transformation interface, returns `self` (floating interface).

        Args:
             m: 4x4 transformation matrix (:class:`ezdxf.math.Matrix44`)
        )ÚNotImplementedError©ro   Úms     r^   Ú	transformzDXFGraphic.transformØ  s   € ô "Ó#Ð#r_   c                óT   — | j                   �| j                   j                  |«       yy)zBShould be called if the main entity transformation was successful.N)ÚxdatarÉ   rÇ   s     r^   Úpost_transformzDXFGraphic.post_transformà  s#   € à�:‰:Ð!Ø�J‰J× Ñ  Õ#ð "r_   c                ó   — | j                   duS )z)Check if post transform call is required.N)rË   rw   s    r^   Úis_post_transform_requiredz%DXFGraphic.is_post_transform_requiredå  s   € ð �z‰z Ð%Ð%r_   c                óN   — | j                  t        j                  |||«      «      S )zÿTranslate entity inplace about `dx` in x-axis, `dy` in y-axis and
        `dz` in z-axis, returns `self` (floating interface).

        Basic implementation uses the :meth:`transform` interface, subclasses
        may have faster implementations.
        )rÉ   r   Ú	translate)ro   ÚdxÚdyÚdzs       r^   rÐ   zDXFGraphic.translateê  s"   € ð �~‰~œh×0Ñ0°°R¸Ó<Ó=Ð=r_   c                óN   — | j                  t        j                  |||«      «      S )zƒScale entity inplace about `dx` in x-axis, `dy` in y-axis and `dz`
        in z-axis, returns `self` (floating interface).
        ©rÉ   r   Úscale)ro   ÚsxÚsyÚszs       r^   rÖ   zDXFGraphic.scaleó  s    € ð �~‰~œhŸn™n¨R°°RÓ8Ó9Ð9r_   c                óJ   — | j                  t        j                  |«      «      S )zzScale entity inplace uniform about `s` in x-axis, y-axis and z-axis,
        returns `self` (floating interface).
        rÕ   )ro   Úss     r^   Úscale_uniformzDXFGraphic.scale_uniformù  s   € ð �~‰~œhŸn™n¨QÓ/Ó0Ð0r_   c                óL   — | j                  t        j                  ||«      «      S )zÖRotate entity inplace about vector `axis`, returns `self`
        (floating interface).

        Args:
            axis: rotation axis as tuple or :class:`Vec3`
            angle: rotation angle in radians
        )rÉ   r   Úaxis_rotate)ro   ÚaxisÚangles      r^   Úrotate_axiszDXFGraphic.rotate_axisÿ  s    € ð �~‰~œh×2Ñ2°4¸Ó?Ó@Ð@r_   c                óJ   — | j                  t        j                  |«      «      S )z•Rotate entity inplace about x-axis, returns `self`
        (floating interface).

        Args:
            angle: rotation angle in radians
        )rÉ   r   Úx_rotate©ro   rà   s     r^   Úrotate_xzDXFGraphic.rotate_x	  ó   € ð �~‰~œh×/Ñ/°Ó6Ó7Ð7r_   c                óJ   — | j                  t        j                  |«      «      S )z•Rotate entity inplace about y-axis, returns `self`
        (floating interface).

        Args:
            angle: rotation angle in radians
        )rÉ   r   Úy_rotaterä   s     r^   Úrotate_yzDXFGraphic.rotate_y  ræ   r_   c                óJ   — | j                  t        j                  |«      «      S )z•Rotate entity inplace about z-axis, returns `self`
        (floating interface).

        Args:
            angle: rotation angle in radians
        )rÉ   r   Úz_rotaterä   s     r^   Úrotate_zzDXFGraphic.rotate_z  ræ   r_   c                óL   — t        | j                  «      xr d| j                  v S )z5Returns ``True`` if entity has an attached hyperlink.ÚPE_URL)ÚboolrË   rw   s    r^   Úhas_hyperlinkzDXFGraphic.has_hyperlink$  s   € ä�D—J‘JÓÒ< X°·±Ð%;Ð<r_   c                ó¸  — ddt        |«      fg}|r\|j                  d«       |j                  dt        |«      f«       |r|j                  dt        |«      f«       |j                  d«       | j                  d«       | j                  d|«       | j                  r=d| j                  j
                  vr%| j                  j
                  j                  d«       | S )zSet hyperlink of an entity.)ié  rî   éè  )éê  Ú{)ró   Ú}rî   )ÚstrÚappendÚdiscard_xdataÚ	set_xdatart   ÚappidsÚnew)ro   ÚlinkÚdescriptionÚlocationrË   s        r^   Úset_hyperlinkzDXFGraphic.set_hyperlink(  s­   € ð " D¬#¨d«)Ð#4Ð5ˆÙØ�L‰L˜Ô%Ø�L‰L˜$¤ KÓ 0Ð1Ô2ÙØ—‘˜d¤C¨£MÐ2Ô3Ø�L‰L˜Ô%à×Ñ˜8Ô$Ø�‰�x Ô'Ø�8Š8˜¨¯©¯©Ñ7Ø�H‰H�O‰O×Ñ Ô)Øˆr_   c                ó2  — d}d}d}| j                   r|d| j                   v rn| j                  d«      D �cg c]  }|j                  dk(  sŒ|j                  ‘Œ  }}t	        |«      r|d   }t	        |«      dkD  r|d   }t	        |«      dkD  r|d   }|||fS c c}w )z,Returns hyperlink, description and location.Ú rî   rò   r   r    é   )rË   Ú	get_xdatarq   rƒ   Úlen)ro   rü   rý   rþ   ÚtagrË   s         r^   Úget_hyperlinkzDXFGraphic.get_hyperlink=  s�   € àˆØˆØˆØ�:Š:˜( d§j¡jÑ0Ø*.¯.©.¸Ô*BÓWÑ*B 3ÀcÇhÁhÐRVÓFV�S—Y“YÐ*BˆEÐWÜ�5ŒzØ˜Q‘x�Ü�5‹z˜AŠ~Ø# A™h�Ü�5‹z˜AŠ~Ø  ™8�Ø�[ (Ð*Ð*ùò Xs   ´BÁ	Bc                óŒ  •— | j                   syt        ‰| �	  |«       |duxr" | j                  j                  |j
                  v }|sd| j                  _        | j                  j                  d«       | j                  j                  d«       | j                  j                  d«       | j                  j                  d«       y)zORemove all dependencies from current document.

        (internal API)
        NrA   rN   rO   rP   rQ   )r­   rg   Úremove_dependenciesrZ   r7   ru   rV   )ro   ÚotherÚhas_linetyperr   s      €r^   r  zDXFGraphic.remove_dependenciesL  s›   ø€ ð
 �}Š}Øä‰Ñ# EÔ*ð  DÐ(ÒS¨d¯h©h×.?Ñ.?À5Ç?Á?Ð.RˆÙØ )ˆD�H‰HÔØ�‰×ÑÐ*Ô+Ø�‰×ÑÐ-Ô.Ø�‰×ÑÐ)Ô*Ø�‰×ÑÐ+Õ,r_   c                óh  — |xs i }d|vr| j                   j                  |d<   | j                  r"t        j                  ||| j                  «      }nt        j
                  ||«      }| j                   j                  |j                   _        | j                   j                  |j                   _        |S )zÝCreate and bind  new entity with same layout settings as `self`.

        Used by INSERT & POLYLINE to create appended DXF entities, don't use it
        to create new standalone entities.

        (internal API)
        r5   )rZ   r5   rt   r
   Úcreate_db_entryrû   r•   rK   )ro   Útype_Ú
dxfattribsr™   s       r^   Ú_new_compound_entityzDXFGraphic._new_compound_entity`  sˆ   € ð  Ò% 2ˆ
ð
 ˜*Ñ$Ø"&§(¡(§.¡.ˆJ�wÑØ�8Š8Ü×,Ñ,¨U°JÀÇÁÓI‰Fä—[‘[ ¨
Ó3ˆFØŸ8™8Ÿ>™>ˆ�
‰
ÔØ $§¡× 3Ñ 3ˆ�
‰
ÔØˆr_   c                óè   •— t         ‰| �  |«       | j                  }|j                  |j                  «       |j                  |j                  «       |j                  |j                  d«      «       y)z5Register required resources to the resource registry.rN   N)	rg   Úregister_resourcesrZ   Ú	add_layerr5   Úadd_linetyper7   Ú
add_handlerW   )ro   ÚregistryrZ   rr   s      €r^   r  zDXFGraphic.register_resourcesw  sU   ø€ ä‰Ñ" 8Ô,Ø�h‰hˆØ×Ñ˜3Ÿ9™9Ô%Ø×Ñ˜cŸl™lÔ+Ø×Ñ˜CŸG™GÐ$5Ó6Õ7r_   c                ó  •— t         ‰| �  ||«       |j                  | j                  j                  «      |j                  _        | j                  j
                  } |d«      r4|j                  | j                  j                  «      |j                  _         |d«      r4|j                  | j                  j                  «      |j                  _	        |j                  j                  d«       |j                  j                  d«       y)z3Translate resources from self to the copied entity.r7   rN   rO   rQ   N)rg   Úmap_resourcesÚ	get_layerrZ   r5   rU   Úget_linetyper7   Ú
get_handlerN   rV   )ro   ÚcloneÚmappingÚattrib_existrr   s       €r^   r  zDXFGraphic.map_resources‚  sº   ø€ ä‰Ñ˜e WÔ-Ø!×+Ñ+¨D¯H©H¯N©NÓ;ˆ�	‰	ŒØ—x‘x×'Ñ'ˆÙ˜
Ô#Ø!(×!5Ñ!5°d·h±h×6GÑ6GÓ!HˆE�I‰IÔÙÐ)Ô*Ø(/×(:Ñ(:¸4¿8¹8×;SÑ;SÓ(TˆE�I‰IÔ%ð 	�	‰	×ÑÐ.Ô/Ø�	‰	×ÑÐ,Õ-r_   ©N©rp   zOptional[SubclassProcessor]Úreturnr'   )r   ÚNone)r   ztuple[int, int, int] | None)r|   zclr.RGB | tuple[int, int, int]r   r!  )r   Úfloat)r;   r"  r   r!  )r   rï   )r   r‹   )r   r   )r   )r•   úOptional[str]rK   Úintr   r!  )r™   r!   r   r!  )r�   r)   r   r!  )r   úOptional[BaseLayout])r°   r(   rµ   r%  r   r!  )r°   r(   r   r   )rÄ   r%   r   r!  )rÈ   r   r   r   )rÈ   r   r   r!  )rÑ   r"  rÒ   r"  rÓ   r"  r   r   )r×   r"  rØ   r"  rÙ   r"  r   r   )rÛ   r"  r   r   )rß   r   rà   r"  r   r   )rà   r"  r   r   )NN)rü   rö   rý   r#  rþ   r#  )r   ztuple[str, str, str])r	  zOptional[Drawing]r   r!  )r  rö   r   r   )r  zxref.Registryr   r!  )r  r   r  zxref.ResourceMapperr   r!  )1Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚDXFTYPErb   Ú__annotations__r   r"   r,   Ú
DXFATTRIBSrh   rx   Úpropertyr|   ÚsetterÚdeleterr;   r‡   r‰   r�   r“   r–   rš   rž   rœ   r«   r±   r´   rº   r¼   rÉ   rÌ   rÎ   rÐ   rÖ   rÜ   rá   rå   ré   rì   rð   rÿ   r  r  r  r  r  Ú__classcell__©rr   s   @r^   r+   r+   ²   sÌ  ø… ñð
 €GØ'.° n€O�^Ó4Ù˜z¨;Ó7€Jð 8<ðØ4ðà	õó<	ð òó ðð 	‡Z�Zò5ó ð5ð 	‡[�[ò'ó ð'ð ò
ó ð
ð ×ÑòKó ðKð ò4ó ð4ð òGó ðGóó
ô+óó+ó"óHó'ð, BFð,Ø ð,Ø*>ð,à	ó,ó,õ*-ó@$ó$ð
 ò&ó ð&ó>ó:ó1óAó8ó8ó8ó=ð &*Ø"&ð	àðð #ðð  ó	ó*+ö-ó(õ.8÷.ñ .r_   r+   c                  ó.   ‡ — e Zd ZdZ	 d	 	 	 dˆ fd„Zˆ xZS )r.   ÚSEQENDc                ó^   •— t         t        | �  |«      }|r|j                  |t        «       |S )z!Loading interface. (internal API))rg   r+   rh   Úsimple_dxfattribs_loaderr-   )ro   rp   rZ   rr   s      €r^   rh   zSeqEnd.load_dxf_attribs•  s/   ø€ ô
 ”J Ñ6°yÓAˆÙØ×.Ñ.¨sÔ4KÔLØˆ
r_   r  r  )r&  r'  r(  r*  rh   r0  r1  s   @r^   r.   r.   ‘  s'   ø„ à€Gð 8<ðØ4ðà	÷ñ r_   r.   c                ó¶   — | j                   j                  �J ‚|€J ‚|j                  r t        j                  | |j                  «       |j                  | «       y)zEAdd `entity` entity to the entity database and to the given `layout`.N)rZ   Úhandlert   r
   Úbindr/   )r™   r°   s     r^   r/   r/      sK   € à�:‰:×ÑÐ$Ð$Ð$ØÐÐÐØ‡z‚zÜ�‰�V˜VŸZ™ZÔ(Ø
×Ñ�fÕr_   c                óL  — |j                   j                  �J ‚|€J ‚| j                   j                  |j                   _        | |v rO|j                  | «       |j                  r t	        j
                  ||j                  «       |j                  |«       y| j                  «        y)z…Add `target` entity to the entity database and to the given `layout`
    and replace the `source` entity by the `target` entity.
    N)rZ   r7  Údelete_entityrt   r
   r8  r/   Údestroy)rµ   Útargetr°   s      r^   r0   r0   ©  sƒ   € ð �:‰:×ÑÐ$Ð$Ð$ØÐÐÐØŸ
™
×)Ñ)€F‡J�JÔØ�ÑØ×Ñ˜VÔ$Ø�:Š:Ü�L‰L˜ §¡Ô,Ø×Ñ˜&Õ!à�‰Õr_   c                ó`   — t        | t        «      ryt        | t        «      r| j                  ryy)zîReturns ``True`` if the `entity` has a graphical representations and
    can reside in the model space, a paper space or a block layout,
    otherwise the entity is a table or class entry or a DXF object from the
    OBJECTS section.
    TF)Ú
isinstancer+   r$   r2   )r™   s    r^   r2   r2   ¹  s)   € ô �&œ*Ô%ØÜ�&œ-Ô(¨V×-EÒ-EØØr_   c                óh  — t         j                  }| j                  }|€|S 	 | j                  j	                  dt         j
                  «      }	 |j                  j	                  |«      }|j                  j                  S # t         j                  $ r |cY S w xY w# t         j                  $ r |cY S w xY w)z°Returns the font name of any DXF entity.

    This function always returns a font name even if the entity doesn't support text
    styles.  The default font name is "txt".
    Ústyle)
r   ÚDEFAULT_TEXT_FONTrt   rZ   rW   ÚDEFAULT_TEXT_STYLEÚDXFAttributeErrorÚstylesÚfontrª   )r™   Ú	font_namert   Ú
style_namer@  s        r^   r3   r3   Æ  s    € ô ×'Ñ'€IØ
�*‰*€CØ
€{ØÐðØ—Z‘Z—^‘^ G¬U×-EÑ-EÓFˆ
ðØ—
‘
—‘˜zÓ*ˆØ�y‰y�~‰~Ðøô	 ×"Ñ"ò ØÒðûô
 ×#Ñ#ò ØÒðús#   ¢*A> Á0B Á>BÂBÂB1Â0B1N)rZ   r'   r[   zIterable[str])r™   r+   r°   r(   r   r!  )rµ   r+   r<  r+   r°   r(   r   r!  )r™   r!   r   zTypeGuard[DXFGraphic])r™   r!   r   rö   )LÚ
__future__r   Útypingr   r   r   r   Útyping_extensionsr   r	   Úezdxf.entitiesr
   Úezdxfr   Úezdxf.lldxfr   Úezdxf.lldxf.attributesr   r   r   r   r   r   rz   r   Úezdxf.lldxf.constr   r   r   r   r   r   r   Ú
ezdxf.mathr   r   r   Úezdxf.proxygraphicr   r   Ú	dxfentityr!   r"   r#   r$   Úezdxf.auditr%   Úezdxf.documentr&   r'   Úezdxf.layoutsr(   Úezdxf.lldxf.tagwriterr)   r*   Ú__all__rŒ   Úis_valid_layer_nameÚis_valid_table_nameÚis_valid_aci_colorÚis_integer_boolÚis_valid_lineweightÚfix_lineweightÚis_positiver�   r,   r+  r-   r1   r+   Úregister_entityr.   r/   r0   r2   r3   r˜   r_   r^   Ú<module>r`     s(  ðö #ß 9Ó 9ß -å "Ý Ý !÷õ õ  Ý ÷÷ ñ ÷ +Ñ *ß Gß NÓ NáÝ#Ý&Ý+Ý(Ý7Ýò
€ò	Ð ñ 'Øñ ˜ C°9×3PÑ3PÔQáØØØØ×3Ñ3ô	
ñ ØØØØ×2Ñ2Ø ô
ñ ØØØØ×/Ñ/Ø ô
ñ ØØØØØ×3Ñ3Ø×*Ñ*ô
ñ ØØØØØ×+Ñ+Ø ô
ñ ˜R¨°wÈÔNñ ˜c¨gÀÔEá˜c¨gÀÔEñ  ØØØØ×/Ñ/ô	
ñ ˜s¨wÀÔFÙ" 3°7ÀTÔJÙ% c°gÈÔMñ " #°'À1ÈtÔTñ $ C°GÀdÔKñWPóS€ˆ[ó Sñh -¨[Ó9Ð ó6ô8\.�ô \.ð~ 	×ÑôˆZó ó ðóóó 
ôr_   