Ë
    £èh"  ã                  ó^   — d dl mZ d dlmZ d dlmZ d dlmZ dgZdZ	dZ
 G d„ d«      Zdd	„Zy
)é    )Úannotations)ÚXRecord)ÚTags)ÚDXFTagÚRoundtripXRecordéf   éÿÿÿÿc                  ó:   — e Zd ZdZdd	d„Zd
d„Zdd„Zdd„Zdd„Zy)r   aé  Helper class for ACAD Roundtrip Data.

    The data is stored in an XRECORD, in sections separated by tags
    (102, "ACAD_SECTION_NAME").

    Example for inverted clipping path of SPATIAL_FILTER objects:

    ...
    100
    AcDbXrecord
    280
    1
    102
    ACAD_INVERTEDCLIP_ROUNDTRIP
    10
    399.725563048036
    20
    233.417786599994
    30
    0.0
    ...
    102
    ACAD_INVERTEDCLIP_ROUNDTRIP_COMPARE
    10
    399.725563048036
    20
    233.417786599994
    ...

    Nc                ó*   — |€
t        «       }|| _        y ©N)r   Úxrecord)Úselfr   s     úBlib/python3.12/site-packages/ezdxf/entities/acad_xrec_roundtrip.pyÚ__init__zRoundtripXRecord.__init__.   s   € Øˆ?Ü“iˆGØˆ�ó    c                ób   — | j                   j                  D ]  \  }}|t        k(  sŒ||k(  sŒ y y)z4Returns True if an entry section for key is present.TF)r   ÚtagsÚSECTION_MARKER_CODE)r   ÚkeyÚcodeÚvalues       r   Úhas_sectionzRoundtripXRecord.has_section3   s1   € àŸ<™<×,Ô,‰KˆD�%ØÔ*Ó*¨u¸«|Ùð -ð r   c                óÒ   — | j                   j                  }t        ||«      \  }}|t        k(  r1|j	                  t        t        |«      «       |j                  |«       y|||dz   | y)zTSet content of section `key` to `tags`. Replaces the content of an existing section.é   N)r   r   Úfind_sectionÚ	NOT_FOUNDÚappendr   r   Úextend)r   r   r   Úxrecord_tagsÚstartÚends         r   Úset_sectionzRoundtripXRecord.set_section:   s]   € à—|‘|×(Ñ(ˆÜ! ,°Ó4‰
ˆˆsØ”IÒØ×Ñ¤Ô':¸CÓ @ÔAØ×Ñ Õ%à,0ˆL˜ ™ SÑ)r   c                ó‚   — | j                   j                  }t        ||«      \  }}|t        k7  r||dz   | S t	        «       S )z%Returns the content of section `key`.r   )r   r   r   r   r   ©r   r   r   r    r!   s        r   Úget_sectionzRoundtripXRecord.get_sectionD   sA   € à—|‘|×(Ñ(ˆÜ! ,°Ó4‰
ˆˆsØ”IÒØ ¨¡	¨CÐ0Ð0Ü‹vˆr   c                ól   — | j                   j                  }t        ||«      \  }}|t        k7  r|||…= yy)z;Removes section `key`, section `key` doesn't have to exist.N)r   r   r   r   r$   s        r   ÚdiscardzRoundtripXRecord.discardL   s:   € à—|‘|×(Ñ(ˆÜ! ,°Ó4‰
ˆˆsØ”IÒØ˜U 3˜YÑ'ð r   r   )r   zXRecord | NoneÚreturnÚNone)r   Ústrr(   Úbool)r   r*   r   r   r(   r)   )r   r*   r(   r   )r   r*   r(   r)   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r"   r%   r'   © r   r   r   r      s    „ ñô>ó
ó1óô(r   c                óÚ   — t         }t        | «      D ]6  \  }}|j                  dk7  rŒ|j                  |k(  r|}Œ(|t         k7  sŒ2||fc S  |t         k7  r|t	        | «      fS t         t         fS )zlReturns the start- and end index of section `key`.

    Returns (-1, -1) if the section does not exist.
    r   )r   Ú	enumerater   r   Úlen)r   r   r    ÚindexÚtags        r   r   r   T   sp   € ô
 €EÜ –o‰
ˆˆsØ�8‰8�sŠ?ØØ�9‰9˜ÒØ‰EØ”iÓØ˜%�<Òð &ð ”	ÒØ”c˜$“iÐÐÜ”iÐÐr   N)r   r   r   r*   r(   ztuple[int, int])Ú
__future__r   Úezdxf.entitiesr   Úezdxf.lldxf.tagsr   Úezdxf.lldxf.typesr   Ú__all__r   r   r   r   r0   r   r   Ú<module>r;      s8   ðõ #å "Ý !Ý $àÐ
€àÐ Ø€	÷C(ñ C(ôL r   