.. role:: clio-inherited
   :class: clio-flag clio-flag-inherited


##############
HandleOperator
##############

.. js:class:: Operators.HandleOperator

   Handles are added scene elements that can update the position of your parts through user interaction. Find more information `here <https://docs.techsoft3d.com/hoops/visualize-web/latest/tutorials/additive-manufacturing/handles.html>`_\ .
   
   
   Index
   =====
   
   .. rubric:: Constructors
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:func:`~Operators.HandleOperator.constructor`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~Operators.HandleOperator.addAxisRotationHandle`
   * :js:meth:`~Operators.HandleOperator.addAxisTranslationHandle`
   * :js:meth:`~Operators.HandleOperator.addHandles`
   * :js:meth:`~Operators.HandleOperator.addMapping`
   * :js:meth:`~Operators.HandleOperator.addPlaneTranslationHandle`
   * :js:meth:`~Operators.HandleOperator.addTrackedPoint`
   * :js:meth:`~Operators.HandleOperator.addViewPlaneTranslationHandle`
   * :js:meth:`~Operators.HandleOperator.clearMapping`
   * :js:meth:`~Operators.HandleOperator.clearTrackedPoints`
   * :js:meth:`~Operators.HandleOperator.generateGroupId`
   * :js:meth:`~Operators.HandleOperator.getNodeIds`
   * :js:meth:`~Operators.HandleOperator.getPosition`
   * :js:meth:`~Operators.HandleOperator.getTrackedPoints`
   * :js:meth:`~Operators.HandleOperator.getTranslation`
   * :js:meth:`~Operators.HandleOperator.isEnabled`
   * :js:meth:`~Operators.HandleOperator.removeHandles`
   * :js:meth:`~Operators.HandleOperator.setAxisMeshData`
   * :js:meth:`~Operators.HandleOperator.setHandleSize`
   * :js:meth:`~Operators.HandleOperator.setMapping`
   * :js:meth:`~Operators.HandleOperator.setNodeIds`
   * :js:meth:`~Operators.HandleOperator.setPlaneMeshData`
   * :js:meth:`~Operators.HandleOperator.setRotateMeshData`
   * :js:meth:`~Operators.HandleOperator.setViewPlaneMeshData`
   * :js:meth:`~Operators.HandleOperator.showHandles`
   * :js:meth:`~Operators.HandleOperator.updatePosition`
   
   




Constructors
============

.. js:method:: Operators.HandleOperator.constructor

   .. rst-class:: sig-pretty-signature
   
      | HandleOperator(**viewer**\ : :js:class:`~IWebViewer`\ , **view**\ : :js:class:`~IView`\ ): :js:class:`HandleOperator <Operators.HandleOperator>`
   
   **Parameters**
   
      **viewer**\ : :js:class:`~IWebViewer`
   
      **view**\ : :js:class:`~IView`
   
   
   **Returns**\ : :js:class:`HandleOperator <Operators.HandleOperator>`
   





Methods
=======

.. js:method:: Operators.HandleOperator.addAxisRotationHandle

   .. rst-class:: sig-pretty-signature
   
      | addAxisRotationHandle(**position**\ : :js:class:`~Point3`\ , **axis**\ : :js:class:`~Point3`\ , **color**\ : :js:class:`~Color`\ , **positionNormal**\ : (*None* \| :js:class:`~Point3`\ )?, **groupId**\ : (*None* \| *number*\ )?): *Promise*
   
   Adds a handle that rotates around an axis
   
   **Parameters**
   
      **position**\ : :js:class:`~Point3`
   
         center of the handle.
   
   
      **axis**\ : :js:class:`~Point3`
   
         axis to rotate around
   
   
      **color**\ : :js:class:`~Color`
   
         color of the handle geometry
   
   
      **positionNormal**\ : (*None* \| :js:class:`~Point3`\ ) = null
   
         optional vector to control the orientation of the handle geometry.
   
   
      **groupId**\ : (*None* \| *number*\ ) = null
   
         optional parameter to associate this handle with a group of NodeIds
   
   
   
   **Returns**\ : *Promise*
   



.. js:method:: Operators.HandleOperator.addAxisTranslationHandle

   .. rst-class:: sig-pretty-signature
   
      | addAxisTranslationHandle(**position**\ : :js:class:`~Point3`\ , **axis**\ : :js:class:`~Point3`\ , **color**\ : :js:class:`~Color`\ , **positionNormal**\ : (*None* \| :js:class:`~Point3`\ )?, **groupId**\ : (*None* \| *number*\ )?): *Promise*
   
   Adds a handle that moves along an axis.
   
   **Parameters**
   
      **position**\ : :js:class:`~Point3`
   
         center of the handle.
   
   
      **axis**\ : :js:class:`~Point3`
   
         axis to move along
   
   
      **color**\ : :js:class:`~Color`
   
         color of the handle geometry
   
   
      **positionNormal**\ : (*None* \| :js:class:`~Point3`\ ) = null
   
         optional vector to control the orientation of the handle geometry.
   
   
      **groupId**\ : (*None* \| *number*\ ) = null
   
         optional parameter to associate this handle with a group of NodeIds
   
   
   
   **Returns**\ : *Promise*
   



.. js:method:: Operators.HandleOperator.addHandles

   .. rst-class:: sig-pretty-signature
   
      | addHandles(**nodeIds**\ : *number*\ [], **position**\ : (*None* \| :js:class:`~Point3`\ )?, **groupId**\ : (*None* \| *number*\ )?): *Promise*
   
   Adds all handles into the scene, oriented along the primary axes
   
   **Parameters**
   
      **nodeIds**\ : *number*\ []
   
         corresponding to the parts that will move with the handles
   
   
      **position**\ : (*None* \| :js:class:`~Point3`\ ) = null
   
         world space coordinates the the handle position
   
   
      **groupId**\ : (*None* \| *number*\ ) = null
   
   
   **Returns**\ : *Promise*
   



.. js:method:: Operators.HandleOperator.addMapping

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | addMapping(**button**\ : :js:data:`~Button`\ , **modifier**\ : :js:data:`~KeyModifiers`\ ?): *void*
   
   Adds a button and key modifier mapping for the operator. If no mapping is provided, all combinations are considered valid. All mappings require a mouse button, but a key modifier is optional.
   
   **Parameters**
   
      **button**\ : :js:data:`~Button`
   
      **modifier**\ : :js:data:`~KeyModifiers` = KeyModifiers.None
   
   
   **Returns**\ : *void*
   



.. js:method:: Operators.HandleOperator.addPlaneTranslationHandle

   .. rst-class:: sig-pretty-signature
   
      | addPlaneTranslationHandle(**position**\ : :js:class:`~Point3`\ , **normal**\ : :js:class:`~Point3`\ , **faceColor**\ : :js:class:`~Color`\ , **lineColor**\ : :js:class:`~Color`\ , **positionNormal**\ : (*None* \| :js:class:`~Point3`\ )?, **groupId**\ : (*None* \| *number*\ )?): *Promise*
   
   Adds a handle that restricts movement to a plane.
   
   **Parameters**
   
      **position**\ : :js:class:`~Point3`
   
         center of the handle.
   
   
      **normal**\ : :js:class:`~Point3`
   
         normal of the plane
   
   
      **faceColor**\ : :js:class:`~Color`
   
         face color of the handle geometry
   
   
      **lineColor**\ : :js:class:`~Color`
   
         outline color of the handle geometry
   
   
      **positionNormal**\ : (*None* \| :js:class:`~Point3`\ ) = null
   
         optional vector to control the orientation of the handle geometry.
   
   
      **groupId**\ : (*None* \| *number*\ ) = null
   
         optional parameter to associate this handle with a group of NodeIds
   
   
   
   **Returns**\ : *Promise*
   



.. js:method:: Operators.HandleOperator.addTrackedPoint

   .. rst-class:: sig-pretty-signature
   
      | addTrackedPoint(**point**\ : :js:class:`~Point3`\ ): *number*
   
   Add a point to the tracked points list. When the handle moves, these points will update in world space.
   
   **Parameters**
   
      **point**\ : :js:class:`~Point3`
   
   
   **Returns**\ : *number*
   
      point index
   
   



.. js:method:: Operators.HandleOperator.addViewPlaneTranslationHandle

   .. rst-class:: sig-pretty-signature
   
      | addViewPlaneTranslationHandle(**position**\ : :js:class:`~Point3`\ , **color**\ : :js:class:`~Color`\ , **groupId**\ : (*None* \| *number*\ )?): *Promise*
   
   Adds a handle that restricts movement to the viewplane.
   
   **Parameters**
   
      **position**\ : :js:class:`~Point3`
   
         center of the handle
   
   
      **color**\ : :js:class:`~Color`
   
         geometry color
   
   
      **groupId**\ : (*None* \| *number*\ ) = null
   
         optional parameter to associate this handle with a group of NodeIds
   
   
   
   **Returns**\ : *Promise*
   



.. js:method:: Operators.HandleOperator.clearMapping

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | clearMapping(): *void*
   
   Clears any button and key modifier mappings for the operator.
   
   **Returns**\ : *void*
   



.. js:method:: Operators.HandleOperator.clearTrackedPoints

   .. rst-class:: sig-pretty-signature
   
      | clearTrackedPoints(): *void*
   
   Clear the list of tracked points.
   
   **Returns**\ : *void*
   



.. js:method:: Operators.HandleOperator.generateGroupId

   .. rst-class:: sig-pretty-signature
   
      | generateGroupId(): *number*
   
   This will generate a unique id to associate a group of handles with a group of NodeIds.
   
   **Returns**\ : *number*
   



.. js:method:: Operators.HandleOperator.getNodeIds

   .. rst-class:: sig-pretty-signature
   
      | getNodeIds(**groupId**\ : (*None* \| *number*\ )?): *number*\ []
   
   Gets the NodeIds that the handles in the scene will move.
   
   **Parameters**
   
      **groupId**\ : (*None* \| *number*\ ) = null
   
         optional parameter that specifies if the NodeIds to retrieve are part of a group.
   
   
   
   **Returns**\ : *number*\ []
   



.. js:method:: Operators.HandleOperator.getPosition

   .. rst-class:: sig-pretty-signature
   
      | getPosition(): (*None* \| :js:class:`~Point3`\ )
   
   **Returns**\ : (*None* \| :js:class:`~Point3`\ )
   
      the current handle position or null if not currently active.
   
   



.. js:method:: Operators.HandleOperator.getTrackedPoints

   .. rst-class:: sig-pretty-signature
   
      | getTrackedPoints(): :js:class:`~Point3`\ []
   
   Gets the tracked point list.
   
   **Returns**\ : :js:class:`~Point3`\ []
   



.. js:method:: Operators.HandleOperator.getTranslation

   .. rst-class:: sig-pretty-signature
   
      | getTranslation(): :js:class:`~Point3`
   
   **Returns**\ : :js:class:`~Point3`
   
      the total translation applied to the handles.
   
   



.. js:method:: Operators.HandleOperator.isEnabled

   .. rst-class:: sig-pretty-signature
   
      | isEnabled(): *boolean*
   
   Returns a boolean value indicating if handles are available to be added to the scene If there is an active explode, active measure, or the model is a 2d drawing. this will be false.
   
   **Returns**\ : *boolean*
   



.. js:method:: Operators.HandleOperator.removeHandles

   .. rst-class:: sig-pretty-signature
   
      | removeHandles(): *Promise*
   
   Removes all handles from the scene.
   
   **Returns**\ : *Promise*
   



.. js:method:: Operators.HandleOperator.setAxisMeshData

   .. rst-class:: sig-pretty-signature
   
      | setAxisMeshData(**meshData**\ : :js:class:`~MeshData`\ ): *Promise*
   
   Sets the mesh data for axis handles.
   
   **Parameters**
   
      **meshData**\ : :js:class:`~MeshData`
   
   
   **Returns**\ : *Promise*
   



.. js:method:: Operators.HandleOperator.setHandleSize

   .. rst-class:: sig-pretty-signature
   
      | setHandleSize(**size**\ : *number*\ ): *void*
   
   Takes a scale value to change the handle size with 1 representing the default size
   
   **Parameters**
   
      **size**\ : *number*
   
   
   **Returns**\ : *void*
   



.. js:method:: Operators.HandleOperator.setMapping

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | setMapping(**button**\ : :js:data:`~Button`\ , **modifier**\ : :js:data:`~KeyModifiers`\ ?): *void*
   
   Sets the button and key modifier mapping for the operator.
   
   **Parameters**
   
      **button**\ : :js:data:`~Button`
   
      **modifier**\ : :js:data:`~KeyModifiers` = KeyModifiers.None
   
   
   **Returns**\ : *void*
   



.. js:method:: Operators.HandleOperator.setNodeIds

   .. rst-class:: sig-pretty-signature
   
      | setNodeIds(**nodeIds**\ : *number*\ [], **groupId**\ : (*None* \| *number*\ )?): *void*
   
   Sets the NodeIds that any handles in the scene will move.
   
   **Parameters**
   
      **nodeIds**\ : *number*\ []
   
      **groupId**\ : (*None* \| *number*\ ) = null
   
         optional parameter that associates a group of NodeIds with a group of handles.
   
   
   
   **Returns**\ : *void*
   



.. js:method:: Operators.HandleOperator.setPlaneMeshData

   .. rst-class:: sig-pretty-signature
   
      | setPlaneMeshData(**meshData**\ : :js:class:`~MeshData`\ ): *Promise*
   
   Sets the mesh data for plane handles.
   
   **Parameters**
   
      **meshData**\ : :js:class:`~MeshData`
   
   
   **Returns**\ : *Promise*
   



.. js:method:: Operators.HandleOperator.setRotateMeshData

   .. rst-class:: sig-pretty-signature
   
      | setRotateMeshData(**meshData**\ : :js:class:`~MeshData`\ ): *Promise*
   
   Sets the mesh data for rotation handles.
   
   **Parameters**
   
      **meshData**\ : :js:class:`~MeshData`
   
   
   **Returns**\ : *Promise*
   



.. js:method:: Operators.HandleOperator.setViewPlaneMeshData

   .. rst-class:: sig-pretty-signature
   
      | setViewPlaneMeshData(**meshData**\ : :js:class:`~MeshData`\ ): *Promise*
   
   Sets the mesh data for view plane handles.
   
   **Parameters**
   
      **meshData**\ : :js:class:`~MeshData`
   
   
   **Returns**\ : *Promise*
   



.. js:method:: Operators.HandleOperator.showHandles

   .. rst-class:: sig-pretty-signature
   
      | showHandles(): *void*
   
   Shows any handles that have been added to the scene.
   
   **Returns**\ : *void*
   



.. js:method:: Operators.HandleOperator.updatePosition

   .. rst-class:: sig-pretty-signature
   
      | updatePosition(**translation**\ : :js:class:`~Point3`\ , **rotation**\ : :js:class:`~Matrix`\ , **finalizePosition**\ : *boolean*\ , **groupId**\ : (*None* \| *number*\ )?): *Promise*
   
   Updates the current handle position.
   
   **Parameters**
   
      **translation**\ : :js:class:`~Point3`
   
         additional translation
   
   
      **rotation**\ : :js:class:`~Matrix`
   
         additional rotation
   
   
      **finalizePosition**\ : *boolean*
   
         keep translation and rotation. If true, added translation and rotation will not reset the next time the position is updated.
   
   
      **groupId**\ : (*None* \| *number*\ ) = null
   
   
   **Returns**\ : *Promise*
   





