
    pj                     &    d dl mZ  G d de      Zy)    )LinkProtocolc                   D    e Zd ZdZed        Zd Zd Zd Zd Z	d Z
d Zy	)
vtkWebProtocolz)Base class for any VTK Web based protocolc                 $    | j                  d      S )Napp)getSharedObject)selfs    Y/DATA/.local/lib/python3.12/site-packages/trame_vtk/modules/vtk/protocols/web_protocol.pyr   zvtkWebProtocol.app   s    ##E**    c                 v    t        |      }|dk  ry| j                  j                         j                  |      S )z{
        Maps global-id for a vtkObject to the vtkObject instance. May return None if the
        id is not valid.
        r   N)intr   GetObjectIdMapGetVTKObjectr	   ids     r
   map_id_to_objectzvtkWebProtocol.map_id_to_object   s5    
 W7xx&&(55b99r   c                 T    | j                   j                         j                  |      S )z5
        Return the id for a given vtkObject
        )r   r   GetGlobalIdr	   objs     r
   get_global_idzvtkWebProtocol.get_global_id   s"     xx&&(44S99r   c                 T    | j                   j                         j                  |      S )zf
        Delete the given vtkObject from the object_id_map. Returns true if delete succeeded.
        )r   r   
FreeObjectr   s     r
   free_objectzvtkWebProtocol.free_object   s"     xx&&(33C88r   c                 T    | j                   j                         j                  |      S )z
        Delete the vtkObject corresponding to the given object_id from the object_id_map.
        Returns true if delete succeeded.
        )r   r   FreeObjectByIdr   s     r
   free_object_by_idz vtkWebProtocol.free_object_by_id!   s"    
 xx&&(77;;r   c                     | j                  |      }|s)| j                  j                         j                  d      }|st	        d|z        |S )z
        Returns the view for a given view ID, if vid is None then return the
        current active view.
        :param vid: The view ID
        :type vid: str
        VIEWzno view provided: %s)r   r   r   GetActiveObject	Exception)r	   vidvs      r
   get_viewzvtkWebProtocol.get_view(   sM     !!#&'')99&AA2S899r   c                 X    | j                   j                         j                  d|       y)z<
        Set a vtkRenderWindow to be the active one
        r   N)r   r   SetActiveObject)r	   views     r
   set_active_viewzvtkWebProtocol.set_active_view9   s!     	!11&$?r   N)__name__
__module____qualname____doc__propertyr   r   r   r   r   r$   r(    r   r
   r   r      s6    3+ +::9<"@r   r   N)wslink.websocketr   r   r.   r   r
   <module>r0      s    )9@\ 9@r   