
    hd                    0   S SK Jr  S SKJrJrJrJrJrJrJ	r	J
r
Jr  S SKJr  S SKrS SKJrJr  S SKJrJr  S SKJr  S SKJrJrJrJrJrJrJrJrJ r J!r!J"r"J#r#  \(       a  S S	K$J%r%  S S
K&J'r'  S SK(J)r)  \RT                  " S5      r+\" SSS9r, " S S\\,   5      r- " S S\-\   5      r. " S S\-\   5      r/ " S S\-\   5      r0 " S S\-\   5      r1 " S S\-\   5      r2 " S S\-\   5      r3 " S S\-\!   5      r4 " S  S!\-\"   5      r5 " S" S#\-\    5      r6g)$    )annotations)	GenericIteratorListOptionalTYPE_CHECKINGTypeVarUnioncastSequence)OrderedDictN)Auditor
AuditError)const	validator)	TableHead)factory	DXFEntityLayerLinetype	TextstyleVPortViewAppIDUCSTableEntryBlockRecordDimStyleis_graphic_entity)Drawing)AbstractTagWriter)EntityDBezdxfTr   )boundc                  j   \ rS rSrSrS"S jrS#S jrS$S jrS%S&S jjr\	S 5       r
\	S'S	 j5       r\S(S
 j5       rS)S jr\rS*S jrS+S jrS%S,S jjrS,S jrS-S jrS(S jrS.S jrS/S jrS.S jrS0S jr\	S1S j5       rS2S jrS3S jrS3S jrS4S jrS4S jrS"S jr S5S jr!S6S jr"S6S jr#S6S  jr$S!r%g)7Table/   UNKNOWNc                N    S U l         [        5       U l        [        5       U l        g N)docr   entriesr   _headselfs    F/var/www/html/env/lib/python3.13/site-packages/ezdxf/sections/table.py__init__Table.__init__2   s    &*%0][
    c                   Xl         [        U5      n[        U[        5      (       a  X0l        O[
        R                  " S5      eU R                  nU Hl  nUR                  5       U:X  a!  U R                  [        [        U5      5        M8  [        R                  SUR                  5        SU R                   S35        Mn     g)z!Loading interface. (internal API)z+Critical structure error in TABLES section.z!Ignored invalid DXF entity type 'z' in z table.N)r+   next
isinstancer   r-   r   DXFStructureError
TABLE_TYPEdxftype_appendr   r#   loggerwarning)r/   r+   entities
table_headexpected_entry_dxftypetable_entrys         r0   load
Table.load7   s    (^
j),,#J))*WXX!%#K""$(>>T![1278K8K8M7N O??+74	 $r3   c                |    Xl         U R                  U R                  U5        U R                  R	                  5         g)zReset table. (internal API)N)r+   	_set_headr8   r,   clear)r/   r+   handles      r0   resetTable.resetI   s)    t/r3   Nc                T    [         R                  " USSU0U R                  S9U l        g )N0name)owner
dxfattribsr+   )r   newr+   r-   )r/   rK   rF   s      r0   rD   Table._set_headO   s#    ]]#64.dhh

r3   c                    U R                   $ )zReturns table head entry.)r-   r.   s    r0   head
Table.headT   s     zzr3   c                    U R                   $ r*   )r8   r.   s    r0   rK   
Table.nameY   s    r3   c                .    [         R                  " U 5      $ )zUnified table entry key.)r   make_table_key)rK   s    r0   key	Table.key]   s     ''--r3   c                >    U R                  U5      U R                  ;   $ )z/Returns ``True`` if a table entry `name` exist.)rW   r,   r/   rK   s     r0   	has_entryTable.has_entryb   s    xx~--r3   c                ,    [        U R                  5      $ )zCount of table entries.)lenr,   r.   s    r0   __len__Table.__len__h   s    4<<  r3   c              #  |   #    U R                   R                  5        H  nUR                  (       d  M  Uv   M     g7f)zIterable of all table entries.N)r,   valuesis_alive)r/   es     r0   __iter__Table.__iter__l   s*     $$&Azzz 's   -<	<c                    U R                  U5      (       a&  [        R                  " U R                   SU S35      eU=(       d    0 nXS'   U R                  R
                  R                  US'   U R                  U5      $ )zCreate a new table entry `name`.

Args:
    name: name of table entry
    dxfattribs: additional DXF attributes for table entry

z '' already exists!rK   rL   )r[   r   DXFTableEntryErrorr8   r-   dxfrF   	new_entryr/   rK   rM   s      r0   rN   	Table.newr   sw     >>$**??#2dV+<=   %2
!6"jjnn33
7~~j))r3   c                    U R                   R                  U R                  U5      5      nU(       a  U$ [        R                  " U5      e)zReturns table entry `name`.

Args:
    name: name of table entry, case-insensitive

Raises:
    DXFTableEntryError: table entry does not exist

)r,   getrW   r   ri   r/   rK   entrys      r0   ro   	Table.get   s9       $0L**400r3   c                    U R                   R                  R                  U5      nU(       a   UR                  5       U R                  :X  a  U$ g)zSReturns table entry by handle or ``None`` if entry does not exist.

(internal API)
N)r+   entitydbro   r9   r8   )r/   rF   rq   s      r0   get_entry_by_handleTable.get_entry_by_handle   s:    
 !!%%f-U]]_7Lr3   c                    U R                   R                  U R                  U5      5      nUb  UR                  R                  $ g)zReturns the handle of table entry by `name`, returns an empty string if no
entry for the given name exist.

Args:
    name: name of table entry, case-insensitive

(internal API)
 )r,   ro   rW   rj   rF   rp   s      r0   get_handle_of_entryTable.get_handle_of_entry   s9       $099###r3   c                    U R                  U5      nU R                  U5      nU R                  R                  U5        U R	                  U5        g)zRemoves table entry `name`.

Args:
    name: name of table entry, case-insensitive

Raises:
    DXFTableEntryError: table entry does not exist

N)rW   ro   rt   delete_entitydiscard)r/   rK   rW   rq   s       r0   removeTable.remove   s<     hhtn##E*Sr3   c                    U R                  U5      nU R                  nU(       a  UR                  U5      nOUR                  5       nX%R                  l        [        [        U5      nU R                  U5        U$ )a  Returns a new table entry `new_name` as copy of `name`,
replaces entry `new_name` if already exist.

Args:
    name: name of table entry, case-insensitive
    new_name: name of duplicated table entry

Raises:
    DXFTableEntryError: table entry does not exist

)	ro   rt   duplicate_entitycopyrj   rK   r   r#   r:   )r/   rK   new_namerq   rt   rk   s         r0   duplicate_entryTable.duplicate_entry   s_     == 11%8I

I%Q	"Ur3   c                <    U R                   U R                  U5      	 g)zuRemove table entry without destroying object.

Args:
    name: name of table entry, case-insensitive

(internal API)
N)r,   rW   rZ   s     r0   r}   Table.discard   s     LL$(r3   c                H    U R                  U5        U R                  U5        g)z9Replace table entry `name` by new `entry`. (internal API)N)r}   r:   rp   s      r0   replaceTable.replace   s    TUr3   c                .    U R                   R                  $ r*   )r+   rt   r.   s    r0   rt   Table.entitydb   s    xx   r3   c                    U R                   c   S5       e[        [        [        R                  " U R
                  XR                   5      5      nU R                  U5        U$ )Create and add new table-entry of type 'self.entry_dxftype'.

Does not check if an entry dxfattribs['name'] already exists!
Duplicate entries are possible for Viewports.
zvalid DXF document required)r+   r   r#   r   create_db_entryr8   r:   r/   rM   rq   s      r0   rk   Table.new_entry   sL     xx#B%BB#Q//XXVWUr3   c                    UR                  5       U R                  :X  d   eXR                  U R                  UR                  R
                  5      '   g)MAdd a table entry, replaces existing entries with same name.
(internal API).
N)r9   r8   r,   rW   rj   rK   r/   rq   s     r0   r:   Table._append   s9     }}$//11116TXXeiinn-.r3   c                V   UR                  5       U R                  :w  a4  [        R                  " SUR                  5        SU R                   35      eUR                  R
                  nU R                  U5      (       a:  [        R                  " U R                  R                  R
                   SU S35      eU R                  (       a   [        R                  " XR                  5        U R                  R                  R                  UR                  l        U R                  U5        g)zMAdd a table `entry`, created by other object than this table.
(internal API)
zInvalid table entry type z for table  z already exists!N)r9   r8   r   DXFTypeErrorrj   rK   r[   ri   r-   r+   r   bindrF   rL   r:   )r/   rq   rK   s      r0   	add_entryTable.add_entry   s     ==?doo-$$+EMMO+< =!__-/  yy~~>>$**::>>&&'q.>?  88LL)**..//		Ur3   c                   U R                  5         SU R                  R                  l        [	        U 5      U R                  R                  l        U R                  R                  U5        U R                  U5        UR                  SS5        g)z)Export DXF representation. (internal API)rJ   r   ENDTABN)	update_owner_handlesr-   rj   rL   r^   count
export_dxfexport_table_entries
write_tag2)r/   	tagwriters     r0   r   Table.export_dxf
  sd     	!!#"

"4y



i(!!),Q)r3   c                h    U R                   R                  5        H  nUR                  U5        M     g r*   )r,   rb   r   )r/   r   rq   s      r0   r   Table.export_table_entries  s'    \\((*EY' +r3   c                    U R                   R                  R                  nU R                  R	                  5        H&  nUR
                  (       d  M  XR                  l        M(     g r*   )r-   rj   rF   r,   rb   rc   rL   )r/   owner_handlerq   s      r0   r   Table.update_owner_handles  s>    zz~~,,\\((*E~~~".		 +r3   c                    U R                   R                  R                  c+  XR                   R                  l        U R                  5         gg)z\Set new `handle` for table, updates also :attr:`owner` tag of table
entries. (internal API)
N)r-   rj   rF   r   )r/   rF   s     r0   
set_handleTable.set_handle  s7     ::>>  ($*JJNN!%%' )r3   c                H    U R                  U5        U R                  U5        g r*   )_fix_table_head_fix_entry_handles)r/   auditors     r0   auditTable.audit'  s      	W%(r3   c                :   U R                   nU  H  nUR                  UR                  R                  5      nXCLd  M.  UR	                  5       UR                  l        U R                   R                  U5        UR                  [        R                  SU 3S9  M     g )Nz$Fixed invalid table entry handle in codemessage)	rt   ro   rj   rF   next_handleaddfixed_errorr   INVALID_TABLE_HANDLE)r/   r   rt   rq   entitys        r0   r   Table._fix_entry_handles-  s    ==E\\%))"2"23F" $,#7#7#9		 !!%(###88B5'J $  r3   c                ~  ^ ^^^^ UUUUU 4S jnTR                   R                  [        R                  :  mT R                  mSTR
                  l        TR
                  R                  nT R                  mUb  US:X  a  U" 5         O'T R                  R                  U5      nUTLa  U" 5         T R                  5         g )Nc                    > TR                  5       TR                  l        TR                  T5        T(       a,  T R	                  [
        R                  STR                   3S9  g g )Nz)Fixed invalid table head handle in table r   )r   rj   rF   r   r   r   r   rK   )r   rt   rQ   logr/   s   r0   fix_head'Table._fix_table_head.<locals>.fix_head=  sU    &224DHHOLL###88G		{S $  r3   rJ   )r+   
dxfversionr   DXF12rQ   rj   rL   rF   rt   ro   r   )r/   r   r   rF   rq   rt   rQ   r   s   ``   @@@r0   r   Table._fix_table_head<  s    	 	 kk$$u{{2yy ==>Vs]J MM%%f-ED 
!!#r3   )r-   r+   r,   returnNone)r+   r   r=   zIterator[DXFEntity]r   r   )r+   r   rF   strr   r   r*   )rK   r   rF   zOptional[str]r   r   )r   r   )rK   r   r   r   )rK   r   r   boolr   int)r   zIterator[T])rK   r   r   r#   )rF   r   r   zOptional[T]rK   r   r   r   )rK   r   r   r   r   r#   rK   r   rq   r#   r   r   )r   r!   )r   r#   rq   r#   r   r   r   r    r   r   )rF   r   )r   r   )&__name__
__module____qualname____firstlineno__r8   r1   rA   rG   rD   propertyrQ   rK   staticmethodrW   r[   __contains__r_   re   rN   ro   ru   ry   r~   r   r}   r   rt   rk   r:   r   r   r   r   r   r   r   r   __static_attributes__ r3   r0   r&   r&   /   s    J!
$

     . .. L!*"1 .)
 ! !
7&	*(/()$r3   r&   c                     ^  \ rS rSrSrSU 4S jjr\R                  SS\R                  SSSS.               SS jjr	SS	 jr
S
rU =r$ )
LayerTablei[  LAYERc                   > [        [        [        TU ]  U5      5      nU R                  (       a  UR                  5         U$ r*   )r   r   superrk   r+   set_required_attributes)r/   rM   layer	__class__s      r0   rk   LayerTable.new_entry^  s1    UEG-j9:88))+r3   N
ContinuousT)color
true_colorlinetype
lineweightplottransparencyrM   c                  [        U=(       d    0 5      n[        R                  " U5      (       a  X(S'   O[        R                  " SU 35      eXHS'   [        R
                  " U5      (       a  XXS'   O[        R                  " SU 35      eUb  [        U5      US'   [        U5      US'   [        SU R                  X5      5      n	Ub  Xyl	        U	$ )	a@  Add a new :class:`~ezdxf.entities.Layer`.

Args:
    name (str): layer name
    color (int): :ref:`ACI` value, default is BYLAYER
    true_color (int): true color value, use :func:`ezdxf.rgb2int` to
        create ``int`` values from RGB values
    linetype (str): line type name, default is "Continuous"
    lineweight (int): line weight, default is BYLAYER
    plot (bool): plot layer as bool, default is ``True``
    transparency: transparency value in the range [0, 1], where 1 is
        100% transparent and 0 is opaque
    dxfattribs (dict): additional DXF attributes

r   zinvalid color: r   r   zinvalid lineweight: r   r   r   )
dictr   is_valid_aci_colorr   DXFValueErroris_valid_lineweightr   r   rN   r   )
r/   rK   r   r   r   r   r   r   rM   r   s
             r0   r   LayerTable.addd  s    6 **+
''.."'w%%w&?@@!):((44'1|$%%(<ZL&IJJ!'*:J|$ Y
6Wdhht89#!-r3   c                6   U R                   c  gU R                   R                  R                  5        Hc  n[        U5      (       d  M  UR                  R                  SS5      nU(       d  M:  U R                  U5      (       a  MR  U R                  U5        Me     g)z<Create for all referenced layers table entries if not exist.Nr   rx   )r+   rt   rb   r   rj   ro   r[   r   )r/   rd   
layer_names      r0   create_referenced_layers#LayerTable.create_referenced_layers  sm    88""))+A$Q''7B/Jz$.."<"<$ ,r3   r   )r   r   )rK   r   r   r   r   zOptional[int]r   r   r   r   r   r   r   zOptional[float]r   r   r   )r   r   r   r   r8   rk   r   BYLAYERLINEWEIGHT_BYLAYERr   r   r   __classcell__r   s   @r0   r   r   [  s    J ]]$($22(,++ 	+
 "+ + + + &+ 
+Z
% 
%r3   r   c                  X   ^  \ rS rSrSrS
U 4S jjrSSSS.         SS jjrS	rU =r$ )LinetypeTablei  LTYPEc                   > UR                  SS/5      nUR                  SS5      n[        [        [        TU ]  U5      5      nUR                  X#5        U$ )Npattern        lengthr   )popr   r   r   rk   setup_pattern)r/   rM   r   r   ltyper   s        r0   rk   LinetypeTable.new_entry  sN    ..SE2!,Xuw0<=G,r3   rx   r   N)descriptionr   rM   c                   [        U=(       d    0 5      nUR                  U[        U5      U[        U5      S.5        U R	                  U5      $ )a@  Add a new line type entry. The simple line type pattern is a list of
floats :code:`[total_pattern_length, elem1, elem2, ...]`
where an element > 0 is a line, an element < 0 is a gap and  an
element == 0.0 is a dot. The definition for complex line types are
strings, like: ``'A,.5,-.2,["GAS",STANDARD,S=.1,U=0.0,X=-0.1,Y=-.05],-.25'``
similar to the line type definitions stored in the line definition
`.lin` files, for more information see the tutorial about complex line
types. Be aware that not many CAD applications and DXF viewers support
complex linetypes.

.. seealso::

    - `Tutorial for simple line types <https://ezdxf.mozman.at/docs/tutorials/linetypes.html>`_
    - `Tutorial for complex line types <https://ezdxf.mozman.at/docs/tutorials/linetypes.html#tutorial-for-complex-linetypes>`_

Args:
    name (str): line type  name
    pattern: line type pattern as list of floats or as a string
    description (str): line type description, optional
    length (float): total pattern length, only for complex line types required
    dxfattribs (dict): additional DXF attributes

)rK   r  r   r   )r   updater   floatrk   )r/   rK   r   r  r   rM   s         r0   r   LinetypeTable.add  sM    @ **+
";/"-		
 ~~j))r3   r   )r   r   )
rK   r   r   zUnion[Sequence[float], str]r  r   r   r  r   r   )	r   r   r   r   r8   rk   r   r   r   r   s   @r0   r   r     sR    J )*)* -)*
 )* )* 
)* )*r3   r   c                     ^  \ rS rSrSrSU 4S jjrSU 4S jjrSS jrSU 4S jjrSS.SS	 jjr	SS.SS
 jjr
SS jrSS jrSS jrSrU =r$ )TextstyleTablei  STYLEc                @   > [         TU ]  5         [        5       U l        g r*   )r   r1   r   	shx_files)r/   r   s    r0   r1   TextstyleTable.__init__  s    /3vr3   c                   > [         TU ]  U5        U R                  R                  5        H  nUR	                  U5        M     g r*   )r   r   r  rb   r   )r/   r   shx_filer   s      r0   r   #TextstyleTable.export_table_entries  s5    $Y/--/H	* 0r3   c                :   UR                   R                  S:X  aP  UR                   R                  S-  (       a2  XR                  U R	                  UR                   R
                  5      '   gXR                  U R	                  UR                   R                  5      '   g)r   rx      N)rj   rK   flagsr  rW   fontr,   r   s     r0   r:   TextstyleTable._append  s]     99>>RUYY__q%87<NN488EIINN345:LL%))..12r3   c                   > [         TU ]  5         U R                  R                  R                  nU R
                  R                  5        H  nXR                  l        M     g r*   )r   r   r-   rj   rF   r  rb   rL   )r/   r   rq   r   s      r0   r   #TextstyleTable.update_owner_handles  sA    $&zz~~,,^^**,E*IIO -r3   NrM   c                   [        U=(       d    0 5      nUR                  U[        U5      SS.5        U R                  U5      $ )a  Add a new text style entry for TTF fonts. The entry must not yet
exist, otherwise an :class:`DXFTableEntryError` exception will be
raised.

Finding the TTF font files is the task of the DXF viewer and each
viewer is different (hint: support files).

Args:
    name (str): text style name
    font (str): TTF font file name like "Arial.ttf", the real font file
        name from the file system is required and only the Windows filesystem
        is case-insensitive.
    dxfattribs (dict): additional DXF attributes

      @)rK   r  last_height)r   r  r   rk   )r/   rK   r  rM   s       r0   r   TextstyleTable.add  sD      **+
D	"	
 ~~j))r3   c                  U R                  U5      b:  [        R                  " U R                  R                  R
                   SU S35      e[        U=(       d    0 5      nUR                  SSUSS.5        U R                  U5      $ )a  Add a new shape font (SHX file) entry. These are special text style
entries and have no name. The entry must not yet exist, otherwise an
:class:`DXFTableEntryError` exception will be raised.

Locating the SHX files in the filesystem is the task of the DXF viewer and each
viewer is different (hint: support files).

Args:
    shx_file_name (str): shape file name like "gdt.shx"
    dxfattribs (dict): additional DXF attributes

z shape file entry for 'rh   rx   r  r  )rK   r  r  r  )	find_shxr   ri   r-   rj   rK   r   r  rk   )r/   shx_file_namerM   s      r0   add_shxTextstyleTable.add_shx	  s     =='3**::>>&&' (!?"35 
 **+
%"		
 ~~j))r3   c                P    U R                  U5      nUc  U R                  U5      $ U$ )a  Get existing entry for a shape file (SHX file), or create a new
entry.

Locating the SHX files in the filesystem is the task of the DXF viewer and each
viewer is different (hint: support files).

Args:
    shx_file_name (str): shape file name like "gdt.shx"

)r  r  )r/   r  
shape_files      r0   get_shxTextstyleTable.get_shx'  s-     ]]=1
<<..r3   c                V    U R                   R                  U R                  U5      5      $ )zFind the shape file (SHX file) text style table entry, by a
case-insensitive search.

A shape file table entry has no name, so you have to search by the
font attribute.

Args:
    shx_file_name (str): shape file name like "gdt.shx"

)r  ro   rW   r/   r  s     r0   r  TextstyleTable.find_shx7  s"     ~~!!$((="9::r3   c                ^     U R                   U R                  U5      	 g! [         a     gf = f)zDiscard the shape file (SHX file) text style table entry. Does not raise an
exception if the entry does not exist.

Args:
    shx_file_name (str): shape file name like "gdt.shx"

N)r  rW   KeyErrorr&  s     r0   discard_shxTextstyleTable.discard_shxD  s.    	txx67 		s    
,,)r  r   r   )rq   r   r   r   )rK   r   r  r   r   r   )r  r   r   r   )r  r   r   zOptional[Textstyle])r  r   r   r   )r   r   r   r   r8   r1   r   r:   r   r   r  r#  r  r*  r   r   r   s   @r0   r  r    sD    J6+
;+ 7; *4 9= *< ; r3   r  c                      \ rS rSrSrSS jrSSS jjrSS.SS jjrSS jrSS	 jr	SS
 jr
SS jrSS jrSS jrSS jrSS jrSS jrSS jrSS jrSrg) ViewportTableiR  VPORTc                    U R                   R                  5        H4  n[        U[        5      (       d   eU H  nUR	                  U5        M     M6     g r*   )r,   rb   r6   listr   )r/   r   rq   rd   s       r0   r   "ViewportTable.export_table_entriesW  sB    \\((*EeT****Y'  +r3   Nc                B    U=(       d    0 nXS'   U R                  U5      $ )zCreate a new table entry.rK   )rk   rl   s      r0   rN   ViewportTable.new]  s#    %2
!6~~j))r3   r  c               T    [        U=(       d    0 5      nXS'   U R                  U5      $ )zAdd a new modelspace viewport entry. A modelspace viewport
configuration can consist of multiple viewport entries with the same
name.

Args:
    name (str): viewport name, multiple entries possible
    dxfattribs (dict): additional DXF attributes

rK   r   rk   rl   s      r0   r   ViewportTable.addc  s*     **+
!6~~j))r3   c                    U R                  U5      n[        [        [           U R	                  U5      5      nU H  nU R
                  R                  U5        M      U R                  U	 g)z3Remove table-entry from table and entitydb by name.N)rW   r   r   r   ro   rt   r|   r,   )r/   rK   rW   r,   rq   s        r0   r~   ViewportTable.removeq  sO    hhtntI7EMM''. LLr3   c              #  x   #    U R                   R                  5        H  n[        U5       S h  vN   M     g  N	7fr*   r,   rb   iterr/   r,   s     r0   re   ViewportTable.__iter__y  ,     ||**,GG}$$ -$   ,:8
:c              #  x   #    U R                   R                  5        H  n[        U5       S h  vN   M     g  N	7fr*   r:  r<  s     r0   _flattenViewportTable._flatten}  r>  r?  c                F    [        [        U R                  5       5      5      $ r*   )r^   r0  rA  r.   s    r0   r_   ViewportTable.__len__  s    4())r3   c                    U R                   c   S5       e[        [        [        R                  " U R
                  XR                   5      5      nU R                  U5        U$ )r   zvalid DXF document expected)r+   r   r   r   r   r8   r:   r   s      r0   rk   ViewportTable.new_entry  sR     xx#B%BB###DOOZJ
 	Ur3   c                    [        5       er*   )NotImplementedError)r/   rK   r   s      r0   r   ViewportTable.duplicate_entry  s    !##r3   c                    U R                  UR                  R                  5      nX R                  ;   a  U R                  U   R	                  U5        g U/U R                  U'   g r*   )rW   rj   rK   r,   append)r/   rq   rW   s      r0   r:   ViewportTable._append  sI    hhuyy~~&,,LL$$U+!&DLLr3   c                    U R                  U5        [        U[        5      (       a  UnOU/nU(       d  g U R                  US   R                  R
                  5      nX0R                  U'   g )Nr   )r}   r6   r0  rW   rj   rK   r,   )r/   rK   rq   configrW   s        r0   r   ViewportTable.replace  sU    TeT""FWFhhvay}}))*"Sr3   c                    U R                   R                  R                  nU R                  R	                  5        H  nU H  nXR                  l        M     M     g r*   )r-   rj   rF   r,   rb   rL   )r/   r   r,   rq   s       r0   r   "ViewportTable.update_owner_handles  s?    zz~~,,||**,G ".		 ! -r3   c                     U R                   U R                  U5         $ ! [         a    [        R                  " U5      ef = f)zgReturns a list of :class:`~ezdxf.entities.VPort` objects, for
the multi-viewport configuration `name`.
)r,   rW   r)  r   ri   rZ   s     r0   
get_configViewportTable.get_config  s>    	1<<// 	1**400	1s	     !Ac                &    U R                  U5        g)z^Delete all :class:`~ezdxf.entities.VPort` objects of the
multi-viewport configuration `name`.
N)r~   rZ   s     r0   delete_configViewportTable.delete_config  s     	Dr3   r   r   r*   )rK   r   r   r   r   )r   zIterator[VPort]r   )r   r   )rK   r   r   r   r   r   r   r   r   )rK   r   r   zlist[VPort])r   r   r   r   r8   r   rN   r   r~   re   rA  r_   rk   r   r:   r   r   rS  rV  r   r   r3   r0   r-  r-  R  sR    J(* ,0 *%%*$(
#/1r3   r-  c                  *    \ rS rSrSrSS.SS jjrSrg)
AppIDTablei  APPIDNr  c               T    [        U=(       d    0 5      nXS'   U R                  U5      $ )zfAdd a new appid table entry.

Args:
    name (str): appid name
    dxfattribs (dict): DXF attributes

rK   r5  rl   s      r0   r   AppIDTable.add  *     **+
!6~~j))r3   r   )rK   r   r   r   r   r   r   r   r8   r   r   r   r3   r0   rY  rY    s    J+/ 
* 
*r3   rY  c                  *    \ rS rSrSrSS.SS jjrSrg)	ViewTablei  VIEWNr  c               T    [        U=(       d    0 5      nXS'   U R                  U5      $ )zdAdd a new view table entry.

Args:
    name (str): view name
    dxfattribs (dict): DXF attributes

rK   r5  rl   s      r0   r   ViewTable.add  r]  r3   r   )rK   r   r   r   r^  r   r3   r0   r`  r`    s    J+/ 
* 
*r3   r`  c                  *    \ rS rSrSrSS.SS jjrSrg)BlockRecordTablei  BLOCK_RECORDNr  c               T    [        U=(       d    0 5      nXS'   U R                  U5      $ )ztAdd a new block record table entry.

Args:
    name (str): block record name
    dxfattribs (dict): DXF attributes

rK   r5  rl   s      r0   r   BlockRecordTable.add  r]  r3   r   )rK   r   r   r   r^  r   r3   r0   re  re    s    J+/ 
* 
*r3   re  c                  *    \ rS rSrSrSS.SS jjrSrg)DimStyleTablei  DIMSTYLENr  c               T    [        U=(       d    0 5      nXS'   U R                  U5      $ )zzAdd a new dimension style table entry.

Args:
    name (str): dimension style name
    dxfattribs (dict): DXF attributes

rK   r5  rl   s      r0   r   DimStyleTable.add  r]  r3   r   )rK   r   r   r   r^  r   r3   r0   rj  rj    s    J+/ 
* 
*r3   rj  c                  *    \ rS rSrSrSS.SS jjrSrg)UCSTablei  UCSNr  c               T    [        U=(       d    0 5      nXS'   U R                  U5      $ )zbAdd a new UCS table entry.

Args:
    name (str): UCS name
    dxfattribs (dict): DXF attributes

rK   r5  rl   s      r0   r   UCSTable.add  r]  r3   r   )rK   r   r   r   r^  r   r3   r0   ro  ro    s    J+/ 
* 
*r3   ro  )7
__future__r   typingr   r   r   r   r   r	   r
   r   r   collectionsr   loggingezdxf.auditr   r   ezdxf.lldxfr   r   ezdxf.entities.tabler   ezdxf.entitiesr   r   r   r   r   r   r   r   r   r   r   r   ezdxf.documentr   ezdxf.lldxf.tagwriterr    ezdxf.entitydbr!   	getLoggerr;   r#   r&   r   r   r  r-  rY  r`  re  rj  ro  r   r3   r0   <module>r     s   #
 
 
 $  + ( *    &7' 
		7	#C{#i$GAJ i$X	@%u @%F3*E(O 3*l{U9% {|jE%L jZ*u * *d * *u[) * *E(O * *u]# *r3   