
    h
                    `    S SK Jr  S SKJr  S SKJr  S SKJr  S/rSr	Sr
 " S S5      rSS	 jrg
)    )annotations)XRecord)Tags)DXFTagRoundtripXRecordf   c                  N    \ rS rSrSrS
SS jjrSS jrSS jrSS jrSS jr	S	r
g)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                *    Uc
  [        5       nXl        g N)r   xrecord)selfr   s     T/var/www/html/env/lib/python3.13/site-packages/ezdxf/entities/acad_xrec_roundtrip.py__init__RoundtripXRecord.__init__.   s    ?iG    c                h    U R                   R                   H  u  p#U[        :X  d  M  X1:X  d  M    g   g)z4Returns True if an entry section for key is present.TF)r   tagsSECTION_MARKER_CODE)r   keycodevalues       r   has_sectionRoundtripXRecord.has_section3   s-    <<,,KD**u| - r   c                    U R                   R                  n[        X15      u  pEU[        :X  a1  UR	                  [        [        U5      5        UR                  U5        gX#US-   U& g)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_sectionRoundtripXRecord.set_section:   sW    ||((!,4
I':C @A%,0S)r   c                ~    U R                   R                  n[        X!5      u  p4U[        :w  a  X#S-   U $ [	        5       $ )z%Returns the content of section `key`.r   )r   r   r   r   r   r   r   r"   r#   r$   s        r   get_sectionRoundtripXRecord.get_sectionD   s;    ||((!,4
I	C00vr   c                h    U R                   R                  n[        X!5      u  p4U[        :w  a  X#U2	 gg)z;Removes section `key`, section `key` doesn't have to exist.N)r   r   r   r   r(   s        r   discardRoundtripXRecord.discardL   s4    ||((!,4
I3Y' r   )r   r   )r   zXRecord | NonereturnNone)r   strr.   bool)r   r0   r   r   r.   r/   )r   r0   r.   r   )r   r0   r.   r/   )__name__
__module____qualname____firstlineno____doc__r   r   r%   r)   r,   __static_attributes__ r   r   r   r      s     >
1(r   c                    [         n[        U 5       H:  u  p4UR                  S:w  a  M  UR                  U:X  a  UnM+  U[         :w  d  M7  X#4s  $    U[         :w  a  U[	        U 5      4$ [         [         4$ )zdReturns 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   sl    
 Eo
88s?99Ei< & 	c$iir   N)r   r   r   r0   r.   ztuple[int, int])
__future__r   ezdxf.entitiesr   ezdxf.lldxf.tagsr   ezdxf.lldxf.typesr   __all__r   r   r   r   r8   r   r   <module>rC      s8    # " ! $
 	C( C(L r   