
#######################
HoopsContextMenuElement
#######################

.. js:class:: wvc.HoopsContextMenuElement

   Provides a context menu component for 3D model interactions and operations.
   
   This component displays a contextual menu with actions like isolate, zoom, visibility toggles, transparency controls, color setting, and model operations. It integrates with the web viewer and model to provide interactive functionality for selected nodes, layers, or types.
   
   The menu dynamically positions itself to stay within viewport bounds and updates its state based on current selections and model properties.
   
   
   Index
   =====
   
   .. rubric:: Constructors
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:func:`~wvc.HoopsContextMenuElement.constructor`
   
   .. rubric:: Properties
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:data:`~wvc.HoopsContextMenuElement.activeItemId`
   * :js:data:`~wvc.HoopsContextMenuElement.activeLayerName`
   * :js:data:`~wvc.HoopsContextMenuElement.activeType`
   * :js:data:`~wvc.HoopsContextMenuElement.color`
   * :js:data:`~wvc.HoopsContextMenuElement.isolateZoomHelper`
   * :js:data:`~wvc.HoopsContextMenuElement.isUnsettingColor`
   * :js:data:`~wvc.HoopsContextMenuElement.x`
   * :js:data:`~wvc.HoopsContextMenuElement.y`
   * :js:data:`~wvc.HoopsContextMenuElement.position`
   
   .. rubric:: Accessors
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:func:`~wvc.HoopsContextMenuElement.contextMenuModel`
   * :js:func:`~wvc.HoopsContextMenuElement.contextMenuWebViewer`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~wvc.HoopsContextMenuElement.connectedCallback`
   * :js:meth:`~wvc.HoopsContextMenuElement.disconnectedCallback`
   * :js:meth:`~wvc.HoopsContextMenuElement.getContextItemIds`
   * :js:meth:`~wvc.HoopsContextMenuElement.handleServiceUpdate`
   * :js:meth:`~wvc.HoopsContextMenuElement.meshLevelFunc`
   * :js:meth:`~wvc.HoopsContextMenuElement.updated`
   * :js:meth:`~wvc.HoopsContextMenuElement.updateIsUnsettingColor`
   
   



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

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


.. js:method:: wvc.HoopsContextMenuElement.constructor

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



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

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


.. js:data:: wvc.HoopsContextMenuElement.activeItemId

      .. rst-class:: sig-pretty-signature
      
         | activeItemId: (*None* | *number*\ )
      



.. js:data:: wvc.HoopsContextMenuElement.activeLayerName

      .. rst-class:: sig-pretty-signature
      
         | activeLayerName: (*None* | *string*\ )
      



.. js:data:: wvc.HoopsContextMenuElement.activeType

      .. rst-class:: sig-pretty-signature
      
         | activeType: (*None* | *string*\ )
      



.. js:data:: wvc.HoopsContextMenuElement.color

      .. rst-class:: sig-pretty-signature
      
         | color: *string*
      



.. js:data:: wvc.HoopsContextMenuElement.isolateZoomHelper

      .. rst-class:: sig-pretty-signature
      
         | isolateZoomHelper: (*undefined* | *IsolateZoomHelper*\ )
      



.. js:data:: wvc.HoopsContextMenuElement.isUnsettingColor

      .. rst-class:: sig-pretty-signature
      
         | isUnsettingColor: *boolean*
      



.. js:data:: wvc.HoopsContextMenuElement.x

      .. rst-class:: sig-pretty-signature
      
         | x: *number*
      



.. js:data:: wvc.HoopsContextMenuElement.y

      .. rst-class:: sig-pretty-signature
      
         | y: *number*
      



.. js:data:: wvc.HoopsContextMenuElement.position

      .. rst-class:: sig-pretty-signature
      
         | position: (*None* | *Point3*\ )
      



.. rst-class:: kind-group kind-accessors

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


.. js:method:: wvc.HoopsContextMenuElement.contextMenuModel

      .. rst-class:: sig-pretty-signature
      
         | *get* contextMenuModel(): (*undefined* | *IContextMenuModel*\ )
      
      Gets or sets the context menu model interface.
      
      The model provides access to 3D model operations like visibility, color, and node queries. Setting a new model triggers helper recreation and component updates.
      
      **Returns**\ : (*undefined* \| *IContextMenuModel*\ )
      
      
         The current model instance or undefined
      
      
      .. rst-class:: sig-pretty-signature
      
         | *set* contextMenuModel(**model**\ : (*undefined* | *IContextMenuModel*\ )): *void*
      
      Sets the context menu model interface.
      
      **Parameters**
      
      
         **model**\ : (*undefined* \| *IContextMenuModel*\ )
      
      
            The model instance to use for 3D operations
      
      
      
      **Returns**\ : *void*
      
      
      



.. js:method:: wvc.HoopsContextMenuElement.contextMenuWebViewer

      .. rst-class:: sig-pretty-signature
      
         | *get* contextMenuWebViewer(): (*undefined* | *IContextMenuWebViewer*\ )
      
      Gets or sets the web viewer interface for context menu operations.
      
      The web viewer provides access to selection management, operators, and view controls. Setting a new web viewer triggers helper recreation and component updates.
      
      **Returns**\ : (*undefined* \| *IContextMenuWebViewer*\ )
      
      
         The current web viewer instance or undefined
      
      
      .. rst-class:: sig-pretty-signature
      
         | *set* contextMenuWebViewer(**webViewer**\ : (*undefined* | *IContextMenuWebViewer*\ )): *void*
      
      Sets the web viewer interface for context menu operations.
      
      **Parameters**
      
      
         **webViewer**\ : (*undefined* \| *IContextMenuWebViewer*\ )
      
      
            The web viewer instance to use for operations
      
      
      
      **Returns**\ : *void*
      
      
      



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

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


.. js:method:: wvc.HoopsContextMenuElement.connectedCallback

      .. rst-class:: sig-pretty-signature
      
         | connectedCallback(): *void*
      
      Lifecycle callback when component is added to the DOM.
      
      Sets up event listeners for context menu prevention and explode service events.
      
      **Returns**\ : *void*
      
      
      



.. js:method:: wvc.HoopsContextMenuElement.disconnectedCallback

      .. rst-class:: sig-pretty-signature
      
         | disconnectedCallback(): *void*
      
      Lifecycle callback when component is removed from the DOM.
      
      Cleans up event listeners for context menu prevention and explode service events.
      
      **Returns**\ : *void*
      
      
      



.. js:method:: wvc.HoopsContextMenuElement.getContextItemIds

      .. rst-class:: sig-pretty-signature
      
         | getContextItemIds(**includeSelected**\ : *boolean*\ , **includeClicked**\ : *boolean*\ , **includeRoot**\ : *boolean*\ ?): *number*\ []
      
      Retrieves the node IDs that are currently in context for operations.
      
      Collects node IDs from various sources based on the provided parameters: selected items, clicked items, active layer, and active type. This method determines which nodes should be affected by context menu operations.
      
      **Parameters**
      
      
         **includeSelected**\ : *boolean*
      
      
            Whether to include currently selected nodes
      
      
         **includeClicked**\ : *boolean*
      
      
            Whether to include the clicked/active node
      
      
         **includeRoot**\ : *boolean* = true
      
      
            Whether to include root nodes in the results
      
      
      
      **Returns**\ : *number*\ []
      
      
         Array of node IDs that are in context for operations
      
      



.. js:method:: wvc.HoopsContextMenuElement.handleServiceUpdate

      .. rst-class:: sig-pretty-signature
      
         | handleServiceUpdate(): *void*
      
      Handles service update events and triggers component re-render.
      
      **Returns**\ : *void*
      
      
      



.. js:method:: wvc.HoopsContextMenuElement.meshLevelFunc

      .. rst-class:: sig-pretty-signature
      
         | meshLevelFunc(**meshLevel**\ : *number*\ ): *void*
      
      Sets the mesh level for context items.
      
      Updates the level of detail for mesh rendering on the currently selected or context items if menu operations are executable.
      
      **Parameters**
      
      
         **meshLevel**\ : *number*
      
      
            The mesh level to apply (higher = more detailed)
      
      
      
      **Returns**\ : *void*
      
      
      



.. js:method:: wvc.HoopsContextMenuElement.updated

      .. rst-class:: sig-pretty-signature
      
         | updated(**_changedProperties**\ : *Map*\ ): *void*
      
      Handles component updates and positions the menu within viewport bounds.
      
      Automatically repositions the menu if it would extend beyond window boundaries and updates the color state based on current context.
      
      **Parameters**
      
      
         **_changedProperties**\ : *Map*
      
      
            Map of changed properties (unused)
      
      
      
      **Returns**\ : *void*
      
      
      



.. js:method:: wvc.HoopsContextMenuElement.updateIsUnsettingColor

      .. rst-class:: sig-pretty-signature
      
         | updateIsUnsettingColor(): *Promise*
      
      Updates the color operation state based on current context items.
      
      Determines whether the color action should be "Set Color" or "Unset Color" based on whether the selected items already have the current color applied.
      
      **Returns**\ : *Promise*
      
      
      




