# HandleOperator

class `Operators.``HandleOperator`()

  Handles are added scene elements that can update the position of your parts through user interaction. Find more information here.

  ## Index

  Constructors

  - `constructor`

  Methods

  - `addAxisRotationHandle`
  - `addAxisTranslationHandle`
  - `addHandles`
  - `addMapping`
  - `addPlaneTranslationHandle`
  - `addTrackedPoint`
  - `addViewPlaneTranslationHandle`
  - `clearMapping`
  - `clearTrackedPoints`
  - `generateGroupId`
  - `getNodeIds`
  - `getPosition`
  - `getTrackedPoints`
  - `getTranslation`
  - `isEnabled`
  - `removeHandles`
  - `setAxisMeshData`
  - `setHandleSize`
  - `setMapping`
  - `setNodeIds`
  - `setPlaneMeshData`
  - `setRotateMeshData`
  - `setViewPlaneMeshData`
  - `showHandles`
  - `updatePosition`

## Constructors

`Operators.HandleOperator.``constructor`()
  HandleOperator(viewer: `IWebViewer`, view: `IView`): `HandleOperator`

  Parameters

  > viewer: `IWebViewer`

  > view: `IView`

  Returns: `HandleOperator`

## Methods

`Operators.HandleOperator.``addAxisRotationHandle`()
  addAxisRotationHandle(position: `Point3`, axis: `Point3`, color: `Color`, positionNormal: (None | `Point3`)?, groupId: (None | number)?): Promise

  Adds a handle that rotates around an axis

  Parameters

  > position: `Point3`

  > > center of the handle.

  > axis: `Point3`

  > > axis to rotate around

  > color: `Color`

  > > color of the handle geometry

  > positionNormal: (None | `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

`Operators.HandleOperator.``addAxisTranslationHandle`()
  addAxisTranslationHandle(position: `Point3`, axis: `Point3`, color: `Color`, positionNormal: (None | `Point3`)?, groupId: (None | number)?): Promise

  Adds a handle that moves along an axis.

  Parameters

  > position: `Point3`

  > > center of the handle.

  > axis: `Point3`

  > > axis to move along

  > color: `Color`

  > > color of the handle geometry

  > positionNormal: (None | `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

`Operators.HandleOperator.``addHandles`()
  addHandles(nodeIds: number[], position: (None | `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 | `Point3`) = null

  > > world space coordinates the the handle position

  > groupId: (None | number) = null

  Returns: Promise

`Operators.HandleOperator.``addMapping`()

  inherited

  addMapping(button: `Button`, modifier: `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: `Button`

  > modifier: `KeyModifiers` = KeyModifiers.None

  Returns: void

`Operators.HandleOperator.``addPlaneTranslationHandle`()
  addPlaneTranslationHandle(position: `Point3`, normal: `Point3`, faceColor: `Color`, lineColor: `Color`, positionNormal: (None | `Point3`)?, groupId: (None | number)?): Promise

  Adds a handle that restricts movement to a plane.

  Parameters

  > position: `Point3`

  > > center of the handle.

  > normal: `Point3`

  > > normal of the plane

  > faceColor: `Color`

  > > face color of the handle geometry

  > lineColor: `Color`

  > > outline color of the handle geometry

  > positionNormal: (None | `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

`Operators.HandleOperator.``addTrackedPoint`()
  addTrackedPoint(point: `Point3`): number

  Add a point to the tracked points list. When the handle moves, these points will update in world space.

  Parameters

  > point: `Point3`

  Returns: number

  > point index

`Operators.HandleOperator.``addViewPlaneTranslationHandle`()
  addViewPlaneTranslationHandle(position: `Point3`, color: `Color`, groupId: (None | number)?): Promise

  Adds a handle that restricts movement to the viewplane.

  Parameters

  > position: `Point3`

  > > center of the handle

  > color: `Color`

  > > geometry color

  > groupId: (None | number) = null

  > > optional parameter to associate this handle with a group of NodeIds

  Returns: Promise

`Operators.HandleOperator.``clearMapping`()

  inherited

  clearMapping(): void

  Clears any button and key modifier mappings for the operator.

  Returns: void

`Operators.HandleOperator.``clearTrackedPoints`()
  clearTrackedPoints(): void

  Clear the list of tracked points.

  Returns: void

`Operators.HandleOperator.``generateGroupId`()
  generateGroupId(): number

  This will generate a unique id to associate a group of handles with a group of NodeIds.

  Returns: number

`Operators.HandleOperator.``getNodeIds`()
  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[]

`Operators.HandleOperator.``getPosition`()
  getPosition(): (None | `Point3`)

  Returns: (None | `Point3`)

  > the current handle position or null if not currently active.

`Operators.HandleOperator.``getTrackedPoints`()
  getTrackedPoints(): `Point3`[]

  Gets the tracked point list.

  Returns: `Point3`[]

`Operators.HandleOperator.``getTranslation`()
  getTranslation(): `Point3`

  Returns: `Point3`

  > the total translation applied to the handles.

`Operators.HandleOperator.``isEnabled`()
  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

`Operators.HandleOperator.``removeHandles`()
  removeHandles(): Promise

  Removes all handles from the scene.

  Returns: Promise

`Operators.HandleOperator.``setAxisMeshData`()
  setAxisMeshData(meshData: `MeshData`): Promise

  Sets the mesh data for axis handles.

  Parameters

  > meshData: `MeshData`

  Returns: Promise

`Operators.HandleOperator.``setHandleSize`()
  setHandleSize(size: number): void

  Takes a scale value to change the handle size with 1 representing the default size

  Parameters

  > size: number

  Returns: void

`Operators.HandleOperator.``setMapping`()

  inherited

  setMapping(button: `Button`, modifier: `KeyModifiers`?): void

  Sets the button and key modifier mapping for the operator.

  Parameters

  > button: `Button`

  > modifier: `KeyModifiers` = KeyModifiers.None

  Returns: void

`Operators.HandleOperator.``setNodeIds`()
  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

`Operators.HandleOperator.``setPlaneMeshData`()
  setPlaneMeshData(meshData: `MeshData`): Promise

  Sets the mesh data for plane handles.

  Parameters

  > meshData: `MeshData`

  Returns: Promise

`Operators.HandleOperator.``setRotateMeshData`()
  setRotateMeshData(meshData: `MeshData`): Promise

  Sets the mesh data for rotation handles.

  Parameters

  > meshData: `MeshData`

  Returns: Promise

`Operators.HandleOperator.``setViewPlaneMeshData`()
  setViewPlaneMeshData(meshData: `MeshData`): Promise

  Sets the mesh data for view plane handles.

  Parameters

  > meshData: `MeshData`

  Returns: Promise

`Operators.HandleOperator.``showHandles`()
  showHandles(): void

  Shows any handles that have been added to the scene.

  Returns: void

`Operators.HandleOperator.``updatePosition`()
  updatePosition(translation: `Point3`, rotation: `Matrix`, finalizePosition: boolean, groupId: (None | number)?): Promise

  Updates the current handle position.

  Parameters

  > translation: `Point3`

  > > additional translation

  > rotation: `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

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your Docs generative AI assistant. Ask me anything about HOOPS Visualize Web or choose a sample question below to start a conversation:

What is HOOPS Visualize Web?
What are the latest release notes for HOOPS Visualize Web?
How do I start evaluating HOOPS Visualize Web?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...