Viewer - Drawing Tools
    Preparing search index...

    Type Alias FullSettings

    The initial settings of the drawing tool. Here you can define the initial settings of the drawing tool.

    type FullSettings = {
        general: {
            autoStart: boolean;
            autoUpdate: boolean;
            closeOnUpdate: boolean;
            displayUnit: string;
            enableDeletion: boolean;
            enableInsertion: boolean;
            enableSelection: boolean;
            enableTranslation: boolean;
        };
        geometry: {
            autoClose: boolean;
            close: boolean;
            mode: "points"
            | "lines";
            points: PointsData;
            constraints?: {
                position?: {
                    x?: [number, number];
                    y?: [number, number];
                    z?: [number, number];
                };
                size?: {
                    x?: [number, number];
                    y?: [number, number];
                    z?: [number, number];
                };
            };
            disabledPoints?: number[];
            maxPoints?: number;
            minPoints?: number;
            strictMinMaxPoints?: boolean;
            weightedAdjacency?: AdjacencyEntry[][];
        };
        keyBindings: {
            cancel: string
            | string[];
            confirm: string | string[];
            delete: string | string[];
            insert: string | string[];
            redo: string | string[];
            undo: string | string[];
        };
        restrictions: { [key: string]: RestrictionProperties };
        visualization: IVisualizationSettings;
        controls?: IControl[];
    }
    Index

    Properties

    general: {
        autoStart: boolean;
        autoUpdate: boolean;
        closeOnUpdate: boolean;
        displayUnit: string;
        enableDeletion: boolean;
        enableInsertion: boolean;
        enableSelection: boolean;
        enableTranslation: boolean;
    }

    The general settings of the drawing tool.

    Here you can define general settings of the drawing tool.

    Type Declaration

    • autoStart: boolean

      If the drawing tool is started automatically when no points are defined.

      true
      
    • autoUpdate: boolean

      If the drawing tool is updated automatically when the drawing is changed.

      false
      
    • closeOnUpdate: boolean

      If the drawing tool is closed when the drawing is updated.

      false
      
    • displayUnit: string

      The unit that will be displayed in the distance and point labels.

      ''
      
    • enableDeletion: boolean

      If points can be deleted in general. If this setting is set to false, the user cannot delete points by using the delete key.

      true
      
    • enableInsertion: boolean

      If points can be added in general. If this setting is set to false, the user cannot add new points by clicking or using the insert key.

      true
      
    • enableSelection: boolean

      If points can be selected in general. If this setting is set to false, the user cannot select points by clicking or using the select key.

      true
      
    • enableTranslation: boolean

      If points can be translated by dragging them. If this setting is set to false, the user cannot move existing points by dragging them.

      The pointer is also not changed to a move pointer when hovering over points, since they cannot be moved.

      In this mode, the drawing tools are used for display purposes.

      true
      
    geometry: {
        autoClose: boolean;
        close: boolean;
        mode: "points" | "lines";
        points: PointsData;
        constraints?: {
            position?: {
                x?: [number, number];
                y?: [number, number];
                z?: [number, number];
            };
            size?: {
                x?: [number, number];
                y?: [number, number];
                z?: [number, number];
            };
        };
        disabledPoints?: number[];
        maxPoints?: number;
        minPoints?: number;
        strictMinMaxPoints?: boolean;
        weightedAdjacency?: AdjacencyEntry[][];
    }

    The geometry settings of the drawing tool.

    Here you can define the points, the mode and specific details of the geometry.

    Type Declaration

    • autoClose: boolean

      If the mode is set to 'lines', if the line is automatically closed. If the mode is set to 'points', this setting is ignored.

      The first and last point are always connected if the line is automatically closed.

      true
      
    • close: boolean

      If the mode is set to 'lines', if it is a closed line or not. If the mode is set to 'points', this setting is ignored.

      A line can be closed by connecting the last point with the first point.

      true
      
    • mode: "points" | "lines"

      The mode of the geometry.

      If the mode is set to 'lines', the points are connected in the order they are defined. If the mode is set to 'points', the points are not connected.

      'lines'
      
    • points: PointsData

      The points that are used when starting the drawing tool. The points are defined as an array of arrays, where each array contains the x, y and z coordinates of the point.

      If the mode is set to 'lines', the points are connected in the order they are defined. If the mode is set to 'points', the points are not connected.

      []
      
      [[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0], [0, 0, 0]]
      
    • Optionalconstraints?: {
          position?: {
              x?: [number, number];
              y?: [number, number];
              z?: [number, number];
          };
          size?: { x?: [number, number]; y?: [number, number]; z?: [number, number] };
      }

      Constraints on the geometry. This can be used to restrict the movement of points to a specific area. The constraints are separated into position and size constraints, which can be defined per axis. Each constraint is defined as a tuple of two numbers, where the first number is the minimum value and the second number is the maximum value. If a number is number is not defined, there is no constraint on that axis.

      For the size constraints, the constraint is applied to the size of the geometry, which is defined as the distance between the furthest points in each axis.

    • OptionaldisabledPoints?: number[]

      The indices of points that are disabled. Disabled points cannot be moved, selected or deleted, but they can be inserted next to. This is useful for points that should be fixed in place, such as the endpoints of a line. The pointer is also not changed to a move pointer when hovering over disabled points, since they cannot be moved.

    • OptionalmaxPoints?: number

      The maximum amount of points, if undefined, the geometry is not restricted. This value is checked whenever the user tries to update or finish the drawing tool.

      undefined
      
    • OptionalminPoints?: number

      The minimum amount of points, if undefined, the geometry is not restricted. This value is checked whenever the user tries to update or finish the drawing tool.

      undefined
      
    • OptionalstrictMinMaxPoints?: boolean

      If the number of points is strictly checked during the drawing process. If this setting is set to true, once the minimum or maximum amount of points is reached, the user cannot add or remove points that would violate the restriction. If this setting is set to false, the user can add or remove points even if the minimum or maximum amount of points is exceeded temporarily. Once the user tries to update or finish the drawing tool, the amount of points is checked in either case.

      true
      
    • OptionalweightedAdjacency?: AdjacencyEntry[][]

      Per-point adjacency graph. When a real point is dragged, its corrected delta is propagated to each listed target via component-wise weight multiplication. Entries with all-zero weights are no-ops and can be omitted. Processing order follows the array declaration order.

    keyBindings: {
        cancel: string | string[];
        confirm: string | string[];
        delete: string | string[];
        insert: string | string[];
        redo: string | string[];
        undo: string | string[];
    }

    The key binding settings of the drawing tool.

    Here you can define which keys are used for the different actions of the drawing tool.

    Type Declaration

    • cancel: string | string[]

      The key that is used to cancel drawing.

      'Escape'
      
    • confirm: string | string[]

      The key that is used to confirm actions.

      'Enter'
      
    • delete: string | string[]

      The key that is used to delete a point.

      ['Delete','-']
      
    • insert: string | string[]

      The key that is used to insert a point.

      ['Insert','+']
      
    • redo: string | string[]

      The keys that are used to redo the last action.

      'Control+Y'
      
    • undo: string | string[]

      The keys that are used to undo the last action.

      'Control+Z'
      
    restrictions: { [key: string]: RestrictionProperties }

    The restrictions of the drawing tool.

    Here you can define the restrictions that are used when interacting with the drawing tool. At least one restriction is required, the plane restriction is added by default if no restrictions are defined.

    visualization: IVisualizationSettings

    The visualization settings of the drawing tool.

    Here you can define the visualization of the drawing tool.

    controls?: IControl[]

    The controls of the drawing tool.

    Here you can define the controls that are used when interacting with the drawing tool. Controls are used to manipulate the points of the drawing tool in specific ways, such as moving a point along an edge or within a plane defined by other points.