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

.. js:class:: wv.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:`~wv.OperatorManager.clear`
   * :js:meth:`~wv.OperatorManager.get`
   * :js:meth:`~wv.OperatorManager.getOperator`
   * :js:meth:`~wv.OperatorManager.indexOf`
   * :js:meth:`~wv.OperatorManager.injectEvent`
   * :js:meth:`~wv.OperatorManager.peek`
   * :js:meth:`~wv.OperatorManager.pop`
   * :js:meth:`~wv.OperatorManager.push`
   * :js:meth:`~wv.OperatorManager.reactivateOperator`
   * :js:meth:`~wv.OperatorManager.reactivateOperatorStack`
   * :js:meth:`~wv.OperatorManager.registerCustomOperator`
   * :js:meth:`~wv.OperatorManager.remove`
   * :js:meth:`~wv.OperatorManager.replaceOperator`
   * :js:meth:`~wv.OperatorManager.set`
   * :js:meth:`~wv.OperatorManager.size`
   * :js:meth:`~wv.OperatorManager.unregisterCustomOperator`
   
   



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

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


.. js:method:: wv.OperatorManager.clear

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



.. js:method:: wv.OperatorManager.get

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



.. js:method:: wv.OperatorManager.getOperator

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



.. js:method:: wv.OperatorManager.indexOf

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



.. js:method:: wv.OperatorManager.injectEvent

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



.. js:method:: wv.OperatorManager.peek

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



.. js:method:: wv.OperatorManager.pop

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



.. js:method:: wv.OperatorManager.push

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



.. js:method:: wv.OperatorManager.reactivateOperator

      .. rst-class:: sig-pretty-signature
      
         | reactivateOperator(**operatorId**\ : :js:data:`OperatorId <wv.OperatorId>`\ ): *Promise*
      
      **Parameters**
      
      
         **operatorId**\ : :js:data:`OperatorId <wv.OperatorId>`
      
      
      **Returns**\ : *Promise*
      



.. js:method:: wv.OperatorManager.reactivateOperatorStack

      .. rst-class:: sig-pretty-signature
      
         | reactivateOperatorStack(): *Promise*
      
      **Returns**\ : *Promise*
      



.. js:method:: wv.OperatorManager.registerCustomOperator

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



.. js:method:: wv.OperatorManager.remove

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



.. js:method:: wv.OperatorManager.replaceOperator

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



.. js:method:: wv.OperatorManager.set

      .. rst-class:: sig-pretty-signature
      
         | set(**operatorId**\ : :js:data:`OperatorId <wv.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 <wv.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:: wv.OperatorManager.size

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



.. js:method:: wv.OperatorManager.unregisterCustomOperator

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




