HandleOperator
- 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/communicator/latest/tutorials/additive-manufacturing/handles.html).
Constructors
Methods
Constructors
- HandleOperator.constructor(viewer, view)
- Arguments
viewer (
WebViewer()
) – Noneview (
View()
) – None
- Return type
HandleOperator
Methods
addAxisRotationHandle
- HandleOperator.addAxisRotationHandle(position, axis, color, positionNormal, groupId)
- Arguments
position (
Point3()
) – center of the handle.axis (
Point3()
) – axis to rotate aroundcolor (
Color()
) – color of the handle geometrypositionNormal (
null | Point3()
) – optional vector to control the orientation of the handle geometry.groupId (
null | number()
) – optional parameter to associate this handle with a group of NodeIds
Adds a handle that rotates around an axis
- Return type
Promise <number>
addAxisTranslationHandle
- HandleOperator.addAxisTranslationHandle(position, axis, color, positionNormal, groupId)
- Arguments
position (
Point3()
) – center of the handle.axis (
Point3()
) – axis to move alongcolor (
Color()
) – color of the handle geometrypositionNormal (
null | Point3()
) – optional vector to control the orientation of the handle geometry.groupId (
null | number()
) – optional parameter to associate this handle with a group of NodeIds
Adds a handle that moves along an axis.
- Return type
Promise <number>
addHandles
- HandleOperator.addHandles(nodeIds, position, groupId)
- Arguments
nodeIds (
[number]()
) – corresponding to the parts that will move with the handlesposition (
null | Point3()
) – world space coordinates the the handle positiongroupId (
null | number()
) – None
Adds all handles into the scene, oriented along the primary axes
- Return type
Promise <void>
addMapping
- HandleOperator.addMapping(button, modifier)
- Arguments
button (
Button()
) – Nonemodifier (
KeyModifiers()
) – None
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.
- Return type
void
addPlaneTranslationHandle
- HandleOperator.addPlaneTranslationHandle(position, normal, faceColor, lineColor, positionNormal, groupId)
- Arguments
position (
Point3()
) – center of the handle.normal (
Point3()
) – normal of the planefaceColor (
Color()
) – face color of the handle geometrylineColor (
Color()
) – outline color of the handle geometrypositionNormal (
null | Point3()
) – optional vector to control the orientation of the handle geometry.groupId (
null | number()
) – optional parameter to associate this handle with a group of NodeIds
Adds a handle that restricts movement to a plane.
- Return type
Promise <number>
addTrackedPoint
addViewPlaneTranslationHandle
- HandleOperator.addViewPlaneTranslationHandle(position, color, groupId)
- Arguments
Adds a handle that restricts movement to the viewplane.
- Return type
Promise <number>
clearMapping
- HandleOperator.clearMapping()
Clears any button and key modifier mappings for the operator.
- Return type
void
clearTrackedPoints
- HandleOperator.clearTrackedPoints()
Clear the list of tracked points.
- Return type
void
generateGroupId
- HandleOperator.generateGroupId()
This will generate a unique id to associate a group of handles with a group of NodeIds.
- Return type
number
getNodeIds
- HandleOperator.getNodeIds(groupId)
- Arguments
groupId (
null | number()
) – optional parameter that specifies if the NodeIds to retrieve are part of a group.
Gets the NodeIds that the handles in the scene will move.
- Return type
[number]
getPosition
- HandleOperator.getPosition()
- Returns
the current handle position or null if not currently active.
- Return type
null | Point3
getTrackedPoints
- HandleOperator.getTrackedPoints()
Gets the tracked point list.
- Return type
[Point3]
getTranslation
- HandleOperator.getTranslation()
- Returns
the total translation applied to the handles.
- Return type
Point3
isEnabled
- HandleOperator.isEnabled()
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.
- Return type
boolean
removeHandles
- HandleOperator.removeHandles()
Removes all handles from the scene.
- Return type
Promise <void>
setAxisMeshData
- HandleOperator.setAxisMeshData(meshData)
- Arguments
meshData (
MeshData()
) – None
Sets the mesh data for axis handles.
- Return type
Promise <void>
setHandleSize
- HandleOperator.setHandleSize(size)
- Arguments
size (
number()
) – None
Takes a scale value to change the handle size with 1 representing the default size
- Return type
void
setMapping
- HandleOperator.setMapping(button, modifier)
- Arguments
button (
Button()
) – Nonemodifier (
KeyModifiers()
) – None
Sets the button and key modifier mapping for the operator.
- Return type
void
setNodeIds
- HandleOperator.setNodeIds(nodeIds, groupId)
- Arguments
nodeIds (
[number]()
) – NonegroupId (
null | number()
) – optional parameter that associates a group of NodeIds with a group of handles.
Sets the NodeIds that any handles in the scene will move.
- Return type
void
setPlaneMeshData
- HandleOperator.setPlaneMeshData(meshData)
- Arguments
meshData (
MeshData()
) – None
Sets the mesh data for plane handles.
- Return type
Promise <void>
setRotateMeshData
- HandleOperator.setRotateMeshData(meshData)
- Arguments
meshData (
MeshData()
) – None
Sets the mesh data for rotation handles.
- Return type
Promise <void>
setViewPlaneMeshData
- HandleOperator.setViewPlaneMeshData(meshData)
- Arguments
meshData (
MeshData()
) – None
Sets the mesh data for view plane handles.
- Return type
Promise <void>
showHandles
- HandleOperator.showHandles()
Shows any handles that have been added to the scene.
- Return type
void
updatePosition
- HandleOperator.updatePosition(translation, rotation, finalizePosition, groupId)
- Arguments
Updates the current handle position.
- Return type
Promise <void>