Options for the DrawTool.createShape method.

interface CreateShapeOptions {
    afterInsertPoint?: PostHook<InsertPointHook>;
    afterRemovePoint?: PostHook<RemovePointHook>;
    afterUpdatePoint?: PostHook<UpdatePointHook>;
    beforeInsertPoint?: PreHook<InsertPointHook>;
    beforeRemovePoint?: PreHook<RemovePointHook>;
    beforeUpdatePoint?: PreHook<UpdatePointHook>;
    borderWidth?: number;
    closeRing?: boolean;
    color?: ColorRepresentation;
    constraints?: Permissions;
    endCondition?: MouseCallback;
    floorElevation?: number;
    fontSize?: number;
    fontWeight?: ShapeFontWeight;
    labelOpacity?: number;
    lineLabelFormatter?: LineLabelFormatter;
    lineWidth?: number;
    maxPoints?: number;
    minPoints?: number;
    name?: string;
    object3d?: Object3D<Object3DEventMap>;
    onPointCreated?: ((shape: entities.Shape<EntityUserData>, index: number, position: Vector3) => void);
    onTemporaryPointMoved?: ((shape: entities.Shape<EntityUserData>, position: Vector3) => void);
    pick?: PickCallback<PickResult<unknown>>;
    pickableLabels?: boolean;
    segmentLabelFormatter?: SegmentLabelFormatter;
    showFloorLine?: boolean;
    showFloorVertices?: boolean;
    showLine?: boolean;
    showLineLabel?: boolean;
    showSegmentLabels?: boolean;
    showSurface?: boolean;
    showSurfaceLabel?: boolean;
    showVertexLabels?: boolean;
    showVerticalLineLabels?: boolean;
    showVerticalLines?: boolean;
    showVertices?: boolean;
    signal?: AbortSignal;
    surfaceLabelFormatter?: SurfaceLabelFormatter;
    surfaceLabelPlacement?: SurfaceLabelPlacement;
    surfaceOpacity?: number;
    vertexLabelFormatter?: VertexLabelFormatter;
    vertexRadius?: number;
    verticalLineLabelFormatter?: VerticalLineLabelFormatter;
}

Hierarchy (view full)

Properties

afterInsertPoint?: PostHook<InsertPointHook>

An optional hook to be called just after a point is inserted.

afterRemovePoint?: PostHook<RemovePointHook>

An optional hook to be called just after a point is removed.

afterUpdatePoint?: PostHook<UpdatePointHook>

An optional hook to be called just after a point is updated.

beforeInsertPoint?: PreHook<InsertPointHook>

An optional hook to be called just before a point is inserted. If the hook returns false, the point is not inserted.

beforeRemovePoint?: PreHook<RemovePointHook>

An optional hook to be called just before a point is removed. If the hook returns false, the point is not removed.

beforeUpdatePoint?: PreHook<UpdatePointHook>

An optional hook to be called just before a point is updated. If the hook returns false, the point is not updated.

borderWidth?: number

The width, in pixels, of the border around vertices and lines.

DEFAULT_BORDER_WIDTH

closeRing?: boolean

If true, the shape's line will be closed just before being returned to the caller.

The main color of the shape. Affects lines, vertices, surfaces and labels.

DEFAULT_COLOR

constraints?: Permissions

An optional list of permitted operations.

endCondition?: MouseCallback

The input required to finish drawing the shape. Does not apply to shapes that require a fixed number of points (i.e point, segment, etc).

right click
floorElevation?: number

The floor elevation, in meters.

0
fontSize?: number

The label font size.

DEFAULT_FONT_SIZE

fontWeight?: ShapeFontWeight

The label font weight.

'bold'

labelOpacity?: number

The specific opacity of the labels.

1
lineLabelFormatter?: LineLabelFormatter

A custom formatter for the line label.

lineWidth?: number

The width, in pixels, of lines.

DEFAULT_LINE_WIDTH

maxPoints?: number

The maximum number of points to create before the shape is automatically completed.

minPoints?: number

The minimum number of points to create before the shape can be completed.

name?: string

The optional display name of this entity. Mostly used for debugging.

The root object of this entity. If none is provided, a new Group is created.

onPointCreated?: ((shape: entities.Shape<EntityUserData>, index: number, position: Vector3) => void)

An optional callback to be called when a point has been added to the shape.

Type declaration

    • (shape, index, position): void
    • Parameters

      Returns void

onTemporaryPointMoved?: ((shape: entities.Shape<EntityUserData>, position: Vector3) => void)

An optional callback to be called when a point has been moved.

Type declaration

pick?: PickCallback<PickResult<unknown>>

The optional custom picking function.

pickableLabels?: boolean

Make labels pickable.

false
segmentLabelFormatter?: SegmentLabelFormatter

A custom formatter for segment labels.

showFloorLine?: boolean

Shows the line that is the vertical projection of the line on the plane at the floorElevation.

DEFAULT_SHOW_FLOOR_LINE

showFloorVertices?: boolean

Shows floor vertices.

DEFAULT_SHOW_FLOOR_VERTICES

showLine?: boolean

Shows the line that connects each vertex.

DEFAULT_SHOW_LINE

showLineLabel?: boolean

Display a label for the entire line.

false
showSegmentLabels?: boolean

Display labels for each segment of the line.

false
showSurface?: boolean

Show the surface polygon.

DEFAULT_SHOW_SURFACE

showSurfaceLabel?: boolean

Display a label for the surface.

false
showVertexLabels?: boolean

Display a label for each vertex.

false
showVerticalLineLabels?: boolean

Display labels for vertical lines.

false
showVerticalLines?: boolean

Show vertical lines that connect each vertex to each floor vertex.

DEFAULT_SHOW_VERTICAL_LINES

showVertices?: boolean

Show vertices.

DEFAULT_SHOW_VERTICES

signal?: AbortSignal

The optional signal to listen to cancel the creation of a shape.

surfaceLabelFormatter?: SurfaceLabelFormatter

A custom formatter for the surface label.

surfaceLabelPlacement?: SurfaceLabelPlacement

An optional function to compute the location of the surface label.

surfaceOpacity?: number

The opacity of the surface.

DEFAULT_SURFACE_OPACITY

vertexLabelFormatter?: VertexLabelFormatter

A custom formatter for the vertex labels.

vertexRadius?: number

The radius, in pixels, of vertices.

DEFAULT_VERTEX_RADIUS

verticalLineLabelFormatter?: VerticalLineLabelFormatter

A custom formatter for vertical line labels.