new Measure()
Creates a new default model edit mode handler.
Extends
Members
-
:boolean
isUserModeHandler <readonly>
-
A flag identifying this object as an edit mode handler.
Type
- boolean
- Inherited From:
- Overrides:
-
:Array
points
-
Stores a list of sequential measurement points.
Type
- Array
Methods
-
cancel(host)
-
Cancels this edit mode.
Parameters:
Name Type Description hostPD.SelectionManager The selection manager.
- Inherited From:
- Overrides:
-
complete(host)
-
Completes any pending modal action(s) in this edit mode.
Parameters:
Name Type Description hostPD.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 hostPD.SelectionManager The selection manager.
meshPD.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 hostPD.SelectionManager The selection manager.
raycasterTHREE.Raycaster The ray cast into the current scene.
eventobject 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 measurement after a drag has finished.
Parameters:
Name Type Description hostPD.SelectionManager The selection manager.
cursorPD.Cursor The cursor that just finished moving.
eventobject 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 measurement point as the cursor is dragged.
Parameters:
Name Type Description hostPD.SelectionManager The selection manager.
newPosTHREE.Vector3 The proposed new position of the cursor.
cursorPD.Cursor The cursor that moved.
eventobject 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 a measure drag event.
Parameters:
Name Type Description hostPD.SelectionManager The selection manager.
cursorPD.Cursor The cursor that is about to move.
eventobject 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 hostPD.SelectionManager The selection manager.
raycasterTHREE.Raycaster The ray cast into the current scene.
eventobject 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 hostPD.SelectionManager The selection manager.
- Inherited From:
- Overrides:
-
progressToNextStage(host [, stage])
-
Increments through the stages of the interactive measurement process.
Parameters:
Name Type Argument Description hostPD.SelectionManager The selection manager.
stagenumber <optional>
An optional stage in the progress, defaults to
host.userActionStage + 1.- Inherited From:
- Overrides:
-
setCursorPosition(host, newPos, 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 hostPD.SelectionManager The selection manager.
newPosObject | Array The new position to move the cursor to.
cursorPD.Cursor The cursor that is being moved.
eventEvent <optional>
The DOM event that invoked this method.
- Overrides: