Ë
    ¯·g‰  ã                   óª  — d Z 	 ddlZddlZddlZddlmZ ddlm	Z	 ddl
mZ d„ Zd	„ Z ej                  ej                  e«        ej                  ej                  e«        ej                  ej                   e«        ej                  ej"                  e«        ej                  ej$                  e«        ej                  ej&                  e«        ej                  ej(                  e«        ej                  ej*                  e«        ej                  ej,                  e«        ej                  ej.                  e«        ej                  ej0                  e«        ej                  ej2                  e«        ej                  ej4                  e«        ej                  ej6                  e«        ej                  ej8                  e«        ej                  ej:                  e«        ej                  ej<                  e«        ej                  ej>                  e«        ej                  ej@                  e«        ej                  ejB                  e«        ej                  ejD                  e«        ej                  ejF                  e«        ej                  ejH                  e«       y# e$ r	  ed«      ‚w xY w)
a#  This module generates support for pickling vtkDataObjects from python.
It needs to be imported specifically in order to work:

>>> import vtkmodules.util.pickle_support

Once imported however, the pickling of data objects is very straighforward. Here is an
example using poly data:

>>> sphereSrc = vtkSphereSource()
>>> sphereSrc.Update()
>>> pickled = pickle.dumps(sphereSrc.GetOutput())
>>> unpickled = pickle.loads(pickled)
>>> print(unpickled)
*description of sphere data set*

The underlying serialization of the vtkDatObjects is based on the marshaling capabilities
found in vtkCommunicator. Importing this module adds entries for the most common data
objects in the global dispatch table used by pickle. NumPy is required as well since the
-serialized data object gets pickled as a numpy array.
é    NznThis module depends on the pickle, copyreg, and numpy modules. Please make sure that it is installed properly.é   )ÚvtkCommunicator)ÚvtkCharArray)ÚvtkCommonDataModelc                 óˆ  — d| j                  «       vsd| j                  «       vrt        d«      ‚d}d}	 t        t        | d   «      }| d   } |«       }t        «       }|j                  |t        |«      j                  d«       t        j                  ||«      dk(  rt        d	«      ‚|S #  t	        dt
        z   dz   «      ‚xY w)
zÛTakes a state dictionary with entries:
      - Type : a string with the class name for the data object
      - Serialized : a numpy array with the serialized data object

      and transforms it into a data object.
    ÚTypeÚ
SerializedzNState dictionary passed to unpickle does not have Type and/or Serialized keys.NzCould not find type z in vtkCommonDataModel moduleé   r   zMarshaling data object failed)ÚkeysÚRuntimeErrorÚgetattrr   Ú	TypeErrorÚtype_stringr   ÚSetVoidArrayÚ
memoryviewÚnbytesr   ÚUnMarshalDataObject)ÚstateÚnew_data_objectÚDataSetClassÚserialized_dataÚ
char_arrays        ú>lib/python3.12/site-packages/vtkmodules/util/pickle_support.pyÚunserialize_VTK_data_objectr       sÒ   € ð 	�e—j‘j“lÑ"¨¸E¿J¹J»LÑ(HÜð ó ð 	ð €OØ€Lð`ÜÔ1°5¸±=ÓAˆð ˜LÑ)€OÙ"“n€OÜ“€JØ×Ñ˜O¬Z¸Ó-H×-OÑ-OÐQRÔSÜ×*Ñ*¨:°ÓGÈ1ÒLÜÐ:Ó;Ð;ØÐøð`ÜÐ.´Ñ<Ð?^Ñ^Ó_Ð_ús   µB* Â*Cc                 ó0  — | j                  d«      st        d«      ‚| j                  «       }t        «       }t	        j
                  | |«      dk(  rt        d«      ‚t        |t        j                  |t        j                  |j                  «       «      dœffS )aB  Returns a tuple with a reference to the unpickling function and a state dictionary
    with entires:
      - Type : a string with the class name for the data object
      - Serialized : a numpy array with the serialized data object

      This is exactly the state dictionary that unserialize_VTK_data_object expects.
    ÚvtkDataObjectz3Object passed to pickling should be a vtkDataObjectr   zUnMarshaling data object failed)r   r	   )ÚIsAr   ÚGetClassNamer   r   ÚMarshalDataObjectr   r   ÚnumpyÚ
frombufferÚint8ÚGetNumberOfValues)Údata_objectÚdata_object_typer   s      r   Úserialize_VTK_data_objectr&   :   s�   € ð �?‰?˜?Ô+ÜÐMÓNÐNØ"×/Ñ/Ó1ÐÜ“€JÜ×(Ñ(¨°jÓAÀQÒFÜÐ<Ó=Ð=Ü&Ø#Ü×)Ñ)¨*´e·j±jÀ*×B^ÑB^ÓB`Óañ	dð)fð fð fó    )%Ú__doc__ÚcopyregÚpickler    ÚImportErrorr   ÚvtkParallelCorer   ÚvtkCommonCorer   Ú r   r   r&   Ú
vtkDataSetÚvtkPolyDataÚvtkUnstructuredGridÚvtkImageDataÚvtkRectilinearGridÚvtkStructuredGridÚvtkExplicitStructuredGridÚvtkStructuredPointsÚvtkUniformGridAMRÚvtkOverlappingAMRÚvtkHierarchicalBoxDataSetÚvtkNonOverlappingAMRÚvtkTableÚvtkTreeÚvtkCompositeDataSetÚvtkDataObjectTreeÚvtkMultiBlockDataSetÚvtkPartitionedDataSetÚvtkPartitionedDataSetCollectionÚvtkMultiPieceDataSetÚvtkDirectedGraphÚvtkUndirectedGraphÚvtkMolecule© r'   r   Ú<module>rG      sy  ðñð*3ß!Ó!õ
 .Ý (Ý !òò4fð* €‡�Ð!×,Ñ,Ð.GÔ Hà €‡�Ð!×-Ñ-Ð/HÔ IØ €‡�Ð!×5Ñ5Ð7PÔ Qà €‡�Ð!×.Ñ.Ð0IÔ JØ €‡�Ð!×4Ñ4Ð6OÔ PØ €‡�Ð!×3Ñ3Ð5NÔ OØ €‡�Ð!×;Ñ;Ð=VÔ WØ €‡�Ð!×5Ñ5Ð7PÔ Qà €‡�Ð!×3Ñ3Ð5NÔ OØ €‡�Ð!×3Ñ3Ð5NÔ OØ €‡�Ð!×;Ñ;Ð=VÔ WØ €‡�Ð!×6Ñ6Ð8QÔ Rà €‡�Ð!×*Ñ*Ð,EÔ Fà €‡�Ð!×)Ñ)Ð+DÔ Eà €‡�Ð!×5Ñ5Ð7PÔ QØ €‡�Ð!×3Ñ3Ð5NÔ OØ €‡�Ð!×6Ñ6Ð8QÔ RØ €‡�Ð!×7Ñ7Ð9RÔ SØ €‡�Ð!×AÑAÐC\Ô ]Ø €‡�Ð!×6Ñ6Ð8QÔ Rà €‡�Ð!×2Ñ2Ð4MÔ NØ €‡�Ð!×4Ñ4Ð6OÔ PØ €‡�Ð!×-Ñ-Ð/HÕ Iøði ò 3Ù
ð 2ó 3ð 3ð3ús   „K ËK