
    Og                        U d dl mZ d dlmZmZ ddlmZmZ ddlm	Z	 erd dl
mZ dgZ e       Zded	<    G d
 d      Zy)    )annotations)TYPE_CHECKINGSequence   )Bodyload)EncodedData)	DXFEntity	AcisCacheSequence[Body]	NO_BODIESc                  B    e Zd ZdZddZed	d       Zd
dZddZddZ	y)r   zThis cache manages ACIS bodies created from SAT or SAB data stored in DXF 
    entities.
    
    Each entry is a list of ACIS bodies and is indexed by a hash calculated from the 
    source content of the SAT or SAB data.

    c                .    i | _         d| _        d| _        y )Nr   )_entrieshitsmissesselfs    U/var/www/html/public_html/myphp/venv/lib/python3.12/site-packages/ezdxf/acis/cache.py__init__zAcisCache.__init__   s    35	    c                    t        | t              rt        t        |             S t        | t              rt        t        |             S t        |       S N)
isinstancelisthashtuple	bytearraybytes)datas    r   	hash_datazAcisCache.hash_data   s>    dD!d$$i(d$$Dzr   c                ,    t        | j                        S r   )lenr   r   s    r   __len__zAcisCache.__len__$   s    4==!!r   c                .   |st         S t        j                  |      }| j                  j	                  |t               }|t         ur| xj
                  dz  c_        |S | xj                  dz  c_        t        t        |            }|| j                  |<   |S )Nr   )	r   r   r!   r   getr   r   r   r   )r   r    
hash_valuebodiess       r   
get_bodieszAcisCache.get_bodies'   sz    ((.
"":y9"IINIMqtDz"$*j!r   c                h    ddl m} t        ||      st        S | j	                  |j
                        S )Nr   )r   )ezdxf.entitiesr   r   r   r)   	acis_data)r   entityDxfBodys      r   from_dxf_entityzAcisCache.from_dxf_entity6   s*    2&'*v//00r   N)returnNone)r    r	   r0   int)r0   r2   )r    r	   r0   r   )r-   r
   r0   r   )
__name__
__module____qualname____doc__r   staticmethodr!   r$   r)   r/    r   r   r   r      s/    
  "1r   N)
__future__r   typingr   r   entitiesr   r   
type_hintsr	   r+   r
   __all__r   r   __annotations__r   r8   r   r   <module>r?      s6    # *   #(-!G	> #,1 ,1r   