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


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

.. js:class:: wv.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:`~wv.Operators.HandleOperator.constructor`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~wv.Operators.HandleOperator.addAxisRotationHandle`
   * :js:meth:`~wv.Operators.HandleOperator.addAxisTranslationHandle`
   * :js:meth:`~wv.Operators.HandleOperator.addHandles`
   * :js:meth:`~wv.Operators.HandleOperator.addMapping`
   * :js:meth:`~wv.Operators.HandleOperator.addPlaneTranslationHandle`
   * :js:meth:`~wv.Operators.HandleOperator.addTrackedPoint`
   * :js:meth:`~wv.Operators.HandleOperator.addViewPlaneTranslationHandle`
   * :js:meth:`~wv.Operators.HandleOperator.clearMapping`
   * :js:meth:`~wv.Operators.HandleOperator.clearTrackedPoints`
   * :js:meth:`~wv.Operators.HandleOperator.generateGroupId`
   * :js:meth:`~wv.Operators.HandleOperator.getNodeIds`
   * :js:meth:`~wv.Operators.HandleOperator.getPosition`
   * :js:meth:`~wv.Operators.HandleOperator.getTrackedPoints`
   * :js:meth:`~wv.Operators.HandleOperator.getTranslation`
   * :js:meth:`~wv.Operators.HandleOperator.isEnabled`
   * :js:meth:`~wv.Operators.HandleOperator.removeHandles`
   * :js:meth:`~wv.Operators.HandleOperator.setAxisMeshData`
   * :js:meth:`~wv.Operators.HandleOperator.setHandleSize`
   * :js:meth:`~wv.Operators.HandleOperator.setMapping`
   * :js:meth:`~wv.Operators.HandleOperator.setNodeIds`
   * :js:meth:`~wv.Operators.HandleOperator.setPlaneMeshData`
   * :js:meth:`~wv.Operators.HandleOperator.setRotateMeshData`
   * :js:meth:`~wv.Operators.HandleOperator.setViewPlaneMeshData`
   * :js:meth:`~wv.Operators.HandleOperator.showHandles`
   * :js:meth:`~wv.Operators.HandleOperator.updatePosition`
   
   



.. rst-class:: kind-group kind-constructors

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


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

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



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

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


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

      .. rst-class:: sig-pretty-signature
      
         | addAxisRotationHandle(**position**\ : :js:class:`Point3 <wv.Point3>`\ , **axis**\ : :js:class:`Point3 <wv.Point3>`\ , **color**\ : :js:class:`Color <wv.Color>`\ , **positionNormal**\ : (*None* | :js:class:`Point3 <wv.Point3>`\ )?, **groupId**\ : (*None* | *number*\ )?): *Promise*
      
      Adds a handle that rotates around an axis
      
      **Parameters**
      
      
         **position**\ : :js:class:`Point3 <wv.Point3>`
      
      
            center of the handle.
      
      
         **axis**\ : :js:class:`Point3 <wv.Point3>`
      
      
            axis to rotate around
      
      
         **color**\ : :js:class:`Color <wv.Color>`
      
      
            color of the handle geometry
      
      
         **positionNormal**\ : (*None* \| :js:class:`Point3 <wv.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:: wv.Operators.HandleOperator.addAxisTranslationHandle

      .. rst-class:: sig-pretty-signature
      
         | addAxisTranslationHandle(**position**\ : :js:class:`Point3 <wv.Point3>`\ , **axis**\ : :js:class:`Point3 <wv.Point3>`\ , **color**\ : :js:class:`Color <wv.Color>`\ , **positionNormal**\ : (*None* | :js:class:`Point3 <wv.Point3>`\ )?, **groupId**\ : (*None* | *number*\ )?): *Promise*
      
      Adds a handle that moves along an axis.
      
      **Parameters**
      
      
         **position**\ : :js:class:`Point3 <wv.Point3>`
      
      
            center of the handle.
      
      
         **axis**\ : :js:class:`Point3 <wv.Point3>`
      
      
            axis to move along
      
      
         **color**\ : :js:class:`Color <wv.Color>`
      
      
            color of the handle geometry
      
      
         **positionNormal**\ : (*None* \| :js:class:`Point3 <wv.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:: wv.Operators.HandleOperator.addHandles

      .. rst-class:: sig-pretty-signature
      
         | addHandles(**nodeIds**\ : *number*\ [], **position**\ : (*None* | :js:class:`Point3 <wv.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 <wv.Point3>`\ ) = null
      
      
            world space coordinates the the handle position
      
      
         **groupId**\ : (*None* \| *number*\ ) = null
      
      
      **Returns**\ : *Promise*
      



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

      .. rst-class:: clio-flags
      
         :clio-inherited:`inherited`
      
      .. rst-class:: sig-pretty-signature
      
         | addMapping(**button**\ : :js:data:`Button <wv.Button>`\ , **modifier**\ : :js:data:`KeyModifiers <wv.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 <wv.Button>`
      
         **modifier**\ : :js:data:`KeyModifiers <wv.KeyModifiers>` = KeyModifiers.None
      
      
      **Returns**\ : *void*
      



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

      .. rst-class:: sig-pretty-signature
      
         | addPlaneTranslationHandle(**position**\ : :js:class:`Point3 <wv.Point3>`\ , **normal**\ : :js:class:`Point3 <wv.Point3>`\ , **faceColor**\ : :js:class:`Color <wv.Color>`\ , **lineColor**\ : :js:class:`Color <wv.Color>`\ , **positionNormal**\ : (*None* | :js:class:`Point3 <wv.Point3>`\ )?, **groupId**\ : (*None* | *number*\ )?): *Promise*
      
      Adds a handle that restricts movement to a plane.
      
      **Parameters**
      
      
         **position**\ : :js:class:`Point3 <wv.Point3>`
      
      
            center of the handle.
      
      
         **normal**\ : :js:class:`Point3 <wv.Point3>`
      
      
            normal of the plane
      
      
         **faceColor**\ : :js:class:`Color <wv.Color>`
      
      
            face color of the handle geometry
      
      
         **lineColor**\ : :js:class:`Color <wv.Color>`
      
      
            outline color of the handle geometry
      
      
         **positionNormal**\ : (*None* \| :js:class:`Point3 <wv.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:: wv.Operators.HandleOperator.addTrackedPoint

      .. rst-class:: sig-pretty-signature
      
         | addTrackedPoint(**point**\ : :js:class:`Point3 <wv.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 <wv.Point3>`
      
      
      **Returns**\ : *number*
      
      
         point index
      
      



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

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



.. js:method:: wv.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:: wv.Operators.HandleOperator.clearTrackedPoints

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



.. js:method:: wv.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:: wv.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:: wv.Operators.HandleOperator.getPosition

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



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

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



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

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



.. js:method:: wv.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:: wv.Operators.HandleOperator.removeHandles

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



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

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



.. js:method:: wv.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:: wv.Operators.HandleOperator.setMapping

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



.. js:method:: wv.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:: wv.Operators.HandleOperator.setPlaneMeshData

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



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

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



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

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



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

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



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

      .. rst-class:: sig-pretty-signature
      
         | updatePosition(**translation**\ : :js:class:`Point3 <wv.Point3>`\ , **rotation**\ : :js:class:`Matrix <wv.Matrix>`\ , **finalizePosition**\ : *boolean*\ , **groupId**\ : (*None* | *number*\ )?): *Promise*
      
      Updates the current handle position.
      
      **Parameters**
      
      
         **translation**\ : :js:class:`Point3 <wv.Point3>`
      
      
            additional translation
      
      
         **rotation**\ : :js:class:`Matrix <wv.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*
      




