
################
LayerTreeElement
################

.. js:class:: wvc.LayerTreeElement

   A custom element representing a layer in the layer tree.
   
   This component displays a layer from the model with its visibility state, nodes, and interactive controls. It does not have any dependency on the @ts3d-hoops/web-viewer Model class.
   
   .. rubric:: Examples
   
   
   .. code-block:: html
   
      <hoops-layer-tree-element layerId="1" layerName="Layer 1"></hoops-layer-tree-element>
      <hoops-layer-tree-element layerId="2" layerName="Layer 2" hidden></hoops-layer-tree-element>
   
   .. rubric:: Custom Element
   
   
   ``hoops-layer-tree-element``
   
   .. rubric:: Attributes
   
   
   **layerId**
   
   
      The id of the layer in the model
   
   
   **layerName**
   
   
      The name of the layer
   
   
   **hidden**
   
   
      The visibility state of the layer
   
   
   .. rubric:: Since
   
   
   ``2025.8.0``
   
   
   Index
   =====
   
   .. rubric:: Constructors
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:func:`~wvc.LayerTreeElement.constructor`
   
   .. rubric:: Properties
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:data:`~wvc.LayerTreeElement.expanded`
   * :js:data:`~wvc.LayerTreeElement.hiddenNodes`
   * :js:data:`~wvc.LayerTreeElement.layerId`
   * :js:data:`~wvc.LayerTreeElement.layerName`
   * :js:data:`~wvc.LayerTreeElement.layerNodes`
   * :js:data:`~wvc.LayerTreeElement.nodesChildren`
   * :js:data:`~wvc.LayerTreeElement.selected`
   * :js:data:`~wvc.LayerTreeElement.selectedNodes`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~wvc.LayerTreeElement.clearSelection`
   * :js:meth:`~wvc.LayerTreeElement.select`
   * :js:meth:`~wvc.LayerTreeElement.selectNodes`
   * :js:meth:`~wvc.LayerTreeElement.toggleNodeSelection`
   * :js:meth:`~wvc.LayerTreeElement.toggleSelection`
   * :js:meth:`~wvc.LayerTreeElement.toggleVisibility`
   * :js:meth:`~wvc.LayerTreeElement.updateVisibility`
   
   



.. rst-class:: kind-group kind-constructors

.. rubric:: Constructors
   :class: kind-group-title


.. js:method:: wvc.LayerTreeElement.constructor

      .. rst-class:: sig-pretty-signature
      
         | LayerTreeElement(): :js:class:`LayerTreeElement <wvc.LayerTreeElement>`
      
      **Returns**\ : :js:class:`LayerTreeElement <wvc.LayerTreeElement>`
      



.. rst-class:: kind-group kind-properties

.. rubric:: Properties
   :class: kind-group-title


.. js:data:: wvc.LayerTreeElement.expanded

      .. rst-class:: sig-pretty-signature
      
         | expanded: *boolean*
      
      Whether the node is expanded or not
      



.. js:data:: wvc.LayerTreeElement.hiddenNodes

      .. rst-class:: sig-pretty-signature
      
         | hiddenNodes: *number*\ []
      
      The hidden attribute represent the visibility of the nodes in the viewer. We use the negated visibility since usually boolean attribute default value is false we prefer to add a hidden boolean attribute than to have visible="true" or visible="false" on each layer.
      



.. js:data:: wvc.LayerTreeElement.layerId

      .. rst-class:: sig-pretty-signature
      
         | layerId: *number*
      
      The id of the layer to render.
      



.. js:data:: wvc.LayerTreeElement.layerName

      .. rst-class:: sig-pretty-signature
      
         | layerName: *string*
      
      The name of the layer to render.
      



.. js:data:: wvc.LayerTreeElement.layerNodes

      .. rst-class:: sig-pretty-signature
      
         | layerNodes: *Map*
      
      List of nodes that belong to this layer
      



.. js:data:: wvc.LayerTreeElement.nodesChildren

      .. rst-class:: sig-pretty-signature
      
         | nodesChildren: *Map*
      
      Map of the nodes' children that belong to this layer
      



.. js:data:: wvc.LayerTreeElement.selected

      .. rst-class:: sig-pretty-signature
      
         | selected: *boolean*
      
      Whether the layer is selected or not.
      



.. js:data:: wvc.LayerTreeElement.selectedNodes

      .. rst-class:: sig-pretty-signature
      
         | selectedNodes: *number*\ []
      
      Which nodes are selected.
      



.. rst-class:: kind-group kind-methods

.. rubric:: Methods
   :class: kind-group-title


.. js:method:: wvc.LayerTreeElement.clearSelection

      .. rst-class:: sig-pretty-signature
      
         | clearSelection(): *void*
      
      **Returns**\ : *void*
      



.. js:method:: wvc.LayerTreeElement.select

      .. rst-class:: sig-pretty-signature
      
         | select(**selected**\ : *boolean*\ ): *void*
      
      **Parameters**
      
      
         **selected**\ : *boolean*
      
      
      **Returns**\ : *void*
      



.. js:method:: wvc.LayerTreeElement.selectNodes

      .. rst-class:: sig-pretty-signature
      
         | selectNodes(**nodeIds**\ : *number*\ [], **selected**\ : *boolean*\ ): *void*
      
      **Parameters**
      
      
         **nodeIds**\ : *number*\ []
      
         **selected**\ : *boolean*
      
      
      **Returns**\ : *void*
      



.. js:method:: wvc.LayerTreeElement.toggleNodeSelection

      .. rst-class:: sig-pretty-signature
      
         | toggleNodeSelection(**nodeId**\ : *number*\ ): *void*
      
      **Parameters**
      
      
         **nodeId**\ : *number*
      
      
      **Returns**\ : *void*
      



.. js:method:: wvc.LayerTreeElement.toggleSelection

      .. rst-class:: sig-pretty-signature
      
         | toggleSelection(): *void*
      
      **Returns**\ : *void*
      



.. js:method:: wvc.LayerTreeElement.toggleVisibility

      .. rst-class:: sig-pretty-signature
      
         | toggleVisibility(): *void*
      
      **Returns**\ : *void*
      



.. js:method:: wvc.LayerTreeElement.updateVisibility

      .. rst-class:: sig-pretty-signature
      
         | updateVisibility(**shownBodyIds**\ : *number*\ [], **hiddenBodyIds**\ : *number*\ []): *void*
      
      **Parameters**
      
      
         **shownBodyIds**\ : *number*\ []
      
         **hiddenBodyIds**\ : *number*\ []
      
      
      **Returns**\ : *void*
      




