TransformGizmo Constructor

Constructor of the TransformGizmo control object.

Signatures

  •   GUIControls.TransformGizmo(viewport, controls, options, paramNameModelMatrix,

Details

The GUI control object can either be bound to an paramate open parameter or not (see https://docs.paramate.trinckle.com/js/page_ref_controls_initialization.php

The GUI control is designed in a flexible style that allows to control either open parameters of type of matrix or an array of matrices. The type is automatically determined from the open parameter. See explanation to argument paramNameModelMatrix.

Parameters

viewport

The paramate viewport object (see viewport constructor or viewport for WebGL constructor).

controls

The paramate controls object (see manually generated controls or auto generated controls).

options

An object containing settings for the control. It shall have the following form:

 {
   hasChildren: <boolean>,
   worldSpace?: <boolean>,
   gizmoSize?: <number>,
   rotStepInRadians?: <number>,
   scalingMin?: <number>,
   dragModeActive?: <boolean>,
   drawLabel?: <boolean>,
   labelText?: string[],
   translateActiveX?: <boolean>,
   translateActiveY?: <boolean>,
   translateActiveZ?: <boolean>,
   translateSize?: <number>,
   translateOffset?: <number>,
   rotateActive?: <boolean>,
   rotateActiveX?: <boolean>,
   rotateActiveY?: <boolean>,
   rotateActiveZ?: <boolean>,
   rotateSize?: <number>,
   rotateOffset?: <number>,
   scaleActive?: <boolean>,
   scaleActiveX?: <boolean>,
   scaleActiveY?: <boolean>,
   scaleActiveZ?: <boolean>,
   scaleUniform?: <boolean>,
   scaleSize?: <number>,
   scaleOffset?: <number>
 }
 

options.hasChildren

Required parameter. Boolean value that defines whether a control has nested controls or not. (Default: false)

options.worldSpace

Optional parameter. Defines whether the gizmo is drawn in the world (global) or model (local) space. (Default: true)

options.gizmoSize

Optional parameter. Defines the size of the control's handles. (Default: 5)

options.rotStepInRadians

Optional parameter. Defines the step of the control's rotation. (Default: ~5 degrees)

options.scalingMin

Optional parameter. Defines the allowed minimum of scaling value of the model. (Default: 0.5 mm)

options.dragModeActive

Optional parameter. Defines whether it is possible to move gizmo on arbitrary axes by dragging it's centre point. (Default: true)

options.drawLabel

Optional parameter. Boolean value that defines whether the helper labels will be rendered together with the gizmo centre point. (Default: false)

options.labelText

Optional parameter. List of string values that define the text for the labels that shall be rendered. This parameter shall be ignored if the options.drawLabel parameter is set to false.

options.translateActiveX

Optional parameter. Defines whether the translate X handle active or not. (Default: true)

options.translateActiveY

Optional parameter. Defines whether the translate Y handle active or not. (Default: true)

options.translateActiveZ

Optional parameter. Defines whether the translate Z handle active or not. (Default: true)

options.translateSize

Optional parameter. Defines the size of the control's translation picker. (Default: 6)

options.translateOffset

Optional parameter. Defines the offset of the text for translation handles. (Default: 20)

options.rotateActive

Optional parameter. Defines whether the rotation feature is active or not. (Default: true)

options.rotateActiveX

Optional parameter. Defines whether the rotate X handle active or not. (Default: true)

options.rotateActiveY

Optional parameter. Defines whether the rotate Y handle active or not. (Default: true)

options.rotateActiveZ

Optional parameter. Defines whether the rotate Z handle active or not. (Default: true)

options.rotateSize

Optional parameter. Defines the size of the control's rotation picker. (Default: 8)

options.rotateOffset

Optional parameter. Defines the offset of the text for rotation handles. (Default: 20)

options.scaleActive

Optional parameter. Defines whether the scaling feature is active or not. (Default: true)

options.scaleActiveX

Optional parameter. Defines whether the scale X handle active or not. (Default: true)

options.scaleActiveY

Optional parameter. Defines whether the scale Y handle active or not. (Default: true)

options.scaleActiveZ

Optional parameter. Defines whether the scale Z handle active or not. (Default: true)

options.scaleUniform

Optional parameter. Defines whether the scaling shall be uniform or not. (Default: true)

options.scaleSize

Optional parameter. Defines the size of the control's scaling picker. (Default: 6)

options.scaleOffset

Optional parameter. Defines the offset of the text for scaling handles. (Default: 20)

paramNameModelMatrix

Optional parameter. A string defining the name of the paramate open parameter.

paramNameWorldMatrix

Optional parameter. A string defining the name of the paramate open parameter.

modelMatrix

Optional parameter. An array of elements of type Matrix44 that define the inital value of the control. If the control is attached to an open parameter (i.e. if argument paramNameModelMatrix is not undefined), this parameter is ignored.

worldMatrix

Optional parameter. An array of elements of type Matrix44 that define the inital value of the control. If the control is attached to an open parameter (i.e. if argument paramNameWorldMatrix is not undefined), this parameter is ignored.