import { z } from "zod"; import { IMaterialBasicLineDataPropertiesDefinition } from "../data/material/IMaterialBasicLineData"; import { IMaterialMultiPointDataPropertiesDefinition } from "../data/material/IMaterialMultiPointData"; import { RestrictionDefinition } from "./IRestrictionSettings"; export interface IControlSettings { } /** * General properties of a drawing tools parameter. */ export interface IDrawingParameterSettings { /** * 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. */ controls?: IControlSettings[]; general?: { /** A prompt that can be defined which is displayed instead of the default prompt. */ prompt?: { /** The title when the parameter is inactive. */ inactiveTitle?: string; /** The title when the parameter is active. */ activeTitle?: string; /** The text when the parameter is inactive. */ activeText?: string; }; options?: { /** If true, the distance labels are shown. (default: true) */ showDistanceLabels?: boolean; /** If true, the point labels are shown. (default: false) */ showPointLabels?: boolean; /** If true, the pointer position is shown. (default: true) */ showPointerPosition?: boolean; /** If true, the snapping to vertices is enabled, if there is a geometry restriction. (default: true) */ snapToVertices?: boolean; /** If true, the snapping to edges is enabled, if there is a geometry restriction. (default: true) */ snapToEdges?: boolean; /** If true, the snapping to faces is enabled, if there is a geometry restriction. (default: true) */ snapToFaces?: boolean; }; /** The mode to determine when the parameter is active. (default: 'default') */ activeMode?: "default" | "activeOnStart"; }; behavior?: { /** * The unit that will be displayed in the distance and point labels. * For some units, special formatting is applied ("mile", "feet", "inches", "kilometer", "meter", "centimeter", "millimeter"), * for other units, the unit is simply appended to the value in the end. * * @default '' */ displayUnit?: string; /** * 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. * * @default true */ enableTranslation?: 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. * * @default true */ enableInsertion?: 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. * * @default true */ enableDeletion?: 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. * * @default true */ enableSelection?: boolean; }; geometry?: { /** * 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. * * @default 'lines' */ mode: "points" | "lines"; /** * 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. * * @default undefined */ minPoints?: 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. * * @default undefined */ maxPoints?: number; /** * 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. * * @default true */ close: 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. * * @default true */ autoClose: boolean; /** * 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. */ weightedAdjacency?: { to: number; weights: [number, number, 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. */ disabledPoints?: 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. */ constraints?: { position?: { x?: [number, number]; y?: [number, number]; z?: [number, number]; }; size?: { x?: [number, number]; y?: [number, number]; z?: [number, number]; }; }; }; /** * The key binding settings of the drawing tool. * * Here you can define which keys are used for the different actions of the drawing tool. */ keyBindings?: { /** * The key that is used to insert a point. * * @default ['Insert','+'] */ insert?: string | string[]; /** * The key that is used to delete a point. * * @default ['Delete','-'] */ delete?: string | string[]; /** * The key that is used to confirm actions. * * @default 'Enter' */ confirm?: string | string[]; /** * The key that is used to cancel drawing. * * @default 'Escape' */ cancel?: string | string[]; /** * The keys that are used to undo the last action. * * @default 'Control+Z' */ undo?: string | string[]; /** * The keys that are used to redo the last action. * * @default 'Control+Y' */ redo?: string | string[]; }; restrictions?: RestrictionDefinition[]; visualization?: Partial; } export interface IVisualizationSettings { /** * If the distance labels are shown. * The distance labels display the distance between the points. * * @default true */ distanceLabels: boolean; /** * The multiplication factor of the point size when interactions are performed. * If the factor is set to 2, the point size is doubled when interacting. * * @default 2 */ distanceMultiplicationFactor: number; /** * The visualization settings for the edge control of the geometry restrictions. * If not defined, the edge control visualization is determined by the general line and point visualization settings. */ edgeControlVisualization?: Pick, "points" | "lines">; /** * The material properties of the lines. */ lines: IMaterialBasicLineDataPropertiesDefinition; /** * If the point labels are shown. * The point labels display the position of the points. * * @default false */ pointLabels: boolean; /** * If the pointer position is shown. * The pointer position displays the position of the pointer. * * @default true */ pointerPosition: boolean; /** * The material properties of the points. */ points: IMaterialMultiPointDataPropertiesDefinition; /** * If the geometry restrictions should display a wireframe. * * This settings is only applied to geometry restrictions that * do not have this settings defined already. * * @default undefined */ wireframe?: boolean; /** * The color of the wireframe. * * This settings is only applied to geometry restrictions that * do not have this settings defined already. * * @default undefined */ wireframeColor?: string; } export type DrawingParameterValue = { points: number[][]; }; export declare const validateDrawingParameterSettings: (param: unknown) => z.ZodSafeParseResult<{ controls?: any[] | null | undefined; geometry?: { mode: "lines" | "points"; minPoints?: number | null | undefined; maxPoints?: number | null | undefined; strictMinMaxPoints?: boolean | undefined; close?: boolean | undefined; autoClose?: boolean | undefined; weightedAdjacency?: { to: number; weights: [number, number, number]; }[][] | null | undefined; disabledPoints?: number[] | null | undefined; constraints?: { position?: { x?: [number, number] | null | undefined; y?: [number, number] | null | undefined; z?: [number, number] | null | undefined; } | null | undefined; size?: { x?: [number, number] | null | undefined; y?: [number, number] | null | undefined; z?: [number, number] | null | undefined; } | null | undefined; } | null | undefined; } | null | undefined; restrictions?: any[] | null | undefined; general?: { prompt?: { inactiveTitle?: string | null | undefined; activeTitle?: string | null | undefined; activeText?: string | null | undefined; } | null | undefined; options?: { showDistanceLabels?: boolean | undefined; showPointLabels?: boolean | undefined; showPointerPosition?: boolean | undefined; snapToVertices?: boolean | undefined; snapToEdges?: boolean | undefined; snapToFaces?: boolean | undefined; } | null | undefined; activeMode?: "default" | "activeOnStart" | undefined; } | null | undefined; behavior?: { displayUnit?: string | null | undefined; enableTranslation?: boolean | undefined; enableInsertion?: boolean | undefined; enableDeletion?: boolean | undefined; enableSelection?: boolean | undefined; } | null | undefined; keyBindings?: { insert?: string | string[] | undefined; delete?: string | string[] | undefined; confirm?: string | string[] | undefined; cancel?: string | string[] | undefined; undo?: string | string[] | undefined; redo?: string | string[] | undefined; } | null | undefined; visualization?: { distanceLabels?: boolean | undefined; pointLabels?: boolean | undefined; pointerPosition?: boolean | undefined; distanceMultiplicationFactor?: number | null | undefined; lines?: any; points?: any; wireframe?: boolean | undefined; wireframeColor?: string | null | undefined; edgeControlVisualization?: { lines?: any; points?: any; } | null | undefined; } | null | undefined; }>; export declare const IDrawingParameterVisualizationSettingsJsonSchema: z.ZodOptional>; pointLabels: z.ZodPreprocess>; pointerPosition: z.ZodPreprocess>; distanceMultiplicationFactor: z.ZodOptional>; lines: z.ZodOptional>; points: z.ZodOptional>; wireframe: z.ZodPreprocess>; wireframeColor: z.ZodOptional>; edgeControlVisualization: z.ZodOptional>; points: z.ZodOptional>; }, z.core.$strip>>>; }, z.core.$strip>>>; export declare const IDrawingParameterJsonSchema: z.ZodObject<{ controls: z.ZodOptional>>; geometry: z.ZodOptional; minPoints: z.ZodOptional>; maxPoints: z.ZodOptional>; strictMinMaxPoints: z.ZodPreprocess>; close: z.ZodPreprocess>; autoClose: z.ZodPreprocess>; weightedAdjacency: z.ZodOptional; }, z.core.$strip>>>>>; disabledPoints: z.ZodOptional>>; constraints: z.ZodOptional>>; y: z.ZodOptional>>; z: z.ZodOptional>>; }, z.core.$strip>>>; size: z.ZodOptional>>; y: z.ZodOptional>>; z: z.ZodOptional>>; }, z.core.$strip>>>; }, z.core.$strip>>>; }, z.core.$strip>>>; restrictions: z.ZodOptional>>; general: z.ZodOptional>; activeTitle: z.ZodOptional>; activeText: z.ZodOptional>; }, z.core.$strip>>>; options: z.ZodOptional>; showPointLabels: z.ZodPreprocess>; showPointerPosition: z.ZodPreprocess>; snapToVertices: z.ZodPreprocess>; snapToEdges: z.ZodPreprocess>; snapToFaces: z.ZodPreprocess>; }, z.core.$strip>>>; activeMode: z.ZodOptional>; }, z.core.$strip>>>; behavior: z.ZodOptional>; enableTranslation: z.ZodPreprocess>; enableInsertion: z.ZodPreprocess>; enableDeletion: z.ZodPreprocess>; enableSelection: z.ZodPreprocess>; }, z.core.$strip>>>; keyBindings: z.ZodOptional]>>; delete: z.ZodOptional]>>; confirm: z.ZodOptional]>>; cancel: z.ZodOptional]>>; undo: z.ZodOptional]>>; redo: z.ZodOptional]>>; }, z.core.$strip>>>; visualization: z.ZodOptional>; pointLabels: z.ZodPreprocess>; pointerPosition: z.ZodPreprocess>; distanceMultiplicationFactor: z.ZodOptional>; lines: z.ZodOptional>; points: z.ZodOptional>; wireframe: z.ZodPreprocess>; wireframeColor: z.ZodOptional>; edgeControlVisualization: z.ZodOptional>; points: z.ZodOptional>; }, z.core.$strip>>>; }, z.core.$strip>>>; }, z.core.$strip>; //# sourceMappingURL=IDrawingParametersSettings.d.ts.map