
    Ogd                    ,   d dl mZ d dlmZ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mZmZ d dlmZm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m Z m!Z!m"Z"m#Z# erd d	l$m%Z% d d
l&m'Z' d dl(m)Z)  ejT                  d      Z+ edd      Z, G d dee,         Z- G d de-e         Z. G d de-e         Z/ G d de-e         Z0 G d de-e         Z1 G d de-e         Z2 G d de-e         Z3 G d de-e!         Z4 G d  d!e-e"         Z5 G d" d#e-e          Z6y)$    )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                  &   e Zd ZdZd dZd!dZd"dZd#d$dZed        Z	ed%d       Z
ed&d	       Zd'd
ZeZd(dZd)dZd#d*dZd*dZd+dZd&dZd,dZd-dZd,dZd.dZed/d       Zd0dZd1dZd1dZd2dZd2dZd dZd3dZ d4dZ!d4dZ"d4dZ#y)5TableUNKNOWNc                N    d | _         t               | _        t               | _        y N)docr   entriesr   _headselfs    Y/var/www/html/public_html/myphp/venv/lib/python3.12/site-packages/ezdxf/sections/table.py__init__zTable.__init__2   s    &*%0][
    c                v   || _         t        |      }t        |t              r|| _        nt        j                  d      | j                  }|D ]i  }|j                         |k(  r | j                  t        t        |             6t        j                  d|j                          d| j                   d       k y)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         r/   loadz
Table.load7   s    (^
j),#DJ))*WXX!%# 	K""$(>>T![1278K8K8M7N O??+74		r1   c                ~    || _         | j                  | j                  |       | j                  j	                          y)zReset table. (internal API)N)r*   	_set_headr6   r+   clear)r.   r*   handles      r/   resetzTable.resetI   s+    t/r1   Nc                X    t        j                  |dd|i| j                        | _        y )N0name)owner
dxfattribsr*   )r   newr*   r,   )r.   rG   rC   s      r/   rA   zTable._set_headO   s#    ]]#64.dhh

r1   c                    | j                   S )zReturns table head entry.)r,   r-   s    r/   headz
Table.headT   s     zzr1   c                    | j                   S r)   )r6   r-   s    r/   rG   z
Table.nameY   s    r1   c                ,    t        j                  |       S )zUnified table entry key.)r   make_table_key)rG   s    r/   keyz	Table.key]   s     ''--r1   c                <    | j                  |      | j                  v S )z/Returns ``True`` if a table entry `name` exist.)rP   r+   r.   rG   s     r/   	has_entryzTable.has_entryb   s    xx~--r1   c                ,    t        | j                        S )zCount of table entries.)lenr+   r-   s    r/   __len__zTable.__len__h   s    4<<  r1   c              #  l   K   | j                   j                         D ]  }|j                  s|  yw)zIterable of all table entries.N)r+   valuesis_alive)r.   es     r/   __iter__zTable.__iter__l   s.     $$& 	Azz	s   *44c                    | j                  |      r%t        j                  | j                   d| d      |xs i }||d<   | j                  j
                  j                  |d<   | j                  |      S )zCreate a new table entry `name`.

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

        z '' already exists!rG   rH   )rS   r   DXFTableEntryErrorr6   r,   dxfrC   	new_entryr.   rG   rI   s      r/   rJ   z	Table.newr   sv     >>$**??#2dV+<=   %2
!
6"jjnn33
7~~j))r1   c                    | j                   j                  | j                  |            }|r|S t        j                  |      )zReturns table entry `name`.

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

        Raises:
            DXFTableEntryError: table entry does not exist

        )r+   getrP   r   r^   r.   rG   entrys      r/   rc   z	Table.get   s9       $0L**400r1   c                    | j                   j                  j                  |      }|r|j                         | j                  k(  r|S y)zcReturns table entry by handle or ``None`` if entry does not exist.

        (internal API)
        N)r*   entitydbrc   r7   r6   )r.   rC   re   s      r/   get_entry_by_handlezTable.get_entry_by_handle   s:    
 !!%%f-U]]_7Lr1   c                    | j                   j                  | j                  |            }||j                  j                  S y)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+   rc   rP   r_   rC   rd   s      r/   get_handle_of_entryzTable.get_handle_of_entry   s9       $099###r1   c                    | j                  |      }| j                  |      }| j                  j                  |       | j	                  |       y)zRemoves table entry `name`.

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

        Raises:
            DXFTableEntryError: table entry does not exist

        N)rP   rc   rg   delete_entitydiscard)r.   rG   rP   re   s       r/   removezTable.remove   s<     hhtn##E*Sr1   c                    | j                  |      }| j                  }|r|j                  |      }n|j                         }||j                  _        t        t        |      }| j                  |       |S )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

        )	rc   rg   duplicate_entitycopyr_   rG   r   r#   r8   )r.   rG   new_namere   rg   r`   s         r/   duplicate_entryzTable.duplicate_entry   sa     == 11%8I

I%	Q	"Ur1   c                <    | j                   | j                  |      = y)zRemove table entry without destroying object.

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

        (internal API)
        N)r+   rP   rR   s     r/   rn   zTable.discard   s     LL$(r1   c                H    | j                  |       | j                  |       y)z9Replace table entry `name` by new `entry`. (internal API)N)rn   r8   rd   s      r/   replacezTable.replace   s    TUr1   c                .    | j                   j                  S r)   )r*   rg   r-   s    r/   rg   zTable.entitydb   s    xx   r1   c                    | j                   J d       t        t        t        j                  | j
                  || j                               }| j                  |       |S )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_entryr6   r8   r.   rI   re   s      r/   r`   zTable.new_entry   sN     xx#B%BB#Q//TXXVWUr1   c                    |j                         | j                  k(  sJ || j                  | j                  |j                  j
                        <   y)]Add a table entry, replaces existing entries with same name.
        (internal API).
        N)r7   r6   r+   rP   r_   rG   r.   re   s     r/   r8   zTable._append   s;     }}$//11116TXXeiinn-.r1   c                <   |j                         | j                  k7  r3t        j                  d|j                          d| j                         |j                  j
                  }| j                  |      r9t        j                  | j                  j                  j
                   d| d      | j                  r t        j                  || j                         | j                  j                  j                  |j                  _        | j                  |       y)z]Add a table `entry`, created by other object than this table.
        (internal API)
        zInvalid table entry type z for table  z already exists!N)r7   r6   r   DXFTypeErrorr_   rG   rS   r^   r,   r*   r   bindrC   rH   r8   )r.   re   rG   s      r/   	add_entryzTable.add_entry   s     ==?doo-$$+EMMO+< =!__-/  yy~~>>$**::>>&&'q.>?  88LL)**..//		Ur1   c                   | j                          d| j                  j                  _        t	        |       | j                  j                  _        | j                  j                  |       | j                  |       |j                  dd       y)z)Export DXF representation. (internal API)rF   r   ENDTABN)	update_owner_handlesr,   r_   rH   rU   count
export_dxfexport_table_entries
write_tag2)r.   	tagwriters     r/   r   zTable.export_dxf
  sd     	!!#"

"4y



i(!!),Q)r1   c                d    | j                   j                         D ]  }|j                  |        y r)   )r+   rX   r   )r.   r   re   s      r/   r   zTable.export_table_entries  s,    \\((* 	(EY'	(r1   c                    | j                   j                  j                  }| j                  j	                         D ]   }|j
                  s||j                  _        " y r)   )r,   r_   rC   r+   rX   rY   rH   )r.   owner_handlere   s      r/   r   zTable.update_owner_handles  sC    zz~~,,\\((* 	/E~~".			/r1   c                    | j                   j                  j                  ,|| j                   j                  _        | j                          yy)zlSet new `handle` for table, updates also :attr:`owner` tag of table
        entries. (internal API)
        N)r,   r_   rC   r   )r.   rC   s     r/   
set_handlezTable.set_handle  s9     ::>>  ($*DJJNN!%%' )r1   c                H    | j                  |       | j                  |       y r)   )_fix_table_head_fix_entry_handles)r.   auditors     r/   auditzTable.audit'  s      	W%(r1   c                :   | j                   }| D ]  }|j                  |j                  j                        }||us-|j	                         |j                  _        | j                   j                  |       |j                  t        j                  d|         y )Nz$Fixed invalid table entry handle in codemessage)	rg   rc   r_   rC   next_handleaddfixed_errorr   INVALID_TABLE_HANDLE)r.   r   rg   re   entitys        r/   r   zTable._fix_entry_handles-  s    == 
	E\\%))"2"23FU" $,#7#7#9		 !!%(###88B5'J $ 
	r1   c                v     fd}j                   j                  t        j                  kD   j                  dj
                  _        j
                  j                  } j                  ||dk(  r |        n& j                  j                  |      }|ur |         j                          y )Nc                     j                         j                  _        j                         r/ j	                  t
        j                  dj                          y y )Nz)Fixed invalid table head handle in table r   )r   r_   rC   r   r   r   r   rG   )r   rg   rL   logr.   s   r/   fix_headz'Table._fix_table_head.<locals>.fix_head=  sU    &224DHHOLL###88G		{S $  r1   rF   )r*   
dxfversionr   DXF12rL   r_   rH   rC   rg   rc   r   )r.   r   r   rC   re   rg   rL   r   s   ``   @@@r/   r   zTable._fix_table_head<  s    	 	 kk$$u{{2yy ==>Vs]J MM%%f-ED 
!!#r1   returnNone)r*   r   r;   zIterator[DXFEntity]r   r   )r*   r   rC   strr   r   r)   )rG   r   rC   zOptional[str]r   r   )r   r   )rG   r   r   r   )rG   r   r   boolr   int)r   zIterator[T])rG   r   r   r#   )rC   r   r   zOptional[T]rG   r   r   r   )rG   r   rs   r   r   r#   rG   r   re   r#   r   r   )r   r!   )r   r#   re   r#   r   r   r   r    r   r   )rC   r   )r   r   )$__name__
__module____qualname__r6   r0   r?   rD   rA   propertyrL   rG   staticmethodrP   rS   __contains__rV   r[   rJ   rc   rh   rk   ro   rt   rn   rw   rg   r`   r8   r   r   r   r   r   r   r   r    r1   r/   r&   r&   /   s    J!
$

     . .. L!*"1 .)
 ! !
7&	*(/()$r1   r&   c                       e Zd ZdZd	 fdZej                  ddej                  dddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d
dZddZ	 xZ
S )
LayerTableLAYERc                z    t        t        t        |   |            }| j                  r|j                          |S r)   )r   r   superr`   r*   set_required_attributes)r.   rI   layer	__class__s      r/   r`   zLayerTable.new_entry^  s1    UEG-j9:88))+r1   N
ContinuousT)color
true_colorlinetype
lineweightplottransparencyrI   c                  t        |xs i       }t        j                  |      r||d<   nt        j                  d|       ||d<   t        j
                  |      r||d<   nt        j                  d|       |t        |      |d<   t        |      |d<   t        d| j                  ||            }	|||	_	        |	S )	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   rJ   r   )
r.   rG   r   r   r   r   r   r   rI   r   s
             r/   r   zLayerTable.addd  s    6 **+
''."'Jw%%w&?@@!)
:((4'1J|$%%(<ZL&IJJ!'*:J|$ Y
6WdhhtZ89#!-Er1   c                   | j                   y| j                   j                  j                         D ]P  }t        |      s|j                  j                  dd      }|s.| j                  |      r@| j                  |       R y)z<Create for all referenced layers table entries if not exist.Nr   rj   )r*   rg   rX   r   r_   rc   rS   r   )r.   rZ   
layer_names      r/   create_referenced_layersz#LayerTable.create_referenced_layers  sj    88""))+ 	%A$Q'7B/J$.."<$	%r1   )r   r   )rG   r   r   r   r   zOptional[int]r   r   r   r   r   r   r   zOptional[float]r   r   r   )r   r   r   r6   r`   r   BYLAYERLINEWEIGHT_BYLAYERr   r   __classcell__r   s   @r/   r   r   [  s    J ]]$($22(,++ 	+
 "+ + + + &+ 
+Z
%r1   r   c                  H     e Zd ZdZd fdZdddd	 	 	 	 	 	 	 	 	 d	dZ xZS )
LinetypeTableLTYPEc                    |j                  ddg      }|j                  dd      }t        t        t        |   |            }|j                  ||       |S )Npattern        lengthr   )popr   r   r   r`   setup_pattern)r.   rI   r   r   ltyper   s        r/   r`   zLinetypeTable.new_entry  sP    ..SE2!,Xuw0<=GV,r1   rj   r   N)descriptionr   rI   c                   t        |xs i       }|j                  |t        |      |t        |      d       | j	                  |      S )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

        )rG   r   r   r   )r   updater   floatr`   )r.   rG   r   r   r   rI   s         r/   r   zLinetypeTable.add  sM    @ **+
";/"-		
 ~~j))r1   )r   r   )
rG   r   r   zUnion[Sequence[float], str]r   r   r   r   r   r   )r   r   r   r6   r`   r   r   r   s   @r/   r   r     sM    J )*)* -)*
 )* )* 
)*r1   r   c                  x     e Zd ZdZd fdZd fdZddZd fdZddddZdddd	Z	dd
Z
ddZddZ xZS )TextstyleTableSTYLEc                @    t         |           t               | _        y r)   )r   r0   r   	shx_files)r.   r   s    r/   r0   zTextstyleTable.__init__  s    /3vr1   c                    t         |   |       | j                  j                         D ]  }|j	                  |        y r)   )r   r   r   rX   r   )r.   r   shx_filer   s      r/   r   z#TextstyleTable.export_table_entries  s:    $Y/--/ 	+H	*	+r1   c                2   |j                   j                  dk(  rL|j                   j                  dz  r3|| j                  | j	                  |j                   j
                        <   y|| j                  | j	                  |j                   j                        <   y)r~   rj      N)r_   rG   flagsr   rP   fontr+   r   s     r/   r8   zTextstyleTable._append  sa     99>>RUYY__q%87<DNN488EIINN345:DLL%))..12r1   c                    t         |           | j                  j                  j                  }| j
                  j                         D ]  }||j                  _         y r)   )r   r   r,   r_   rC   r   rX   rH   )r.   r   re   r   s      r/   r   z#TextstyleTable.update_owner_handles  sH    $&zz~~,,^^**, 	+E*EIIO	+r1   NrI   c               ~    t        |xs i       }|j                  |t        |      dd       | j                  |      S )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

              @)rG   r   last_height)r   r   r   r`   )r.   rG   r   rI   s       r/   r   zTextstyleTable.add  sD      **+
D	"	
 ~~j))r1   c                  | j                  |      9t        j                  | j                  j                  j
                   d| d      t        |xs i       }|j                  dd|dd       | j                  |      S )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 'r]   rj   r   r   )rG   r   r   r   )	find_shxr   r^   r,   r_   rG   r   r   r`   )r.   shx_file_namerI   s      r/   add_shxzTextstyleTable.add_shx	  s     =='3**::>>&&' (!?"35 
 **+
%"		
 ~~j))r1   c                N    | j                  |      }|| j                  |      S |S )a3  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      r/   get_shxzTextstyleTable.get_shx'  s-     ]]=1
<<..r1   c                V    | j                   j                  | j                  |            S )a  Find 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   rc   rP   r.   r   s     r/   r   zTextstyleTable.find_shx7  s"     ~~!!$((="9::r1   c                \    	 | j                   | j                  |      = y# t        $ r Y yw xY w)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   rP   KeyErrorr   s     r/   discard_shxzTextstyleTable.discard_shxD  s.    	txx67 		s    	++r   r   )re   r   r   r   )rG   r   r   r   r   r   )r   r   r   r   )r   r   r   zOptional[Textstyle])r   r   r   r   )r   r   r   r6   r0   r   r8   r   r   r   r   r   r   r   r   s   @r/   r   r     s?    J6+
;+ 7; *4 9= *< ;r1   r   c                      e Zd ZdZddZdddZddddZddZddZdd	Z	dd
Z
ddZddZddZddZddZddZddZy)ViewportTableVPORTc                    | j                   j                         D ],  }t        |t              sJ |D ]  }|j	                  |        . y r)   )r+   rX   r4   listr   )r.   r   re   rZ   s       r/   r   z"ViewportTable.export_table_entriesW  sI    \\((* 	(EeT*** (Y'(	(r1   Nc                :    |xs i }||d<   | j                  |      S )zCreate a new table entry.rG   )r`   ra   s      r/   rJ   zViewportTable.new]  s%    %2
!
6~~j))r1   r   c               L    t        |xs i       }||d<   | j                  |      S )a(  Add 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

        rG   r   r`   ra   s      r/   r   zViewportTable.addc  s,     **+
!
6~~j))r1   c                    | j                  |      }t        t        t           | j	                  |            }|D ]  }| j
                  j                  |        | j                  |= y)z3Remove table-entry from table and entitydb by name.N)rP   r   r   r   rc   rg   rm   r+   )r.   rG   rP   r+   re   s        r/   ro   zViewportTable.removeq  sT    hhtntI7 	/EMM''.	/LLr1   c              #  t   K   | j                   j                         D ]  }t        |      E d {     y 7 wr)   r+   rX   iterr.   r+   s     r/   r[   zViewportTable.__iter__y  2     ||**, 	%GG}$$	%$   ,868c              #  t   K   | j                   j                         D ]  }t        |      E d {     y 7 wr)   r  r	  s     r/   _flattenzViewportTable._flatten}  r
  r  c                F    t        t        | j                                     S r)   )rU   r  r  r-   s    r/   rV   zViewportTable.__len__  s    4())r1   c                    | j                   J d       t        t        t        j                  | j
                  || j                               }| j                  |       |S )rz   zvalid DXF document expected)r*   r   r   r   r{   r6   r8   r|   s      r/   r`   zViewportTable.new_entry  sT     xx#B%BB###DOOZJ
 	Ur1   c                    t               r)   )NotImplementedError)r.   rG   rs   s      r/   rt   zViewportTable.duplicate_entry  s    !##r1   c                    | j                  |j                  j                        }|| j                  v r| j                  |   j	                  |       y |g| j                  |<   y r)   )rP   r_   rG   r+   append)r.   re   rP   s      r/   r8   zViewportTable._append  sK    hhuyy~~&$,,LL$$U+!&DLLr1   c                    | j                  |       t        |t              r|}n|g}|sy | j                  |d   j                  j
                        }|| j                  |<   y )Nr   )rn   r4   r  rP   r_   rG   r+   )r.   rG   re   configrP   s        r/   rw   zViewportTable.replace  sT    TeT"FWFhhvay}}))*"Sr1   c                    | j                   j                  j                  }| j                  j	                         D ]  }|D ]  }||j                  _          y r)   )r,   r_   rC   r+   rX   rH   )r.   r   r+   re   s       r/   r   z"ViewportTable.update_owner_handles  sK    zz~~,,||**, 	/G  /".		/	/r1   c                    	 | j                   | j                  |         S # t        $ r t        j                  |      w xY w)zwReturns a list of :class:`~ezdxf.entities.VPort` objects, for
        the multi-viewport configuration `name`.
        )r+   rP   r   r   r^   rR   s     r/   
get_configzViewportTable.get_config  s>    	1<<// 	1**400	1s     ?c                &    | j                  |       y)znDelete all :class:`~ezdxf.entities.VPort` objects of the
        multi-viewport configuration `name`.
        N)ro   rR   s     r/   delete_configzViewportTable.delete_config  s     	Dr1   r   r)   )rG   r   r   r   r   )r   zIterator[VPort]r   )r   r   )rG   r   rs   r   r   r   r   r   r   )rG   r   r   zlist[VPort])r   r   r   r6   r   rJ   r   ro   r[   r  rV   r`   rt   r8   rw   r   r  r  r   r1   r/   r   r   R  sR    J(* ,0 *%%*$(
#/1r1   r   c                      e Zd ZdZddddZy)
AppIDTableAPPIDNr   c               L    t        |xs i       }||d<   | j                  |      S )zAdd a new appid table entry.

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

        rG   r  ra   s      r/   r   zAppIDTable.add  ,     **+
!
6~~j))r1   )rG   r   r   r   r   r   r   r6   r   r   r1   r/   r  r    s    J+/ 
*r1   r  c                      e Zd ZdZddddZy)	ViewTableVIEWNr   c               L    t        |xs i       }||d<   | j                  |      S )zAdd a new view table entry.

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

        rG   r  ra   s      r/   r   zViewTable.add  r  r1   )rG   r   r   r   r   r   r1   r/   r"  r"    s    J+/ 
*r1   r"  c                      e Zd ZdZddddZy)BlockRecordTableBLOCK_RECORDNr   c               L    t        |xs i       }||d<   | j                  |      S )zAdd a new block record table entry.

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

        rG   r  ra   s      r/   r   zBlockRecordTable.add  r  r1   )rG   r   r   r   r   r   r1   r/   r&  r&    s    J+/ 
*r1   r&  c                      e Zd ZdZddddZy)DimStyleTableDIMSTYLENr   c               L    t        |xs i       }||d<   | j                  |      S )zAdd a new dimension style table entry.

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

        rG   r  ra   s      r/   r   zDimStyleTable.add  r  r1   )rG   r   r   r   r   r   r1   r/   r*  r*    s    J+/ 
*r1   r*  c                      e Zd ZdZddddZy)UCSTableUCSNr   c               L    t        |xs i       }||d<   | j                  |      S )zAdd a new UCS table entry.

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

        rG   r  ra   s      r/   r   zUCSTable.add  r  r1   )rG   r   r   r   r   r   r1   r/   r.  r.    s    J+/ 
*r1   r.  )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!   	getLoggerr9   r#   r&   r   r   r   r   r  r"  r&  r*  r.  r   r1   r/   <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]# *r1   