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

.. 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.
   
   
   Index
   =====
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~OperatorManager.clear`
   * :js:meth:`~OperatorManager.get`
   * :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
=======

.. js:method:: OperatorManager.clear

   .. rst-class:: sig-pretty-signature
   
      | clear(): *void*
   
   Removes all operators from the stack
   
   **Returns**\ : *void*
   



.. js:method:: OperatorManager.get

   .. rst-class:: sig-pretty-signature
   
      | get(**position**\ : *number*\ ): :js:data:`~OperatorId`
   
   **Parameters**
   
      **position**\ : *number*
   
   
   **Returns**\ : :js:data:`~OperatorId`
   
      the operator id at the given position of the stack Will return OperatorId.Invalid if position is out of bounds.
   
   



.. js:method:: OperatorManager.getOperator

   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`Navigate <OperatorId.Navigate>`\ ): :js:class:`CameraNavigationOperator <Operators.Camera.CameraNavigationOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`Navigate <OperatorId.Navigate>`
   
   
   **Returns**\ : :js:class:`CameraNavigationOperator <Operators.Camera.CameraNavigationOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`Orbit <OperatorId.Orbit>`\ ): :js:class:`CameraOrbitOperator <Operators.Camera.CameraOrbitOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`Orbit <OperatorId.Orbit>`
   
   
   **Returns**\ : :js:class:`CameraOrbitOperator <Operators.Camera.CameraOrbitOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`Pan <OperatorId.Pan>`\ ): :js:class:`CameraPanOperator <Operators.Camera.CameraPanOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`Pan <OperatorId.Pan>`
   
   
   **Returns**\ : :js:class:`CameraPanOperator <Operators.Camera.CameraPanOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`Zoom <OperatorId.Zoom>`\ ): :js:class:`CameraZoomOperator <Operators.Camera.CameraZoomOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`Zoom <OperatorId.Zoom>`
   
   
   **Returns**\ : :js:class:`CameraZoomOperator <Operators.Camera.CameraZoomOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`WindowZoom <OperatorId.WindowZoom>`\ ): :js:class:`CameraWindowZoomOperator <Operators.Camera.CameraWindowZoomOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`WindowZoom <OperatorId.WindowZoom>`
   
   
   **Returns**\ : :js:class:`CameraWindowZoomOperator <Operators.Camera.CameraWindowZoomOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`Walk <OperatorId.Walk>`\ ): :js:class:`CameraKeyboardWalkOperator <Operators.Camera.CameraKeyboardWalkOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`Walk <OperatorId.Walk>`
   
   
   **Returns**\ : :js:class:`CameraKeyboardWalkOperator <Operators.Camera.CameraKeyboardWalkOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`KeyboardWalk <OperatorId.KeyboardWalk>`\ ): :js:class:`CameraKeyboardWalkOperator <Operators.Camera.CameraKeyboardWalkOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`KeyboardWalk <OperatorId.KeyboardWalk>`
   
   
   **Returns**\ : :js:class:`CameraKeyboardWalkOperator <Operators.Camera.CameraKeyboardWalkOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`WalkMode <OperatorId.WalkMode>`\ ): :js:class:`CameraWalkModeOperator <Operators.Camera.CameraWalkModeOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`WalkMode <OperatorId.WalkMode>`
   
   
   **Returns**\ : :js:class:`CameraWalkModeOperator <Operators.Camera.CameraWalkModeOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`Turntable <OperatorId.Turntable>`\ ): :js:class:`CameraTurntableOperator <Operators.Camera.CameraTurntableOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`Turntable <OperatorId.Turntable>`
   
   
   **Returns**\ : :js:class:`CameraTurntableOperator <Operators.Camera.CameraTurntableOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`Select <OperatorId.Select>`\ ): :js:class:`SelectionOperator <Operators.SelectionOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`Select <OperatorId.Select>`
   
   
   **Returns**\ : :js:class:`SelectionOperator <Operators.SelectionOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`AreaSelect <OperatorId.AreaSelect>`\ ): :js:class:`AreaSelectionOperator <Operators.AreaSelectionOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`AreaSelect <OperatorId.AreaSelect>`
   
   
   **Returns**\ : :js:class:`AreaSelectionOperator <Operators.AreaSelectionOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`RayDrillSelect <OperatorId.RayDrillSelect>`\ ): :js:class:`RayDrillSelectionOperator <Operators.RayDrillSelectionOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`RayDrillSelect <OperatorId.RayDrillSelect>`
   
   
   **Returns**\ : :js:class:`RayDrillSelectionOperator <Operators.RayDrillSelectionOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`RedlineCircle <OperatorId.RedlineCircle>`\ ): :js:class:`RedlineCircleOperator <Operators.Redline.RedlineCircleOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`RedlineCircle <OperatorId.RedlineCircle>`
   
   
   **Returns**\ : :js:class:`RedlineCircleOperator <Operators.Redline.RedlineCircleOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`RedlineText <OperatorId.RedlineText>`\ ): :js:class:`RedlineTextOperator <Operators.Redline.RedlineTextOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`RedlineText <OperatorId.RedlineText>`
   
   
   **Returns**\ : :js:class:`RedlineTextOperator <Operators.Redline.RedlineTextOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`RedlineRectangle <OperatorId.RedlineRectangle>`\ ): :js:class:`RedlineRectangleOperator <Operators.Redline.RedlineRectangleOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`RedlineRectangle <OperatorId.RedlineRectangle>`
   
   
   **Returns**\ : :js:class:`RedlineRectangleOperator <Operators.Redline.RedlineRectangleOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`RedlinePolyline <OperatorId.RedlinePolyline>`\ ): :js:class:`RedlinePolylineOperator <Operators.Redline.RedlinePolylineOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`RedlinePolyline <OperatorId.RedlinePolyline>`
   
   
   **Returns**\ : :js:class:`RedlinePolylineOperator <Operators.Redline.RedlinePolylineOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`MeasureEdgeLength <OperatorId.MeasureEdgeLength>`\ ): :js:class:`MeasureEdgeLengthOperator <Operators.Measure.MeasureEdgeLengthOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`MeasureEdgeLength <OperatorId.MeasureEdgeLength>`
   
   
   **Returns**\ : :js:class:`MeasureEdgeLengthOperator <Operators.Measure.MeasureEdgeLengthOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`MeasureFaceFaceDistance <OperatorId.MeasureFaceFaceDistance>`\ ): :js:class:`MeasureFaceFaceDistanceOperator <Operators.Measure.MeasureFaceFaceDistanceOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`MeasureFaceFaceDistance <OperatorId.MeasureFaceFaceDistance>`
   
   
   **Returns**\ : :js:class:`MeasureFaceFaceDistanceOperator <Operators.Measure.MeasureFaceFaceDistanceOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`MeasurePointPointDistance <OperatorId.MeasurePointPointDistance>`\ ): :js:class:`MeasurePointPointDistanceOperator <Operators.Measure.MeasurePointPointDistanceOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`MeasurePointPointDistance <OperatorId.MeasurePointPointDistance>`
   
   
   **Returns**\ : :js:class:`MeasurePointPointDistanceOperator <Operators.Measure.MeasurePointPointDistanceOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`MeasureFaceFaceAngle <OperatorId.MeasureFaceFaceAngle>`\ ): :js:class:`MeasureFaceFaceAngleOperator <Operators.Measure.MeasureFaceFaceAngleOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`MeasureFaceFaceAngle <OperatorId.MeasureFaceFaceAngle>`
   
   
   **Returns**\ : :js:class:`MeasureFaceFaceAngleOperator <Operators.Measure.MeasureFaceFaceAngleOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`MeasurePolylineDistance <OperatorId.MeasurePolylineDistance>`\ ): :js:class:`MeasurePolylineDistanceOperator <Operators.Measure.MeasurePolylineDistanceOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`MeasurePolylineDistance <OperatorId.MeasurePolylineDistance>`
   
   
   **Returns**\ : :js:class:`MeasurePolylineDistanceOperator <Operators.Measure.MeasurePolylineDistanceOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`MeasurePolygonArea <OperatorId.MeasurePolygonArea>`\ ): :js:class:`MeasurePolygonAreaOperator <Operators.Measure.MeasurePolygonAreaOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`MeasurePolygonArea <OperatorId.MeasurePolygonArea>`
   
   
   **Returns**\ : :js:class:`MeasurePolygonAreaOperator <Operators.Measure.MeasurePolygonAreaOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`Note <OperatorId.Note>`\ ): :js:class:`NoteOperator <Operators.NoteOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`Note <OperatorId.Note>`
   
   
   **Returns**\ : :js:class:`NoteOperator <Operators.NoteOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`Cutting <OperatorId.Cutting>`\ ): :js:class:`CuttingPlaneOperator <Operators.CuttingPlaneOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`Cutting <OperatorId.Cutting>`
   
   
   **Returns**\ : :js:class:`CuttingPlaneOperator <Operators.CuttingPlaneOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`Handle <OperatorId.Handle>`\ ): :js:class:`HandleOperator <Operators.HandleOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`Handle <OperatorId.Handle>`
   
   
   **Returns**\ : :js:class:`HandleOperator <Operators.HandleOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`NavCube <OperatorId.NavCube>`\ ): :js:class:`NavCubeOperator <Operators.NavCubeOperator>`
   
   **Parameters**
   
      **id**\ : :js:data:`NavCube <OperatorId.NavCube>`
   
   
   **Returns**\ : :js:class:`NavCubeOperator <Operators.NavCubeOperator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`~BuiltInOperatorId`\ ): :js:class:`Operator <Operators.Operator>`
   
   **Parameters**
   
      **id**\ : :js:data:`~BuiltInOperatorId`
   
   
   **Returns**\ : :js:class:`Operator <Operators.Operator>`
   
      Operator reference
   
   
   .. rst-class:: sig-pretty-signature
   
      | getOperator(**id**\ : :js:data:`~OperatorId`\ ): (*None* \| :js:class:`Operator <Operators.Operator>`\ )
   
   **Parameters**
   
      **id**\ : :js:data:`~OperatorId`
   
   
   **Returns**\ : (*None* \| :js:class:`Operator <Operators.Operator>`\ )
   
      Operator reference
   
   



.. js:method:: OperatorManager.indexOf

   .. rst-class:: sig-pretty-signature
   
      | indexOf(**operatorId**\ : :js:data:`~OperatorId`\ ): *number*
   
   Returns the index of an operator on the stack
   
   **Parameters**
   
      **operatorId**\ : :js:data:`~OperatorId`
   
   
   **Returns**\ : *number*
   
      operator index or -1 if not found
   
   



.. js:method:: OperatorManager.injectEvent

   .. rst-class:: sig-pretty-signature
   
      | injectEvent(**event**\ : (:js:class:`KeyInputEvent <Event.KeyInputEvent>` \| :js:class:`MouseInputEvent <Event.MouseInputEvent>` \| :js:class:`MouseWheelInputEvent <Event.MouseWheelInputEvent>` \| :js:class:`TouchInputEvent <Event.TouchInputEvent>`\ ), **eventType**\ : :js:data:`~EventType`\ ): *Promise*
   
   **Parameters**
   
      **event**\ : (:js:class:`KeyInputEvent <Event.KeyInputEvent>` \| :js:class:`MouseInputEvent <Event.MouseInputEvent>` \| :js:class:`MouseWheelInputEvent <Event.MouseWheelInputEvent>` \| :js:class:`TouchInputEvent <Event.TouchInputEvent>`\ )
   
      **eventType**\ : :js:data:`~EventType`
   
   
   **Returns**\ : *Promise*
   



.. js:method:: OperatorManager.peek

   .. rst-class:: sig-pretty-signature
   
      | peek(): :js:data:`~OperatorId`
   
   **Returns**\ : :js:data:`~OperatorId`
   
      the operator id at the top of the stack
   
   



.. js:method:: OperatorManager.pop

   .. rst-class:: sig-pretty-signature
   
      | pop(): (*undefined* \| :js:data:`~OperatorId`\ )
   
   Removes an operator from the top of the stack
   
   **Returns**\ : (*undefined* \| :js:data:`~OperatorId`\ )
   
      the operator id
   
   



.. js:method:: OperatorManager.push

   .. rst-class:: sig-pretty-signature
   
      | push(**operatorId**\ : :js:data:`~OperatorId`\ ): *boolean*
   
   Adds an operator on the stack if it's not already on the stack
   
   **Parameters**
   
      **operatorId**\ : :js:data:`~OperatorId`
   
         id of the operator to add to the stack
   
   
   
   **Returns**\ : *boolean*
   
      boolean indicating success or failure
   
   



.. js:method:: OperatorManager.registerCustomOperator

   .. rst-class:: sig-pretty-signature
   
      | registerCustomOperator(**operator**\ : :js:class:`Operator <Operators.Operator>`\ ): :js:data:`~OperatorId`
   
   Registers a custom operator
   
   **Parameters**
   
      **operator**\ : :js:class:`Operator <Operators.Operator>`
   
   
   **Returns**\ : :js:data:`~OperatorId`
   
      operatorId
   
   



.. js:method:: OperatorManager.remove

   .. rst-class:: sig-pretty-signature
   
      | remove(**operatorId**\ : :js:data:`~OperatorId`\ ): *void*
   
   Removes an operator from the stack
   
   **Parameters**
   
      **operatorId**\ : :js:data:`~OperatorId`
   
         id of the operator to remove from the stack
   
   
   
   **Returns**\ : *void*
   



.. js:method:: OperatorManager.replaceOperator

   .. rst-class:: sig-pretty-signature
   
      | replaceOperator(**previousOperatorId**\ : :js:data:`~OperatorId`\ , **newOperatorId**\ : :js:data:`~OperatorId`\ ): *boolean*
   
   Replaces the operator that the specified id refers to. Returns a boolean indicating success or failure.
   
   **Parameters**
   
      **previousOperatorId**\ : :js:data:`~OperatorId`
   
         operator id for the operator to be replaced.
   
   
      **newOperatorId**\ : :js:data:`~OperatorId`
   
         operator id for the new operator.
   
   
   
   **Returns**\ : *boolean*
   



.. js:method:: OperatorManager.set

   .. rst-class:: sig-pretty-signature
   
      | set(**operatorId**\ : :js:data:`~OperatorId`\ , **position**\ : *number*\ ): *boolean*
   
   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.
   
   **Parameters**
   
      **operatorId**\ : :js:data:`~OperatorId`
   
         id of the operator to add to the stack
   
   
      **position**\ : *number*
   
         position on the stack to assign
   
   
   
   **Returns**\ : *boolean*
   
      boolean indicating success or failure
   
   



.. js:method:: OperatorManager.size

   .. rst-class:: sig-pretty-signature
   
      | size(): *number*
   
   **Returns**\ : *number*
   
      the operator stack size
   
   



.. js:method:: OperatorManager.unregisterCustomOperator

   .. rst-class:: sig-pretty-signature
   
      | unregisterCustomOperator(**operatorId**\ : :js:data:`~OperatorId`\ ): *void*
   
   Removes a custom operator from the registered operator list.
   
   **Parameters**
   
      **operatorId**\ : :js:data:`~OperatorId`
   
   
   **Returns**\ : *void*
   





