.. role:: ts-api-decorator

#########
AxisTriad
#########

.. container:: ts-api-section

   .. js:class:: AxisTriad

      This class provides an interface to the axis triad which is enabled by default.
      The default functionality orients the camera based on the axis that is clicked.
      This triad 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/communicator/latest/prog_guide/viewing/scene_attributes/axis-triad-and-navcube.html).



.. container:: api-index-section

   .. rubric:: Methods

   .. rst-class:: api-index-list-item api-kind-method api-parent-kind-class

   * :js:meth:`~AxisTriad.disable`
   * :js:meth:`~AxisTriad.enable`
   * :js:meth:`~AxisTriad.getAnchor`
   * :js:meth:`~AxisTriad.getEnabled`
   * :js:meth:`~AxisTriad.getOverlayId`
   * :js:meth:`~AxisTriad.getSelectionAxis`
   * :js:meth:`~AxisTriad.insideOverlay`
   * :js:meth:`~AxisTriad.onClickSelection`
   * :js:meth:`~AxisTriad.setAnchor`
   * :js:meth:`~AxisTriad.setAxisColor`





------------

Methods
=======

.. rst-class:: ts-api-section

disable
-------

.. js:method:: AxisTriad.disable()



   Disables this [[AxisTriad]].

   :returns: A promise that resolves on completion.


   :rtype: Promise <void>

.. rst-class:: ts-api-section

enable
------

.. js:method:: AxisTriad.enable()



   Enables this [[AxisTriad]].

   :returns: A promise that resolves on completion.


   :rtype: Promise <void>

.. rst-class:: ts-api-section

getAnchor
---------

.. js:method:: AxisTriad.getAnchor()



   Gets the anchor position for this [[AxisTriad]].
   Default position is in the lower left corner.

   :returns: The overlay anchor value of the triad.


   :rtype: OverlayAnchor

.. rst-class:: ts-api-section

getEnabled
----------

.. js:method:: AxisTriad.getEnabled()



   Gets the current state of this [[AxisTriad]].

   :returns: ``true`` if enabled and ``false`` otherwise.


   :rtype: boolean

.. rst-class:: ts-api-section

getOverlayId
------------

.. js:method:: AxisTriad.getOverlayId()



   Gets the overlay id. This id should be considered reserved and not be used by client applications.

   :returns: The overlay id used by this [[AxisTriad]].


   :rtype: number

.. rst-class:: ts-api-section

getSelectionAxis
----------------

.. js:method:: AxisTriad.getSelectionAxis( selectionItem)

   :param selectionItem: selection item to check.
   :type selectionItem: null | SelectionItem


   Checks if a selection is part of the axis triad, and return the corresponding axis.

   :returns: Axis if selected, null otherwise.


   :rtype: null | Axis

.. rst-class:: ts-api-section

insideOverlay
-------------

.. js:method:: AxisTriad.insideOverlay( mousePos)

   :param mousePos: None
   :type mousePos: Point2


   Determines whether or not a point is inside the axis triad overlay

   :returns: Boolean indicating whether the provided point is inside the axis triad overlay


   :rtype: boolean

.. rst-class:: ts-api-section

onClickSelection
----------------

.. js:method:: AxisTriad.onClickSelection( selection)

   :param selection: None
   :type selection: null | SelectionItem


   Called when the axis triad is clicked. Realigns the view along the axis selected by ``selection``
   or does nothing if no axis is selected.


   :rtype: Promise <void>

.. rst-class:: ts-api-section

setAnchor
---------

.. js:method:: AxisTriad.setAnchor( anchor)

   :param anchor: The anchor position.
   :type anchor: OverlayAnchor


   Sets the anchor position for this [[AxisTriad]].

   :returns: A promise that resolves on completion.


   :rtype: Promise <void>

.. rst-class:: ts-api-section

setAxisColor
------------

.. js:method:: AxisTriad.setAxisColor( axis, color)

   :param axis: The axis that will change color
   :type axis: Axis
   :param color: The color to set
   :type color: Color


   Sets the color of one axis on this [[AxisTriad]]


   :rtype: Promise <void>

