Class: Rotate

BIM.UserModeHandler. Rotate

Handles the interactive translation of the selection within the model.

This is the default handler for the PD.MODE.ROTATE mode. It allows the user to interactively drag the current selection using a large 3D touch-friendly cursor and manipulators.


new Rotate()

Creates a new rotate selection mode handler.

Author:
  • drajmarsh

Extends

Members


:boolean

actionApplied

Whether or not the action was applied to the selection.

Type
  • boolean
Inherited From:
Overrides:

:number

angle

The signed rotation angle.

Type
  • number

:number

id

A unique id generated each time a new drag is initiated.

Type
  • number
Inherited From:
Overrides:

:boolean

isUserModeHandler <readonly>

A flag identifying this object as an edit mode handler.

Type
  • boolean
Inherited From:
Overrides:

:THREE.Matrix4

matrix

The matrix to use for rotation.

Type
  • THREE.Matrix4

:Array.<THREE.Vector3>

refPoints

Stores the reference positions required for the action.

For a simple move, this is just the start point [0] and the drag point [1]. For a rotation, it is the center point [0], the reference direction [1] and the drag direction [2]. You can add any extra points your action needs within the subclass constructor.

Type
  • Array.<THREE.Vector3>
Inherited From:
Overrides:

:number

setupStages

The progress stage at which setup finishes and dragging begins.

Setup stages display a detached cursor and are used to set the reference positions prior to actual dragging. During these stages, the user can click anywhere in the canvas and the cursor will move to that spot, and snapping should include the selected element. After the setup stages, when the user is dragging the selected element around, it should be excluded from snap detection.

Type
  • number
Inherited From:
Overrides:

:boolean

stageMessages

Stores the messages for each progress stage.

The number of messages in this array also determines the maximum progress stage it wil get to.

Type
  • boolean
Inherited From:
Overrides:

:THREE.Vector3

vector

Stores a movement vector.

Type
  • THREE.Vector3
Inherited From:
Overrides:

Methods


applyActionOnDrag(host, cursor, event)

Apply the action to the selection set during cursor drag.

Parameters:
Name Type Description
host PD.SelectionManager

The selection manager.

cursor PD.Cursor

The cursor that moved.

event object

The DOM event that triggered this move.

Inherited From:
Overrides:
Returns:

Returns true if the action was applied, otherwise false.

Type
boolean

applyActionOnRelease(host, cursor, event)

Apply the action to the selection set during cursor drag.

Parameters:
Name Type Description
host PD.SelectionManager

The selection manager.

cursor PD.Cursor

The cursor that moved.

event object

The DOM event that triggered this move.

Overrides:
Returns:

Returns true if the action was applied.

Type
boolean

checkToSnapValue(host, newPos, cursor, event)

Snaps the rotation angle to reasonable values.

Parameters:
Name Type Description
host PD.SelectionManager

The selection manager.

newPos THREE.Vector3

The proposed new position of the cursor.

cursor PD.Cursor

The cursor that moved.

event object

The DOM event that triggered this move.

Overrides:

initialise(host)

Called each time this edit mode is entered.

Parameters:
Name Type Description
host PD.SelectionManager

The selection manager.

Inherited From:
Overrides:

setCursorPosition(host, pos, cursor [, event])

Manually sets the cursor position during a measure action.

This method is called when the user manually edits the cursor position using the keyboard or other numeric input within the UI, as opposed to dragging the cursor. It is not called when the cursor is moved interactively using the manipulators and a pointer.

Parameters:
Name Type Argument Description
host PD.SelectionManager

The selection manager.

pos Object | Array

The new position to move the cursor to.

cursor PD.Cursor

The cursor that is being moved.

event Event <optional>

The DOM event that invoked this method.

Inherited From:
Overrides: