Viewer - Drawing Tools
    Preparing search index...

    Interface IDrawingToolsApi

    interface IDrawingToolsApi {
        closed: boolean;
        paused: boolean;
        pointsData: PointsData;
        restrictions: { [key: string]: IRestrictionApi };
        showDistanceLabels: boolean;
        showPointLabels: boolean;
        uuid: string;
        addPoint(index: number, position?: vec3): void;
        addRestriction(
            properties: RestrictionProperties,
            token?: string,
        ): IRestrictionApi | undefined;
        cancel(): void;
        cancelDrag(): void;
        canRedo(): boolean;
        canUndo(): boolean;
        close(): void;
        continue(): void;
        isInteractionActive(): boolean;
        movePoint(
            index: number,
            position: vec3,
            temporary?: boolean,
            skipConstraints?: boolean,
        ): void;
        pause(): void;
        redo(): void;
        removePoint(index: number): void;
        removeRestriction(id: string): void;
        undo(): void;
        update(): | void
        | { metaData: (RayTraceResult | undefined)[]; pointsData: PointsData };
    }

    Implemented by

    Index

    Properties

    closed: boolean

    Check if the drawing tool is closed.

    paused: boolean

    Check if the drawing tool is paused.

    pointsData: PointsData

    The points data of the drawing tool.

    restrictions: { [key: string]: IRestrictionApi }

    The restrictions of the drawing tool.

    showDistanceLabels: boolean

    Show the distance labels of the drawing tool.

    showPointLabels: boolean

    Show the point labels of the drawing tool.

    uuid: string

    The unique identifier of the drawing tool instance.

    Methods

    • Add a point to the drawing tool.

      Parameters

      • index: number

        The index of the point in the position array.

      • Optionalposition: vec3

        The position of the point.

      Returns void

    • Cancel the drawing tool.

      Returns void

    • Cancel any in-progress hover or drag interaction without closing the drawing tool.

      Returns void

    • Check if the drawing tool can redo the last action.

      Returns boolean

    • Check if the drawing tool can undo the last action.

      Returns boolean

    • Close the drawing tool.

      Returns void

    • Resume the drawing tool after it has been paused.

      Returns void

    • Returns true if a point or control is currently hovered or being dragged.

      Returns boolean

    • Move a point of the drawing tool.

      Parameters

      • index: number

        The index of the point in the position array.

      • position: vec3

        The new position of the point.

      • Optionaltemporary: boolean

        If true, the move will not be applied immediately (default: false).

      • OptionalskipConstraints: boolean

      Returns void

    • Pause the drawing tool, suspending all user interactions while keeping the current state. Call continue to resume.

      Returns void

    • Redo the last action of the drawing tool.

      Returns void

    • Remove a point from the drawing tool.

      Parameters

      • index: number

        The index of the point in the position array.

      Returns void

    • Remove a restriction from the drawing tool.

      Parameters

      • id: string

      Returns void

    • Undo the last action of the drawing tool.

      Returns void

    • Receive an update of the drawing tool.

      Returns void | { metaData: (RayTraceResult | undefined)[]; pointsData: PointsData }

      The points data of the drawing tool.