Class: WorkPlane

PD.UserModeHandler. WorkPlane

Handles the interactive setting of a reference work plane.

This is the default handler for the PD.MODE.WORK_PLANE mode. It allows for the interactive setting of a reference point position within the model using a large 3D touch-friendly cursor and manipulators. It is a single-stage mode to let the user drag a single point into position somewhere in the model with standard snapping.

The dynamic position is stored in a static PD.UserModeHandler.WorkPlane.pos object of type PD.Point.


new WorkPlane()

Author:
  • drajmarsh

Extends

Members


:boolean

isUserModeHandler <readonly>

A flag identifying this object as an edit mode handler.

Type
  • boolean
Inherited From:

:PD.Point

pos <static>

The static point that is updated when the position is moved.

Type

Methods


cancel(host)

Cancels this edit mode.

Parameters:
Name Type Description
host PD.SelectionManager

The selection manager.

Inherited From:
Overrides:

complete(host)

Completes any pending modal action(s) in this edit mode.

Parameters:
Name Type Description
host PD.SelectionManager

The selection manager.

Inherited From:
Overrides:
Returns:

Returns true is a pending action was completed.

Type
boolean

displayDimensions(host, mesh)

Regenerates dimension lines for the current mode, if any.

Parameters:
Name Type Description
host PD.SelectionManager

The selection manager.

mesh PD.PolyMesh

The mesh to add the dimension(s) to.

Inherited From:
Overrides:
Returns:

Returns true if something in the model was dimensioned and the mesh should be visible, otherwise false.

Type
boolean

handleClickSelect(host, raycaster, event)

Handles interactive selection of the dimension line.

Parameters:
Name Type Description
host PD.SelectionManager

The selection manager.

raycaster THREE.Raycaster

The ray cast into the current scene.

event object

The DOM event that triggered this selection.

Inherited From:
Overrides:
Returns:

Returns true if something in the model was selected and geometry was added to the mesh, otherwise false.

Type
boolean

handleDragEnd(host, cursor, event)

Completes the origin move after a drag has finished.

Parameters:
Name Type Description
host PD.SelectionManager

The selection manager.

cursor PD.Cursor

The cursor that just finished moving.

event object

The DOM event that triggered the end of the move.

Inherited From:
Overrides:
Returns:

Returns true if the move was finalised.

Type
boolean

handleDragMove(host, newPos, cursor, event)

Moves the origin point as the cursor is dragged.

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.

Inherited From:
Overrides:
Returns:

Returns true if the move was applied.

Type
boolean

handleDragStart(host, cursor, event)

Prepare the model just prior to an origin drag event.

Parameters:
Name Type Description
host PD.SelectionManager

The selection manager.

cursor PD.Cursor

The cursor that is about to move.

event object

The DOM event that triggered this move.

Inherited From:
Overrides:
Returns:

Returns true if the move is allowed.

Type
boolean

handlePreSelect(host, raycaster, event)

Handles interactive pre-selection events.

Positions the cursor on first and second clicks.

Parameters:
Name Type Description
host PD.SelectionManager

The selection manager.

raycaster THREE.Raycaster

The ray cast into the current scene.

event object

The DOM event that triggered this callback.

Inherited From:
Overrides:
Returns:

Returns true if something in the model was pre-selected and geometry was added to the mesh, otherwise false.

Type
boolean

initialise(host)

Called each time this edit mode is entered.

Parameters:
Name Type Description
host PD.SelectionManager

The selection manager.

Inherited From:

progressToNextStage(host [, stage])

Increments through the stages of the interactive positioning process.

Parameters:
Name Type Argument Description
host PD.SelectionManager

The selection manager.

stage number <optional>

An optional stage in the progress, defaults to host.userActionStage + 1.

Inherited From:
Overrides:

setCursorPosition(host, pos [, event])

Manually sets the cursor position during an 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.

This method should undertake whatever action dragging the cursor would have at the current progress stage.

Parameters:
Name Type Argument Description
host PD.SelectionManager

The selection manager.

pos Object | Array

The new position to move the cursor to.

event Event <optional>

The event that invoked this method.

Inherited From:

getNextUndoID() <static>

Retrieves and incremented undo identifier.

Returns:

Returns the updated undo identifier.

Type
number

getUndoID() <static>

Retrieves the current undo identifier.

Returns:

Returns the current undo identifier.

Type
number