Class: SurfaceDrawing

BIM. SurfaceDrawing


new SurfaceDrawing()

A utility class for drawing on a model surface.

Author:
  • drajmarsh

Members


:PD.LocalCoordinates

_localCoords <static>

The local coordinates of the current polygon.

Type

:BIM.Element|null

cursor <static>

Stores the cursor to follow drawing surface.

Type

:BIM.Element|null

element <static>

Stores the element that owns the drawing surface.

Type

:BIM.Element|null

junction <static>

Stores the junction that defines the drawing surface.

Type

Methods


handleDragMove(host, newPos, cursor, event) <static>

Moves the cursor over the drawing surface.

Parameters:
Name Type Description
host PD.SelectionManager

The selection manager.

newPos THREE.Vector3

The point to snap to the surface surface.

cursor PD.Cursor | null

The cursor to align with the surface, or null.

event object

The DOM event that triggered this move.

Returns:

Returns true if the move was applied.

Type
boolean

handleDragStart(host, cursor, event) <static>

Prepare cursor for an interactive 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.

Returns:

Returns true if the move is allowed.

Type
boolean

handlePreSelect(host, raycaster, cursor) <static>

Handles interactive pre-selection events.

Parameters:
Name Type Description
host PD.SelectionManager

The selection manager.

raycaster THREE.Raycaster

The ray cast into the current scene.

cursor PD.Cursor

The cursor that is about to move.

Returns:

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

Type
boolean

init(element, junction, cursor) <static>

Initialises surface drawing.

Parameters:
Name Type Description
element BIM.Element

The element that owns the drawing surface.

junction BIM.Junction

The junction that defines the drawing surface.

cursor PD.Cursor

The cursor to follow the drawing surface.

Returns:

Returns true if surface able to be drawn on was found and set, otherwise false.

Type
boolean

setCursorToSurface(host, cursor [, newPos]) <static>

Moves the cursor over the drawing surface.

Parameters:
Name Type Argument Description
host PD.SelectionManager

The selection manager.

cursor PD.Cursor | null

The cursor to align with the surface, or null.

newPos THREE.Vector3 <optional>

An optional point to snap to the surface surface.

Returns:

Returns true if the cursor was updated.

Type
boolean