Ë
    £èh—ž  ã                  ó4  — U d Z ddlmZ ddlmZmZmZmZmZm	Z	m
Z
mZ ddlmZ ddlZddlZddlmZ ddl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 ddlmZ ddl m!Z! ddl"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-m.Z. er,ddl/m0Z0 ddl1m2Z2 ddl3m4Z4m5Z5 ddlmZ ddl6m7Z7 ddl8m9Z9 ddlm:Z: g d¢Z; ejx                  d«      Z=dZ>dZ?dZ@ ed ed «       ed!«      d"œ«      ZAd#eBd$<    e
d%d&¬'«      ZC G d(„ d&«      ZDe!jŠ                   G d)„ d*eD«      «       ZFy)+a   :class:`DXFEntity` is the super class of all DXF entities.

The current entity system uses the features of the latest supported DXF version.

The stored DXF version of the document is used to warn users if they use
unsupported DXF features of the current DXF version.

The DXF version of the document can be changed at runtime or overridden by
exporting, but unsupported DXF features are just ignored by exporting.

Ezdxf does no conversion between different DXF versions, this package is
still not a CAD application.

é    )Úannotations)ÚTYPE_CHECKINGÚAnyÚIterableÚIteratorÚOptionalÚTypeÚTypeVarÚCallable)ÚSelfN)Úoptions)Úconst)ÚTags)ÚDXFTag)ÚExtendedTags)ÚDXFAttrÚDXFAttributesÚDefSubclass)Úset_flag_stateé   )Úfactory)ÚAppDataÚReactors)ÚDXFNamespaceÚSubclassProcessor)ÚXData)ÚExtensionDict)Údefault_copyÚCopyNotSupported)ÚAuditor)ÚDrawing)Ú
DXFGraphicÚInsert)r   )ÚAbstractTagWriter)ÚMatrix44)Úxref)Ú	DXFEntityÚDXFTagStorageÚ
base_classr   ÚezdxfÚ_source_of_copyÚ_uuidÚ_source_block_referenceé   iJ  )ÚhandleÚownerr   r)   ÚTr'   )Úboundc                  óv  — e Zd ZU dZdZ ee«      Zi Zde	d<   e
j                  ZdPd„ZedQd„«       Ze	 	 	 	 dR	 	 	 	 	 	 	 	 	 dSd„«       Zd	„ Zd
„ ZedTdUd„«       ZdTdVd„Z	 dT	 	 	 dWd„ZdXd„ZedTdYd„«       ZedZd„«       Zefd[d„Zefd\d„Zd]d„ZdPd„Zed^d„«       Zed_d„«       Z ed_d„«       Z!d`d„Z"dad„Z#dbd„Z$ed^d„«       Z%ed^d„«       Z&ed^d„«       Z'ed^d„«       Z(edcd„«       Z)ddd „Z*dPd!„Z+dTded"„Z,dfd#„Z-dgd$„Z.dhd%„Z/e/Z0dhd&„Z1did'„Z2did(„Z3did)„Z4dTdjd*„Z5	 dk	 	 	 	 	 	 	 dld+„Z6dmdnd,„Z7dTdod-„Z8dPd.„Z9d/„ Z:dTdpd0„Z;dqd1„Z<drd2„Z=drd3„Z>drd4„Z?drd5„Z@dsd6„ZAed^d7„«       ZBdtd8„ZCdtd9„ZDdPd:„ZEdPd;„ZFdud<„ZGdvd=„ZHdwd>„ZIdxd?„ZJdud@„ZKdvdA„ZLdwdB„ZMdydC„ZNdzdD„ZOd{dE„ZPd|dF„ZQd}dG„ZRd|dH„ZSd^dI„ZTd~dJ„ZUddK„ZVdbdL„ZWdbdM„ZXd€dN„ZYd�dO„ZZy)‚r'   z(Common super class for all DXF entities.Ú	DXFENTITYúdict[str, Any]ÚDEFAULT_ATTRIBSc                óz   — d| _         t        | ¬«      | _        d| _        d| _        d| _        d| _        d| _        y)z#Default constructor. (internal API)N)Úentity)Údocr   ÚdxfÚappdataÚreactorsÚextension_dictÚxdataÚproxy_graphic©Úselfs    ú8lib/python3.12/site-packages/ezdxf/entities/dxfentity.pyÚ__init__zDXFEntity.__init__e   s>   € ð '+ˆŒÜ!-°TÔ!:ˆŒð +/ˆŒØ,0ˆŒØ7;ˆÔØ&*ˆŒ
Ø.2ˆÕó    c                óv   — t        | t        d«      }|€%t        j                  «       }t	        | t        |«       |S )z±Returns a UUID, which allows to distinguish even
        virtual entities without a handle.

        Dynamic attribute: this UUID will be created at the first request.

        N)ÚgetattrÚDYN_UUID_ATTRIBUTEÚuuidÚuuid4Úsetattr)rA   Úuuid_s     rB   rH   zDXFEntity.uuidy   s5   € ô ˜Ô0°$Ó7ˆØˆ=Ü—J‘J“LˆEÜ�DÔ,¨eÔ4ØˆrD   Nc                óü   —  | «       }||_         ||j                  _        ||j                  _        t	        | j
                  «      }|j                  |xs i «       |j                  |«       |j                  «        |S )a¨  Constructor for building new entities from scratch by ezdxf.

        NEW process:

        This is a trusted environment where everything is under control of
        ezdxf respectively the package-user, it is okay to raise exception
        to show implementation errors in ezdxf or usage errors of the
        package-user.

        The :attr:`Drawing.is_loading` flag can be checked to distinguish the
        NEW and the LOAD process.

        Args:
            handle: unique DXF entity handle or None
            owner: owner handle if entity has an owner else None or '0'
            dxfattribs: DXF attributes
            doc: DXF document

        (internal API)
        )	r9   r:   r/   r0   Údictr6   ÚupdateÚupdate_dxf_attribsÚpost_new_hook)Úclsr/   r0   Ú
dxfattribsr9   r8   Úattribss          rB   ÚnewzDXFEntity.new‡   sj   € ñ8 “ˆØˆŒ
Ø"ˆ�
‰
ÔØ ˆ�
‰
ÔÜ�s×*Ñ*Ó+ˆØ�‰�zÒ' RÔ(Ø×!Ñ! 'Ô*à×ÑÔØˆrD   c                 ó   — y)zÕPost-processing and integrity validation after entity creation.

        Called only if created by ezdxf (see :meth:`DXFEntity.new`),
        not if loaded from an external source.

        (internal API)
        N© r@   s    rB   rP   zDXFEntity.post_new_hook®   s   € ð 	rD   c                 ó   — y)a¦  Post-processing and integrity validation after binding entity to a
        DXF Document. This method is triggered by the :func:`factory.bind`
        function only when the entity was created by ezdxf.

        If the entity was loaded in the 1st loading stage, the
        :func:`factory.load` functions also calls the :func:`factory.bind`
        to bind entities to the loaded document, but not all entities are
        loaded at this time. To avoid problems this method will not be called
        when loading content from DXF file, but :meth:`post_load_hook` will be
        triggered for loaded entities at a later and safer point in time.

        (internal API)
        NrV   r@   s    rB   Úpost_bind_hookzDXFEntity.post_bind_hook¸   s   € ð 	rD   c                óh   —  | «       }||_         |r|j                  nd}|j                  ||¬«       |S )aÈ  Constructor to generate entities loaded from an external source.

        LOAD process:

        This is an untrusted environment where valid structure are not
        guaranteed and errors should be fixed, because the package-user is not
        responsible for the problems and also can't fix them, raising
        exceptions should only be done for unrecoverable issues.
        Log fixes for debugging!

            Be more like BricsCAD and not as mean as AutoCAD!

        The :attr:`Drawing.is_loading` flag can be checked to distinguish the
        NEW and the LOAD process.

        Args:
            tags: DXF tags as :class:`ExtendedTags`
            doc: DXF Document

        (internal API)
        N©Ú
dxfversion)r9   r[   Ú	load_tags©rQ   Útagsr9   r8   r[   s        rB   ÚloadzDXFEntity.loadÈ   s7   € ñ0 “ˆØˆŒ
Ù'*�S—^’^°ˆ
Ø×Ñ˜¨*ÐÔ5ØˆrD   c                óÖ  — |r„t        |j                  «      r| j                  |j                  «       t        |j                  «      r	 t	        |j                  «      | _        t        ||¬«      }| j                  |«      | _        yy# t
        j                  $ rM t	        j                  |j                  «      | _        t        j                  d|j                  «       › �«       Y Œ„w xY w)a’  Generic tag loading interface, called if DXF document is loaded
        from external sources.

        1. Loading stage which set the basic DXF attributes, additional
           resources (DXF objects) are not loaded yet. References to these
           resources have to be stored as handles and can be resolved in the
        2. Loading stage: :meth:`post_load_hook`.

        (internal API)
        zremoved invalid XDATA from rZ   N)Úlenr;   Úsetup_app_datar>   r   r   ÚDXFValueErrorÚ	safe_initÚloggerÚdebugÚentity_namer   Úload_dxf_attribsr:   )rA   r^   r[   Ú	processors       rB   r\   zDXFEntity.load_tagsæ   s¶   € ñ Ü�4—<‘<Ô Ø×#Ñ# D§L¡LÔ1Ü�4—:‘:ŒðUÜ!& t§z¡zÓ!2�D”Jô
 *¨$¸:ÔFˆIØ×,Ñ,¨YÓ7ˆD�Hð øô ×*Ñ*ò UÜ!&§¡°·±Ó!<�D”JÜ—L‘LÐ#>¸t×?OÑ?OÓ?QÐ>RÐ!SÖTðUús   Á	B ÂAC(Ã'C(c                ó   — t        || «      S )z'Load DXF attributes into DXF namespace.)r   )rA   ri   s     rB   rh   zDXFEntity.load_dxf_attribsþ   s   € ô ˜I tÓ,Ð,rD   c                óR   — | j                   �| j                   j                  |«       y)ax  The 2nd loading stage when loading DXF documents from an external
        source, for the 1st loading stage see :meth:`load_tags`.

        This stage is meant to convert resource handles into :class:`DXFEntity`
        objects. This is an untrusted environment where valid structure are not
        guaranteed, raise exceptions only for unrecoverable structure errors
        and fix everything else. Log fixes for debugging!

        Some fixes can not be applied at this stage, because some structures
        like the OBJECTS section are not initialized, in this case return a
        callable, which will be executed after the DXF document is fully
        initialized, for an example see :class:`Image`.

        Triggered in method: :meth:`Drawing._2nd_loading_stage`

        Examples for two stage loading:
        Image, Underlay, DXFGroup, Dictionary, Dimstyle, MText

        N)r=   Úload_resources)rA   r9   s     rB   Úpost_load_hookzDXFEntity.post_load_hook  s'   € ð( ×ÑÐ*Ø×Ñ×.Ñ.¨sÔ3ØrD   c                óL   — | j                  t        j                  |«      |«      S )z6Load constructor from text for testing. (internal API))r_   r   Ú	from_text)rQ   Útextr9   s      rB   ro   zDXFEntity.from_text  s    € ð �x‰xœ×.Ñ.¨tÓ4°cÓ:Ð:rD   c                ó8  —  | «       }|j                   |_         |j                  |_        |j                  |_        |j                  |_        |j                  |_        |j
                  |_        |j                  |_        |j                  j                  |«       |S )z]Copy constructor for type casting e.g. Polyface and Polymesh.
        (internal API)
        )r9   r:   r=   r<   r;   r>   r?   Úrewire)rQ   Úotherr8   s      rB   Úshallow_copyzDXFEntity.shallow_copy!  su   € ñ
 “ˆØ—Y‘YˆŒ
Ø—Y‘YˆŒ
Ø %× 4Ñ 4ˆÔØŸ.™.ˆŒØŸ™ˆŒØ—{‘{ˆŒØ$×2Ñ2ˆÔØ�
‰
×Ñ˜&Ô!àˆrD   c                ó$   — |j                  | «      S )a¸  Internal entity copy for usage in the same document or as virtual entity.

        Returns a copy of `self` but without handle, owner and reactors.
        This copy is NOT stored in the entity database and does NOT reside
        in any layout, block, table or objects section!
        The extension dictionary will be copied for entities bound to a valid
        DXF document. The reactors are not copied.

        (internal API)
        )Úcopy©rA   Úcopy_strategys     rB   rv   zDXFEntity.copy2  s   € ð ×!Ñ! $Ó'Ð'rD   c                 ó   — y)z¯Copy entity data like vertices or attribs to the copy of the entity.

        This is the second stage of the copy process, see copy() method.

        (internal API)
        NrV   )rA   r8   rx   s      rB   Ú	copy_datazDXFEntity.copy_data?  s   € ð 	rD   c                ób   — t        |t        «      r|j                  sd}t        | t        |«       y)zÇSet immediate source entity of a copy.

        Also used from outside to set the source of sub-entities
        of disassembled entities (POLYLINE, LWPOLYLINE, ...).

        (Internal API)
        N)Ú
isinstancer'   Úis_aliverJ   ÚDYN_SOURCE_OF_COPY_ATTRIBUTE©rA   Úsources     rB   Úset_source_of_copyzDXFEntity.set_source_of_copyH  s&   € ô �fœiÔ(°·²ØˆFä�Ô2°FÕ;rD   c                óF   — t        | t        «      rt        | t        «       yy)zADelete source of copy reference.

        (Internal API)
        N)Úhasattrr~   Údelattrr@   s    rB   Údel_source_of_copyzDXFEntity.del_source_of_copyU  s   € ô
 �4Ô5Ô6Ü�DÔ6Õ7ð 7rD   c                ó   — | j                   duS )z$Is ``True`` if the entity is a copy.N)Úsource_of_copyr@   s    rB   Úis_copyzDXFEntity.is_copy]  s   € ð ×"Ñ"¨$Ð.Ð.rD   c                ób   — t        | t        d«      }t        |t        «      r|j                  sy|S )zyThe immediate source entity if this entity is a copy else
        ``None``. Never references a destroyed entity.
        N)rF   r~   r|   r'   r}   r   s     rB   r‡   zDXFEntity.source_of_copyb  s+   € ô ˜Ô;¸TÓBˆÜ�fœiÔ(°·²ØØˆrD   c                óØ   — | j                   }t        |t        «      rM|j                  rA|j                  r5|j                   }t        |t        «      r|j                  r|j                  rŒ5|S )z±The origin source entity if this entity is a copy else
        ``None``. References the first non-virtual source entity and never
        references a destroyed entity.
        )r‡   r|   r'   r}   Ú
is_virtualr   s     rB   Úorigin_of_copyzDXFEntity.origin_of_copym  sQ   € ð ×$Ñ$ˆä˜¤Ô+°·²ÀF×DUÒDUØ×*Ñ*ˆFô ˜¤Ô+°·²ÀF×DUÓDUàˆrD   c                ór   — | j                   j                  }|j                  «       D ]  \  }} |||«       Œ y)z]Set DXF attributes by a ``dict`` like :code:`{'layer': 'test',
        'color': 4}`.
        N)r:   ÚsetÚitems)rA   rR   ÚsetterÚkeyÚvalues        rB   rO   zDXFEntity.update_dxf_attribsy  s2   € ð —‘—‘ˆØ$×*Ñ*Ö,‰JˆC�Ù�3˜Õñ -rD   c                óþ   — |D ]x  }|d   \  }}|t         j                  k(  rt        j                  |«      | _        Œ9|t         j
                  k(  rt        j                  |«      | _        Œg| j                  ||«       Œz y)z3Setup data structures from APP data. (internal API)r   N)	r   ÚACAD_REACTORSr   Ú	from_tagsr<   ÚACAD_XDICTIONARYr   r=   Úset_app_data)rA   r;   ÚdataÚcodeÚappids        rB   rb   zDXFEntity.setup_app_data�  sj   € ãˆDØ˜q™'‰KˆD�%Øœ×+Ñ+Ò+Ü (× 2Ñ 2°4Ó 8�•Øœ%×0Ñ0Ò0Ü&3×&=Ñ&=¸dÓ&C�Õ#à×!Ñ! %¨Õ.ñ rD   c                óv   — || j                   _        | j                  r| j                  j                  |«       yy)z$Update entity handle. (internal API)N)r:   r/   r=   Úupdate_owner©rA   r/   s     rB   Úupdate_handlezDXFEntity.update_handleŒ  s/   € à ˆ�‰ŒØ×ÒØ×Ñ×,Ñ,¨VÕ4ð rD   c                ó   — t        | d«      S )z(Is ``False`` if entity has been deleted.r:   )rƒ   r@   s    rB   r}   zDXFEntity.is_alive’  s   € ô �t˜UÓ#Ð#rD   c                óR   — | j                   du xs | j                  j                  du S )z*Is ``True`` if entity is a virtual entity.N)r9   r:   r/   r@   s    rB   r‹   zDXFEntity.is_virtual—  s%   € ð �x‰x˜4ÐÒ: 4§8¡8§?¡?°dÐ#:Ð:rD   c                ót   — | j                   r,| j                  s t        j                  | | j                  «      S y)z/Is ``True`` if entity is bound to DXF document.F)r}   r‹   r   Úis_boundr9   r@   s    rB   r¢   zDXFEntity.is_boundœ  s+   € ð �=Š= §¢Ü×#Ñ# D¨$¯(©(Ó3Ð3ØrD   c                ó"   — t        | t        «      S )zDIs ``True`` if this virtual entity was created by a block reference.)rƒ   Ú$DYN_SOURCE_BLOCK_REFERENCE_ATTRIBUTEr@   s    rB   Úhas_source_block_referencez$DXFEntity.has_source_block_reference£  s   € ô �tÔAÓBÐBrD   c                óF   — t        | t        d«      }|�|j                  r|S y)z­The source block reference (INSERT) which created
        this virtual entity. The property is ``None`` if this entity was not
        created by a block reference.
        N)rF   r¤   r}   ©rA   Úblockrefs     rB   Úsource_block_referencez DXFEntity.source_block_reference¨  s)   € ô ˜4Ô!EÀtÓLˆØÐ H×$5Ò$5ØˆOØrD   c                óf   — | j                   sJ d«       ‚| j                  ryt        | t        |«       y)a1  Set the immediate source block reference which created this virtual
        entity.

        The source block reference can only be set once by the immediate INSERT
        entity and does not change if the entity is passed through multiple
        nested INSERT entities.

        (Internal API)
        z#instance has to be a virtual entityN)r‹   r¥   rJ   r¤   r§   s     rB   Úset_source_block_referencez$DXFEntity.set_source_block_reference³  s/   € ð �ŠÐEÐ EÓEˆØ×*Ò*ØÜ�Ô:¸HÕErD   c                óF   — t        | t        «      rt        | t        «       yy)z?Delete source block reference.

        (Internal API)
        N)rƒ   r¤   r„   r@   s    rB   Údel_source_block_referencez$DXFEntity.del_source_block_referenceÂ  s   € ô
 �4Ô=Ô>Ü�DÔ>Õ?ð ?rD   c                ó:   — | j                   j                  ||«      S )a•  Get DXF attribute `key`, returns `default` if key doesn't exist, or
        raise :class:`DXFValueError` if `default` is :class:`DXFValueError`
        and no DXF default value is defined::

            layer = entity.get_dxf_attrib("layer")
            # same as
            layer = entity.dxf.layer

        Raises :class:`DXFAttributeError` if `key` is not an supported DXF
        attribute.

        )r:   Úget)rA   r‘   Údefaults      rB   Úget_dxf_attribzDXFEntity.get_dxf_attribÊ  s   € ð �x‰x�|‰|˜C Ó)Ð)rD   c                ó<   — | j                   j                  ||«       y)a  Set new `value` for DXF attribute `key`::

           entity.set_dxf_attrib("layer", "MyLayer")
           # same as
           entity.dxf.layer = "MyLayer"

        Raises :class:`DXFAttributeError` if `key` is not an supported DXF
        attribute.

        N)r:   rŽ   )rA   r‘   r’   s      rB   Úset_dxf_attribzDXFEntity.set_dxf_attribÙ  s   € ð 	�‰�‰�S˜%Õ rD   c                ó:   — | j                   j                  |«       y)zÏDelete DXF attribute `key`, does not raise an error if attribute is
        supported but not present.

        Raises :class:`DXFAttributeError` if `key` is not an supported DXF
        attribute.

        N)r:   Údiscard©rA   r‘   s     rB   Údel_dxf_attribzDXFEntity.del_dxf_attribæ  s   € ð 	�‰×Ñ˜ÕrD   c                ó8   — | j                   j                  |«      S )zžReturns ``True`` if DXF attribute `key` really exist.

        Raises :class:`DXFAttributeError` if `key` is not an supported DXF
        attribute.

        )r:   rƒ   r¶   s     rB   Úhas_dxf_attribzDXFEntity.has_dxf_attribð  s   € ð �x‰x×Ñ Ó$Ð$rD   c                ó²   — || j                   v rI| j                  r<| j                  j                  | j                   j                  |«      j                  k\  S yy)z…Returns ``True`` if DXF attrib `key` is supported by this entity.
        Does not grant that attribute `key` really exist.

        TF)Ú
DXFATTRIBSr9   r[   r¯   r¶   s     rB   Úis_supported_dxf_attribz!DXFEntity.is_supported_dxf_attribû  sN   € ð
 �$—/‘/Ñ!Ø�xŠxà—H‘H×'Ñ'Ø—‘×*Ñ*¨3Ó/×:Ñ:ñ;ðð
 àrD   c                ó   — | j                   S )z:Get DXF type as string, like ``LINE`` for the line entity.)ÚDXFTYPEr@   s    rB   ÚdxftypezDXFEntity.dxftype  s   € à�|‰|ÐrD   c                ój   — dj                  | j                  «       | j                  j                  «      S )z'Returns a simple string representation.z{}(#{}))Úformatr¿   r:   r/   r@   s    rB   Ú__str__zDXFEntity.__str__  s#   € à×Ñ §¡£°·±·±Ó@Ð@rD   c                óJ   — t        | j                  «      dz   t        | «      z   S )z;Returns a simple string representation including the class.Ú )ÚstrÚ	__class__r@   s    rB   Ú__repr__zDXFEntity.__repr__  s   € ä�4—>‘>Ó" SÑ(¬3¨t«9Ñ4Ð4rD   c                óœ   — | j                   j                  «       }|r)|j                  «       D ��ci c]  \  }}||vsŒ||“Œ c}}S |S c c}}w )z‹Returns a ``dict`` with all existing DXF attributes and their
        values and exclude all DXF attributes listed in set `drop`.

        )r:   Úall_existing_dxf_attribsr�   )rA   ÚdropÚall_attribsÚkÚvs        rB   rR   zDXFEntity.dxfattribs  sS   € ð
 —h‘h×7Ñ7Ó9ˆÙØ%0×%6Ñ%6Ô%8ÔJÑ%8™T˜Q ¸AÀTºM�A�q‘DÐ%8ÒJÐJàÐùó Ks
   °A½Ac                óŒ   — | j                   j                  |d«      }| j                   j                  |t        |||¬«      «       y)z™Set binary coded `flag` of DXF attribute `name` to 1 (on)
        if `state` is ``True``, set `flag` to 0 (off)
        if `state` is ``False``.
        r   )ÚstateN)r:   r¯   rŽ   r   )rA   ÚflagrÏ   ÚnameÚflagss        rB   r   zDXFEntity.set_flag_state"  s3   € ð —‘—‘˜T 1Ó%ˆØ�‰�‰�Tœ>¨%°¸UÔCÕDrD   c                óR   — t        | j                  j                  |d«      |z  «      S )z‰Returns ``True`` if any `flag` of DXF attribute is 1 (on), else
        ``False``. Always check only one flag state at the time.
        r   )Úboolr:   r¯   )rA   rÐ   rÑ   s      rB   Úget_flag_statezDXFEntity.get_flag_state,  s#   € ô �D—H‘H—L‘L  qÓ)¨DÑ0Ó1Ð1rD   c                óÚ   — | j                   r_d| j                  _        d| j                  _        d| _        d| _        d| _        d| _        | j                  «        | j                  «        yy)aû  Remove all dependencies from current document.

        Intended usage is to remove dependencies from the current document to
        move or copy the entity to `other` DXF document.

        An error free call of this method does NOT guarantee that this entity
        can be moved/copied to the `other` document, some entities like
        DIMENSION have too many dependencies to a document to move or copy
        them, but to check this is not the domain of this method!

        (internal API)
        N)
r}   r:   r0   r/   r<   r=   r;   r>   r…   r­   )rA   rs   s     rB   Úremove_dependencieszDXFEntity.remove_dependencies2  s[   € ð �=Š=Ø!ˆD�H‰HŒNØ"ˆD�H‰HŒOØ ˆDŒMØ"&ˆDÔØˆDŒLØˆDŒJà×#Ñ#Ô%Ø×+Ñ+Õ-ð rD   c                óÂ   — | j                   sy| j                  �| j                  j                  «        | `| `| `| `| `| `| j                  «        | j                  «        y)z‡Delete all data and references. Does not delete entity from
        structures like layouts or groups.

        (internal API)
        N)
r}   r=   Údestroyr;   r<   r>   r9   r:   r…   r­   r@   s    rB   rÙ   zDXFEntity.destroyJ  sc   € ð �}Š}Øà×ÑÐ*Ø×Ñ×'Ñ'Ô)ØÐ#ØˆLØˆMØˆJØˆHØˆHà×ÑÔ!Ø×'Ñ'Õ)rD   c                ó6   — | j                   sy| `| `| `| `| `| `y)zvDelete entity but not the referenced content!

        DANGER! DON'T USE THIS METHOD!

        (internal API)
        N)r}   r=   r;   r<   r>   r9   r:   r@   s    rB   Ú_silent_killzDXFEntity._silent_kill_  s-   € ð �}Š}ØØÐØˆLØˆMØˆJØˆHØ‰HrD   c                 ó   — y)z*Internal messaging system.  (internal API)NrV   )rA   Úmessage_typer˜   s      rB   ÚnotifyzDXFEntity.notifyo  s   € àrD   c                 ó   — y)zšPre requirement check and pre-processing for export.

        Returns ``False``  if entity should not be exported at all.

        (internal API)
        TrV   ©rA   Ú	tagwriters     rB   Úpreprocess_exportzDXFEntity.preprocess_exports  s   € ð rD   c                óÂ   — |j                   | j                  k  ry| j                  |«      sy| j                  |«       | j	                  |«       | j                  |«       y)a   Export DXF entity by `tagwriter`.

        This is the first key method for exporting DXF entities:

            - has to know the group codes for each attribute
            - has to add subclass tags in correct order
            - has to integrate extended data: ExtensionDict, Reactors, AppData
            - has to maintain the correct tag order (because sometimes order matters)

        (internal API)

        N)r[   ÚMIN_DXF_VERSION_FOR_EXPORTrâ   Úexport_base_classÚexport_entityÚexport_xdatarà   s     rB   Ú
export_dxfzDXFEntity.export_dxf|  sZ   € ð ×Ñ $×"AÑ"AÒAØØ×%Ñ% iÔ0Øà×Ñ˜yÔ)ð 	×Ñ˜9Ô%ð 	×Ñ˜)Õ$rD   c                óº  — | j                   }|dk(  rdnd}|j                  t        j                  |«       |j                  t        j
                  k\  rÖ|j                  || j                  j                  «       | j                  r| j                  j                  |«       | j                  r| j                  j                  |«       | j                  r| j                  j                  |«       |j                  t        j                  | j                  j                  dd«      «       y|j                  r'|j                  || j                  j                  «       yy)z?Export base class DXF attributes and structures. (internal API)ÚDIMSTYLEéi   r.   r0   Ú0N)r¾   Ú
write_tag2r   ÚSTRUCTURE_MARKERr[   ÚDXF2000r:   r/   r;   rè   Úhas_extension_dictr=   r<   Ú
OWNER_CODEr¯   Úwrite_handles)rA   rá   r¿   Ú_handle_codes       rB   rå   zDXFEntity.export_base_class–  só   € à—,‘,ˆØ%¨Ò3‘s¸ˆà×ÑœU×3Ñ3°WÔ=à×Ñ¤5§=¡=Ò0Ø× Ñ  ¨t¯x©x¯©Ô?Ø�|Š|Ø—‘×'Ñ'¨	Ô2Ø×&Ò&Ø×#Ñ#×.Ñ.¨yÔ9Ø�}Š}Ø—‘×(Ñ(¨Ô3Ø× Ñ ¤×!1Ñ!1°4·8±8·<±<ÀÈÓ3MÕNà×&Ò&Ø×$Ñ$ \°4·8±8·?±?ÕCð 'rD   c                 ó   — y)a_  Export DXF entity specific data by `tagwriter`.

        This is the second key method for exporting DXF entities:

            - has to know the group codes for each attribute
            - has to add subclass tags in correct order
            - has to maintain the correct tag order (because sometimes order matters)

        (internal API)
        NrV   rà   s     rB   ræ   zDXFEntity.export_entity«  s   € ð 	rD   c                óT   — | j                   r| j                   j                  |«       yy)z/Export DXF XDATA by `tagwriter`. (internal API)N)r>   rè   rà   s     rB   rç   zDXFEntity.export_xdataº  s    € à�:Š:Ø�J‰J×!Ñ! )Õ,ð rD   c                 ó   — y)zValidity check. (internal API)NrV   )rA   Úauditors     rB   ÚauditzDXFEntity.audit¿  s   � rD   c                ód   — | j                   }|�"|j                  r|j                  j                  S y)zrReturns ``True`` if entity has an attached
        :class:`~ezdxf.entities.xdict.ExtensionDict` instance.
        F)r=   r}   Ú
dictionary©rA   Úxdicts     rB   rð   zDXFEntity.has_extension_dictÇ  s0   € ð
 ×#Ñ#ˆàÐ §¢Ø×#Ñ#×,Ñ,Ð,ØrD   c                óH   — | j                   r| j                  S t        d«      ‚)z¨Returns the existing :class:`~ezdxf.entities.xdict.ExtensionDict`
        instance.

        Raises:
            AttributeError: extension dict does not exist

        z#Entity has no extension dictionary.)rð   r=   ÚAttributeErrorr@   s    rB   Úget_extension_dictzDXFEntity.get_extension_dictÒ  s%   € ð ×"Ò"Ø×&Ñ&Ð&ä Ð!FÓGÐGrD   c                ó˜   — | j                   €J ‚t        j                  | j                  j                  | j                   «      }|| _        |S )zCCreate a new :class:`~ezdxf.entities.xdict.ExtensionDict` instance.)r9   r   rT   r:   r/   r=   rû   s     rB   Únew_extension_dictzDXFEntity.new_extension_dictß  s=   € à�x‰xÐ#Ð#Ð#Ü×!Ñ! $§(¡(§/¡/°4·8±8Ó<ˆØ#ˆÔØˆrD   c                óz   — t        | j                  t        «      r| j                  j                  «        d| _        y)z=Delete :class:`~ezdxf.entities.xdict.ExtensionDict` instance.N)r|   r=   r   rÙ   r@   s    rB   Údiscard_extension_dictz DXFEntity.discard_extension_dictæ  s,   € ä�d×)Ñ)¬=Ô9Ø×Ñ×'Ñ'Ô)Ø"ˆÕrD   c                óŒ   — t        | j                  t        «      r*t        | j                  «      dk(  r| j	                  «        yyy)zHDelete :class:`~ezdxf.entities.xdict.ExtensionDict` instance when empty.r   N)r|   r=   r   ra   r  r@   s    rB   Údiscard_empty_extension_dictz&DXFEntity.discard_empty_extension_dictì  s=   € ô �t×*Ñ*¬MÔ:Ü�D×'Ñ'Ó(¨AÒ-à×'Ñ'Õ)ð .ð ;rD   c                ó8   — | j                   r|| j                   v S y)z?Returns ``True`` if application defined data for `appid` exist.F)r;   ©rA   rš   s     rB   Úhas_app_datazDXFEntity.has_app_dataô  s   € à�<Š<Ø˜DŸL™LÐ(Ð(àrD   c                ó’   — | j                   r't        | j                   j                  |«      dd «      S t        j                  |«      ‚)zÏReturns application defined data for `appid`.

        Args:
            appid: application name as defined in the APPID table.

        Raises:
            DXFValueError: no data for `appid` found

        r   éÿÿÿÿ)r;   r   r¯   r   rc   r  s     rB   Úget_app_datazDXFEntity.get_app_dataû  s=   € ð �<Š<Ü˜Ÿ™×(Ñ(¨Ó/°°"Ð5Ó6Ð6ä×%Ñ% eÓ,Ð,rD   c                ór   — | j                   €t        «       | _         | j                   j                  ||«       y)zôSet application defined data for `appid` as iterable of tags.

        Args:
             appid: application name as defined in the APPID table.
             tags: iterable of (code, value) tuples or :class:`~ezdxf.lldxf.types.DXFTag`

        N)r;   r   Úadd©rA   rš   r^   s      rB   r—   zDXFEntity.set_app_data
  s+   € ð �<‰<ÐÜ"›9ˆDŒLØ�‰×Ñ˜ Õ%rD   c                óT   — | j                   r| j                   j                  |«       yy)zxDiscard application defined data for `appid`. Does not raise an
        exception if no data for `appid` exist.
        N)r;   rµ   r  s     rB   Údiscard_app_datazDXFEntity.discard_app_data  s"   € ð �<Š<Ø�L‰L× Ñ  Õ'ð rD   c                ó8   — | j                   r|| j                   v S y)z4Returns ``True`` if extended data for `appid` exist.F)r>   r  s     rB   Ú	has_xdatazDXFEntity.has_xdata  s   € à�:Š:Ø˜DŸJ™JÐ&Ð&àrD   c                ó’   — | j                   r't        | j                   j                  |«      dd «      S t        j                  |«      ‚)zÍReturns extended data for `appid`.

        Args:
            appid: application name as defined in the APPID table.

        Raises:
            DXFValueError: no extended data for `appid` found

        r   N)r>   r   r¯   r   rc   r  s     rB   Ú	get_xdatazDXFEntity.get_xdata$  s;   € ð �:Š:Ü˜Ÿ
™
Ÿ™ uÓ-¨a¨bÐ1Ó2Ð2ä×%Ñ% eÓ,Ð,rD   c                ór   — | j                   €t        «       | _         | j                   j                  ||«       y)zéSet extended data for `appid` as iterable of tags.

        Args:
             appid: application name as defined in the APPID table.
             tags: iterable of (code, value) tuples or :class:`~ezdxf.lldxf.types.DXFTag`

        N)r>   r   r  r  s      rB   Ú	set_xdatazDXFEntity.set_xdata3  s)   € ð �:‰:ÐÜ›ˆDŒJØ�
‰
�‰�u˜dÕ#rD   c                óT   — | j                   r| j                   j                  |«       yy)zvDiscard extended data for `appid`. Does not raise an exception if
        no extended data for `appid` exist.
        N)r>   rµ   r  s     rB   Údiscard_xdatazDXFEntity.discard_xdata?  s"   € ð �:Š:Ø�J‰J×Ñ˜uÕ%ð rD   c                ó^   — | j                  |«      r| j                  j                  ||«      S y)zWReturns ``True`` if a tag list `name` for extended data `appid`
        exist.
        F)r  r>   Ú	has_xlist©rA   rš   rÑ   s      rB   Úhas_xdata_listzDXFEntity.has_xdata_listF  s*   € ð �>‰>˜%Ô Ø—:‘:×'Ñ'¨¨tÓ4Ð4àrD   c                óŽ   — | j                   r%t        | j                   j                  ||«      «      S t        j                  |«      ‚)a(  Returns tag list `name` for extended data `appid`.

        Args:
            appid: application name as defined in the APPID table.
            name: extended data list name

        Raises:
            DXFValueError: no extended data for `appid` found or no data list `name` not found

        )r>   r   Ú	get_xlistr   rc   r  s      rB   Úget_xdata_listzDXFEntity.get_xdata_listO  s8   € ð �:Š:Ü˜Ÿ
™
×,Ñ,¨U°DÓ9Ó:Ð:ä×%Ñ% eÓ,Ð,rD   c                ót   — | j                   €t        «       | _         | j                   j                  |||«       y)a$  Set tag list `name` for extended data `appid` as iterable of tags.

        Args:
             appid: application name as defined in the APPID table.
             name: extended data list name
             tags: iterable of (code, value) tuples or :class:`~ezdxf.lldxf.types.DXFTag`

        N)r>   r   Ú	set_xlist©rA   rš   rÑ   r^   s       rB   Úset_xdata_listzDXFEntity.set_xdata_list_  s-   € ð �:‰:ÐÜ›ˆDŒJØ�
‰
×Ñ˜U D¨$Õ/rD   c                óV   — | j                   r| j                   j                  ||«       yy)z¤Discard tag list `name` for extended data `appid`. Does not raise
        an exception if no extended data for `appid` or no tag list `name`
        exist.
        N)r>   Údiscard_xlistr  s      rB   Údiscard_xdata_listzDXFEntity.discard_xdata_listl  s$   € ð
 �:Š:Ø�J‰J×$Ñ$ U¨DÕ1ð rD   c                óZ   — | j                   €J ‚| j                   j                  |||«       y)a  
        Replaces tag list `name` for existing extended data `appid` by `tags`.
        Appends new list if tag list `name` do not exist, but raises
        :class:`DXFValueError` if extended data `appid` do not exist.

        Args:
             appid: application name as defined in the APPID table.
             name: extended data list name
             tags: iterable of (code, value) tuples or :class:`~ezdxf.lldxf.types.DXFTag`

        Raises:
            DXFValueError: no extended data for `appid` found

        N)r>   Úreplace_xlistr"  s       rB   Úreplace_xdata_listzDXFEntity.replace_xdata_listt  s*   € ð �z‰zÐ%Ð%Ð%Ø�
‰
× Ñ  ¨¨dÕ3rD   c                ó,   — t        | j                  «      S )z(Returns ``True`` if entity has reactors.)rÔ   r<   r@   s    rB   Úhas_reactorszDXFEntity.has_reactors†  s   € ä�D—M‘MÓ"Ð"rD   c                óR   — | j                   r| j                   j                  «       S g S )z/Returns associated reactors as list of handles.)r<   r¯   r@   s    rB   Úget_reactorszDXFEntity.get_reactorsŠ  s    € à&*§m¢mˆt�}‰}× Ñ Ó"Ð;¸Ð;rD   c                óp   — | j                   €t        «       | _         | j                   j                  |«       y)z Set reactors as list of handles.N)r<   r   rŽ   )rA   Úhandless     rB   Úset_reactorszDXFEntity.set_reactorsŽ  s'   € à�=‰=Ð Ü$›JˆDŒMØ�‰×Ñ˜'Õ"rD   c                óp   — | j                   €t        «       | _         | j                   j                  |«       y)zAppend `handle` to reactors.N)r<   r   r  r�   s     rB   Úappend_reactor_handlezDXFEntity.append_reactor_handle”  s'   € à�=‰=Ð Ü$›JˆDŒMØ�‰×Ñ˜&Õ!rD   c                óT   — | j                   r| j                   j                  |«       yy)zhDiscard `handle` from reactors. Does not raise an exception if
        `handle` does not exist.
        N)r<   rµ   r�   s     rB   Údiscard_reactor_handlez DXFEntity.discard_reactor_handleš  s"   € ð �=Š=Ø�M‰M×!Ñ! &Õ)ð rD   c                óH  — | j                   r:| j                   j                  j                  «       D ]  }|j                  |«       Œ | j                  rP| j                  j                  «       D ]2  }|j                  «       D ]  }|j                  |j                  «       Œ Œ4 yy)z5Register required resources to the resource registry.N)	r>   r˜   ÚkeysÚ	add_appidr;   r^   Úget_hard_owner_handlesÚ
add_handler’   )rA   ÚregistryrÑ   r^   Útags        rB   Úregister_resourceszDXFEntity.register_resources¡  sz   € à�:Š:ØŸ
™
Ÿ™×,Ñ,Ö.�Ø×"Ñ" 4Õ(ð /à�<Š<ØŸ™×)Ñ)Ö+�Ø×6Ñ6Ö8�CØ×'Ñ'¨¯	©	Õ2ñ 9ñ ,ð rD   c                ó¼  ‡‡— ˆˆfd„}|j                   r0|j                   j                  j                  «       D ]	  Š |«        Œ |j                  rF|j                  j	                  «       D ])  Š‰j                  ‰|j                  j                  ¬«       Œ+ |j                  rH| j                  €J ‚| j                  j                  j                  |j                  j                  ‰«       | j                  r\| j                  j                  D �cg c]  }‰j                  |«      ‘Œ }}|D �cg c]
  }|dk7  sŒ	|‘Œ }}|r|j                  |«       yyyc c}w c c}w )z3Translate resources from self to the copied entity.c                 óÂ   •— t        ‰«      D ]P  \  } \  }}|dk(  rt        |‰j                  |«      «      ‰| <   Œ-|dk(  sŒ3t        |‰j                  |«      «      ‰| <   ŒR y )Nií  ië  )Ú	enumerater   Ú
get_handleÚ	get_layer)Úindexr™   r’   Úmappingr^   s      €€rB   Úmap_xdata_resourcesz4DXFEntity.map_resources.<locals>.map_xdata_resources®  s^   ø€ Ü(1°$®Ñ$�‘}˜˜eØ˜4’<Ü"(¨¨w×/AÑ/AÀ%Ó/HÓ"I�D˜’KØ˜T“\Ü"(¨¨w×/@Ñ/@ÀÓ/GÓ"H�D˜’Kñ	 )8rD   )Únew_owner_handleNrì   )r>   r˜   Úvaluesr;   r^   Úmap_pointersr:   r/   r=   rú   Úmap_resourcesr<   r@  r0  )rA   ÚclonerC  rD  ÚhÚmapped_handlesr^   s     `   @rB   rH  zDXFEntity.map_resources«  s)  ù€ õ	Ið �;Š;ØŸ™×(Ñ(×/Ñ/Ö1�Ù#Õ%ð 2ð �=Š=ØŸ™×*Ñ*Ö,�Ø×$Ñ$ T¸E¿I¹I×<LÑ<LÐ$ÕMð -ð ×ÒØ×&Ñ&Ð2Ð2Ð2Ø×Ñ×*Ñ*×8Ñ8Ø×$Ñ$×/Ñ/°ôð �=Š=à=A¿]¹]×=SÒ=SÓTÑ=S¸˜g×0Ñ0°Õ3Ð=SˆNÐTÙ)7ÓD© A¸1À»8ša¨ˆNÐDÙØ×"Ñ" >Õ2ð ð	 ùâTùÚDs   ÄEÄ-
EÄ8E©ÚreturnÚNone)rM  z	uuid.UUID)NNNN)
rQ   úType[T]r/   úOptional[str]r0   rP  r9   úOptional[Drawing]rM  r1   ©N)rQ   rO  r^   r   r9   rQ  rM  r1   )r^   r   r[   rP  rM  rN  )ri   zOptional[SubclassProcessor]rM  r   )r9   r!   rM  zOptional[Callable])rQ   rO  rp   rÅ   r9   rQ  rM  r1   )rQ   rO  rs   r'   rM  r1   ©rM  r   )r8   r   rM  rN  )r€   úOptional[DXFEntity]©rM  rÔ   )rM  rT  )rR   rM   rM  rN  )r;   z
list[Tags]rM  rN  )r/   rÅ   rM  rN  )rM  zOptional[Insert])r¨   r#   rM  rN  )r‘   rÅ   r°   r   rM  r   )r‘   rÅ   r’   r   rM  rN  )r‘   rÅ   rM  rN  )r‘   rÅ   rM  rÔ   )rM  rÅ   )rÊ   zOptional[set[str]]rM  rM   )TrÒ   )rÐ   ÚintrÏ   rÔ   rÑ   rÅ   rM  rN  )rÒ   )rÐ   rV  rÑ   rÅ   rM  rÔ   )rs   rQ  )rÝ   rV  r˜   r   rM  rN  )rá   r$   rM  rÔ   ©rá   r$   rM  rN  )r÷   r    rM  rN  )rM  r   )rš   rÅ   rM  rÔ   )rš   rÅ   rM  r   )rš   rÅ   r^   r   rM  rN  )rš   rÅ   )rš   rÅ   rM  rN  )rš   rÅ   rÑ   rÅ   rM  rÔ   )rš   rÅ   rÑ   rÅ   rM  r   )rš   rÅ   rÑ   rÅ   r^   r   rM  rN  )rš   rÅ   rÑ   rÅ   rM  rN  )rM  z	list[str])r/  zIterable[str]rM  rN  )r:  zxref.RegistryrM  rN  )rI  r   rC  zxref.ResourceMapperrM  rN  )[Ú__name__Ú
__module__Ú__qualname__Ú__doc__r¾   r   r)   r»   r6   Ú__annotations__r   ÚDXF12rä   rC   ÚpropertyrH   ÚclassmethodrT   rP   rX   r_   r\   rh   rm   ro   rt   r   rv   rz   r�   r…   rˆ   r‡   rŒ   rO   rb   rž   r}   r‹   r¢   r¥   r©   r«   r­   r±   r³   r·   r¹   Údxf_attrib_existsr¼   r¿   rÂ   rÇ   rR   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-  r0  r2  r4  r<  rH  rV   rD   rB   r'   r'   W   s  … Ù2à€GÙ˜zÓ*€Jð ')€O�^Ó(Ø!&§¡Ðó3ð( òó ðð ð !%Ø#ØØ!%ð$Øð$àð$ð ð$ð
 ð$ð 
ò$ó ð$òLòð  óó ðô:8ð2 8<ð-Ø4ð-à	ó-óð0 ó;ó ð;ð òó ðð  ".ô (ð 5Aô ó<ó8ð ò/ó ð/ð òó ðð ò	ó ð	óó	/ó5ð ò$ó ð$ð ò;ó ð;ð òó ðð òCó ðCð òó ðóFó@ô*ó!óó%ð 'Ðóó óAó5ô	ð :AðEØðEØ $ðEØ36ðEà	óEô2ô.ó0*ò*ô óó%ó4Dó*ó-ó
-ð òó ðóHóó#ó*óó-ó
&ó(óó-ó
$ó&óó-ó 0ó2ó4ó$#ó<ó#ó"ó*ó3ô3rD   c                  ó²   ‡ — e Zd ZdZdˆ fd„Zefdd„Zdd„Zed„ «       Z	edd„«       Z
dd„Zeddd„«       Zdd	„Zdd
„Zdd„Zdd„Zdˆ fd„Zdd„Zdd„Zˆ xZS )r(   z5Just store all the tags as they are. (internal class)c                óN   •— t         ‰| �  «        t        «       | _        d| _        y)zDefault constructorN)ÚsuperrC   r   ÚxtagsÚembedded_objects©rA   rÆ   s    €rB   rC   zDXFTagStorage.__init__Ï  s   ø€ ä‰ÑÔÜ!“^ˆŒ
Ø6:ˆÕrD   c                ó<   — t        d| j                  «       › d�«      ‚)NzCopying of tag storage z not supported.)r   r¿   rw   s     rB   rv   zDXFTagStorage.copyÕ  s"   € ÜØ% d§l¡l£nÐ%5°_ÐEó
ð 	
rD   c                ó   — t        d«      ‚)Nz cannot transform DXF tag storage)ÚNotImplementedError)rA   Úms     rB   Ú	transformzDXFTagStorage.transformÚ  s   € Ü!Ð"DÓEÐErD   c                ó4   — | j                   j                  d   S )Nr   )rd  Ú
subclassesr@   s    rB   r)   zDXFTagStorage.base_classÝ  s   € à�z‰z×$Ñ$ QÑ'Ð'rD   c                ó8   — | j                   j                  d«      S )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.
        Ú
AcDbEntity)rd  Úhas_subclassr@   s    rB   Úis_graphic_entityzDXFTagStorage.is_graphic_entityá  s   € ð �z‰z×&Ñ& |Ó4Ð4rD   c                óö   — ddl m} t        «       }	 | j                  j	                  d«      }|D ],  \  }}|j                  |«      }t        |t        «      sŒ(|||<   Œ. |S # t
        j                  $ r |cY S w xY w)a:  Returns the graphical properties like layer, color, linetype, ... as
        `dxfattribs` dict if the :class:`TagStorage` object represents a graphical
        entity otherwise returns an empty dictionary.

        These are all the DXF attributes which are stored in the ``AcDbEntity``
        subclass.

        r   )Úacdb_entity_group_codesro  )
Úezdxf.entities.dxfgfxrs  rM   rd  Úget_subclassr   ÚDXFKeyErrorr¯   r|   rÅ   )rA   rs  rS   r^   r™   r’   Úattrib_names          rB   Úgraphic_propertiesz DXFTagStorage.graphic_propertiesê  s   € õ 	Bä"&£&ˆð	Ø—:‘:×*Ñ*¨<Ó8ˆDó  ‰KˆD�%Ø1×5Ñ5°dÓ;ˆKÜ˜+¤sÕ+Ø',�˜Ò$ð  ð ˆøô × Ñ ò 	ØŠNð	ús   ’A  Á A8Á7A8c                ó  — t        |t        «      sJ ‚| j                  |¬«      }|r|j                  nd }|j	                  ||¬«       |j                  |«       |j                  |«       t        j                  r|j                  «        |S )N)r9   rZ   )
r|   r   rT   r[   r\   Ú
store_tagsÚstore_embedded_objectsr   Úload_proxy_graphicsÚload_proxy_graphicr]   s        rB   r_   zDXFTagStorage.load  sx   € ä˜$¤Ô-Ð-Ð-Ø—‘˜S�Ó!ˆÙ'*�S—^’^°ˆ
Ø×Ñ˜¨*ÐÔ5Ø×Ñ˜$ÔØ×%Ñ% dÔ+Ü×&Ò&Ø×%Ñ%Ô'ØˆrD   c                ó  — 	 | j                   j                  d«      }|j	                  d«      D �cg c]  }|j
                  ‘Œ }}t        |«      rdj                  |«      | _        y y # t        j                  $ r Y y w xY wc c}w )Nro  i6  rD   )	rd  ru  r   rv  Úfind_allr’   ra   Újoinr?   )rA   r^   r;  Úbinary_datas       rB   r}  z DXFTagStorage.load_proxy_graphic  sz   € ð	Ø—:‘:×*Ñ*¨<Ó8ˆDð -1¯M©M¸#Ô,>Ó?Ñ,> S�s—y“yÐ,>ˆÐ?Üˆ{ÔØ!$§¡¨+Ó!6ˆDÕð øô × Ñ ò 	Ùð	üâ?s   ‚A( °BÁ(A>Á=A>c                ó(  — || _         | j                  d   j                  | _        	 |j	                  d«      }|j                  dd«      | j                  j                  d<   y # t        j                  $ r d| j                  j                  d<   Y y w xY w)Nr   ro  éC   Ú
paperspace)
rd  r)   r’   r¾   ru  Úget_first_valuer:   Ú__dict__r   rv  )rA   r^   Úacdb_entitys      rB   rz  zDXFTagStorage.store_tags  s€   € ð ˆŒ
Ø—‘ qÑ)×/Ñ/ˆŒð	0Ø×+Ñ+¨LÓ9ˆKØ.9×.IÑ.IÈ"ÈaÓ.PˆD�H‰H×Ñ˜lÒ+øÜ× Ñ ò 	0à./ˆD�H‰H×Ñ˜lÓ+ð	0ús   §:A" Á",BÂBc                ó&   — |j                   | _         y rR  )re  )rA   r^   s     rB   r{  z$DXFTagStorage.store_embedded_objects"  s   € Ø $× 5Ñ 5ˆÕrD   c                óÀ   — | j                   j                  dd D ]  }|j                  |«       Œ | j                  r#| j                  D ]  }|j                  |«       Œ yy)z Write subclass tags as they are.r   N)rd  rm  Ú
write_tagsre  )rA   rá   Úsubclassr^   s       rB   ræ   zDXFTagStorage.export_entity%  sY   € àŸ
™
×-Ñ-¨a¨bÓ1ˆHØ× Ñ  Õ*ð 2ð × Ò Ø×-Ô-�Ø×$Ñ$ TÕ*ñ .ð !rD   c                ó@   •— | j                   sy | `t        ‰| �  «        y rR  )r}   rd  rc  rÙ   rf  s    €rB   rÙ   zDXFTagStorage.destroy.  s   ø€ Ø�}Š}ØàˆJÜ‰‰ÕrD   c              #  ó¼   K  — ddl m} | j                  rF || j                  | j                  «      j	                  «       D ]  }|j                  | «       |–— Œ yy­w)z0Implements the SupportsVirtualEntities protocol.r   )ÚProxyGraphicN)Úezdxf.proxygraphicrŽ  r?   r9   Úvirtual_entitiesr�   )rA   rŽ  Úes      rB   Ú__virtual_entities__z"DXFTagStorage.__virtual_entities__5  sO   è ø€ å3à×ÒÙ! $×"4Ñ"4°d·h±hÓ?×PÑPÖR�Ø×$Ñ$ TÔ*Ø“ñ Sð ùs   ‚AAc                ó"   — | j                  «       S )z+Yields proxy graphic as "virtual" entities.)r’  r@   s    rB   r�  zDXFTagStorage.virtual_entities>  s   € à×(Ñ(Ó*Ð*rD   rL  rS  )rj  r%   rM  r   rU  )rM  r5   rR  )r^   r   r9   rQ  rM  r(   )r^   r   rM  rN  rW  )rM  zIterator[DXFGraphic])rX  rY  rZ  r[  rC   r   rv   rk  r^  r)   rq  rx  r_  r_   r}  rz  r{  ræ   rÙ   r’  r�  Ú__classcell__)rÆ   s   @rB   r(   r(   Ë  s   ø„ á?õ;ð ".ô 
ó
Fð ñ(ó ð(ð ò5ó ð5óð. ó	ó ð	ó7ó
0ó6ó+õó÷+rD   r(   )Gr[  Ú
__future__r   Útypingr   r   r   r   r   r	   r
   r   Útyping_extensionsr   ÚloggingrH   r*   r   Úezdxf.lldxfr   Úezdxf.lldxf.tagsr   Úezdxf.lldxf.typesr   Úezdxf.lldxf.extendedtagsr   Úezdxf.lldxf.attributesr   r   r   Úezdxf.toolsr   Ú r   r;   r   r   Údxfnsr   r   r>   r   rü   r   rv   r   r   Úezdxf.auditr    Úezdxf.documentr!   Úezdxf.entitiesr"   r#   Úezdxf.lldxf.tagwriterr$   Ú
ezdxf.mathr%   r&   Ú__all__Ú	getLoggerre   r~   rG   r¤   r)   r\  r1   r'   Úset_default_classr(   rV   rD   rB   Ú<module>r©     s  ðòõ #÷	÷ 	ó 	õ #ã Û Ý Ý Ý !Ý $Ý 1ß FÑ FÝ &Ý ß &ß 2Ý Ý  ß 0áÝ#Ý&ß1Ý.Ý7Ý#Ýò L€Ø	ˆ×	Ñ	˜7Ó	#€ð  1Ð àÐ ð (AÐ $á%Øá˜!“*ñ
 ˜“ñó€
ˆKó ñ  ˆC�{Ô#€÷q3ñ q3ðh 	×Ñôt+�Ió t+ó ñt+rD   