@shapediver/viewer.rendering-engine.intersection-restriction-engine 3.16.8 → 3.16.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/api/implementation/AbstractRestrictionApi.d.ts +12 -12
  2. package/dist/api/implementation/AbstractRestrictionApi.js +46 -46
  3. package/dist/api/implementation/AbstractRestrictionApi.js.map +1 -1
  4. package/dist/api/implementation/AbstractSnapRestrictionApi.d.ts +12 -12
  5. package/dist/api/implementation/AbstractSnapRestrictionApi.js +46 -46
  6. package/dist/api/implementation/AbstractSnapRestrictionApi.js.map +1 -1
  7. package/dist/api/implementation/camera_plane/CameraPlaneRestrictionApi.d.ts +6 -6
  8. package/dist/api/implementation/camera_plane/CameraPlaneRestrictionApi.js +23 -23
  9. package/dist/api/implementation/camera_plane/CameraPlaneRestrictionApi.js.map +1 -1
  10. package/dist/api/implementation/geometry/GeometryRestrictionApi.d.ts +14 -14
  11. package/dist/api/implementation/geometry/GeometryRestrictionApi.js +53 -53
  12. package/dist/api/implementation/geometry/GeometryRestrictionApi.js.map +1 -1
  13. package/dist/api/implementation/line/LineRestrictionApi.d.ts +10 -10
  14. package/dist/api/implementation/line/LineRestrictionApi.js +39 -39
  15. package/dist/api/implementation/line/LineRestrictionApi.js.map +1 -1
  16. package/dist/api/implementation/plane/PlaneRestrictionApi.d.ts +19 -19
  17. package/dist/api/implementation/plane/PlaneRestrictionApi.js +66 -66
  18. package/dist/api/implementation/plane/PlaneRestrictionApi.js.map +1 -1
  19. package/dist/api/implementation/plane/snap/AngularRestrictionApi.d.ts +9 -9
  20. package/dist/api/implementation/plane/snap/AngularRestrictionApi.js +39 -39
  21. package/dist/api/implementation/plane/snap/AngularRestrictionApi.js.map +1 -1
  22. package/dist/api/implementation/plane/snap/AxisRestrictionApi.d.ts +6 -6
  23. package/dist/api/implementation/plane/snap/AxisRestrictionApi.js +23 -23
  24. package/dist/api/implementation/plane/snap/AxisRestrictionApi.js.map +1 -1
  25. package/dist/api/implementation/plane/snap/GridRestrictionApi.d.ts +9 -9
  26. package/dist/api/implementation/plane/snap/GridRestrictionApi.js +39 -39
  27. package/dist/api/implementation/plane/snap/GridRestrictionApi.js.map +1 -1
  28. package/dist/api/implementation/point/PointRestrictionApi.d.ts +9 -9
  29. package/dist/api/implementation/point/PointRestrictionApi.js +36 -36
  30. package/dist/api/implementation/point/PointRestrictionApi.js.map +1 -1
  31. package/dist/api/interfaces/IRestrictionApi.d.ts +10 -10
  32. package/dist/api/interfaces/IRestrictionApi.js +2 -2
  33. package/dist/api/interfaces/ISnapRestrictionApi.d.ts +12 -12
  34. package/dist/api/interfaces/ISnapRestrictionApi.js +2 -2
  35. package/dist/implementation/EventManager.d.ts +25 -25
  36. package/dist/implementation/EventManager.d.ts.map +1 -1
  37. package/dist/implementation/EventManager.js +62 -62
  38. package/dist/implementation/EventManager.js.map +1 -1
  39. package/dist/implementation/GeometryMathManager.d.ts +87 -87
  40. package/dist/implementation/GeometryMathManager.js +260 -260
  41. package/dist/implementation/GeometryMathManager.js.map +1 -1
  42. package/dist/implementation/RestrictionManager.d.ts +28 -28
  43. package/dist/implementation/RestrictionManager.js +323 -323
  44. package/dist/implementation/RestrictionManager.js.map +1 -1
  45. package/dist/implementation/restrictions/AbstractRestriction.d.ts +42 -42
  46. package/dist/implementation/restrictions/AbstractRestriction.js +164 -154
  47. package/dist/implementation/restrictions/AbstractRestriction.js.map +1 -1
  48. package/dist/implementation/restrictions/AbstractSnapRestriction.d.ts +35 -35
  49. package/dist/implementation/restrictions/AbstractSnapRestriction.js +150 -140
  50. package/dist/implementation/restrictions/AbstractSnapRestriction.js.map +1 -1
  51. package/dist/implementation/restrictions/RestrictionsHelper.d.ts +10 -10
  52. package/dist/implementation/restrictions/RestrictionsHelper.d.ts.map +1 -1
  53. package/dist/implementation/restrictions/RestrictionsHelper.js +50 -50
  54. package/dist/implementation/restrictions/RestrictionsHelper.js.map +1 -1
  55. package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.d.ts +17 -17
  56. package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.js +62 -62
  57. package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.js.map +1 -1
  58. package/dist/implementation/restrictions/geometry/GeometryRestriction.d.ts +92 -92
  59. package/dist/implementation/restrictions/geometry/GeometryRestriction.js +410 -400
  60. package/dist/implementation/restrictions/geometry/GeometryRestriction.js.map +1 -1
  61. package/dist/implementation/restrictions/line/LineRestriction.d.ts +58 -58
  62. package/dist/implementation/restrictions/line/LineRestriction.js +291 -281
  63. package/dist/implementation/restrictions/line/LineRestriction.js.map +1 -1
  64. package/dist/implementation/restrictions/plane/PlaneRestriction.d.ts +65 -65
  65. package/dist/implementation/restrictions/plane/PlaneRestriction.js +306 -306
  66. package/dist/implementation/restrictions/plane/PlaneRestriction.js.map +1 -1
  67. package/dist/implementation/restrictions/plane/snap/AngularRestriction.d.ts +39 -39
  68. package/dist/implementation/restrictions/plane/snap/AngularRestriction.d.ts.map +1 -1
  69. package/dist/implementation/restrictions/plane/snap/AngularRestriction.js +346 -346
  70. package/dist/implementation/restrictions/plane/snap/AngularRestriction.js.map +1 -1
  71. package/dist/implementation/restrictions/plane/snap/AxisRestriction.d.ts +27 -27
  72. package/dist/implementation/restrictions/plane/snap/AxisRestriction.d.ts.map +1 -1
  73. package/dist/implementation/restrictions/plane/snap/AxisRestriction.js +239 -229
  74. package/dist/implementation/restrictions/plane/snap/AxisRestriction.js.map +1 -1
  75. package/dist/implementation/restrictions/plane/snap/GridRestriction.d.ts +39 -39
  76. package/dist/implementation/restrictions/plane/snap/GridRestriction.d.ts.map +1 -1
  77. package/dist/implementation/restrictions/plane/snap/GridRestriction.js +318 -308
  78. package/dist/implementation/restrictions/plane/snap/GridRestriction.js.map +1 -1
  79. package/dist/implementation/restrictions/point/PointRestriction.d.ts +45 -45
  80. package/dist/implementation/restrictions/point/PointRestriction.js +166 -156
  81. package/dist/implementation/restrictions/point/PointRestriction.js.map +1 -1
  82. package/dist/index.d.ts +29 -29
  83. package/dist/index.js +37 -37
  84. package/dist/interfaces/IDragAnchor.d.ts +8 -8
  85. package/dist/interfaces/IDragAnchor.js +2 -2
  86. package/dist/interfaces/IRestriction.d.ts +117 -117
  87. package/dist/interfaces/IRestriction.d.ts.map +1 -1
  88. package/dist/interfaces/IRestriction.js +23 -23
  89. package/dist/interfaces/IRestriction.js.map +1 -1
  90. package/dist/interfaces/IRestrictionManager.d.ts +13 -13
  91. package/dist/interfaces/IRestrictionManager.js +2 -2
  92. package/dist/interfaces/ISnapRestriction.d.ts +81 -81
  93. package/dist/interfaces/ISnapRestriction.d.ts.map +1 -1
  94. package/dist/interfaces/ISnapRestriction.js +3 -3
  95. package/package.json +10 -10
package/dist/index.js CHANGED
@@ -1,38 +1,38 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LineRestrictionApi = exports.PointRestrictionApi = exports.CameraPlaneRestrictionApi = exports.GeometryRestrictionApi = exports.GridRestrictionApi = exports.AxisRestrictionApi = exports.AngularRestrictionApi = exports.PlaneRestrictionApi = exports.CameraPlaneRestriction = exports.LineRestriction = exports.PointRestriction = exports.GeometryRestriction = exports.PlaneRestriction = exports.RESTRICTION_TYPE = exports.GeometryMathManager = exports.EventManager = exports.RestrictionManager = void 0;
4
- const CameraPlaneRestrictionApi_1 = require("./api/implementation/camera_plane/CameraPlaneRestrictionApi");
5
- Object.defineProperty(exports, "CameraPlaneRestrictionApi", { enumerable: true, get: function () { return CameraPlaneRestrictionApi_1.CameraPlaneRestrictionApi; } });
6
- const GeometryRestrictionApi_1 = require("./api/implementation/geometry/GeometryRestrictionApi");
7
- Object.defineProperty(exports, "GeometryRestrictionApi", { enumerable: true, get: function () { return GeometryRestrictionApi_1.GeometryRestrictionApi; } });
8
- const LineRestrictionApi_1 = require("./api/implementation/line/LineRestrictionApi");
9
- Object.defineProperty(exports, "LineRestrictionApi", { enumerable: true, get: function () { return LineRestrictionApi_1.LineRestrictionApi; } });
10
- const PlaneRestrictionApi_1 = require("./api/implementation/plane/PlaneRestrictionApi");
11
- Object.defineProperty(exports, "PlaneRestrictionApi", { enumerable: true, get: function () { return PlaneRestrictionApi_1.PlaneRestrictionApi; } });
12
- const AngularRestrictionApi_1 = require("./api/implementation/plane/snap/AngularRestrictionApi");
13
- Object.defineProperty(exports, "AngularRestrictionApi", { enumerable: true, get: function () { return AngularRestrictionApi_1.AngularRestrictionApi; } });
14
- const AxisRestrictionApi_1 = require("./api/implementation/plane/snap/AxisRestrictionApi");
15
- Object.defineProperty(exports, "AxisRestrictionApi", { enumerable: true, get: function () { return AxisRestrictionApi_1.AxisRestrictionApi; } });
16
- const GridRestrictionApi_1 = require("./api/implementation/plane/snap/GridRestrictionApi");
17
- Object.defineProperty(exports, "GridRestrictionApi", { enumerable: true, get: function () { return GridRestrictionApi_1.GridRestrictionApi; } });
18
- const PointRestrictionApi_1 = require("./api/implementation/point/PointRestrictionApi");
19
- Object.defineProperty(exports, "PointRestrictionApi", { enumerable: true, get: function () { return PointRestrictionApi_1.PointRestrictionApi; } });
20
- const EventManager_1 = require("./implementation/EventManager");
21
- Object.defineProperty(exports, "EventManager", { enumerable: true, get: function () { return EventManager_1.EventManager; } });
22
- const GeometryMathManager_1 = require("./implementation/GeometryMathManager");
23
- Object.defineProperty(exports, "GeometryMathManager", { enumerable: true, get: function () { return GeometryMathManager_1.GeometryMathManager; } });
24
- const RestrictionManager_1 = require("./implementation/RestrictionManager");
25
- Object.defineProperty(exports, "RestrictionManager", { enumerable: true, get: function () { return RestrictionManager_1.RestrictionManager; } });
26
- const CameraPlaneRestriction_1 = require("./implementation/restrictions/camera_plane/CameraPlaneRestriction");
27
- Object.defineProperty(exports, "CameraPlaneRestriction", { enumerable: true, get: function () { return CameraPlaneRestriction_1.CameraPlaneRestriction; } });
28
- const GeometryRestriction_1 = require("./implementation/restrictions/geometry/GeometryRestriction");
29
- Object.defineProperty(exports, "GeometryRestriction", { enumerable: true, get: function () { return GeometryRestriction_1.GeometryRestriction; } });
30
- const LineRestriction_1 = require("./implementation/restrictions/line/LineRestriction");
31
- Object.defineProperty(exports, "LineRestriction", { enumerable: true, get: function () { return LineRestriction_1.LineRestriction; } });
32
- const PlaneRestriction_1 = require("./implementation/restrictions/plane/PlaneRestriction");
33
- Object.defineProperty(exports, "PlaneRestriction", { enumerable: true, get: function () { return PlaneRestriction_1.PlaneRestriction; } });
34
- const PointRestriction_1 = require("./implementation/restrictions/point/PointRestriction");
35
- Object.defineProperty(exports, "PointRestriction", { enumerable: true, get: function () { return PointRestriction_1.PointRestriction; } });
36
- const IRestriction_1 = require("./interfaces/IRestriction");
37
- Object.defineProperty(exports, "RESTRICTION_TYPE", { enumerable: true, get: function () { return IRestriction_1.RESTRICTION_TYPE; } });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LineRestrictionApi = exports.PointRestrictionApi = exports.CameraPlaneRestrictionApi = exports.GeometryRestrictionApi = exports.GridRestrictionApi = exports.AxisRestrictionApi = exports.AngularRestrictionApi = exports.PlaneRestrictionApi = exports.CameraPlaneRestriction = exports.LineRestriction = exports.PointRestriction = exports.GeometryRestriction = exports.PlaneRestriction = exports.RESTRICTION_TYPE = exports.GeometryMathManager = exports.EventManager = exports.RestrictionManager = void 0;
4
+ const CameraPlaneRestrictionApi_1 = require("./api/implementation/camera_plane/CameraPlaneRestrictionApi");
5
+ Object.defineProperty(exports, "CameraPlaneRestrictionApi", { enumerable: true, get: function () { return CameraPlaneRestrictionApi_1.CameraPlaneRestrictionApi; } });
6
+ const GeometryRestrictionApi_1 = require("./api/implementation/geometry/GeometryRestrictionApi");
7
+ Object.defineProperty(exports, "GeometryRestrictionApi", { enumerable: true, get: function () { return GeometryRestrictionApi_1.GeometryRestrictionApi; } });
8
+ const LineRestrictionApi_1 = require("./api/implementation/line/LineRestrictionApi");
9
+ Object.defineProperty(exports, "LineRestrictionApi", { enumerable: true, get: function () { return LineRestrictionApi_1.LineRestrictionApi; } });
10
+ const PlaneRestrictionApi_1 = require("./api/implementation/plane/PlaneRestrictionApi");
11
+ Object.defineProperty(exports, "PlaneRestrictionApi", { enumerable: true, get: function () { return PlaneRestrictionApi_1.PlaneRestrictionApi; } });
12
+ const AngularRestrictionApi_1 = require("./api/implementation/plane/snap/AngularRestrictionApi");
13
+ Object.defineProperty(exports, "AngularRestrictionApi", { enumerable: true, get: function () { return AngularRestrictionApi_1.AngularRestrictionApi; } });
14
+ const AxisRestrictionApi_1 = require("./api/implementation/plane/snap/AxisRestrictionApi");
15
+ Object.defineProperty(exports, "AxisRestrictionApi", { enumerable: true, get: function () { return AxisRestrictionApi_1.AxisRestrictionApi; } });
16
+ const GridRestrictionApi_1 = require("./api/implementation/plane/snap/GridRestrictionApi");
17
+ Object.defineProperty(exports, "GridRestrictionApi", { enumerable: true, get: function () { return GridRestrictionApi_1.GridRestrictionApi; } });
18
+ const PointRestrictionApi_1 = require("./api/implementation/point/PointRestrictionApi");
19
+ Object.defineProperty(exports, "PointRestrictionApi", { enumerable: true, get: function () { return PointRestrictionApi_1.PointRestrictionApi; } });
20
+ const EventManager_1 = require("./implementation/EventManager");
21
+ Object.defineProperty(exports, "EventManager", { enumerable: true, get: function () { return EventManager_1.EventManager; } });
22
+ const GeometryMathManager_1 = require("./implementation/GeometryMathManager");
23
+ Object.defineProperty(exports, "GeometryMathManager", { enumerable: true, get: function () { return GeometryMathManager_1.GeometryMathManager; } });
24
+ const RestrictionManager_1 = require("./implementation/RestrictionManager");
25
+ Object.defineProperty(exports, "RestrictionManager", { enumerable: true, get: function () { return RestrictionManager_1.RestrictionManager; } });
26
+ const CameraPlaneRestriction_1 = require("./implementation/restrictions/camera_plane/CameraPlaneRestriction");
27
+ Object.defineProperty(exports, "CameraPlaneRestriction", { enumerable: true, get: function () { return CameraPlaneRestriction_1.CameraPlaneRestriction; } });
28
+ const GeometryRestriction_1 = require("./implementation/restrictions/geometry/GeometryRestriction");
29
+ Object.defineProperty(exports, "GeometryRestriction", { enumerable: true, get: function () { return GeometryRestriction_1.GeometryRestriction; } });
30
+ const LineRestriction_1 = require("./implementation/restrictions/line/LineRestriction");
31
+ Object.defineProperty(exports, "LineRestriction", { enumerable: true, get: function () { return LineRestriction_1.LineRestriction; } });
32
+ const PlaneRestriction_1 = require("./implementation/restrictions/plane/PlaneRestriction");
33
+ Object.defineProperty(exports, "PlaneRestriction", { enumerable: true, get: function () { return PlaneRestriction_1.PlaneRestriction; } });
34
+ const PointRestriction_1 = require("./implementation/restrictions/point/PointRestriction");
35
+ Object.defineProperty(exports, "PointRestriction", { enumerable: true, get: function () { return PointRestriction_1.PointRestriction; } });
36
+ const IRestriction_1 = require("./interfaces/IRestriction");
37
+ Object.defineProperty(exports, "RESTRICTION_TYPE", { enumerable: true, get: function () { return IRestriction_1.RESTRICTION_TYPE; } });
38
38
  //# sourceMappingURL=index.js.map
@@ -1,9 +1,9 @@
1
- import { vec3 } from "gl-matrix";
2
- export interface IDragAnchor {
3
- position: vec3;
4
- rotation?: {
5
- axis: vec3;
6
- angle: number;
7
- };
8
- }
1
+ import { vec3 } from "gl-matrix";
2
+ export interface IDragAnchor {
3
+ position: vec3;
4
+ rotation?: {
5
+ axis: vec3;
6
+ angle: number;
7
+ };
8
+ }
9
9
  //# sourceMappingURL=IDragAnchor.d.ts.map
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=IDragAnchor.js.map
@@ -1,118 +1,118 @@
1
- import { mat4, vec3 } from "gl-matrix";
2
- import { ITreeNode } from "@shapediver/viewer.shared.node-tree";
3
- import { IRay } from "@shapediver/viewer.shared.types";
4
- import { CameraPlaneRestrictionProperties } from "../implementation/restrictions/camera_plane/CameraPlaneRestriction";
5
- import { GeometryRestrictionProperties } from "../implementation/restrictions/geometry/GeometryRestriction";
6
- import { LineRestrictionProperties } from "../implementation/restrictions/line/LineRestriction";
7
- import { PlaneRestrictionProperties } from "../implementation/restrictions/plane/PlaneRestriction";
8
- import { PointRestrictionProperties } from "../implementation/restrictions/point/PointRestriction";
9
- import { IDragAnchor } from "./IDragAnchor";
10
- import { ISnapRestriction } from "./ISnapRestriction";
11
- export declare enum RESTRICTION_TYPE {
12
- PLANE = "plane",
13
- GEOMETRY = "geometry",
14
- POINT = "point",
15
- LINE = "line",
16
- CAMERA_PLANE = "camera_plane"
17
- }
18
- export interface DraggingRestrictionMetaData extends RestrictionMetaData {
19
- dragAnchors?: IDragAnchor[];
20
- dragOrigin: vec3;
21
- node: ITreeNode;
22
- type: "dragging";
23
- }
24
- export interface DrawingRestrictionMetaData extends RestrictionMetaData {
25
- index?: number;
26
- positionArray?: Float32Array;
27
- type: "drawing";
28
- }
29
- export interface TransformationToolsRestrictionMetaData extends RestrictionMetaData {
30
- type: "transformation-tools";
31
- }
32
- export interface IRestriction {
33
- readonly id: string;
34
- readonly priority: number;
35
- readonly snapRestrictions: {
36
- [key: string]: ISnapRestriction;
37
- };
38
- readonly type: RESTRICTION_TYPE;
39
- enabled: boolean;
40
- hideable: boolean;
41
- rotation: {
42
- axis: vec3;
43
- angle: number;
44
- };
45
- showVisualization: boolean;
46
- /**
47
- * Ray trace the restriction.
48
- * If the ray does not intersect the restriction, the method returns undefined.
49
- *
50
- * @param ray The ray to trace.
51
- * @param metaData The meta data of the ray.
52
- * @returns The intersection point of the ray with the restriction.
53
- */
54
- rayTrace(ray: IRay, metaData?: RestrictionMetaData): RestrictionResult | undefined;
55
- /**
56
- * Remove the visualization of the restriction.
57
- */
58
- removeVisualization(): void;
59
- }
60
- export interface RestrictionMetaData {
61
- pressedKeys?: string[];
62
- toggledKeys?: string[];
63
- startPoint?: vec3;
64
- type: "drawing" | "dragging" | "transformation-tools";
65
- }
66
- export interface RestrictionPropertiesBase {
67
- /**
68
- * Whether to create visual helper objects (grid, axis, etc.) for restrictions. (default: true)
69
- */
70
- createHelperObjects?: boolean;
71
- /**
72
- * If the restriction should be hidden by geometry in front of it. (default: false)
73
- */
74
- hideable?: boolean;
75
- /**
76
- * The id of the restriction.
77
- */
78
- id?: string;
79
- /**
80
- * The priority of the restriction.
81
- */
82
- priority?: number;
83
- /**
84
- * The rotation of the object after the restriction is applied.
85
- */
86
- rotation?: {
87
- axis: vec3;
88
- angle: number;
89
- };
90
- /**
91
- * Type of the restriction
92
- */
93
- type: RESTRICTION_TYPE;
94
- }
95
- export declare type RayTraceResult = {
96
- distance?: number;
97
- distanceSquared?: number;
98
- dragAnchor?: IDragAnchor;
99
- point: vec3;
100
- closestPointOnRay?: vec3;
101
- restriction: IRestriction;
102
- transformation?: mat4;
103
- restrictionResult: RestrictionResult;
104
- };
105
- export declare type RestrictionProperties = PointRestrictionProperties | PlaneRestrictionProperties | LineRestrictionProperties | GeometryRestrictionProperties | CameraPlaneRestrictionProperties;
106
- export declare type RestrictionResult = {
107
- closestIntersectionPoint: vec3;
108
- distanceOriginToClosestIntersectionPointSquared: number;
109
- targetPoint: vec3;
110
- distanceClosestPointToTargetPointSquared: number;
111
- restriction: IRestriction;
112
- snapRestriction?: ISnapRestriction;
113
- restrictionIntersectionData?: unknown;
114
- };
115
- export declare const isDraggingRestriction: (metaData?: RestrictionMetaData) => metaData is DraggingRestrictionMetaData;
116
- export declare const isDrawingRestriction: (metaData?: RestrictionMetaData) => metaData is DrawingRestrictionMetaData;
117
- export declare const isTransformationToolsRestriction: (metaData?: RestrictionMetaData) => metaData is TransformationToolsRestrictionMetaData;
1
+ import { mat4, vec3 } from "gl-matrix";
2
+ import { ITreeNode } from "@shapediver/viewer.shared.node-tree";
3
+ import { IRay } from "@shapediver/viewer.shared.types";
4
+ import { CameraPlaneRestrictionProperties } from "../implementation/restrictions/camera_plane/CameraPlaneRestriction";
5
+ import { GeometryRestrictionProperties } from "../implementation/restrictions/geometry/GeometryRestriction";
6
+ import { LineRestrictionProperties } from "../implementation/restrictions/line/LineRestriction";
7
+ import { PlaneRestrictionProperties } from "../implementation/restrictions/plane/PlaneRestriction";
8
+ import { PointRestrictionProperties } from "../implementation/restrictions/point/PointRestriction";
9
+ import { IDragAnchor } from "./IDragAnchor";
10
+ import { ISnapRestriction } from "./ISnapRestriction";
11
+ export declare enum RESTRICTION_TYPE {
12
+ PLANE = "plane",
13
+ GEOMETRY = "geometry",
14
+ POINT = "point",
15
+ LINE = "line",
16
+ CAMERA_PLANE = "camera_plane"
17
+ }
18
+ export interface DraggingRestrictionMetaData extends RestrictionMetaData {
19
+ dragAnchors?: IDragAnchor[];
20
+ dragOrigin: vec3;
21
+ node: ITreeNode;
22
+ type: "dragging";
23
+ }
24
+ export interface DrawingRestrictionMetaData extends RestrictionMetaData {
25
+ index?: number;
26
+ positionArray?: Float32Array;
27
+ type: "drawing";
28
+ }
29
+ export interface TransformationToolsRestrictionMetaData extends RestrictionMetaData {
30
+ type: "transformation-tools";
31
+ }
32
+ export interface IRestriction {
33
+ readonly id: string;
34
+ readonly priority: number;
35
+ readonly snapRestrictions: {
36
+ [key: string]: ISnapRestriction;
37
+ };
38
+ readonly type: RESTRICTION_TYPE;
39
+ enabled: boolean;
40
+ hideable: boolean;
41
+ rotation: {
42
+ axis: vec3;
43
+ angle: number;
44
+ };
45
+ showVisualization: boolean;
46
+ /**
47
+ * Ray trace the restriction.
48
+ * If the ray does not intersect the restriction, the method returns undefined.
49
+ *
50
+ * @param ray The ray to trace.
51
+ * @param metaData The meta data of the ray.
52
+ * @returns The intersection point of the ray with the restriction.
53
+ */
54
+ rayTrace(ray: IRay, metaData?: RestrictionMetaData): RestrictionResult | undefined;
55
+ /**
56
+ * Remove the visualization of the restriction.
57
+ */
58
+ removeVisualization(): void;
59
+ }
60
+ export interface RestrictionMetaData {
61
+ pressedKeys?: string[];
62
+ toggledKeys?: string[];
63
+ startPoint?: vec3;
64
+ type: "drawing" | "dragging" | "transformation-tools";
65
+ }
66
+ export interface RestrictionPropertiesBase {
67
+ /**
68
+ * Whether to create visual helper objects (grid, axis, etc.) for restrictions. (default: true)
69
+ */
70
+ createHelperObjects?: boolean;
71
+ /**
72
+ * If the restriction should be hidden by geometry in front of it. (default: false)
73
+ */
74
+ hideable?: boolean;
75
+ /**
76
+ * The id of the restriction.
77
+ */
78
+ id?: string;
79
+ /**
80
+ * The priority of the restriction.
81
+ */
82
+ priority?: number;
83
+ /**
84
+ * The rotation of the object after the restriction is applied.
85
+ */
86
+ rotation?: {
87
+ axis: vec3;
88
+ angle: number;
89
+ };
90
+ /**
91
+ * Type of the restriction
92
+ */
93
+ type: RESTRICTION_TYPE;
94
+ }
95
+ export type RayTraceResult = {
96
+ distance?: number;
97
+ distanceSquared?: number;
98
+ dragAnchor?: IDragAnchor;
99
+ point: vec3;
100
+ closestPointOnRay?: vec3;
101
+ restriction: IRestriction;
102
+ transformation?: mat4;
103
+ restrictionResult: RestrictionResult;
104
+ };
105
+ export type RestrictionProperties = PointRestrictionProperties | PlaneRestrictionProperties | LineRestrictionProperties | GeometryRestrictionProperties | CameraPlaneRestrictionProperties;
106
+ export type RestrictionResult = {
107
+ closestIntersectionPoint: vec3;
108
+ distanceOriginToClosestIntersectionPointSquared: number;
109
+ targetPoint: vec3;
110
+ distanceClosestPointToTargetPointSquared: number;
111
+ restriction: IRestriction;
112
+ snapRestriction?: ISnapRestriction;
113
+ restrictionIntersectionData?: unknown;
114
+ };
115
+ export declare const isDraggingRestriction: (metaData?: RestrictionMetaData) => metaData is DraggingRestrictionMetaData;
116
+ export declare const isDrawingRestriction: (metaData?: RestrictionMetaData) => metaData is DrawingRestrictionMetaData;
117
+ export declare const isTransformationToolsRestriction: (metaData?: RestrictionMetaData) => metaData is TransformationToolsRestrictionMetaData;
118
118
  //# sourceMappingURL=IRestriction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IRestriction.d.ts","sourceRoot":"","sources":["../../src/interfaces/IRestriction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAE,IAAI,EAAC,MAAM,WAAW,C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AM,qBAAqB,GACjC,WAAW,mBAAmB,KAC5B,QAAQ,IAAI,2BAEd,CAAC;AACF,eAAO,MAAM,oBAAoB,GAChC,WAAW,mBAAmB,KAC5B,QAAQ,IAAI,0BAEd,CAAC;AACF,eAAO,MAAM,gCAAgC,GAC5C,WAAW,mBAAmB,KAC5B,QAAQ,IAAI,sCAEd,CAAC"}
@@ -1,24 +1,24 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isTransformationToolsRestriction = exports.isDrawingRestriction = exports.isDraggingRestriction = exports.RESTRICTION_TYPE = void 0;
4
- var RESTRICTION_TYPE;
5
- (function (RESTRICTION_TYPE) {
6
- RESTRICTION_TYPE["PLANE"] = "plane";
7
- RESTRICTION_TYPE["GEOMETRY"] = "geometry";
8
- RESTRICTION_TYPE["POINT"] = "point";
9
- RESTRICTION_TYPE["LINE"] = "line";
10
- RESTRICTION_TYPE["CAMERA_PLANE"] = "camera_plane";
11
- })(RESTRICTION_TYPE = exports.RESTRICTION_TYPE || (exports.RESTRICTION_TYPE = {}));
12
- const isDraggingRestriction = (metaData) => {
13
- return (metaData === null || metaData === void 0 ? void 0 : metaData.type) === "dragging";
14
- };
15
- exports.isDraggingRestriction = isDraggingRestriction;
16
- const isDrawingRestriction = (metaData) => {
17
- return (metaData === null || metaData === void 0 ? void 0 : metaData.type) === "drawing";
18
- };
19
- exports.isDrawingRestriction = isDrawingRestriction;
20
- const isTransformationToolsRestriction = (metaData) => {
21
- return (metaData === null || metaData === void 0 ? void 0 : metaData.type) === "transformation-tools";
22
- };
23
- exports.isTransformationToolsRestriction = isTransformationToolsRestriction;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isTransformationToolsRestriction = exports.isDrawingRestriction = exports.isDraggingRestriction = exports.RESTRICTION_TYPE = void 0;
4
+ var RESTRICTION_TYPE;
5
+ (function (RESTRICTION_TYPE) {
6
+ RESTRICTION_TYPE["PLANE"] = "plane";
7
+ RESTRICTION_TYPE["GEOMETRY"] = "geometry";
8
+ RESTRICTION_TYPE["POINT"] = "point";
9
+ RESTRICTION_TYPE["LINE"] = "line";
10
+ RESTRICTION_TYPE["CAMERA_PLANE"] = "camera_plane";
11
+ })(RESTRICTION_TYPE || (exports.RESTRICTION_TYPE = RESTRICTION_TYPE = {}));
12
+ const isDraggingRestriction = (metaData) => {
13
+ return (metaData === null || metaData === void 0 ? void 0 : metaData.type) === "dragging";
14
+ };
15
+ exports.isDraggingRestriction = isDraggingRestriction;
16
+ const isDrawingRestriction = (metaData) => {
17
+ return (metaData === null || metaData === void 0 ? void 0 : metaData.type) === "drawing";
18
+ };
19
+ exports.isDrawingRestriction = isDrawingRestriction;
20
+ const isTransformationToolsRestriction = (metaData) => {
21
+ return (metaData === null || metaData === void 0 ? void 0 : metaData.type) === "transformation-tools";
22
+ };
23
+ exports.isTransformationToolsRestriction = isTransformationToolsRestriction;
24
24
  //# sourceMappingURL=IRestriction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IRestriction.js","sourceRoot":"","sources":["../../src/interfaces/IRestriction.ts"],"names":[],"mappings":";;;AAYA,IAAY,gBAMX;AAND,WAAY,gBAAgB;IAC3B,mCAAe,CAAA;IACf,yCAAqB,CAAA;IACrB,mCAAe,CAAA;IACf,iCAAa,CAAA;IACb,iDAA6B,CAAA;AAC9B,CAAC,EANW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAM3B;AA4HM,MAAM,qBAAqB,GAAG,CACpC,QAA8B,EACY,EAAE;IAC5C,OAAO,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,MAAK,UAAU,CAAC;AACtC,CAAC,CAAC;AAJW,QAAA,qBAAqB,yBAIhC;AACK,MAAM,oBAAoB,GAAG,CACnC,QAA8B,EACW,EAAE;IAC3C,OAAO,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,MAAK,SAAS,CAAC;AACrC,CAAC,CAAC;AAJW,QAAA,oBAAoB,wBAI/B;AACK,MAAM,gCAAgC,GAAG,CAC/C,QAA8B,EACuB,EAAE;IACvD,OAAO,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,MAAK,sBAAsB,CAAC;AAClD,CAAC,CAAC;AAJW,QAAA,gCAAgC,oCAI3C"}
1
+ {"version":3,"file":"IRestriction.js","sourceRoot":"","sources":["../../src/interfaces/IRestriction.ts"],"names":[],"mappings":";;;AAYA,IAAY,gBAMX;AAND,WAAY,gBAAgB;IAC3B,mCAAe,CAAA;IACf,yCAAqB,CAAA;IACrB,mCAAe,CAAA;IACf,iCAAa,CAAA;IACb,iDAA6B,CAAA;AAC9B,CAAC,EANW,gBAAgB,gCAAhB,gBAAgB,QAM3B;AA4HM,MAAM,qBAAqB,GAAG,CACpC,QAA8B,EACY,EAAE;IAC5C,OAAO,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,MAAK,UAAU,CAAC;AACtC,CAAC,CAAC;AAJW,QAAA,qBAAqB,yBAIhC;AACK,MAAM,oBAAoB,GAAG,CACnC,QAA8B,EACW,EAAE;IAC3C,OAAO,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,MAAK,SAAS,CAAC;AACrC,CAAC,CAAC;AAJW,QAAA,oBAAoB,wBAI/B;AACK,MAAM,gCAAgC,GAAG,CAC/C,QAA8B,EACuB,EAAE;IACvD,OAAO,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,MAAK,sBAAsB,CAAC;AAClD,CAAC,CAAC;AAJW,QAAA,gCAAgC,oCAI3C"}
@@ -1,14 +1,14 @@
1
- import { IRay } from "@shapediver/viewer.shared.types";
2
- import { DraggingRestrictionMetaData, DrawingRestrictionMetaData, IRestriction, RayTraceResult, RestrictionProperties, TransformationToolsRestrictionMetaData } from "./IRestriction";
3
- export interface IRestrictionManager {
4
- readonly restrictions: {
5
- [token: string]: IRestriction;
6
- };
7
- showRestrictionVisualization: boolean;
8
- addRestriction(properties: RestrictionProperties): string | undefined;
9
- close(): void;
10
- getRestriction(token: string): IRestriction | undefined;
11
- rayTrace(ray: IRay, metaData?: DrawingRestrictionMetaData | DraggingRestrictionMetaData | TransformationToolsRestrictionMetaData): RayTraceResult | undefined;
12
- removeRestriction(token: string): boolean;
13
- }
1
+ import { IRay } from "@shapediver/viewer.shared.types";
2
+ import { DraggingRestrictionMetaData, DrawingRestrictionMetaData, IRestriction, RayTraceResult, RestrictionProperties, TransformationToolsRestrictionMetaData } from "./IRestriction";
3
+ export interface IRestrictionManager {
4
+ readonly restrictions: {
5
+ [token: string]: IRestriction;
6
+ };
7
+ showRestrictionVisualization: boolean;
8
+ addRestriction(properties: RestrictionProperties): string | undefined;
9
+ close(): void;
10
+ getRestriction(token: string): IRestriction | undefined;
11
+ rayTrace(ray: IRay, metaData?: DrawingRestrictionMetaData | DraggingRestrictionMetaData | TransformationToolsRestrictionMetaData): RayTraceResult | undefined;
12
+ removeRestriction(token: string): boolean;
13
+ }
14
14
  //# sourceMappingURL=IRestrictionManager.d.ts.map
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=IRestrictionManager.js.map
@@ -1,82 +1,82 @@
1
- import { IRay } from "@shapediver/viewer.shared.types";
2
- import { vec3 } from "gl-matrix";
3
- import { RestrictionMetaData, RestrictionResult } from "./IRestriction";
4
- export declare type SnapRestrictionProperties = {
5
- /**
6
- * Whether to create visual helper objects (grid, axis, etc.) for restrictions. (default: true)
7
- */
8
- createHelperObjects?: boolean;
9
- /**
10
- * If the restriction should be enabled by default.
11
- */
12
- enabled?: boolean;
13
- /**
14
- * If the enabling or disabling of the restriction is allowed to the end user.
15
- * If it is not editable, the default value for enabling or disabling the restriction is used.
16
- */
17
- enabledEditable?: boolean;
18
- /**
19
- * Priority of the restriction.
20
- * The higher the priority, the sooner the restriction is applied.
21
- * If the priority is the same, the result that is closer to the original point is chosen.
22
- */
23
- priority?: number;
24
- /**
25
- * The activation key of the restriction.
26
- * If the key is not provided, no key is assigned.
27
- * If the key is provided, the restriction is only active when the key is pressed.
28
- */
29
- activationKey?: string;
30
- /**
31
- * Whether the visualization of the restriction is shown or not (if there is one).
32
- * @default true
33
- */
34
- enableVisualization?: boolean;
35
- };
36
- export interface ISnapRestriction {
37
- /**
38
- * The unique identifier of the restriction.
39
- */
40
- readonly id: string;
41
- /**
42
- * If the restriction is actively being used at the moment.
43
- */
44
- active: boolean;
45
- /**
46
- * Whether the restriction is enabled or not.
47
- */
48
- enabled: boolean;
49
- /**
50
- * If the enabling or disabling of the restriction is allowed to the end user.
51
- * If it is not editable, the default value for enabling or disabling the restriction is used.
52
- */
53
- enabledEditable: boolean;
54
- /**
55
- * If the visualization of the restriction is enabled or not.
56
- * If the restriction has no visualization, this property has no effect.
57
- */
58
- enableVisualization: boolean;
59
- /**
60
- * The priority of the restriction.
61
- */
62
- priority: number;
63
- /**
64
- * Whether the visualization of the restriction is shown or not (if there is one).
65
- */
66
- showVisualization: boolean;
67
- /**
68
- * Remove the visualization of the restriction.
69
- */
70
- removeVisualization(): void;
71
- /**
72
- * Restrict the position of a point.
73
- *
74
- * @param ray The ray that is used for the restriction.
75
- * @param point The position of the point.
76
- * @param distance The distance of the point to the ray.
77
- * @param metaData The meta data of the point.
78
- * @returns The restricted position of the point.
79
- */
80
- snap(ray: IRay, point: vec3, distance: number, metaData?: RestrictionMetaData): RestrictionResult | undefined;
81
- }
1
+ import { IRay } from "@shapediver/viewer.shared.types";
2
+ import { vec3 } from "gl-matrix";
3
+ import { RestrictionMetaData, RestrictionResult } from "./IRestriction";
4
+ export type SnapRestrictionProperties = {
5
+ /**
6
+ * Whether to create visual helper objects (grid, axis, etc.) for restrictions. (default: true)
7
+ */
8
+ createHelperObjects?: boolean;
9
+ /**
10
+ * If the restriction should be enabled by default.
11
+ */
12
+ enabled?: boolean;
13
+ /**
14
+ * If the enabling or disabling of the restriction is allowed to the end user.
15
+ * If it is not editable, the default value for enabling or disabling the restriction is used.
16
+ */
17
+ enabledEditable?: boolean;
18
+ /**
19
+ * Priority of the restriction.
20
+ * The higher the priority, the sooner the restriction is applied.
21
+ * If the priority is the same, the result that is closer to the original point is chosen.
22
+ */
23
+ priority?: number;
24
+ /**
25
+ * The activation key of the restriction.
26
+ * If the key is not provided, no key is assigned.
27
+ * If the key is provided, the restriction is only active when the key is pressed.
28
+ */
29
+ activationKey?: string;
30
+ /**
31
+ * Whether the visualization of the restriction is shown or not (if there is one).
32
+ * @default true
33
+ */
34
+ enableVisualization?: boolean;
35
+ };
36
+ export interface ISnapRestriction {
37
+ /**
38
+ * The unique identifier of the restriction.
39
+ */
40
+ readonly id: string;
41
+ /**
42
+ * If the restriction is actively being used at the moment.
43
+ */
44
+ active: boolean;
45
+ /**
46
+ * Whether the restriction is enabled or not.
47
+ */
48
+ enabled: boolean;
49
+ /**
50
+ * If the enabling or disabling of the restriction is allowed to the end user.
51
+ * If it is not editable, the default value for enabling or disabling the restriction is used.
52
+ */
53
+ enabledEditable: boolean;
54
+ /**
55
+ * If the visualization of the restriction is enabled or not.
56
+ * If the restriction has no visualization, this property has no effect.
57
+ */
58
+ enableVisualization: boolean;
59
+ /**
60
+ * The priority of the restriction.
61
+ */
62
+ priority: number;
63
+ /**
64
+ * Whether the visualization of the restriction is shown or not (if there is one).
65
+ */
66
+ showVisualization: boolean;
67
+ /**
68
+ * Remove the visualization of the restriction.
69
+ */
70
+ removeVisualization(): void;
71
+ /**
72
+ * Restrict the position of a point.
73
+ *
74
+ * @param ray The ray that is used for the restriction.
75
+ * @param point The position of the point.
76
+ * @param distance The distance of the point to the ray.
77
+ * @param metaData The meta data of the point.
78
+ * @returns The restricted position of the point.
79
+ */
80
+ snap(ray: IRay, point: vec3, distance: number, metaData?: RestrictionMetaData): RestrictionResult | undefined;
81
+ }
82
82
  //# sourceMappingURL=ISnapRestriction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ISnapRestriction.d.ts","sourceRoot":"","sources":["../../src/interfaces/ISnapRestriction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAC,mBAAmB,EAAE,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAItE,oBAAY,yBAAyB,GAAG;IACvC;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAMF,MAAM,WAAW,gBAAgB;IAGhC;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,mBAAmB,EAAE,OAAO,CAAC;IAC7B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,iBAAiB,EAAE,OAAO,CAAC;IAM3B;;OAEG;IACH,mBAAmB,IAAI,IAAI,CAAC;IAC5B;;;;;;;;OAQG;IACH,IAAI,CACH,GAAG,EAAE,IAAI,EACT,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,mBAAmB,GAC5B,iBAAiB,GAAG,SAAS,CAAC;CAGjC"}
1
+ {"version":3,"file":"ISnapRestriction.d.ts","sourceRoot":"","sources":["../../src/interfaces/ISnapRestriction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAC,mBAAmB,EAAE,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAItE,MAAM,MAAM,yBAAyB,GAAG;IACvC;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAMF,MAAM,WAAW,gBAAgB;IAGhC;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,mBAAmB,EAAE,OAAO,CAAC;IAC7B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,iBAAiB,EAAE,OAAO,CAAC;IAM3B;;OAEG;IACH,mBAAmB,IAAI,IAAI,CAAC;IAC5B;;;;;;;;OAQG;IACH,IAAI,CACH,GAAG,EAAE,IAAI,EACT,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,mBAAmB,GAC5B,iBAAiB,GAAG,SAAS,CAAC;CAGjC"}
@@ -1,4 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- // #endregion Interfaces (1)
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // #endregion Interfaces (1)
4
4
  //# sourceMappingURL=ISnapRestriction.js.map