§
    é&VfT  ã                   óª   — d 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
        d¬¦  «         G d	„ d
¦  «        ¦   «         Zd„ Zd„ Zd„ Z	 	 dd„Zd„ ZdS )z+Internal information about the mesh plugin.é    N)ÚAny)Úsummary_pb2)Úplugin_data_pb2ÚmeshT)Úfrozenc                   óF   — e Zd ZU dZeed<   ej        j        ed<   eed<   dS )Ú
MeshTensoraˆ  A mesh tensor.

    Attributes:
      data: Tensor of shape `[dim_1, ..., dim_n, 3]` representing the mesh data
        of one of the following:
          - 3D coordinates of vertices
          - Indices of vertices within each triangle
          - Colors for each vertex
      content_type: Type of the mesh plugin data content.
      data_type: Data type of the elements in the tensor.
    ÚdataÚcontent_typeÚ	data_typeN)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__annotations__r   ÚMeshPluginDataÚContentType© ó    ú^/var/www/html/software/conda/lib/python3.11/site-packages/tensorboard/plugins/mesh/metadata.pyr	   r	      s@   € € € € € € ð
ð 
ð €I€IIØ!Ô0Ô<Ð<Ð<Ñ<Ø€N€NN€N€Nr   r	   c                 ól   — d}| D ].}|t           j        j        k    rt          d¦  «        ‚|d|z  z  }Œ/|S )zýCreates bitmask for all existing components of the summary.

    Args:
      content_type: list of plugin_data_pb2.MeshPluginData.ContentType,
        representing all components related to the summary.
    Returns: bitmask based on passed tensors.
    r   z.Cannot include UNDEFINED content type in mask.é   )r   r   Ú	UNDEFINEDÚ
ValueError)Úcontent_typesÚ
componentsr   s      r   Úget_components_bitmaskr   2   sO   € ð €JØ%ð 6ð 6ˆØ?Ô9ÔCÒCÐCÝÐMÑNÔNÐNØ 1¨Ñ#4Ñ5ˆ
ˆ
ØÐr   c                  ó   — t           S )z%Returns current verions of the proto.)Ú_PROTO_VERSIONr   r   r   Úget_current_versionr    B   s   € åÐr   c                 óT   — | ›dt           j        j                             |¦  «        ›S )zKReturns a unique instance name for a given summary related to the
    mesh.Ú_)r   r   r   ÚName)Únamer   s     r   Úget_instance_namer%   G   s/   € ð 	ˆˆÝÔ&Ô2×7Ò7¸ÑEÔEÐEðð r   c                 óP  — t          |¦  «        dk    rt          dt          |¦  «        z  ¦  «        ‚t          j        t          ¦   «         | ||||¬¦  «        }|                     ¦   «         }t          j        ||t          j         	                    t          |¬¦  «        ¬¦  «        S )a°  Creates summary metadata which defined at MeshPluginData proto.

    Arguments:
      name: Original merged (summaries of different types) summary name.
      display_name: The display name used in TensorBoard.
      content_type: Value from MeshPluginData.ContentType enum describing data.
      components: Bitmask representing present parts (vertices, colors, etc.) that
        belong to the summary.
      shape: list of dimensions sizes of the tensor.
      description: The description to show in TensorBoard.
      json_config: A string, JSON-serialized dictionary of ThreeJS classes
        configuration.

    Returns:
      A `summary_pb2.SummaryMetadata` protobuf object.
    é   z2Tensor shape should be of shape BxNx3, but got %s.)Úversionr$   r   r   ÚshapeÚjson_config)Úplugin_nameÚcontent)Údisplay_nameÚsummary_descriptionÚplugin_data)Úlenr   Ústrr   r   r    ÚSerializeToStringr   ÚSummaryMetadataÚ
PluginDataÚPLUGIN_NAME)	r$   r-   r   r   r)   Údescriptionr*   Úmesh_plugin_datar,   s	            r   Úcreate_summary_metadatar8   P   s¸   € õ6 ˆ5z„zQ‚€ÝØ@Å3ÀuÁ:Ä:ÑMñ
ô 
ð 	
õ 'Ô5Ý#Ñ%Ô%ØØ!ØØØðñ ô Ðð ×0Ò0Ñ2Ô2€GÝÔ&Ø!Ø'ÝÔ/×:Ò:Ý#¨Wð ;ñ 
ô 
ðñ ô ð r   c                 ó*  — t          | t          ¦  «        st          d¦  «        ‚t          j                             | ¦  «        }|j        dk    rDt          t          j        j        t          j        j	        t          j        j
        g¦  «        |_        |S )a"  Parse summary metadata to a Python object.

    Arguments:
      content: The `content` field of a `SummaryMetadata` proto
        corresponding to the mesh plugin.

    Returns:
      A `MeshPluginData` protobuf object.
    Raises: Error if the version of the plugin is not supported.
    zContent type must be bytes.r   )Ú
isinstanceÚbytesÚ	TypeErrorr   r   Ú
FromStringr   r   ÚVERTEXÚFACEÚCOLOR)r,   Úresults     r   Úparse_plugin_metadatarB      s‚   € õ guÑ%Ô%ð 7ÝÐ5Ñ6Ô6Ð6ÝÔ+×6Ò6°wÑ?Ô?€FàÔ˜AÒÐÝ2åÔ.Ô5ÝÔ.Ô3ÝÔ.Ô4ðñ
ô 
ˆÔð €Mr   )NN)r   ÚdataclassesÚtypingr   Útensorboard.compat.protor   Útensorboard.plugins.meshr   r5   r   Ú	dataclassr	   r   r    r%   r8   rB   r   r   r   ú<module>rH      s  ðð 2Ð 1à Ð Ð Ð à Ð Ð Ð Ð Ð à 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø 4Ð 4Ð 4Ð 4Ð 4Ð 4à€ð €ð €Ô˜dÐ#Ñ#Ô#ðð ð ð ð ñ ô ñ $Ô#ðð$ð ð ð ð ð ð
ð ð ð Øð.ð .ð .ð .ðbð ð ð ð r   