.. role:: ts-api-decorator

###############
OperatorManager
###############

.. container:: ts-api-section

   .. js:class:: OperatorManager

      Main interface into the Operator functionality of the viewer.
      The OperatorManager manages a number of operators in a stack and allows the user to register and unregister new operators.



.. container:: api-index-section

   .. rubric:: Methods

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

   * :js:meth:`~OperatorManager.clear`
   * :js:meth:`~OperatorManager.getOperator`
   * :js:meth:`~OperatorManager.indexOf`
   * :js:meth:`~OperatorManager.injectEvent`
   * :js:meth:`~OperatorManager.peek`
   * :js:meth:`~OperatorManager.pop`
   * :js:meth:`~OperatorManager.push`
   * :js:meth:`~OperatorManager.registerCustomOperator`
   * :js:meth:`~OperatorManager.remove`
   * :js:meth:`~OperatorManager.replaceOperator`
   * :js:meth:`~OperatorManager.set`
   * :js:meth:`~OperatorManager.size`
   * :js:meth:`~OperatorManager.unregisterCustomOperator`





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

Methods
=======

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

clear
-----

.. js:method:: OperatorManager.clear()



   Removes all operators from the stack


   :rtype: void

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

getOperator
-----------

.. js:method:: OperatorManager.getOperator( id)

   :param id: None
   :type id: Navigate




   :returns: Operator reference


   :rtype: CameraNavigationOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: Orbit


   :rtype: CameraOrbitOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: Pan


   :rtype: CameraPanOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: Zoom


   :rtype: CameraZoomOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: WindowZoom


   :rtype: CameraWindowZoomOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: Walk


   :rtype: CameraKeyboardWalkOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: KeyboardWalk


   :rtype: CameraKeyboardWalkOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: WalkMode


   :rtype: CameraWalkModeOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: Turntable


   :rtype: CameraTurntableOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: Select


   :rtype: SelectionOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: AreaSelect


   :rtype: AreaSelectionOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: RayDrillSelect


   :rtype: RayDrillSelectionOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: RedlineCircle


   :rtype: RedlineCircleOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: RedlineText


   :rtype: RedlineTextOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: RedlineRectangle


   :rtype: RedlineRectangleOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: RedlinePolyline


   :rtype: RedlinePolylineOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: MeasureEdgeLength


   :rtype: MeasureEdgeLengthOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: MeasureFaceFaceDistance


   :rtype: MeasureFaceFaceDistanceOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: MeasurePointPointDistance


   :rtype: MeasurePointPointDistanceOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: MeasureFaceFaceAngle


   :rtype: MeasureFaceFaceAngleOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: MeasurePolylineDistance


   :rtype: MeasurePolylineDistanceOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: MeasurePolygonArea


   :rtype: MeasurePolygonAreaOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: Note


   :rtype: NoteOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: Cutting


   :rtype: CuttingPlaneOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: Handle


   :rtype: HandleOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: NavCube


   :rtype: NavCubeOperator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: BuiltInOperatorId


   :rtype: Operator

.. js:method:: OperatorManager.getOperator( id)
   :noindex:

   :param id: None
   :type id: OperatorId


   :rtype: null | Operator

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

indexOf
-------

.. js:method:: OperatorManager.indexOf( operatorId)

   :param operatorId: None
   :type operatorId: OperatorId


   Returns the index of an operator on the stack

   :returns: operator index or -1 if not found


   :rtype: number

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

injectEvent
-----------

.. js:method:: OperatorManager.injectEvent( event, eventType)

   :param event: None
   :type event: MouseInputEvent | MouseWheelInputEvent | KeyInputEvent | TouchInputEvent
   :param eventType: None
   :type eventType: EventType


   :rtype: Promise <void>

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

peek
----

.. js:method:: OperatorManager.peek()





   :returns: the operator id at the top of the stack


   :rtype: OperatorId

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

pop
---

.. js:method:: OperatorManager.pop()



   Removes an operator from the top of the stack

   :returns: the operator id


   :rtype: undefined | OperatorId

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

push
----

.. js:method:: OperatorManager.push( operatorId)

   :param operatorId: id of the operator to add to the stack
   :type operatorId: OperatorId


   Adds an operator on the stack if it's not already on the stack

   :returns: boolean indicating success or failure


   :rtype: boolean

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

registerCustomOperator
----------------------

.. js:method:: OperatorManager.registerCustomOperator( operator)

   :param operator: None
   :type operator: Operator


   Registers a custom operator

   :returns: operatorId


   :rtype: OperatorId

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

remove
------

.. js:method:: OperatorManager.remove( operatorId)

   :param operatorId: id of the operator to remove from the stack
   :type operatorId: OperatorId


   Removes an operator from the stack


   :rtype: void

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

replaceOperator
---------------

.. js:method:: OperatorManager.replaceOperator( previousOperatorId, newOperatorId)

   :param previousOperatorId: operator id for the operator to be replaced.
   :type previousOperatorId: OperatorId
   :param newOperatorId: operator id for the new operator.
   :type newOperatorId: OperatorId


   Replaces the operator that the specified id refers to. Returns a boolean indicating success or failure.


   :rtype: boolean

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

set
---

.. js:method:: OperatorManager.set( operatorId, position)

   :param operatorId: id of the operator to add to the stack
   :type operatorId: OperatorId
   :param position: position on the stack to assign
   :type position: number


   Sets a position on the stack to an operator if it's not already on the stack
   If there is already an operator in that position, it is replaced.

   :returns: boolean indicating success or failure


   :rtype: boolean

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

size
----

.. js:method:: OperatorManager.size()





   :returns: the operator stack size


   :rtype: number

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

unregisterCustomOperator
------------------------

.. js:method:: OperatorManager.unregisterCustomOperator( operatorId)

   :param operatorId: None
   :type operatorId: OperatorId


   Removes a custom operator from the registered operator list.


   :rtype: void

