
##############
OverlayManager
##############

.. js:class:: wv.Overlay.OverlayManager

   The OverlayManager exposes functionality for creating overlays that are layered on top of the 3d scene. More information can be found `here <https://docs.techsoft3d.com/hoops/visualize-web/latest/prog_guide/viewing/scene_attributes/overlays.html>`__\ . An overlay defines a viewport on the screen with an associated camera. These overlays are useful for creating axis triads, navigational cubes, or similar elements. The overlays are not designed to create multiple views of a model. Therefore, inserting large amounts of geometry into overlays isn't recommended. Add directly additional views from the webviewer instead.
   
   
   Index
   =====
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~wv.Overlay.OverlayManager.addNodes`
   * :js:meth:`~wv.Overlay.OverlayManager.destroy`
   * :js:meth:`~wv.Overlay.OverlayManager.getViewportAnchor`
   * :js:meth:`~wv.Overlay.OverlayManager.getViewportPixelOffsetInCanvas`
   * :js:meth:`~wv.Overlay.OverlayManager.getViewportPixelPosition`
   * :js:meth:`~wv.Overlay.OverlayManager.getViewportPixelSize`
   * :js:meth:`~wv.Overlay.OverlayManager.maxIndex`
   * :js:meth:`~wv.Overlay.OverlayManager.setCamera`
   * :js:meth:`~wv.Overlay.OverlayManager.setViewport`
   * :js:meth:`~wv.Overlay.OverlayManager.setVisibility`
   
   



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

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


.. js:method:: wv.Overlay.OverlayManager.addNodes

      .. rst-class:: sig-pretty-signature
      
         | addNodes(**index**\ : *number*\ , **nodes**\ : *number*\ []): *Promise*
      
      Adds nodes into the overlay at the given index. They will no longer be rendered in the main window or any other overlay. This method should not be called before the model structure ready callback has been triggered.
      
      **Parameters**
      
      
         **index**\ : *number*
      
      
            the overlay index to add nodes into.
      
      
         **nodes**\ : *number*\ []
      
      
            the nodes to add into the overlay.
      
      
      
      **Returns**\ : *Promise*
      



.. js:method:: wv.Overlay.OverlayManager.destroy

      .. rst-class:: sig-pretty-signature
      
         | destroy(**index**\ : *number*\ ): *Promise*
      
      Removes an overlay from the system. All nodes that have been assigned to this overlay will be returned to the default view.
      
      **Parameters**
      
      
         **index**\ : *number*
      
      
            the index of the overlay to destroy.
      
      
      
      **Returns**\ : *Promise*
      



.. js:method:: wv.Overlay.OverlayManager.getViewportAnchor

      .. rst-class:: sig-pretty-signature
      
         | getViewportAnchor(**index**\ : *number*\ ): (*None* | :js:data:`OverlayAnchor <wv.OverlayAnchor>`\ )
      
      Get the anchor point of the viewport with the supplied index, or ``null`` if none has been set.
      
      **Parameters**
      
      
         **index**\ : *number*
      
      
            The index of the overlay to get the anchor of.
      
      
      
      **Returns**\ : (*None* \| :js:data:`OverlayAnchor <wv.OverlayAnchor>`\ )
      



.. js:method:: wv.Overlay.OverlayManager.getViewportPixelOffsetInCanvas

      .. rst-class:: sig-pretty-signature
      
         | getViewportPixelOffsetInCanvas(**index**\ : *number*\ ): (*None* | :js:class:`Point2 <wv.Point2>`\ )
      
      Gets the calculated position of the upper-left corner of the viewport with the supplied index, or ``null`` if none has been set.
      
      **Parameters**
      
      
         **index**\ : *number*
      
      
            The index of the overlay to get the offset of
      
      
      
      **Returns**\ : (*None* \| :js:class:`Point2 <wv.Point2>`\ )
      



.. js:method:: wv.Overlay.OverlayManager.getViewportPixelPosition

      .. rst-class:: sig-pretty-signature
      
         | getViewportPixelPosition(**index**\ : *number*\ ): (*None* | :js:class:`Point2 <wv.Point2>`\ )
      
      Gets position in pixels of the viewport with the supplied index, or ``null`` if none has been set. Note: This does not take the anchor point into account
      
      **Parameters**
      
      
         **index**\ : *number*
      
      
            The index of the overlay to get the position of.
      
      
      
      **Returns**\ : (*None* \| :js:class:`Point2 <wv.Point2>`\ )
      



.. js:method:: wv.Overlay.OverlayManager.getViewportPixelSize

      .. rst-class:: sig-pretty-signature
      
         | getViewportPixelSize(**index**\ : *number*\ ): (*None* | :js:class:`Point2 <wv.Point2>`\ )
      
      Gets size in pixels of the viewport with the supplied index, or ``null`` if none has been set.
      
      **Parameters**
      
      
         **index**\ : *number*
      
      
            The index of the overlay to get the size of.
      
      
      
      **Returns**\ : (*None* \| :js:class:`Point2 <wv.Point2>`\ )
      



.. js:method:: wv.Overlay.OverlayManager.maxIndex

      .. rst-class:: sig-pretty-signature
      
         | maxIndex(): *number*
      
      Gets the maximum index value that can be used for indexing overlays.
      
      **Returns**\ : *number*
      
      
         the maximum index value.
      
      



.. js:method:: wv.Overlay.OverlayManager.setCamera

      .. rst-class:: sig-pretty-signature
      
         | setCamera(**index**\ : *number*\ , **camera**\ : :js:class:`Camera <wv.Camera>`\ ): *Promise*
      
      Sets the camera for the given index.
      
      **Parameters**
      
      
         **index**\ : *number*
      
         **camera**\ : :js:class:`Camera <wv.Camera>`
      
      
      **Returns**\ : *Promise*
      



.. js:method:: wv.Overlay.OverlayManager.setViewport

      .. rst-class:: sig-pretty-signature
      
         | setViewport(**index**\ : *number*\ , **anchor**\ : :js:data:`OverlayAnchor <wv.OverlayAnchor>`\ , **x**\ : *number*\ , **xUnit**\ : :js:data:`OverlayUnit <wv.OverlayUnit>`\ , **y**\ : *number*\ , **yUnit**\ : :js:data:`OverlayUnit <wv.OverlayUnit>`\ , **width**\ : *number*\ , **widthUnit**\ : :js:data:`OverlayUnit <wv.OverlayUnit>`\ , **height**\ : *number*\ , **heightUnit**\ : :js:data:`OverlayUnit <wv.OverlayUnit>`\ ): *Promise*
      
      Creates an overlay or updates an existing one.
      
      **Parameters**
      
      
         **index**\ : *number*
      
      
            the index of the overlay. This value may be any number between 1 and maxIndex(). If No overlay exists for this index one will be created.
      
      
         **anchor**\ : :js:data:`OverlayAnchor <wv.OverlayAnchor>`
      
      
            the anchor point for the viewport.
      
      
         **x**\ : *number*
      
      
            the x value of the viewport location.
      
      
         **xUnit**\ : :js:data:`OverlayUnit <wv.OverlayUnit>`
      
      
            the unit type of the x parameter.
      
      
         **y**\ : *number*
      
      
            the y value of the viewport location.
      
      
         **yUnit**\ : :js:data:`OverlayUnit <wv.OverlayUnit>`
      
      
            the unit type of the y parameter.
      
      
         **width**\ : *number*
      
      
            the width of the viewport.
      
      
         **widthUnit**\ : :js:data:`OverlayUnit <wv.OverlayUnit>`
      
      
            the unit type of the width parameter.
      
      
         **height**\ : *number*
      
      
            the height of the viewport.
      
      
         **heightUnit**\ : :js:data:`OverlayUnit <wv.OverlayUnit>`
      
      
            the unit type of the height parameter.
      
      
      
      **Returns**\ : *Promise*
      



.. js:method:: wv.Overlay.OverlayManager.setVisibility

      .. rst-class:: sig-pretty-signature
      
         | setVisibility(**index**\ : *number*\ , **visibility**\ : *boolean*\ ): *Promise*
      
      Sets the visibility state for the given viewport.
      
      **Parameters**
      
      
         **index**\ : *number*
      
      
            the overlay index.
      
      
         **visibility**\ : *boolean*
      
      
            boolean value indicating whether the overlay should be rendered.
      
      
      
      **Returns**\ : *Promise*
      




