
    h1                       S SK Jr  S SKJrJrJrJr  S SKJr  S SK	r	S SK
Jr  S SKJrJrJrJr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  S S
KJr  S SKJ r   S SK!J"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-  SSK.J/r/  SSK0J1r1  \(       a,  S SK!J2r2  S SK3J4r4J5r5  S SK6J7r7  S SK8J9r9  S SKJ:r:  S SK;J<r<  S SK=J>r>  S/r?\	R                  " S5      rA\" S\" SS\R                  S 9\" S!SS"\R                  \S#9\" S$S S"\R                  \S#9\" S%S\R                  " S S&5      \S'9\" S(SS"\R                  \S#9\" S)SS"\R                  \S#9\" S*SS"\R                  \S#9\" S+SS"\R                  \S#9\" S,S-S"\R                  \S#9\" S.S/S"S09\" S1\R                  \S"\R                  \S29\" S3\R                  \S"\R                  \S29\" S4\R                  \S"S59\" S6\R                  \S"S59S7.5      rI\" \I5      rJ\* " S8 S\'\,5      5       rKg)9    )annotations)TYPE_CHECKINGIterableOptionalIterator)SelfN)	validator)DXFAttrDXFAttributesDefSubclassXTypeRETURN_DEFAULTgroup_code_mapping)TagsDXFTag)const)Vec3UVecX_AXISZ_AXISNULLVEC)transform_extrusionexplode_entity)
AuditError   )
base_classSubclassProcessor)
DXFGraphicacdb_entity)register_entity)OverrideMixinregister_override_handlesDimStyleOverride)default_copy)Auditor)DXFNamespace	DXFEntity)
BaseLayout)AbstractTagWriter)Matrix44)EntityQuery)xrefLeaderezdxf
AcDbLeader   Standard)defaultr	   G   T)r4   optionalr	   fixerH   I      )r4   r	   r7   J   K   (   )   M      iT  0)r4   r6      )xtyper4   r6   r	   r7         )rC   r4   r6      )dimstylehas_arrowhead	path_typeannotation_typehookline_directionhas_hooklinetext_height
text_widthblock_colorannotation_handlenormal_vectorhorizontal_directionleader_offset_block_ref"leader_offset_annotation_placementc                  *  ^  \ rS rSrSrSr\" \\\	5      r
\R                  rSU 4S jjr\4SS jjr S   SU 4S jjjrSS jrSS jrSU 4S	 jjrSS
 jrSU 4S jjrSU 4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"S jjrS#U 4S jjrSrU =r $ )$r/      zDXF LEADER entityLEADERc                0   > [         TU ]  5         / U l        g N)super__init__vertices)self	__class__s    G/var/www/html/env/lib/python3.13/site-packages/ezdxf/entities/leader.pyr[   Leader.__init__   s    $&    c                |    [        U[        5      (       d   e[        R                  " U R                  5      Ul        g)zCopy vertices.N)
isinstancer/   r   listr\   )r]   entitycopy_strategys      r_   	copy_dataLeader.copy_data   s)    &&))))))DMM2ra   c                  > [         TU ]  U5      nU(       an  UR                  S5      nU(       a2  [        U R	                  U5      5      nUR                  U[        USS9  U$ [        R                  " SUR                   S35      eU$ )N   T)recoverz)missing 'AcDbLeader' subclass in LEADER(#))
rZ   load_dxf_attribssubclass_by_indexr   load_verticesfast_load_dxfattribsacdb_leader_group_codesr   DXFStructureErrorhandle)r]   	processordxftagsr^   s       r_   rm   Leader.load_dxf_attribs   s     g&y1..q1DD..t45..0$ /  
	 --?

|1M  
ra   c              #     #    U HP  nUR                   S:X  a'  U R                  R                  UR                  5        M:  UR                   S:X  a  ML  Uv   MR     g 7f)N
   L   )coder\   appendvalue)r]   rv   tags      r_   ro   Leader.load_vertices   sC     Cxx2~$$SYY/R	 s   AAc                |    [        U R                  5      S:  a#  [        R                  S[	        U 5       S35        gg)Nrj   zInvalid z: more than 1 vertex required.FT)lenr\   loggerdebugstr)r]   	tagwriters     r_   preprocess_exportLeader.preprocess_export   s3    t}}!LL8CI;.LMNra   c                  > [         TU ]  U5        UR                  [        R                  [
        R                  5        U R                  R                  U/ SQ5        U R                  U5        U R                  R                  U/ SQ5        g)z(Export entity specific data as DXF tags.)rG   rH   rI   rJ   rK   rL   rM   rN   )rO   rP   rQ   rR   rS   rT   N)
rZ   export_entity
write_tag2r   SUBCLASS_MARKERacdb_leadernameru   export_dxf_attribsexport_vertices)r]   r   r^   s     r_   r   Leader.export_entity   sp    i(U22K4D4DE##		
 	Y'##
	
ra   c                    UR                  S[        U R                  5      5        U R                   H  nUR                  SU5        M     g )Nrz   ry   )r   r   r\   write_vertex)r]   r   vertexs      r_   r   Leader.export_vertices   s9    RT]]!34mmF""2v. $ra   c                b  > U R                   c   e[        TU ]	  U5        UR                  U R                  R
                  5        U R                  SS5      (       d  gU R                   R                  [        R                  :  a  [        X5        gU R                  5       R                  U5        g)z5Register required resources to the resource registry.NACADDSTYLE)docrZ   register_resourcesadd_dim_styleru   rG   has_xdata_list
dxfversionr   DXF12r#   overrideregister_resources_r12)r]   registryr^   s     r_   r   Leader.register_resources   s    xx###"8,txx001 ""684488,%d5 MMO228<ra   c                  > [         TU ]  X5        U R                  R                  S5      (       a4  UR	                  U R                  R
                  5      UR                  l        U R                  c   eU R                  R                  [        R                  :  a  gU R                  5       nUR                  (       d  g[        U[        5      (       d   eUR                  X5        g)z3Translate resources from self to the copied entity.rP   N)rZ   map_resourcesru   hasattr
get_handlerP   r   r   r   r   r   dimstyle_attribsrc   r/   map_resources_r12)r]   clonemappingself_overrider^   s       r_   r   Leader.map_resources  s    e-88/00*1*<*<TXX=W=W*XEII' xx###88,--%((((''7ra   c                    [        U 5      $ )a  Returns the :class:`~ezdxf.entities.DimStyleOverride` object.

.. warning::

    The LEADER entity shares only the DIMSTYLE override infrastructure with the
    DIMENSION entity but does not support any other features of the DIMENSION
    entity!

    HANDLE WITH CARE!

r$   r]   s    r_   r   Leader.override  s      %%ra   c                P    U Vs/ s H  n[        U5      PM     snU l        gs  snf )ziSet vertices of the leader, vertices is an iterable of
(x, y [,z]) tuples or :class:`~ezdxf.math.Vec3`.

N)r   r\   )r]   r\   vs      r_   set_verticesLeader.set_vertices+  s!    
 +33(Qa(33s   #c                F   [        UR                  U R                  5      5      U l        [        U R                  R
                  U5      u  U R                  l        nUR                  U R                  R                  5      U R                  l        U R                  U5        U $ )z=Transform LEADER entity by transformation matrix `m` inplace.)	rd   transform_verticesr\   r   ru   rQ   transform_directionrR   post_transform)r]   m_s      r_   	transformLeader.transform2  s}    Q11$--@A$7HH""A%
! )*(=(=HH)))
% 	Ara   c              #  `   #    SSK Jn  U" U 5       H  nUR                  U 5        Uv   M     g7f)z0Implements the SupportsVirtualEntities protocol.r   )virtual_entitiesN)ezdxf.render.leaderr   set_source_of_copy)r]   r   es      r_   __virtual_entities__Leader.__virtual_entities__>  s*     8!$'A  &G (s   ,.c                "    U R                  5       $ )zYields the DXF primitives the LEADER entity is build up as virtual entities.

These entities are located at the original location, but are not stored
in the entity database, have no handle and are not assigned to any
layout.
)r   r   s    r_   r   Leader.virtual_entitiesF  s     ((**ra   c                    [        X5      $ )a  Explode parts of the LEADER entity as DXF primitives into target layout,
if target layout is ``None``, the target layout is the layout of the LEADER
entity. This method destroys the source entity.

Returns an :class:`~ezdxf.query.EntityQuery` container referencing all
DXF primitives.

Args:
    target_layout: target layout for the created DXF primitives, ``None`` for
        the same layout as the source entity.

r   )r]   target_layouts     r_   explodeLeader.explodeO  s     d22ra   c           	        > [         TU ]  U5        [        U R                  5      S:  aS  UR	                  [
        R                  S[        U 5       S[        U R                  5       S3U S9  U R                  5         gg)zValidity check.rj   zDeleted entity z with invalid vertex count = .)r{   message
dxf_entityN)	rZ   auditr   r\   fixed_errorr   INVALID_VERTEX_COUNTr   destroy)r]   auditorr^   s     r_   r   Leader.audit^  su    gt}}!44)#d) 5'(+	    LLN "ra   )r\   )returnNone)re   r   r   r   rY   )rt   zOptional[SubclassProcessor]r   r(   )rv   r   r   zIterable[DXFTag])r   r+   r   bool)r   r+   r   r   )r   zxref.Registryr   r   )r   r   r   zxref.ResourceMapperr   r   )r   r%   )r\   zIterable[UVec])r   r,   r   r/   )r   zIterator[DXFGraphic])r   zOptional[BaseLayout]r   r-   )r   r'   r   r   )!__name__
__module____qualname____firstlineno____doc__DXFTYPEr   r   r    r   
DXFATTRIBSr   DXF2000MIN_DXF_VERSION_FOR_EXPORTr[   r&   rg   rm   ro   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes____classcell__)r^   s   @r_   r/   r/      s    Gz;DJ!&' 5A 3 8<4	 $
</
="8$&4
+3
 
ra   )L
__future__r   typingr   r   r   r   typing_extensionsr   loggingezdxf.lldxfr	   ezdxf.lldxf.attributesr
   r   r   r   r   r   ezdxf.lldxf.tagsr   r   r   
ezdxf.mathr   r   r   r   r   ezdxf.math.transformtoolsr   ezdxf.exploder   ezdxf.auditr   	dxfentityr   r   dxfgfxr   r    factoryr!   	dimensionr"   r#   dimstyleoverrider%   copyr&   r'   ezdxf.entitiesr(   r)   ezdxf.layoutsr*   ezdxf.lldxf.tagwriterr+   r,   ezdxf.queryr-   r0   r.   __all__	getLoggerr   is_valid_table_nameis_integer_boolis_in_integer_rangeis_greater_zerois_valid_aci_colorpoint3dis_not_null_vectorr   rq   r/    ra   r_   <module>r      sW   # > > "  !  *  : : 9 ( " 4 + $ ? . #6(7#'*			7	#33
 !// 
 // 
 #33Aq9 	
 &// 
  // 
 // 
 // 
 22 
 %S#E --22 
 !(--22 !
 $+u}}g$
 /6u}}g/
Yrul -[9  DZ D Dra   