
#######
NavCube
#######

.. js:class:: wv.NavCube

   This class provides an interface to the navigational cube which is enabled by default. The default functionality changes the camera's view orientation based on the location the user clicks on the cube. This cube is initialized and associated with an overlay when the view is created. For additional information on overlays please refer to the [[OverlayManager]].
   
   More information can be found `here <https://docs.techsoft3d.com/hoops/visualize-web/latest/prog_guide/viewing/scene_attributes/axis-triad-and-navcube.html>`__\ .
   
   
   Index
   =====
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~wv.NavCube.disable`
   * :js:meth:`~wv.NavCube.enable`
   * :js:meth:`~wv.NavCube.getAnchor`
   * :js:meth:`~wv.NavCube.getEnabled`
   * :js:meth:`~wv.NavCube.getOverlayId`
   * :js:meth:`~wv.NavCube.getPreserveModelUp`
   * :js:meth:`~wv.NavCube.insideOverlay`
   * :js:meth:`~wv.NavCube.onClickSelection`
   * :js:meth:`~wv.NavCube.onMoveSelection`
   * :js:meth:`~wv.NavCube.setAnchor`
   * :js:meth:`~wv.NavCube.setPreserveModelUp`
   
   



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

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


.. js:method:: wv.NavCube.disable

      .. rst-class:: sig-pretty-signature
      
         | disable(): *Promise*
      
      Disables the NavCube.
      
      **Returns**\ : *Promise*
      



.. js:method:: wv.NavCube.enable

      .. rst-class:: sig-pretty-signature
      
         | enable(): *Promise*
      
      Enables the NavCube.
      
      **Returns**\ : *Promise*
      



.. js:method:: wv.NavCube.getAnchor

      .. rst-class:: sig-pretty-signature
      
         | getAnchor(): :js:data:`OverlayAnchor <wv.OverlayAnchor>`
      
      Gets the anchor position for the NavCube. Default position is in the UpperRightCorner, see [[OverlayAnchor]] for more details.
      
      **Returns**\ : :js:data:`OverlayAnchor <wv.OverlayAnchor>`
      



.. js:method:: wv.NavCube.getEnabled

      .. rst-class:: sig-pretty-signature
      
         | getEnabled(): *boolean*
      
      Gets whether the NavCube is currently enabled.
      
      **Returns**\ : *boolean*
      



.. js:method:: wv.NavCube.getOverlayId

      .. rst-class:: sig-pretty-signature
      
         | getOverlayId(): *number*
      
      Gets the associated overlay id.
      
      **Returns**\ : *number*
      



.. js:method:: wv.NavCube.getPreserveModelUp

      .. rst-class:: sig-pretty-signature
      
         | getPreserveModelUp(): *boolean*
      
      Gets the NavCube preserveModelUp state.
      
      **Returns**\ : *boolean*
      
      
         true if model up is preserved, false if camera up is preserved.
      
      



.. js:method:: wv.NavCube.insideOverlay

      .. rst-class:: sig-pretty-signature
      
         | insideOverlay(**mousePos**\ : :js:class:`Point2 <wv.Point2>`\ ): *boolean*
      
      Determines whether or not a point is inside the NavCube overlay.
      
      **Parameters**
      
      
         **mousePos**\ : :js:class:`Point2 <wv.Point2>`
      
      
      **Returns**\ : *boolean*
      
      
         Boolean indicating whether the provided point is inside the NavCube overlay
      
      



.. js:method:: wv.NavCube.onClickSelection

      .. rst-class:: sig-pretty-signature
      
         | onClickSelection(**selection**\ : (*None* | :js:class:`SelectionItem <wv.Selection.SelectionItem>`\ )): *Promise*
      
      Called when the NavCube is clicked. Realigns the view to the side/edge/corner selected by ``selection``\ , or rotates the view 90 degrees if the selection matches the current view orientation, or does nothing if no side is selected.
      
      **Parameters**
      
      
         **selection**\ : (*None* \| :js:class:`SelectionItem <wv.Selection.SelectionItem>`\ )
      
      
      **Returns**\ : *Promise*
      



.. js:method:: wv.NavCube.onMoveSelection

      .. rst-class:: sig-pretty-signature
      
         | onMoveSelection(**selection**\ : (*None* | :js:class:`SelectionItem <wv.Selection.SelectionItem>`\ )): *void*
      
      Called when the NavCube is "moused over". Displays face/edge/corner that will be selected.
      
      **Parameters**
      
      
         **selection**\ : (*None* \| :js:class:`SelectionItem <wv.Selection.SelectionItem>`\ )
      
      
      **Returns**\ : *void*
      



.. js:method:: wv.NavCube.setAnchor

      .. rst-class:: sig-pretty-signature
      
         | setAnchor(**anchor**\ : :js:data:`OverlayAnchor <wv.OverlayAnchor>`\ ): *Promise*
      
      Sets the anchor position for the NavCube.
      
      **Parameters**
      
      
         **anchor**\ : :js:data:`OverlayAnchor <wv.OverlayAnchor>`
      
      
            the anchor position.
      
      
      
      **Returns**\ : *Promise*
      



.. js:method:: wv.NavCube.setPreserveModelUp

      .. rst-class:: sig-pretty-signature
      
         | setPreserveModelUp(**preserve**\ : *boolean*\ ): *void*
      
      Determines if model up or camera up will the preserved when navigating with the NavCube. If model up is preserved, navigation with the NavCube will keep the model upright all the time. If camera up is preserved, navigation with the NavCube will attempt to preserve the current up direction of the camera as much as possible. Defaults to ``true``\ .
      
      **Parameters**
      
      
         **preserve**\ : *boolean*
      
      
            If true, model up is preserved. Otherwise, camera up is preserved.
      
      
      
      **Returns**\ : *void*
      




