Options
All
  • Public
  • Public/Protected
  • All
Menu

Viewer - Drawing Tools

Index

Type Aliases

AngularRestrictionProperties: { angleStep?: number; angleStepEditable?: boolean } & SnapRestrictionProperties
AxisRestrictionProperties: { activationKeyPlane?: string; activationKeyX?: string; activationKeyY?: string; activationKeyZ?: string } & SnapRestrictionProperties
Callbacks: { onCancel: any; onUpdate: any }

The callbacks of the drawing tool.

Here you can define the callbacks that are used when interacting with the drawing tool.

Type declaration

  • onCancel:function
    • onCancel(): void
    • The callback that is called when the drawing tool is cancelled.

      Returns void

  • onUpdate:function
    • The callback that is called when the drawing tool is updated.

      Parameters

      • pointsData: PointsData

        The points data of the drawing tool.

      Returns void

DrawingToolsEventResponseMapping: { drawing_tools.added: IDrawingToolsEvent; drawing_tools.cancel: IDrawingToolsEvent; drawing_tools.deselected: IDrawingToolsEvent; drawing_tools.drag.end: IDrawingToolsEvent; drawing_tools.drag.move: IDrawingToolsEvent; drawing_tools.drag.start: IDrawingToolsEvent; drawing_tools.finish: IDrawingToolsEvent; drawing_tools.geometry.changed: IDrawingToolsEvent; drawing_tools.maximumPoints: IDrawingToolsEvent; drawing_tools.minimumPoints: IDrawingToolsEvent; drawing_tools.moved: IDrawingToolsEvent; drawing_tools.removed: IDrawingToolsEvent; drawing_tools.selected: IDrawingToolsEvent; drawing_tools.unclosedLoop: IDrawingToolsEvent }

Type declaration

GridRestrictionProperties: { gridUnit?: number; gridUnitEditable?: boolean } & SnapRestrictionProperties

Properties for the grid restriction

PointsData: number[][]

The data of the points. The points are defined as an array of arrays, where each array contains the x, y and z coordinates of the point.

example

[[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0], [0, 0, 0]]

RestrictionDefinition: IPointRestrictionDefinition | ILineRestrictionDefinition | IPlaneRestrictionDefinition | ICameraPlaneRestrictionDefinition | IGeometryRestrictionDefinition
Settings: { controls?: Partial<Settings["controls"]>; general?: Partial<Settings["general"]>; geometry?: Partial<Settings["geometry"]>; restrictions?: Partial<Settings["restrictions"]>; visualization?: Partial<Settings["visualization"]> }

Type declaration

  • Optional controls?: Partial<Settings["controls"]>
  • Optional general?: Partial<Settings["general"]>
  • Optional geometry?: Partial<Settings["geometry"]>
  • Optional restrictions?: Partial<Settings["restrictions"]>
  • Optional visualization?: Partial<Settings["visualization"]>
SnapRestrictionProperties: { activationKey?: string; enabled?: boolean; enabledEditable?: boolean; priority?: number }

Type declaration

  • Optional activationKey?: string

    The activation key of the restriction. If the key is not provided, no key is assigned. If the key is provided, the restriction is only active when the key is pressed.

  • Optional enabled?: boolean

    If the restriction should be enabled by default.

  • Optional enabledEditable?: boolean

    If the enabling or disabling of the restriction is allowed to the end user. If it is not editable, the default value for enabling or disabling the restriction is used.

  • Optional priority?: number

    Priority of the restriction. The higher the priority, the sooner the restriction is applied. If the priority is the same, the result that is closer to the original point is chosen.

Functions

  • Create a new instance of DrawingTools.

    throws

    An error if there is already an active instance of DrawingTools.

    Parameters

    • viewport: IViewportApi

      The viewport to which the DrawingTools should be attached.

    • callbacks: Callbacks
    • settings: Settings

    Returns IDrawingToolsApi

    The DrawingTools instance.