Ë
    £èhó  ã                   ój   — 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mZmZ  G d„ de	«      Zy	)
é    )ÚIterableÚOptional)ÚVec3ÚUVec)Úconsté   )Ú
BaseLayout)Ú
DXFGraphicÚAttDefÚBlockÚEndBlkc                   óÖ  — e Zd ZdZdefd„Zedee   fd„«       Z	edee
   fd„«       Zedefd„«       Zej                  dd„«       Zed	„ «       Zedefd
„«       Zej                  defd„«       Zedefd„«       Zej                  defd„«       Zedefd„«       Zej                  deddfd„«       Zdee   fd„Zdedefd„Zdedee   fd„Zddededefd„Zdee   fd„Zdefd„Zd„ Zy)ÚBlockLayoutzŽBlockLayout has the same factory-functions as Layout, but is managed
    in the :class:`BlocksSection` class. It represents a DXF Block.

    Úreturnc                 ó\   — t        |t        «      r| j                  |   }|| j                  v S )z�Returns ``True`` if block contains `entity`.

        Args:
             entity: :class:`DXFGraphic` object or handle as hex string

        )Ú
isinstanceÚstrÚentitydbÚentity_space)ÚselfÚentitys     ú9lib/python3.12/site-packages/ezdxf/layouts/blocklayout.pyÚ__contains__zBlockLayout.__contains__   s-   € ô �fœcÔ"Ø—]‘] 6Ñ*ˆFØ˜×*Ñ*Ð*Ð*ó    c                 ó.   — | j                   j                  S )z5the associated :class:`~ezdxf.entities.Block` entity.)Úblock_recordÚblock©r   s    r   r   zBlockLayout.block   s   € ð × Ñ ×&Ñ&Ð&r   c                 ó.   — | j                   j                  S )z6the associated :class:`~ezdxf.entities.EndBlk` entity.)r   Úendblkr   s    r   r    zBlockLayout.endblk    s   € ð × Ñ ×'Ñ'Ð'r   c                 óB   — | j                   j                  j                  S )zGet/set the BLOCK name)r   ÚdxfÚnamer   s    r   r#   zBlockLayout.name%   s   € ð × Ñ ×$Ñ$×)Ñ)Ð)r   Nc                 ó:   — | j                   j                  |«       y ©N)r   Úrename)r   Únew_names     r   r#   zBlockLayout.name*   s   € à×Ñ× Ñ  Õ*r   c                 ó.   — | j                   j                  S )z_DXF name space of associated :class:`~ezdxf.entities.BlockRecord`
        table entry.
        )r   r"   r   s    r   r"   zBlockLayout.dxf.   s   € ð
 × Ñ ×$Ñ$Ð$r   c                 óT   — t        | j                  j                  j                  «      S )z\Set property to ``True`` to allow exploding block references of
        this block.
        )Úboolr   r"   Úexploder   s    r   Úcan_explodezBlockLayout.can_explode5   s!   € ô
 �D×%Ñ%×)Ñ)×1Ñ1Ó2Ð2r   Úvaluec                 óL   — t        |«      | j                  j                  _        y r%   )Úintr   r"   r+   ©r   r-   s     r   r,   zBlockLayout.can_explode<   s   € ä(+¨E«
ˆ×Ñ×ÑÕ%r   c                 óT   — t        | j                  j                  j                  «      S )zgSet property to ``True`` to allow block references of this block
        only scale uniformly.
        )r*   r   r"   Úscaler   s    r   Úscale_uniformlyzBlockLayout.scale_uniformly@   s!   € ô
 �D×%Ñ%×)Ñ)×/Ñ/Ó0Ð0r   c                 óL   — t        |«      | j                  j                  _        y r%   )r/   r   r"   r2   r0   s     r   r3   zBlockLayout.scale_uniformlyG   s   € ä&)¨%£jˆ×Ñ×ÑÕ#r   c                 óT   — t        | j                  j                  j                  «      S )z$Get/Set the base point of the block.©r   r   r"   Ú
base_pointr   s    r   r7   zBlockLayout.base_pointK   s   € ô �D—J‘J—N‘N×-Ñ-Ó.Ð.r   c                 óL   — t        |«      | j                  j                  _        y r%   r6   r0   s     r   r7   zBlockLayout.base_pointP   s   € ä$(¨£Kˆ�
‰
�‰Õ!r   c                 ó   — d„ | D «       S )zYReturns iterable of all :class:`~ezdxf.entities.attrib.Attdef`
        entities.
        c              3   óB   K  — | ]  }t        |t        «      sŒ|–— Œ y ­wr%   )r   r   )Ú.0Úes     r   Ú	<genexpr>z&BlockLayout.attdefs.<locals>.<genexpr>X   s   è ø€ Ð9™4�a¤:¨a´Õ#8”™4ùs   ‚˜© r   s    r   ÚattdefszBlockLayout.attdefsT   s   € ñ :™4Ó9Ð9r   Útagc                 ó(   — | j                  |«      duS )z_Returns ``True`` if an :class:`~ezdxf.entities.attrib.Attdef` for
        `tag` exist.
        N)Ú
get_attdef)r   r@   s     r   Ú
has_attdefzBlockLayout.has_attdefZ   s   € ð �‰˜sÓ#¨4Ð/Ð/r   c                 óh   — | j                  «       D ]  }||j                  j                  k(  sŒ|c S  y)z^Returns attached :class:`~ezdxf.entities.attrib.Attdef` entity by
        `tag` name.
        N)r?   r"   r@   )r   r@   Úattdefs      r   rB   zBlockLayout.get_attdef`   s.   € ð —l‘l–nˆFØ�f—j‘j—n‘nÓ$Ø’ð %ð r   Údefaultc                 óX   — | j                  |«      }|€|S |j                  j                  S )a  Returns text content for :class:`~ezdxf.entities.attrib.Attdef`
        `tag` as string or returns `default` if no :class:`Attdef` for `tag`
        exist.

        Args:
            tag: name of tag
            default: default value if `tag` not exist

        )rB   r"   Útext)r   r@   rF   rE   s       r   Úget_attdef_textzBlockLayout.get_attdef_texti   s*   € ð —‘ Ó%ˆØˆ>ØˆNØ�z‰z�‰Ðr   c                 ó0   — d„ | j                  «       D «       S )zAReturns iterable for all constant ATTDEF entities. (internal API)c              3   ó:   K  — | ]  }|j                   sŒ|–— Œ y ­wr%   ©Úis_const©r;   rE   s     r   r=   z0BlockLayout.get_const_attdefs.<locals>.<genexpr>z   s   è ø€ ÐG¡^˜6°v·³”¡^ùs   ‚”)r?   r   s    r   Úget_const_attdefszBlockLayout.get_const_attdefsx   s   € áG T§\¡\¤^ÓGÐGr   c                 óB   — t        d„ | j                  «       D «       «      S )zWReturns ``True`` if the block has a non constant attribute
        definition.
        c              3   ó6   K  — | ]  }|j                    –— Œ y ­wr%   rL   rN   s     r   r=   z3BlockLayout.has_non_const_attdef.<locals>.<genexpr>€   s   è ø€ ÐD±^¨6�v—‘Ô&±^ùs   ‚)Úanyr?   r   s    r   Úhas_non_const_attdefz BlockLayout.has_non_const_attdef|   s   € ô ÑD°T·\±\´^ÓDÓDÐDr   c                 óx   — | j                  «       }| j                  j                  t        j                  |«       y r%   )rS   r   Úset_flag_stater   ÚBLK_NON_CONSTANT_ATTRIBUTES)r   Ústates     r   Úupdate_block_flagszBlockLayout.update_block_flags‚   s*   € Ø×)Ñ)Ó+ˆØ�
‰
×!Ñ!¤%×"CÑ"CÀUÕKr   )r   N)Ú )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r*   r   Úpropertyr   r   r   r   r    r   r#   Úsetterr"   r,   r3   r   r7   r   r   r   r?   rC   rB   rI   rO   rS   rX   r>   r   r   r   r   
   sÑ  „ ñð
	+ dó 	+ð ð'�x ‘ò 'ó ð'ð ð(˜ Ñ(ò (ó ð(ð ð*�cò *ó ð*ð 
‡[�[ò+ó ð+ð ñ%ó ð%ð ð3˜Tò 3ó ð3ð ×Ñð3 ò 3ó ð3ð ð1 ò 1ó ð1ð ×Ñð1 Tò 1ó ð1ð ð/˜Dò /ó ð/ð ×Ñð0 ð 0¨ò 0ó ð0ð:˜ &Ñ)ó :ð0˜cð 0 dó 0ð˜cð  h¨vÑ&6ó ñ 3ð °ð ¸có ðH 8¨FÑ#3ó HðE dó EóLr   r   N)Útypingr   r   Ú
ezdxf.mathr   r   Úezdxf.lldxfr   Úbaser	   Úezdxf.entitiesr
   r   r   r   r   r>   r   r   Ú<module>re      s)   ð÷ &ß !Ý Ý ß <Ó <ôzL�*õ zLr   